{"id":15665722,"url":"https://github.com/asottile/markdown-code-blocks","last_synced_at":"2025-05-12T13:28:00.112Z","repository":{"id":19135227,"uuid":"84905096","full_name":"asottile/markdown-code-blocks","owner":"asottile","description":"Generate html from markdown with code-block highlighting","archived":false,"fork":false,"pushed_at":"2025-03-31T21:00:17.000Z","size":238,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-03T13:42:27.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/asottile.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},"funding":{"github":"asottile"}},"created_at":"2017-03-14T04:21:23.000Z","updated_at":"2025-03-31T21:00:23.000Z","dependencies_parsed_at":"2023-09-26T16:20:10.381Z","dependency_job_id":"f092274d-d5b2-40d4-a526-dd0f2da2f6e1","html_url":"https://github.com/asottile/markdown-code-blocks","commit_stats":{"total_commits":178,"total_committers":3,"mean_commits":"59.333333333333336","dds":0.3258426966292135,"last_synced_commit":"a7db418e1fbaa2f0806b1fc18ecd6c0d9042b87f"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asottile%2Fmarkdown-code-blocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asottile%2Fmarkdown-code-blocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asottile%2Fmarkdown-code-blocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asottile%2Fmarkdown-code-blocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asottile","download_url":"https://codeload.github.com/asottile/markdown-code-blocks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253747255,"owners_count":21957727,"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":[],"created_at":"2024-10-03T13:52:56.149Z","updated_at":"2025-05-12T13:28:00.055Z","avatar_url":"https://github.com/asottile.png","language":"Python","funding_links":["https://github.com/sponsors/asottile"],"categories":[],"sub_categories":[],"readme":"[![build status](https://github.com/asottile/markdown-code-blocks/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/markdown-code-blocks/actions/workflows/main.yml)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/markdown-code-blocks/main.svg)](https://results.pre-commit.ci/latest/github/asottile/markdown-code-blocks/main)\n\nmarkdown-code-blocks\n====================\n\nA stupid simple bit of code which combines [mistune][mistune] and\n[pygments][pygments] to convert markdown into html.  Very similar to github\nmarkdown, but for python.\n\n\n## Installation\n\n```bash\npip install markdown-code-blocks\n```\n\n## Usage\n\nThe library provides a single function `highlight` which takes in a markdown\nstring and returns html.\n\nYou can also use the cli `markdown-code-blocks-highlight`.  It optionally\ntakes a single filename (defaulting to stdin) and writes to stdout.\n\nFor example:\n\n`markdown-code-blocks-highlight f.md \u003e f.htm`\n\n\n## pygments css\n\nI'd suggest grabbing a theme file from [pygments-css][pygments-css]\n(or any other provider of pygments themes -- if you google there's a bunch of\nthem).\n\nThis library will use the class `.highlight` so be sure to change out whatever\nclass the theme uses with that.\n\nMost themes (for whatever reason) don't add styles for diff display.  I\nusually do something like this:\n\n```css\n.highlight .gi { color: #070; }\n.highlight .gd { color: #911; }\n```\n\n[mistune]: https://github.com/lepture/mistune\n[pygments]: http://pygments.org/\n[pygments-css]: https://github.com/richleland/pygments-css\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasottile%2Fmarkdown-code-blocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasottile%2Fmarkdown-code-blocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasottile%2Fmarkdown-code-blocks/lists"}