Skip to main content

an extension for sphinx to render d2lang diagrams in sphinx documents

Project description

sphinxcontrib-d2lang

This is a Sphinx extension fori 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.1.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.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinxcontrib-d2lang-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 c466a0821489a9cfc1cbec5bb7125559b3c16cb2e96762cdd79aef900dc678f5
MD5 0d2b873b3a219fb9a29a4715841a0c9f
BLAKE2b-256 64114eb40656423b29bde7ac78e850732b90f76c4aceafa2401a789de857d4be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sphinxcontrib_d2lang-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5240ca67a203528cbe0f7cad027a18252a4d45f5d44fc23cd5088d70e5feb2f8
MD5 82e26d4b9ae8fef53780cd62df03448a
BLAKE2b-256 04676ec2ce3a49e5171bef5e53dd6063a002295899f952189037881c7515252e

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