Skip to content

We are creating a react module to parse a Markdown formatted text into PDF using the react-pdf library.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE
MIT
LICENSE.MIT
Notifications You must be signed in to change notification settings

proppex/react-md2pdf

Repository files navigation

react-md2pdf

We are creating a react module to parse a Markdown formatted text into PDF using the react-pdf library.

Usage

Using the component is quite simple. Just insert the <Markdown /> JSX tag as a component in the React-PDF Page:

<PDFViewer width={500} height={800}>
  <Document>
    <Page size="A4" style={styles.page}>
      <Markdown md={markdownText} />
    </Page>
  </Document>
</PDFViewer>

Contributing

The library converts the Markdown string by composing the AST and then traverse the resultant tree in a recursive fashion.

Resources

  • To parse the Markdown document to Abstract Syntax Tree we are using Remark.js

How to test

To test the development of the library:

  1. Build the library on watch mode

    # In the root folder
    npm run build -- --watch

    That will keep the builder running and watching for any change.

  2. Run the test server

    # In the server-test folder
    # First install dependencies
    npm ci
    
    # Second run the server in dev mode
    num run dev

The server has the dependency to the lib as a folder link, which means that it will get any modification without the need to restart the server. Nonetheless, any changes to the library will require to refresh the page.

Licensing

This project includes code from react-pdf library in the form of a dependency, which is licensed under the MIT License. The MIT License from this library can be found in the LICENSE.MIT file and in the original project.

The extensions and additional code in this project are licensed under the Apache License 2.0. The full text of the Apache License can be found in the LICENSE file.

Original MIT Library License

LICENSE.MIT

Apache License 2.0

LICENSE

About

We are creating a react module to parse a Markdown formatted text into PDF using the react-pdf library.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE
MIT
LICENSE.MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •