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.5.tar.gz (3.2 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.5-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinxcontrib-d2lang-0.0.5.tar.gz
  • Upload date:
  • Size: 3.2 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.5.tar.gz
Algorithm Hash digest
SHA256 26479daf1738d5f8ceafea5c51665a59262f89dc8e726bcdbf1a4384a2b26ac6
MD5 97d53b36bbf740a663aae9eb23757982
BLAKE2b-256 5e5de43c14a2a6628b2773cfab913f204eaee05847b706c35dccafd507b7728d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sphinxcontrib_d2lang-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 791c23669e8879222e614f095afaec85b7596d65831f1fd801c9937fcd9bc58f
MD5 247f05367489437309bdd8cbf5ca341d
BLAKE2b-256 7579b1ca20d0ac54a35a9d3d791ec8c69d58731df2ac4cf2a484969bc51ecf30

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