Seasawher / mdgen

Tool to generate markdown files from lean files. This is heavily inspired by lean2md.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mdgen

mdgen is a tool to generate .md files from .lean files. A similar tool, lean2md, is already available, but it is written in Python. mdgen is written purely in Lean.

How to use

Add this repository to your lakefile:

require mdgen from git
  "https://github.com/Seasawher/mdgen" @ "main"

Don't forget to run lake update mdgen after editing the lakefile. And simply run lake exe mdgen <input_dir> <output_dir>.

Features

mdgen has the following features:

  • The comments enclosed with an /-! ... -/ or /- ... -/ are converted as ground text.

  • The inline comment, doc comment and non-comment parts are converted to lean code blocks.

  • Lines ending with --# are ignored.

  • Directories within input_dir will also be converted.

If you want to know more details, check the test code.

Acknowledgments

Many parts of the code are copied from lean2md. Thank you @arthurpaulino.

About

Tool to generate markdown files from lean files. This is heavily inspired by lean2md.

License:MIT License


Languages

Language:Lean 98.1%Language:Dockerfile 1.9%