Closed alanlivio closed 2 years ago
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?
You mean, dynamically generating new markdown pages? 🤔
Yes. But defined from some yaml.
Interesting idea. Is the number of pages variable or static? Could you perhaps elaborate on your use case?
I think that may depend on the list of extra
variables.
Image the next mkdocs.yaml and I will create one page for each given icon/url.
extra:
new_pages:
- icon: "<url>"
url: "<url>"
- icon: "<url>"
url: "<url>"
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?
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.