Neoteroi / mkdocs-plugins

Plugins for MkDocs.
MIT License
116 stars 9 forks source link

[timeline] Option to generate timeline from files in a folder #44

Open Andre601 opened 10 months ago

Andre601 commented 10 months ago

It would be really cool if you could configure the timeline plugin to generate a timeline based on files in a folder. That way could you easily add more content (Maybe even with more formatting through markdown) without having to constantly extend the ::timeline:: ... ::/timeline:: placeholder.

Perhaps the plugin could use certain frontmatter and/or page values for the different options?

For example:

---
timeline:
  title: 'title' # If not present defaults to {{ page.title }}
  sub_title: 'Q1 2023' # Maybe use H1 header?
  icon: ':simple-github:' # Could default to Mkdocs-material's icon option?
---

# Page

Lorem Ipsum

would be equivalent to

::timeline::
[
  {
    "title": "title",
    "icon": ":simple-github:",
    "sub_title": "Q1 2023",
    "content": "Lorem Ipsum"
  }
]
::/timeline::

To define it, a folder option could be added:

::timeline:: folder=".profiles"

::/timeline::

This would search for a profiles folder relative to its own position...