A parser utility for converting JSON to HTML and HTML to JSON specifically designed for use with Camunda 7 forms.
To use this library in your project, follow these steps:
-
Add the library as a dependency in your package.json file using the git format.
"dependencies": { "camunda-json-html-parser": "git+https://github.com/pitanglabs/camunda-json-html-parser.git" }
-
Run
npm install
to install the library and its dependencies. -
Now you can import and use the functions exported by the library in your project:
import { convertHtmlToJson, convertJsonToHtml, } from "camunda-json-html-parser"; // Provide the browser DOM Document (window.document) const convertedHtml = convertJsonToHtml(document, jsonContent);
-
Clone the repository to your local machine.
-
Navigate into the project directory:
$ cd camunda-json-html-parser
-
Install dependencies:
$ npm install
-
Run the test application:
$ npm run test
-
Follow the Prompts:
- Choose the conversion type (JSON to HTML or HTML to JSON).
- Enter the input and output file paths.
- Note: Ensure the input file is located in the directory.
-
Optional: Format HTML File: If converting from JSON to HTML, you can run the following command after conversion to format the HTML file for readability:
$ npm run prettier
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.