{"id":16489585,"url":"https://github.com/alvinwan/mathdowncompat","last_synced_at":"2025-03-01T04:24:50.814Z","repository":{"id":57439973,"uuid":"125687618","full_name":"alvinwan/mathdowncompat","owner":"alvinwan","description":"MathTex compatibility for in-browser markdown using MathJax, MathML, and/or images","archived":false,"fork":false,"pushed_at":"2018-03-18T06:47:44.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T19:13:26.181Z","etag":null,"topics":["images","markdown","math","mathml","mathtex"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alvinwan.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}},"created_at":"2018-03-18T02:56:08.000Z","updated_at":"2020-06-30T17:36:46.000Z","dependencies_parsed_at":"2022-09-26T17:20:15.900Z","dependency_job_id":null,"html_url":"https://github.com/alvinwan/mathdowncompat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinwan%2Fmathdowncompat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinwan%2Fmathdowncompat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinwan%2Fmathdowncompat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinwan%2Fmathdowncompat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvinwan","download_url":"https://codeload.github.com/alvinwan/mathdowncompat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241316042,"owners_count":19942980,"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":["images","markdown","math","mathml","mathtex"],"created_at":"2024-10-11T13:44:38.415Z","updated_at":"2025-03-01T04:24:50.792Z","avatar_url":"https://github.com/alvinwan.png","language":"Python","readme":"# MathDownCompat (MDC)\nMathTex compatibility for in-browser markdown using MathJax, MathML, and/or images\n\nHave delimited math formulas in your markdown? If you're fortunate enough to have control over the webpage containing your markdown, pretty math displays are just one `script` tag away, using MathJax. If otherwise, you're in a fix. This is where MDC comes in: pip install and with just one command, you'll have your math display ready to go in a jiffy. Math can be converted into one of the following alternatives:\n\n1. MathML: a native markup language supported by Safari and Firefox\n2. Images: All math is converted into images and saved to your local disk. You can configure a custom URL prefix, should you host the images on Github or elsewhere. (Automatic Imgur upload support coming soon)\n\nTo get started, download the package via `pip`.\n\n```\npip install mathdowncompat\n```\n\nAfter installation, use the `mdcompat` command to process any markdown file's math excerpts. For example, consider the following sample file `sample.md`.\n\n```markdown\n# Hello World\n\nThis is some $\\frac{1}{n} \\sum_{i=1}^n x_i$ average math. ;)\n\n$$\\int e^{xy} dude$$\n```\n\nRun the following on the `sample.md` above. By default, MDC will search for all math environments delimited by `$` and `$$`, replacing all with paths to images. By default, these paths are relative to your current working directory.\n\n```\nmdcompat sample.md\n```\n\nWith that one command, you are now done. Your output at `sample.md.converted` will match the following.\n\n```markdown\n# Hello World\n\nThis is some ![1](assets/1.png) average math. ;)\n\n![2](assets/2.png)\n```\n\nWant to share this markdown file online? Say we upload all images to `alvinwan.com/static`. Then, we specify that as our image URL prefix.\n\n```\nmdcompat sample.md --image-url-prefix alvinwan.com/static\n```\n\nThis gives us the following markdown file that we can then host online.\n\n```markdown\n# Hello World\n\nThis is some ![1](alvinwan.com/static/assets/1.png) average math. ;)\n\n![2](alvinwan.com/static/assets/2.png)\n```\n\nYou can use the options below to specify a host URL or convert to MathML instead of images. (In the future, you can specify an option to automatically upload images to Imgur) The output file is then the following\n\n```\nusage: mdcompat [-h] [--converter {mathml,image}] [--out OUT] [--verbose]\n                [--image-assets IMAGE_ASSETS]\n                [--image-url-prefix IMAGE_URL_PREFIX]\n                path\n\npositional arguments:\n  path                  path to markdown file\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --converter {mathml,image}\n                        math converter to apply\n  --out OUT             path to output markdown file\n  --verbose\n  --image-assets IMAGE_ASSETS\n                        path to assets\n  --image-url-prefix IMAGE_URL_PREFIX\n                        prefix for all image urls\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvinwan%2Fmathdowncompat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvinwan%2Fmathdowncompat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvinwan%2Fmathdowncompat/lists"}