{"id":13992874,"url":"https://github.com/Seasawher/mdgen","last_synced_at":"2025-07-22T16:32:29.206Z","repository":{"id":215772635,"uuid":"737009824","full_name":"Seasawher/mdgen","owner":"Seasawher","description":"Tool to generate markdown files from lean files. This is heavily inspired by lean2md.","archived":false,"fork":false,"pushed_at":"2024-10-24T12:31:12.000Z","size":113,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-25T13:20:03.044Z","etag":null,"topics":["lean","lean4","markdown-converter"],"latest_commit_sha":null,"homepage":"","language":"Lean","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/Seasawher.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}},"created_at":"2023-12-29T14:29:58.000Z","updated_at":"2024-10-24T12:31:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"2583df67-9de8-4235-bb9f-140d4baeadf4","html_url":"https://github.com/Seasawher/mdgen","commit_stats":null,"previous_names":["seasawher/mdgen"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seasawher%2Fmdgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seasawher%2Fmdgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seasawher%2Fmdgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seasawher%2Fmdgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seasawher","download_url":"https://codeload.github.com/Seasawher/mdgen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227133915,"owners_count":17735825,"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":["lean","lean4","markdown-converter"],"created_at":"2024-08-09T14:02:09.862Z","updated_at":"2025-07-22T16:32:29.148Z","avatar_url":"https://github.com/Seasawher.png","language":"Lean","funding_links":[],"categories":["Lean"],"sub_categories":[],"readme":"# mdgen\n\n`mdgen` is a tool to generate `.md` files from `.lean` files.\n\nA similar tool, [lean2md](https://github.com/arthurpaulino/lean2md), is already available, but it is written in Python. `mdgen` is written purely in Lean. And mdgen has more features!\n\n## How to use\n\nAdd this repository to your `lakefile`:\n\n```lean\nrequire mdgen from git\n  \"https://github.com/Seasawher/mdgen\" @ \"main\"\n```\n\nDon't forget to run `lake update mdgen` after editing the `lakefile`. And simply run `lake exe mdgen \u003cinput_dir\u003e \u003coutput_dir\u003e`.\n\n## Features\n\n`mdgen` has the following features:\n\n* The comments enclosed with an `/-! ... -/` or `/- ... -/` are converted as ground text.\n\n* Nested block comments can also be handled. You can also insert a code block in the block comment.\n\n* The inline comment, doc comment and non-comment parts are converted to lean code blocks.\n\n* Lines ending with `--#` are ignored.\n\n* Lines enclosed by `--#--` are ignored.\n\n* Directories within `input_dir` will also be converted.\n\n* Uniform internal link syntax is supported. You can write the path from the `output_dir` with the symbol `#{root}` in a markdown part. mdgen will automatically insert the required number of `../`. Thus links to the same file can be written in the same way regardless of where they are referenced from.\n\n* You can convert a doc comment to a block comment. Simply insert `/-⋆-/` immediately before the doc comment `/-- foo -/` without any whitespace.\n\n* By default, code blocks are specified with the language `lean`, but you can attach any string as a metadata to the code block by writing it after `-- ⋆MDGEN_LANG⋆=` on the first line of the code section.\n\nIf you want to know more details, check the test code.\n\n* [source](./Test/Src/First.lean)\n* [expected output](./Test/Exp/First.md)\n\n## CLI options\n\n* `-c`, `--count`: Counts the total number of characters in the input Lean files. However, please be aware that the output may not be entirely accurate.\n\n## Acknowledgments\n\nI would like to acknowledge the author of [lean2md](https://github.com/arthurpaulino/lean2md), [@arthurpaulino](https://github.com/arthurpaulino).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSeasawher%2Fmdgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSeasawher%2Fmdgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSeasawher%2Fmdgen/lists"}