Skip to content

Support include and literal include directives with use mkdocs-include-markdown plugin #6

@jodygarnett

Description

@jodygarnett

GeoServer makes use of include and literalinclude directives, map these to mkdocs-include plugin use.

Although material-for-mkdocs recommends use of snippets the mkdocs-include plugin closely matches the sphinx-build functionality.

Implementation notes:

  • Use of absolute path is assumed from docs folder
  • Use ./ or ../ to indicate a relative path

Reference:

literal include directive mapping

Used to include code example:

RichStructuredText:

.. literalinclude:: files/counteries.sld
   :language: xml

Markdown:

 ```xml
 {% include "./files/countries.sld" %}
 ```

include directive markdown

Used to include rst content inline:

RichStructuredText

.. include:: /../../../../LICENSE.md
   :start-after: GeoServer is distributed under the GNU General Public License Version 2.0 license:
   :end-before: For latest contact information of Open Source Geospatial Foundation see the website at

MarkDown:

{%
   include-markdown "../../../../../LICENSE.md"
   start="GeoServer is distributed under the GNU General Public License Version 2.0 license:"
   end="For latest contact information of Open Source Geospatial Foundation see the website at"
   dedent=true
%}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions