{"id":23918733,"url":"https://github.com/adobe/helix-md2jcr","last_synced_at":"2026-02-22T20:05:42.476Z","repository":{"id":257873787,"uuid":"867137774","full_name":"adobe/helix-md2jcr","owner":"adobe","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-08T15:14:16.000Z","size":792,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-08T16:26:12.891Z","etag":null,"topics":["helix","library"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adobe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-03T14:13:13.000Z","updated_at":"2025-04-08T15:14:19.000Z","dependencies_parsed_at":"2024-10-16T20:57:29.347Z","dependency_job_id":"a77de94a-5669-48c9-a05a-672ca48fce8b","html_url":"https://github.com/adobe/helix-md2jcr","commit_stats":null,"previous_names":["mhaack/helix-md2jcr","adobe/helix-md2jcr"],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fhelix-md2jcr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fhelix-md2jcr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fhelix-md2jcr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fhelix-md2jcr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adobe","download_url":"https://codeload.github.com/adobe/helix-md2jcr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249269945,"owners_count":21241236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["helix","library"],"created_at":"2025-01-05T13:40:54.736Z","updated_at":"2026-01-25T08:06:11.909Z","avatar_url":"https://github.com/adobe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Helix Markdown to JCR\n\n\u003e A library that converts markdown to JCR.\n\n## Status\n[![codecov](https://img.shields.io/codecov/c/github/adobe/helix-md2jcr.svg)](https://codecov.io/gh/adobe/helix-md2jcr)\n[![GitHub license](https://img.shields.io/github/license/adobe/helix-md2jcr.svg)](https://github.com/adobe/helix-md2jcr/blob/main/LICENSE.txt)\n[![GitHub issues](https://img.shields.io/github/issues/adobe/helix-md2jcr.svg)](https://github.com/adobe/helix-md2jcr/issues)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Development\nInstall all dependencies by running:\n\n```bash\nnpm install\n```\n\n## Usage\n\n### Installation\n\nYou can install the package via npm:\n\n```bash\nnpm install @adobe/helix-md2jcr\n```\n\nOr use it directly with `npx` without installing:\n\n```bash\nnpx @adobe/helix-md2jcr path/to/content.md\n```\n\n### Converting Markdown to JCR Nodes\n\nThe package includes a CLI tool `md2jcr` that converts markdown files to JCR XML format.\n\n**Basic usage:**\n```bash\nnpx @adobe/helix-md2jcr path/to/content.md\n```\n\n**Convert a single file:**\n```bash\nmd2jcr test/fixtures/simple.md\n```\n\n**Convert all markdown files in a directory:**\n```bash\nmd2jcr test/fixtures/\n```\n\n**View output in console with verbose flag `-v`:**\n```bash\nmd2jcr test/fixtures/simple.md -v\n```\n\n**View decoded XML output with `-v` and `-d` flags:**\n```bash\nmd2jcr test/fixtures/simple.md -v -d\n```\n\n**Use custom Universal Editor files from a directory:**\n```bash\nmd2jcr content.md -ue path/to/ue-files-directory\n```\n\nThe converter will generate a `.xml` file alongside the markdown file containing the JCR structure. This can be used to check for potential content changes due to conversion.\n\n#### Command-Line Options\n\n- `-v`, `--verbose` - Print the XML output to the console\n- `-d`, `--decode` - Decode HTML entities in the XML output (use with `-v`)\n- `-ue`, `--ue-files \u003cdirectory\u003e` - Specify a directory containing Universal Editor configuration files\n\nExample directory structure:\n```\nue-files/\n  ├── component-models.json\n  ├── component-definition.json\n  └── component-filters.json\n```\n\n### Programmatic Usage\n\nYou can also use the library programmatically in your Node.js code:\n\n```javascript\nimport { md2jcr } from '@adobe/helix-md2jcr';\n\nconst markdown = '# Hello World\\n\\nThis is a test.';\nconst options = {\n  models: [...],\n  definition: {...},\n  filters: [...]\n};\n\nconst xml = await md2jcr(markdown, options);\nconsole.log(xml);\n```\n\n## Baseline XML Files\nRunning the ./baseline-tests.sh script will detect any md file under test/fixtures and execute the convert2jcr node script.  \nThe script will generate new xml files beside the md files it locates. This is helpful when making changes to the converter\nand you want to see if the changes have any impact on the output.  By using git diff, you will see the new changes in the xml files.\nIf you are satisfied with the changes, you can commit the new xml files.\n\n\n## Running Tests\nSimply execute the following command to run the tests:\n```bash\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadobe%2Fhelix-md2jcr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadobe%2Fhelix-md2jcr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadobe%2Fhelix-md2jcr/lists"}