Replies: 4 comments 2 replies
-
You mean, dynamically generating new markdown pages? 🤔 Interesting idea. Is the number of pages variable or static? Could you perhaps elaborate on your use case? |
Beta Was this translation helpful? Give feedback.
-
Yes. But defined from some yaml.
I think that may depend on the list of extra:
new_pages:
- icon: "<url>"
url: "<url>"
- icon: "<url>"
url: "<url>" |
Beta Was this translation helpful? Give feedback.
-
Perhap it is possible to use mkdocs-macros for this, but I had not thought about it. To avoid "reinventing the wheel", I would look at solutions that have already been implemented. For a dynamic behavior with a variable number pages, I would rather use an existing plugin: awesome pages. Would it do what your are expecting? |
Beta Was this translation helpful? Give feedback.
-
I am not saying that I hold the truth: but I would apply a separation of concerns., by generating your pages before launching the If we consider the document generation process, I would do it this way: flowchart LR
A[Generate\nmarkdown pages] --> F
subgraph mkdocs
F[awesomepages] --> B[macros] --> C[render pages] --> D[serve/build]
end
You could generate pages containing macros commands, so that they could be converted later in the process. Integrating the two in a single script would be easy. |
Beta Was this translation helpful? Give feedback.
-
I know that
mkdcos-macros-plugin
enable the use of theextra
variables from the mkdocs.yamlSuch variables can be in existing markdown files, e.g., page.md uses
extra.data_for_page1
and page2.md usesextra.data_for_page2
.I am wondering if it is possible to use such variables to make mkdcos create the page1.md/page2.md files itself.
Beta Was this translation helpful? Give feedback.
All reactions