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.2.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_custom_fences-0.1.2-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

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