{"id":29140786,"url":"https://github.com/seasawher/mdgen","last_synced_at":"2026-01-24T15:08:41.105Z","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":"2025-12-13T12:40:47.000Z","size":219,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-15T03:47:49.220Z","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-29T14:29:58.000Z","updated_at":"2025-12-13T12:40:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"96c5f7d8-a546-49ce-bfe5-d5e3a8ceb514","html_url":"https://github.com/Seasawher/mdgen","commit_stats":null,"previous_names":["seasawher/mdgen"],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/Seasawher/mdgen","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","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seasawher%2Fmdgen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28730311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"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":["lean","lean4","markdown-converter"],"created_at":"2025-06-30T17:40:19.941Z","updated_at":"2026-01-24T15:08:41.097Z","avatar_url":"https://github.com/Seasawher.png","language":"Lean","funding_links":[],"categories":[],"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 `-- ⋆LANG⋆=` on the first line of the code section.\n\n* If you write `-- ⋆QUOTE⋆` on the first line of the code, `\u003e ` will be inserted at the beginning of every line in that code block, turning it into a quoted code block.\n  * When you want to use both `⋆QUOTE⋆` and `⋆LANG⋆` at the same time, write `⋆QUOTE⋆` first, separated by either a whitespace or a comma, as in `-- ⋆QUOTE⋆ ⋆LANG⋆=hoge`.\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* `-e`, `--exercise`: Erases parts of Lean code and replaces them with `sorry`.\n  * Replace the code enclosed by `-- sorry` with `sorry`, preserving indentation.\n  * Replace the inline code enclosed by `/-+-/` with `sorry`.\n  * Replace the code after `/- sorry -/` with sorry.\n  * Lines ending with `--##` are ignored.\n  * Blocks enclosed with `--##--` are ignored.\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"}