{"id":35144659,"url":"https://github.com/hkato/markdown-kroki","last_synced_at":"2026-05-12T16:39:20.293Z","repository":{"id":288782989,"uuid":"969089138","full_name":"hkato/markdown-kroki","owner":"hkato","description":"Diagram extension for Python-Markdown using Kroki server.","archived":false,"fork":false,"pushed_at":"2025-10-05T07:21:32.000Z","size":539,"stargazers_count":6,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-12T17:23:19.018Z","etag":null,"topics":["diagrams","markdown","mermaid","mkdocs","plantuml"],"latest_commit_sha":null,"homepage":"https://hkato.github.io/markdown-kroki/","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/hkato.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}},"created_at":"2025-04-19T11:07:09.000Z","updated_at":"2026-01-27T11:51:58.000Z","dependencies_parsed_at":"2025-04-19T18:56:51.351Z","dependency_job_id":null,"html_url":"https://github.com/hkato/markdown-kroki","commit_stats":null,"previous_names":["hkato/markdown-kroki"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hkato/markdown-kroki","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkato%2Fmarkdown-kroki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkato%2Fmarkdown-kroki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkato%2Fmarkdown-kroki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkato%2Fmarkdown-kroki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hkato","download_url":"https://codeload.github.com/hkato/markdown-kroki/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkato%2Fmarkdown-kroki/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32948318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["diagrams","markdown","mermaid","mkdocs","plantuml"],"created_at":"2025-12-28T13:08:19.188Z","updated_at":"2026-05-12T16:39:20.287Z","avatar_url":"https://github.com/hkato.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [markdown-kroki](https://hkato.github.io/markdown-kroki/)\n\n[![PyPI version](https://img.shields.io/pypi/v/markdown-kroki)](https://pypi.org/project/markdown-kroki/)\n![License](https://img.shields.io/pypi/l/markdown-kroki)\n![Python versions](https://img.shields.io/pypi/pyversions/markdown-kroki)\n\nDiagram extension for [Python-Markdown][python-markdown] using [Kroki server][kuroki].\n\nThis extension converts various diagram code blocks into Base64 encoded [data: URI][data-uri] or direct image link.\nThis enables PDF generation with tools like [MkDocs to PDF][mkdocs-to-pdf]/[WeasyPrint][wasyprint]\nwithout requiring JavaScript(e.g. [Mermaid][mermaid])\n\n## Install\n\n```sh\npip install markdown-kroki\n```\n\n## Requirements\n\n### Internet access to the public Kroki server\n\nDefault setting with no options.\n\n### Self-Managed Kroki server (recommended)\n\nHere is a sample Docker Compose file.\n\nref. Kroki.io \u003e [Install](https://kroki.io/#install) \u003e [Using Docker or Podman](https://docs.kroki.io/kroki/setup/use-docker-or-podman/)\n\n```sh\ndocker compose up -d\n```\n\n\u003e The default port used by MkDocs (`mkdocs serve`) may conflict with the default\n\u003e port of a Dockerized Kroki instance.\n\u003e Consequently, you will need to change the port configuration for one of them.\n\n## Usage\n\n````md\n```{diagram language} formant=[svg|png] {img tag attribute}=\"value\" {diagram option}=\"value\"\n```\n````\n\n- format (optional): Output image format default to svg\n- img tag attribute (optional): alt, width, height, class, id, style, title\n- diagram option (optional): refer to [Diagram options](https://docs.kroki.io/kroki/setup/diagram-options/)\n\n### [MkDocs][mkdocs] Integration\n\n```yaml\n# mkdocs.yml\nmarkdown_extensions:\n  - markdown_kroki:\n      kroki_url: http://localhost:18000  # default: https://kroki.io\n      img_src: link                      # default: data/data URI, link/direct link\n```\n\n### [Pelican][pelican] Integration\n\n```py\n# pelicanconf.py\nMARKDOWN = {\n    'extension_configs': {\n        'markdown.extensions.codehilite': {'css_class': 'highlight'},\n        'markdown.extensions.extra': {},\n        'markdown_kroki': {                         # Add these\n            'kroki_url': 'http://localhost:18000',\n            'img_src': 'link'\n        },\n    },\n    'output_format': 'html5',\n}\n```\n\n### Python code\n\n````python\nimport markdown\nfrom markdown_kroki import KrokiDiagramExtension\n\nmarkdown_text = \"\"\"```plantuml format=\"svg\" theme=\"sketchy-outline\" width=\"300\"\n@startuml\nAlice -\u003e Bob: Authentication Request\nBob --\u003e Alice: Authentication Response\n@enduml\n```\"\"\"\n\nhtml_output = markdown.markdown(markdown_text, extensions=[\n                                KrokiDiagramExtension(kroki_url='https://kroki.io')])\n\nprint(html_output)\n````\n\n```html\n\u003cp\u003e\u003cimg src=\"data:image/svg+xml;base64,PHN2ZyBhcmlhLXJvbGVkZXNjcmlwdGlvbj0ic2VxdWVuY2UiIHJvbGU\n9ImdyYXBoaWNzLWRvY3VtZW50IGRvY3VtZW50IiB2aWV3Qm94PSItNTAgLTEwIDc1MCA1NzQiIHN0eWxlPSJtYXgtd2lkd\nGg6IDc1MHB4OyBiYWNrZ3JvdW5kLWNvbG9yOiB3aGl0ZTsiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk\n...\n...\n...\nIHgxPSIyNzYiLz48L3N2Zz4=\" width=\"300\" \u003e\u003c/p\u003e\n```\n\n## Process flow\n\n### data URI\n\n```mermaid\nsequenceDiagram\n    participant application as MkDocs, Pelican\u003cbr/\u003eor your application\n    participant markdown as Python Markdown\n    participant extension as KrokiDiagramExtension\n    participant engine as Kroki Server\n\n    application-\u003e\u003emarkdown: Markdown + Diagrams\n    markdown-\u003e\u003eextension: Preprocessor\n    extension-\u003e\u003eengine: Diagram code\n    engine--\u003e\u003eengine: Convert\n    engine--\u003e\u003eextension: Image Data\n    extension--\u003e\u003eextension: Base64 encode\n    extension--\u003e\u003emarkdown: Markdown + data URI image\n    markdown--\u003e\u003eapplication: HTML + data URI image\n```\n\n### Direct link (GET API)\n\n```mermaid\nsequenceDiagram\n    participant application as MkDocs, Pelican\u003cbr/\u003eor your application\n    participant markdown as Python Markdown\n    participant extension as KrokiDiagramExtension\n    participant engine as Kroki Server\n\n    application-\u003e\u003emarkdown: Markdown + Diagrams\n    markdown-\u003e\u003eextension: Preprocessor\n    extension--\u003e\u003eextension: Encoded code\u003cbr/\u003ebase64+deflate\n    extension--\u003e\u003emarkdown: Markdown + Kroki direct link\n    markdown--\u003e\u003eapplication: HTML + Kroki direct kink\n    application-\u003e\u003eengine: GET API\u003cbr/\u003e\u003cimg src=\"http[s]\"\u003e\n    engine--\u003e\u003eapplication: Image data\n```\n\n\u003c!-- Links --\u003e\n\n[python-markdown]: https://python-markdown.github.io/\n[kuroki]: https://kroki.io/\n[data-uri]: https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/data\n[mkdocs-to-pdf]: https://mkdocs-to-pdf.readthedocs.io/\n[wasyprint]: https://weasyprint.org/\n[mermaid]: https://mermaid.js.org/\n[mkdocs]: https://www.mkdocs.org/\n[pelican]: https://getpelican.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkato%2Fmarkdown-kroki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhkato%2Fmarkdown-kroki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkato%2Fmarkdown-kroki/lists"}