{"library":"markdown-inline-graphviz-extension","title":"Markdown Inline Graphviz Extension","description":"The `markdown-inline-graphviz-extension` library is a Python Markdown extension that allows rendering of Graphviz DOT language diagrams directly within Markdown documents, replacing inline definitions with inline SVG or PNG images. It is a Python 3 fork and continuation of previous projects, designed to work seamlessly with any Python-Markdown-based static site generator. Its current version is 1.1.3, with updates occurring on an as-needed basis to ensure compatibility and address issues.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install markdown-inline-graphviz-extension"],"cli":null},"imports":["import markdown\nhtml = markdown.markdown(text, extensions=['markdown_inline_graphviz'])"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import markdown\nimport os\n\n# Ensure Graphviz 'dot' executable is in your system's PATH\n# For example, on Ubuntu/Debian: sudo apt-get install graphviz\n# On macOS: brew install graphviz\n\nmarkdown_text = \"\"\"\n# My Document with a Graph\n\nHere is a simple graph:\n\n{% dot example.svg\ndigraph G {\n    A -> B;\n    B -> C;\n    C -> A;\n}\n%}\n\nAnother graph using a different engine:\n\n{% neato another.svg\nnode [shape=box];\nA -- B;\nB -- C;\nC -- A;\n%}\n\n\"\"\"\n\n# Render the markdown with the inline_graphviz extension\n# Ensure the extension name is exactly 'markdown_inline_graphviz'\ntry:\n    html_output = markdown.markdown(markdown_text, extensions=['markdown_inline_graphviz'])\n    print(html_output)\nexcept Exception as e:\n    print(f\"Error rendering markdown: {e}\")\n    print(\"Please ensure Graphviz is installed on your system and its executables are in your PATH.\")\n    print(\"You can test by running 'dot -V' or 'neato -V' in your terminal.\")\n","lang":"python","description":"This quickstart demonstrates how to parse Markdown text containing inline Graphviz definitions using the `markdown_inline_graphviz` extension and print the resulting HTML. It is crucial to have the Graphviz 'dot' executable (and other layout engines like 'neato') installed on your system and available in your system's PATH for this extension to function correctly. The example includes both `dot` and `neato` graph definitions.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}