Git Product home page Git Product logo

mkdocs-plugin-rzk's Introduction

Rzk plugin for MkDocs

PyPI - Version

This is a MkDocs plugin for rendering SVG diagrams for Literate Rzk Markdown files (any file ending in .rzk.md extension). To use it, simply install the latest version (pip install mkdocs-plugin-rzk) and add it to your mkdocs.yml config file:

plugins:
  - rzk

Configuration

The following config options are supported:

Name Type Default Description
path str rzk Path to the Rzk executable
render_svg bool True Enable/disable rendering SVGs for definitions (currently only works for files without dependencies)
anchor_definitions bool True Turn names of definitions into links to themselves (useful for generating a link to a particular #define in the generated MkDocs)

Development

To test this plugin while developing locally, run pip install --editable <path/to/this/folder> in the MkDocs project where this plugin is to be used. You will need to manually stop and rerun the MkDocs server on every update (hot reloading does not work).

Packaging and Deployment

If you don't have them already, install the build and twine packages as such: python3 -m pip install --upgrade build twine.

Next, package your code by running python3 -m build to generate distribution archives (wheels) under the dist directory.

Lastly, run twine upload dist/* to upload the new version to PyPI.

mkdocs-plugin-rzk's People

Contributors

aabounegm avatar fizruk avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

mkdocs-plugin-rzk's Issues

Automatically hide long definitions using admonitions

The idea is to automatically hide definitions when they are "too large" (which can be configurable based on the number of lines). For example, here is what it might look like for is-natural-in-family-yon:

Screenshot 2023-09-21 at 13 39 29

The change should be purely text-based: separating a part of a block that starts with a line that contains a single := and ends either with an end of a code block, or a non-empty line that is not indented. I think that should be enough.

Then, in mkdocs.yml we could have something like

plugins:
  - rzk:
      collapse-large-definitions:
        min-lines: 4  # auto-collapse rendered definitions with 4+ lines (keeping statements/type signatures)

Add an option to hide implementation by default

We can use Markdown admonitions to separate and hide implementation details for definitions with large bodies (I think >3 lines can be considered large by default, but of course, should be configurable).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.