{"id":26710707,"url":"https://github.com/metadoc/metadoc-md","last_synced_at":"2025-07-26T17:41:13.322Z","repository":{"id":44165783,"uuid":"146349711","full_name":"metadoc/metadoc-md","owner":"metadoc","description":"Parse markdown code within description attributes of a https://github.com/metadoc/metadoc.js output file.","archived":false,"fork":false,"pushed_at":"2022-12-07T23:51:44.000Z","size":1038,"stargazers_count":4,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T09:42:03.091Z","etag":null,"topics":["documentation","generator","markdown","metadoc"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metadoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["coreybutler"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-08-27T20:22:36.000Z","updated_at":"2021-12-18T18:26:11.000Z","dependencies_parsed_at":"2023-01-25T00:30:54.739Z","dependency_job_id":null,"html_url":"https://github.com/metadoc/metadoc-md","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metadoc%2Fmetadoc-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metadoc%2Fmetadoc-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metadoc%2Fmetadoc-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metadoc%2Fmetadoc-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metadoc","download_url":"https://codeload.github.com/metadoc/metadoc-md/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248765999,"owners_count":21158296,"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":["documentation","generator","markdown","metadoc"],"created_at":"2025-03-27T09:34:18.959Z","updated_at":"2025-04-13T18:52:39.339Z","avatar_url":"https://github.com/metadoc.png","language":"JavaScript","funding_links":["https://github.com/sponsors/coreybutler"],"categories":[],"sub_categories":[],"readme":"# metadoc-md\n\nThis [metadoc](https://github.com/author/metadoc) post-processor will convert markdown, mermaid, or MathJax snippets within a metadoc's description attributes into HTML.\n\n_Metadoc output before metadoc-md:_\n\n![Input](https://github.com/author/metadoc-md/raw/master/input.png)\n\n_Metadoc output after metadoc-md:_\n\n![Output](https://github.com/author/metadoc-md/raw/master/output.png)\n\n## Usage\n\nThis post-processor can be run standalone or as a part of a metadoc build process.\n\nTo run as a standalone CLI application, the utility must be installed globally:\n\n`npm install -g @author.io/metadoc-md`\n\nIt can then be used from the command line:\n\n```sh\nmetadoc-md --source /path/to/metadoc/api.json\n```\n\nAlternatively, it metadoc-md can be a part of a series of metadoc post-processors. In this scenario, the module should be saved as part of the `devDependencies`:\n\n`npm install @author.io/metadoc-md --save-dev`\n\nIt can then be applied as a piped command to the metadoc generation process:\n\n```sh\nmetadoc --source ./src --output ./docs --warnskippedevents --warnnocode --ignore ./work/in/progress | metadoc-md\n```\n\n## Additional Flags\n\n_Common Flags:_\n\n- `--output` Specify a custom output file (relative or absolute path).\n\n_Boolean Flags:_\n\nEach boolean flag (except `--output`) can receive a `true`/`false` value to enable/disable a feature. For example, to disable GFM, use `--gfm false`. If no value is supplied, it is assumed to be `true`. This means `--gfm` is the same as `--gfm true`.\n\n- `--pedantic` Conform to the original markdown.pl as much as possible. Don't fix original markdown bugs or behavior. Turns off and overrides gfm.\n- `--gfm` Apply [Github Flavored Markdown](https://github.github.com/gfm/). Enabled by default\n- `--tables` When using `gfm`, use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-). Enabled by default.\n- `--breaks` \tIf true, use GFM hard and soft line breaks. Requires `gfm` be true.\n- `--smartlists` If true, use smarter list behavior than those found in markdown.pl.\n- `--smartypants` If true, use \"smart\" typographic punctuation for things like quotes and dashes.\n- `--xhtml` If true, emit self-closing HTML tags for void elements (\u003cbr/\u003e, \u003cimg/\u003e, etc.) with a \"/\" as required by XHTML.\n- `--svg` Renders mermaid SVG files. See mermaid support secction below.\n\nThese features are all implemented by passing configuration values into [marked configuration options](https://marked.js.org/#/USING_ADVANCED.md#options).\n\n## Mermaid Support\n\n![Mermaid Graph](https://github.com/author/metadoc-md/raw/master/mermaid.png)\n\n[Mermaid](https://github.com/knsv/mermaid) generates graphical SVG diagrams from text. It follows a markdown-like approach. metadoc-md identifies mermaid text and converts it to an HTML-friendly format.\n\nFor example:\n\n_Metadoc output before metadoc-md:_\n\n````\n```mermaid\ngraph LR\na--\u003eb;\nb--\u003ec;\n```\n````\n\n_Metadoc output after metadoc-md:_\n\n```html\n\u003cdiv id=\"mermaid1\" class=\"mermaid\"\u003e\n  graph LR\n  a--\u003eb;\n  b--\u003ec;\n\u003c/div\u003e\n```\n\nAs shown above, metadoc-md identifies mermaid code and generates an HTML container for it with an automatic ID. However; it does not generate the SVG graphic. Mermaid provides a [browser library](https://www.jsdelivr.com/package/npm/mermaid) for this, which can parse the HTML and replace it with an SVG graphic. See the [usage instructions](https://mermaidjs.github.io/mermaidAPI.html)) for detail.\n\n### Recognized Mermaid Types\n\n- sequenceDiagram\n- classDiagram\n- graph (flowcharts)\n- gitGraph\n- gantt\n\n## MathJAX Support\n\n![MathJax](https://github.com/author/metadoc-md/raw/master/mathjax.png)\n\n[MathJax](http://mathjax.org/) will generate equation displays from text. Metadoc-md identifies these equations using a markdown-like approach.\n\nFor example:\n\n_Before metadoc-md:_\n\n````\n```math-tex\nx = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}\n```\n````\n\n_After metadoc-md:_\n\n```html\n\u003cdiv id=\"math1\" class=\"math\"\u003e\n  x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}\n\u003c/div\u003e\n```\n\nAs shown above, metadoc-md identifies MathJax code and generates the HTML container for it. Notice the language is `math-tex`, indicating the equation content is LaTeX format. `math-inlinetex`, `math-asciimath`, and `math-mathml` are also supported by MathJax. However; metadoc-md does not generate any graphics. The [MathJax Getting Started Guide](https://www.mathjax.org/#gettingstarted) provides instructions for generating the graphics in the browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetadoc%2Fmetadoc-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetadoc%2Fmetadoc-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetadoc%2Fmetadoc-md/lists"}