{"id":25645686,"url":"https://github.com/hunyadi/markdown_doc","last_synced_at":"2026-02-23T11:40:13.096Z","repository":{"id":278162618,"uuid":"904736963","full_name":"hunyadi/markdown_doc","owner":"hunyadi","description":"Generate Markdown documentation from Python code","archived":false,"fork":false,"pushed_at":"2026-02-01T09:41:13.000Z","size":193,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-01T19:55:02.046Z","etag":null,"topics":["documentation-generator","markdown","python-typing"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/markdown-doc/","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/hunyadi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-17T13:08:18.000Z","updated_at":"2026-02-01T09:40:35.000Z","dependencies_parsed_at":"2025-08-08T23:24:35.531Z","dependency_job_id":"e8b2190d-02c1-47c7-ab3e-092ac75cdb89","html_url":"https://github.com/hunyadi/markdown_doc","commit_stats":null,"previous_names":["hunyadi/markdown_doc"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/hunyadi/markdown_doc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunyadi%2Fmarkdown_doc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunyadi%2Fmarkdown_doc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunyadi%2Fmarkdown_doc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunyadi%2Fmarkdown_doc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hunyadi","download_url":"https://codeload.github.com/hunyadi/markdown_doc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunyadi%2Fmarkdown_doc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29741689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","python-typing"],"created_at":"2025-02-23T09:18:01.605Z","updated_at":"2026-02-23T11:40:13.085Z","avatar_url":"https://github.com/hunyadi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generate Markdown documentation from Python code\n\nThis library generates Markdown documentation directly from Python code, utilizing Python type annotations.\n\n## Features at a glance\n\n* Each module produces a Markdown file.\n* [Documentation strings](https://docs.python.org/3/library/stdtypes.html#definition.__doc__) are extracted from module, class, enumeration and function definitions.\n* Cross-references may be local or fully qualified, and work across modules.\n* Classes with member variable declarations produce member documentation.\n* Data-class field descriptions are validated if they have a matching member variable declaration.\n* Enumeration members are published, even if they lack a description.\n* Magic methods (e.g. `__eq__`) are published if they have a doc-string.\n* Multi-line code blocks in doc-strings are retained as Markdown code blocks.\n* Forward-references and type annotations as strings are automatically evaluated.\n\n## Documentation features\n\nCross-references with Sphinx-style syntax are supported in module, class and function doc-strings:\n\n```python\n@dataclass\nclass SampleClass:\n    \"\"\"\n    This class is extended by :class:`DerivedClass`.\n\n    This class implements :meth:`__lt__` and :meth:`SampleClass.__gt__`.\n    \"\"\"\n```\n\nThe following Sphinx-style cross-references are recognized:\n\n* `:mod:` for a module\n* `:class:` for a regular class\n* `:exc:` for an exception class\n* `:deco:` for a decorator function\n* `:func:` for a function defined at the module level\n* `:meth:` for a method of a class\n\nClass member variable and data-class field descriptions are defined with `:param ...:`:\n\n```python\n@dataclass\nclass DerivedClass(SampleClass):\n    \"\"\"\n    This data-class derives from another base class.\n\n    :param union: A union of several types.\n    :param json: A complex type with type substitution.\n    :param schema: A complex type without type substitution.\n    \"\"\"\n\n    union: SimpleType\n    json: JsonType\n    schema: Schema\n```\n\nEnumeration member description follows the member value assignment:\n\n```python\nclass EnumType(enum.Enum):\n    enabled = \"enabled\"\n    \"Documents the enumeration member `enabled`.\"\n\n    disabled = \"disabled\"\n    \"Documents the enumeration member `disabled`.\"\n```\n\n## Usage\n\n### Calling the utility in Python\n\n```python\nfrom markdown_doc.generator import MarkdownGenerator\n\nMarkdownGenerator([module1, module2, module3]).generate(out_dir)\n```\n\nPass an object of `MarkdownOptions` to configure behavior:\n\n```python\nMarkdownGenerator(\n    [module1, module2, module3],\n    options=MarkdownOptions(\n        anchor_style=MarkdownAnchorStyle.GITBOOK,\n        partition_strategy=PartitionStrategy.SINGLE,\n        include_private=False,\n        stdlib_links=True,\n    ),\n).generate(out_dir)\n```\n\n### Running the utility from the command line\n\n```\n$ python3 -m markdown_doc --help\nusage: markdown_doc [-h] [-d [DIRECTORY ...]] [-m [MODULE ...]] [-r ROOT_DIR] [-o OUT_DIR] [--anchor-style {GitBook,GitHub}] [--partition {single,by_kind}]\n\nGenerates Markdown documentation from Python code\n\noptions:\n  -h, --help            show this help message and exit\n  -d [DIRECTORY ...], --directory [DIRECTORY ...]\n                        folder(s) to recurse into when looking for modules\n  -m [MODULE ...], --module [MODULE ...]\n                        qualified names(s) of Python module(s) to scan\n  -r ROOT_DIR, --root-dir ROOT_DIR\n                        path to act as root for converting directory paths into qualified module names (default: working directory)\n  -o OUT_DIR, --out-dir OUT_DIR\n                        output directory (default: 'docs' in working directory)\n  --anchor-style {GitBook,GitHub}\n                        output format for generating anchors in headings\n  --partition {single,by_kind}\n                        how to split module contents across Markdown files\n```\n\n## Related work\n\nIn order to reduce added complexity, this library does not use the Sphinx framework with [autodoc](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunyadi%2Fmarkdown_doc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhunyadi%2Fmarkdown_doc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunyadi%2Fmarkdown_doc/lists"}