Skip to main content

A series of snippets to create custom fences for mkdocs

Project description

MKDOCS CUSTOM FENCES

This package is for mkdocs and include some "code snippet" to create custom fences using pydownx superfences. This allow to customize your code blocks during the processor of your mkdocs.

For the moment, it includes only md_render.

Get started

pip install mkdocs_custom_fences After the installation you should be able to access the extensions in mkdocs.yml using mkdocs_custom_fences.file.class. See below for more information using configuration.

Mkdocs configuration

In your mkdocs.yml configuration you need to configure superfences to use custom fences.

markdow_extensions:
  pymdownx.superfences:
      custom_fences:
        - name: language
          class: language
          format: !!python/name:mkdocs_custom_fences.file.class

Markdown Render

→ Configuration : !!python/name:mkdocs_custom_fences.md_render.md_sub_render This custom formattor allow you to "force" markdown and remove the code block.

Add this in your configuration :

markdow_extensions:
  pymdownx.superfences:
      custom_fences:
        - name: md-render
          class: md-render
          format: !!python/name:mkdocs_custom_fences.md_render.md_sub_render

💡You can customize the name and class with any language you want.

Example :

    ```md-render
    |Col0|Col1|Col2|Col3|
    |----|----|----|----|
    |xml |x|x|x|
    ```

Will become :

Contribution

I will be happy to see any new configuration and custom fences.

To contribute :

  • Fork and clone this project
  • pip install -r requirements.txt (I advice you to use virtual environment ; personnaly I use conda.)
  • Create a new file (don't use any already custom fences for new customization). Don't forget to update the requirements.txt if you need).
  • Edit this README to add an example and the configuration.
  • Add the custom fences to the list.
  • Create a pull request

⚠️ You need to use conventionnal commit as described here

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_custom_fences-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_custom_fences-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_custom_fences-0.1.0.tar.gz.

File metadata

  • Download URL: mkdocs_custom_fences-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for mkdocs_custom_fences-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1b430de04d553df0bb886a4f3473b8a0e473b6f88acfc8c82ba36dbb3c430b99
MD5 e0931e0d5cc94ce070265fe71836f5f0
BLAKE2b-256 3c67ff82373d4673df1228caa5c9b2eb9b7c5432de6b6a83192e783e18ad9f04

See more details on using hashes here.

File details

Details for the file mkdocs_custom_fences-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_custom_fences-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for mkdocs_custom_fences-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1113791227e84c4e0008a95d838f714cd710e099948ac03e7b9884c995be0846
MD5 972656f570b5089f6198ef4cfdadcbab
BLAKE2b-256 2d728fe6a1d147a1aea954cffcfa733cb4375d5eaa64d829efab2bc7ff0b42c0

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