Skip to content

Releases: fralau/mkdocs-macros-plugin

v.1.3.7 With Test Framework

03 Nov 09:25
Compare
Choose a tag to compare

1.3.7, 2024-10-18

  • Fixed: incompatibility with the d2 module (#249)

1.3.6, 2024-10-17

  • Added: complete test framework, using pytest and Mkdocs-Test (#244)
    A number of automated test cases are implemented.
  • Changed: move from setup.py to pyproject.toml (#250)

1.2.0, 2024-09-15

  • Added: three hooks register_variables/macros/filters to facilitate
    cooperation with other MkDocs plugins.
  • Fixed: `define_env() was always required in module (#191)
  • Added: trace the case when no module is found (INFO)
  • Improved documentation, particularly about HTML pages
  • Added: parameters j2_comment_start_string and
    j2_comment_end_string to plugin's parameters,
    to specify alternate markers for comments.
  • Added the multiline parameter force_render_paths in the config file,
    to specify directories or file patterns to be rendered for the case when render_by_default = false
    (the render_macros parameter in the YAML header of the page
    has the last word).

1.0.5, 2023-10-31

  • Added: git.short_tag (#183)
  • Added: Mermaid diagrams in the documentation (Readthedocs)
  • Fixed: Changelog was no longer displayed (#186)

Production version

13 Aug 11:52
Compare
Choose a tag to compare

1.0.4, 2023-08-07

  • Fixed: Warning due to filter issue with mkdocs >= 1.5
  • Fixed: Debug html tables (including for macro_info()) are
    now readable also in dark mode.

1.0.2, 2023-07-02

  • Added: it is now possible to use macros in page titles, in the
    nav section of the yaml file, or in the level 1 titles;
    the macros are correctly interpreted in the navigation part
    of the page.

1.0.1, 2023-05-25

1.0.0-alpha, 2023-04-23

  • Improved user guide, with introduction of two new pages:
    "Controlling macro rendering" and "Post production".

  • Fixed: (#158) In modules, on_pre_page_macros(), the env.markdown
    attribute is now available to create a header or footer.

  • Changed: In on_post_page_macros() use env.markdown instead of
    env.raw_markdown, for the same purpose.

  • Added: (#162) Allow opt-in of page rendering, by using parameter
    render_macros: true in yaml header of the page
    (requires render_by_default:false in the macro parameters,
    in the config file).

  • Fixed: macro_info() now generates a header of category 2,
    so as to be used with other material in the same page,
    and not confuse the macro generators.

  • Changed: ignore_macros: true in page header is deprecated.
    Use render_macros: false instead.

  • Fixed: issues #155 (documentation type), #143 (git.tab),
    #135 (indicate page where rendering failed).

Improved workflow

23 Nov 19:17
Compare
Choose a tag to compare

Now mkdocs-macros has has better integration with the general workflow

  1. Metavariables declared in the YAML header of a markdown page are now directly accessible by macros in the page, without needing to go through the page.meta object (e.g. if the meta-variable foois declared in the YAML header, it can be accessible as {{ foo }} as well as {{ page.meta.foo }}. It makes using macros much simpler.

  2. The console messages of mkdocs-macros are now integrated with the standard logging of MkDocs. It means that you can both suppress them (--quiet option) or expand them to include debug messages (--verbose).

  3. Macros have their own trace function (chatter()) which writes into MkDocs' log as Info. If you are using the local server (mkdocs serve), you can toggle that trace on and off, with a verbose parameter in the plugin's configuration and this will be instantly reflected on the console.

  4. The Python module can use a new on_post_build() function, for actions that need to take place after the HTML site directory is built (typically adding or modifying files).

Improved Debug/Documentation Information

24 Feb 20:17
Compare
Choose a tag to compare

The purpose of this new version is to improve the usability and documentation (as in php).

A rendering error no longer stop the mkdocs server, but results in the error and traceback being displayed in the page.

A new command {{ macros_infos() }} displays detailed information on the environment, and all variables, functions and filters available. This should be the go-to for questions on "is information XY available, and where?".

The config and page objects are now included.

To facilitate debugging and documentation, an environment object is available out of the box, with information of platform and software versions. If the website is under a git repository, the git version is also indicated.

A function now() has been added for timestamps and other operations related to time.

Let me know how this version works for you.

Includes and new declaration function for the Python module

10 Nov 10:02
Compare
Choose a tag to compare

This is a pre-release version. It contains the following improvements:

  • allows include of external files from markdown files, with the {{ % include ... % }} directive
  • in Python module, introduction of the define_env() function.
    This new function uses a single env argument (the decorator @macro is replaced by @env.macro.
  • it is now possible to create jinja2 filters (@env.filter decorator)
  • it is possible to access to the whole information in the YAML config file, through the env.conf object.
  • the declarare_variables() is still available though it will become deprecated.
  • enhanced documentation
  • enhanced trace for buildand servecommands