Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jodygarnett opened this issue Dec 2, 2023 · 0 comments

Comments

@jodygarnett
Copy link
Owner

jodygarnett commented Dec 2, 2023

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
%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant