{"id":13557304,"url":"https://github.com/readthedocs/recommonmark","last_synced_at":"2025-04-03T11:31:44.741Z","repository":{"id":35576487,"uuid":"39848792","full_name":"readthedocs/recommonmark","owner":"readthedocs","description":"A markdown parser for docutils","archived":true,"fork":false,"pushed_at":"2021-05-18T11:04:48.000Z","size":182,"stargazers_count":343,"open_issues_count":0,"forks_count":250,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-03T01:31:25.122Z","etag":null,"topics":["commonmark","docutils","recommonmark"],"latest_commit_sha":null,"homepage":"https://recommonmark.readthedocs.io/","language":"Python","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/readthedocs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-28T17:42:59.000Z","updated_at":"2025-02-23T11:36:09.000Z","dependencies_parsed_at":"2022-09-13T08:12:10.188Z","dependency_job_id":null,"html_url":"https://github.com/readthedocs/recommonmark","commit_stats":null,"previous_names":["rtfd/recommonmark"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readthedocs%2Frecommonmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readthedocs%2Frecommonmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readthedocs%2Frecommonmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readthedocs%2Frecommonmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/readthedocs","download_url":"https://codeload.github.com/readthedocs/recommonmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246993072,"owners_count":20865931,"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":["commonmark","docutils","recommonmark"],"created_at":"2024-08-01T12:04:16.111Z","updated_at":"2025-04-03T11:31:39.732Z","avatar_url":"https://github.com/readthedocs.png","language":"Python","funding_links":[],"categories":["Python","others"],"sub_categories":[],"readme":"# recommonmark\n\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n**Warning:** recommonmark is now deprecated. We recommend using [MyST](https://github.com/executablebooks/MyST-Parser) for a docutils bridge going forward. See [this issue](https://github.com/readthedocs/recommonmark/issues/221) for background and discussion.\n\nA `docutils`-compatibility bridge to [CommonMark][cm].\n\nThis allows you to write CommonMark inside of Docutils \u0026 Sphinx projects.\n\nDocumentation is available on Read the Docs: \u003chttp://recommonmark.readthedocs.org\u003e\n\nContents\n--------\n\n* [API Reference](api_ref.md)\n* [AutoStructify Component](auto_structify.md)\n\n## Getting Started\n\nTo use `recommonmark` inside of Sphinx only takes 2 steps. \nFirst you install it:\n\n```\npip install recommonmark \n```\n\nThen add this to your Sphinx conf.py:\n\n```\n# for Sphinx-1.4 or newer\nextensions = ['recommonmark']\n\n# for Sphinx-1.3\nfrom recommonmark.parser import CommonMarkParser\n\nsource_parsers = {\n    '.md': CommonMarkParser,\n}\n\nsource_suffix = ['.rst', '.md']\n```\n\nThis allows you to write both `.md` and `.rst` files inside of the same project.\n\n### Links\n\nFor all links in commonmark that aren't explicit URLs, they are treated as cross references with the [`:any:`](http://www.sphinx-doc.org/en/stable/markup/inline.html#role-any) role. This allows referencing a lot of things including files, labels, and even objects in the loaded domain.\n\n#### Linking to headings in other files\n\nFor linking to headings in other files you can use the [`autosectionlabel`][] sphinx feature, e.g.\n\n```python\n# conf.py\n\nextensions = [\n    # Auto-generate section labels.\n    'sphinx.ext.autosectionlabel',\n]\n\n# Prefix document path to section labels, otherwise autogenerated labels would look like 'heading'\n# rather than 'path/to/file:heading'\nautosectionlabel_prefix_document = True\n```\n\nYou would use it like:\n\n```markdown\n\u003c!-- path/to/file_1.md --\u003e\n\n# Title\n\n## My Subtitle\n```\n\n```markdown\n\u003c!-- file_2.md --\u003e\n\n[My Subtitle][]\n\n[My Subtitle]: \u003cpath/to/file_1:My Subtitle\u003e\n```\n\n### AutoStructify\n\nAutoStructify makes it possible to write your documentation in Markdown, and automatically convert this\ninto rST at build time. See [the AutoStructify Documentation](http://recommonmark.readthedocs.org/en/latest/auto_structify.html)\nfor more information about configuration and usage.\n\nTo use the advanced markdown to rst transformations you must add `AutoStructify` to your Sphinx conf.py.\n\n```python\n# At top on conf.py (with other import statements)\nimport recommonmark\nfrom recommonmark.transform import AutoStructify\n\n# At the bottom of conf.py\ndef setup(app):\n    app.add_config_value('recommonmark_config', {\n            'url_resolver': lambda url: github_doc_root + url,\n            'auto_toc_tree_section': 'Contents',\n            }, True)\n    app.add_transform(AutoStructify)\n```\n\nSee https://github.com/rtfd/recommonmark/blob/master/docs/conf.py for a full example.\n\nAutoStructify comes with the following options. See [http://recommonmark.readthedocs.org/en/latest/auto_structify.html](http://recommonmark.readthedocs.org/en/latest/auto_structify.html) for more information about the specific features.\n\n* __enable_auto_toc_tree__: enable the Auto Toc Tree feature.\n* __auto_toc_maxdepth__: The max depth of the Auto Toc. Defaults to 1.\n* __auto_toc_tree_section__: when True, Auto Toc Tree will only be enabled on section that matches the title.\n* __enable_auto_doc_ref__: enable the Auto Doc Ref feature. **Deprecated**\n* __enable_math__: enable the Math Formula feature.\n* __enable_inline_math__: enable the Inline Math feature.\n* __enable_eval_rst__: enable the evaluate embedded reStructuredText feature.\n* __url_resolver__: a function that maps a existing relative position in the document to a http link\n* __known_url_schemes__: a list of url schemes to treat as URLs, schemes not in this list will be assumed to be Sphinx cross-references.\n    Defaults to `None`, which means treat all URL schemes as URLs.\n    Example: `['http', 'https', 'mailto']`\n\n## Development\n\nYou can run the tests by running `tox` in the top-level of the project.\n\nWe are working to expand test coverage,\nbut this will at least test basic Python 2 and 3 compatability.\n\n## Why a bridge?\n\nMany python tools (mostly for documentation creation) rely on `docutils`.\nBut [docutils][dc] only supports a ReStructuredText syntax.\n\nFor instance [this issue][sphinx-issue] and [this StackOverflow\nquestion][so-question] show that there is an interest in allowing `docutils`\nto use markdown as an alternative syntax.\n\n## Why another bridge to docutils?\n\nrecommonmark uses the [python implementation][pcm] of [CommonMark][cm] while\n[remarkdown][rmd] implements a stand-alone parser leveraging [parsley][prs].\n\nBoth output a [`docutils` document tree][dc] and provide scripts\nthat leverage `docutils` for generation of different types of documents.\n\n## Acknowledgement\n\nrecommonmark is mainly derived from [remarkdown][rmd] by Steve Genoud and\nleverages the python CommonMark implementation.\n\nIt was originally created by [Luca Barbato][lu-zero],\nand is now maintained in the Read the Docs (rtfd) GitHub organization.\n\n[cm]: http://commonmark.org\n[pcm]: https://github.com/rtfd/CommonMark-py\n[rmd]: https://github.com/sgenoud/remarkdown\n[prs]: https://github.com/python-parsley/parsley\n[lu-zero]: https://github.com/lu-zero\n\n[dc]: http://docutils.sourceforge.net/docs/ref/doctree.html\n[sphinx-issue]: https://bitbucket.org/birkenfeld/sphinx/issue/825/markdown-capable-sphinx\n[so-question]: http://stackoverflow.com/questions/2471804/using-sphinx-with-markdown-instead-of-rst\n[`autosectionlabel`]: https://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freadthedocs%2Frecommonmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freadthedocs%2Frecommonmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freadthedocs%2Frecommonmark/lists"}