Testing of includes files#1197
Conversation
|
|
@paigem @heidinett , I've started using it with the ACCESS-ESM1.5 page using the payu page I wrote as a base to include information (#1202). Here are a few thoughts:
--8<-- "snippet path"
See the section on [modifying the PBS resources](https://access-hive-docs--1202.org.readthedocs.build/models/run_a_model/run_access-esm/#modify-pbs-resources) to learn how to change the laboratory location.Items 2 and 3 make me think that include sections should be as short as possible. We should not try to have a one-to-one correspondance between a collapsible section of documentation and an include section. Include sections might be smaller, we might include several sections in a single collapsible section with potentially additional text in between to add a reference on the page. |
|
I had a look at macros instead of snippets. The macros extension does not support including a part of a file in another file. I think that would be an annoying limitation to put the documentation together, resulting in a lot of files. I think we should encourage using Snippets but if there is a macro in the include part, then do it through Macros. In short, I don't think one tool will give us the best outcome. I also had a look at the current includes in this test branch that have text with macros and the text can/should be changed for all of them but one occurrence. I say "should" because I think some of the text on the persistent session is wrong as it implies persistent sessions are linked to a specific model whereas we want to encourage people to use only one persistent session for everything. Persistent sessions should be linked to cylc and not a specific model. That's an aside on the testing of include files, although it makes me think macros in include files should be infrequent. Text in include files should be generic text about something (payu, rose/cylc etc.) and as such should not need to refer to specifics of the page they go in. Exceptions should be relatively rare. In turn that means recommending Snippets first and Macros for exceptions should work fine. I'm obviously happy to discuss that point further. |
|
I think I found a better tool!!! https://github.com/mondeja/mkdocs-include-markdown-plugin It can do everything Snippet does, and offset Headers!!! Which means we can include headers in include sections. I like also the "rewrite-relative-urls" option so include files can use relative URLs and it will still be valid in the final file. But I believe Snippet does as well. I think it will not work with macros inside, though. Just because of when macros are dealt with and I didn't see a way around that. |
Description
This PR is to test how includes files work to ensure they do everything we want them to do. In this test, I added a file to describe persistent sessions, and then try to include it in the Run ACCESS-CM2 page.
I am trying to use includes files via the pymdownx.snippets extension, as this is something we already have in our mkdocs.yml file.