Skip to main content

Plugin for MkDocs helping with rendering Entangled (entangled.github.io) projects.

Project description

Welcome to MkDocs Entangled Plugin

Using this plugin, you can make your Entangled documents look better.

Examples

Detailed examples are found in the entangled/mkdocs-examples repository.

Install

Install this with pip install mkdocs-entangled-plugin. To use the entangled plugin, add the following lines to your mkdocs.yml:

plugins:
  - entangled

markdown_extensions:
  - pymdownx.superfences
  - pymdownx.tabbed:
      alternate_style: true 

For more information, see the documentation.

Components

This plugin bundles functionality for literate programming with Entangled.

  • Annotate code blocks with titles.
  • Build artifacts using Make.

Annotate code blocks

The default markdown syntax that Entangled supports has fenced code blocks as follows

``` {.python file=examples/hello_world.py}
if __name__ == "__main__":
    <<hello-world>>
```

Which renders like this:

if __name__ == "__main__":
    <<hello-world>>

Or named code blocks

``` {.python #hello-world}
print("Hello, World!")
```

that render like this:

print("Hello, Universe!")

Build Artifacts

Build artifacts by specifying a Makefile.

=== "Figure 1"

    ![](fig/plot.svg)

=== "Source"

    ``` {.gnuplot file=examples/plot.gp}
    # enter your plotting commands here
    ```

    ``` {.make .build-artifact}
    .RECIPEPREFIX = >
  
    docs/fig/plot.svg: examples/plot.gp
    > mkdir -p $(@D)
    > gnuplot $^ > $@
    ```

=== "Figure 1"

![](fig/plot.svg)

=== "Source"

``` {.gnuplot file=examples/plot.gp}
set term svg background rgb 'white' size 700, 500
sinc(r) = sin(pi*r) / (pi*r)
set isosamples 50, 50
set hidden3d
set xrange [-4:4]
set yrange [-4:4]
set xyplane 0
set title "Sinc function"
splot sinc(sqrt(x**2 + y**2)) t'' lc rgb '#5533cc'
```

``` {.make .build-artifact}
.RECIPEPREFIX = >

docs/fig/plot.svg: examples/plot.gp
> mkdir -p $(@D)
> gnuplot $^ > $@
```

License

Licensed under the Apache-2 license agreement: see LICENSE

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

mkdocs_entangled_plugin-0.4.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

mkdocs_entangled_plugin-0.4.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_entangled_plugin-0.4.0.tar.gz.

File metadata

File hashes

Hashes for mkdocs_entangled_plugin-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e78f1ff3b55a3838f6a5d6a46d9280484af4520a4679f9bccd8b638406b026c8
MD5 ac061d91e1bea89dc0badc3736492a9e
BLAKE2b-256 ab1baf0757f0a5a60a636903f520ca6164df314068374f765a072d06b65bad7a

See more details on using hashes here.

File details

Details for the file mkdocs_entangled_plugin-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_entangled_plugin-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af4fe84e2218e2c0a805d20161977e34cd56f8af24b4d1a88be4c258176b81bb
MD5 94751ac99fa1e9be09459569f233bd8d
BLAKE2b-256 64d09bf18d41e1e2eda91d67a3493778016001402781dcf9f3c391d94fb50545

See more details on using hashes here.

Supported by

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