Skip to main content

an extension for sphinx to render d2lang diagrams in sphinx documents

Project description

sphinxcontrib-d2lang

This is a Sphinx extension for d2lang.

Usage

Install

$ pip install sphinxcontrib-d2lang

Adding the extension

conf.py

extensions = [
    "sphinxcontrib.d2lang",
]

Adding a diagram (inline)

You can use d2lang in sphinx directive

source/index.rst

Hello World
===========

.. d2lang::

    hello -> world

Adding a diagram (external file)

You can use an external file like this

Hello World
===========

.. d2lang:: helloworld.d2

Options

There is two options you can use

  • layout
  • filename

Layout engine

You can specify layout engine to use

Hello World
===========

.. d2lang::
   :layout: elk

    hello -> world

Output filename

Hello World
===========

.. d2lang::
   :filename: d2lang_files/helloworld.svg

    hello -> world

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinxcontrib-d2lang-0.0.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinxcontrib_d2lang-0.0.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file sphinxcontrib-d2lang-0.0.3.tar.gz.

File metadata

  • Download URL: sphinxcontrib-d2lang-0.0.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for sphinxcontrib-d2lang-0.0.3.tar.gz
Algorithm Hash digest
SHA256 70fc3703fa30a0c75ccfa117ca77bb64d47dded4c8212a9c104c69cf915ff1b3
MD5 5bc34ffc699125b46ab15e858819aeda
BLAKE2b-256 9d05b7397a85b8d62ea52864ddc69db6f9970e9236f725504a8d080a4bd645b5

See more details on using hashes here.

File details

Details for the file sphinxcontrib_d2lang-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_d2lang-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0d76b388533ff1c9bc21720a234f7377b6a15c6c789f9f33cebd15b5c10c5599
MD5 b79d34d08921a3adfa8a669cf01ef36a
BLAKE2b-256 b028edcf55e8d7ca7c3928ad903c3287a00215b06d63fb78864dad21080ba077

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page