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.2.tar.gz (2.9 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.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinxcontrib-d2lang-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for sphinxcontrib-d2lang-0.0.2.tar.gz
Algorithm Hash digest
SHA256 afbb702a2dedb77b307cebd769defc1a7aacec4f17471abcea939d0c651570ff
MD5 3d7e7d70478cf8e2c9290eaddf6fc78c
BLAKE2b-256 ba51124130b102aed8fd8a9dd16c2f9ff347b24e50f4505a35f9397cae86ee58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sphinxcontrib_d2lang-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61f2c01dabd2260943718f6a1b2b64f275e2e0eab50ad45a25a7097281d0bfb4
MD5 3ce26b2836af7bbe2f9f58616ebe2518
BLAKE2b-256 a6c94e7a25baf4373b8bdf8afede3685a8d53819629434b155a0687c8a241017

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