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.4.tar.gz (3.1 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.4-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinxcontrib-d2lang-0.0.4.tar.gz
  • Upload date:
  • Size: 3.1 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.4.tar.gz
Algorithm Hash digest
SHA256 fc0ee78ff8e11098e428917f719f8fd4a0b74304caa1c1c7c9f07c353a3dea5d
MD5 e26e43d9f1e9193cff43a724bbc382f5
BLAKE2b-256 198d115fffe73ea9f3e238b274a205697990fd65e01f3a5e9b45a1856ec38a9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sphinxcontrib_d2lang-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6f66ec3e012454140c57351c3e223621bf9b37093957c5f07eac2bae2058c344
MD5 afc668a718dd5047b30d1b0d38229ccc
BLAKE2b-256 afa31bfb7c97b66e0ea9fd96ab6bc2b78d038d8c6983f6ff743607e53252467b

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