Neoteroi / mkdocs-plugins

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

Show event description #56

Closed changbowen closed 5 months ago

changbowen commented 5 months ago

Only a suggestion.. I think the description property could be better used to display additional information in events (or even activities). The proposed change is only a quick and possibly dirty way to render the description as html or as text in a span. It allows me abuse it a bit:

<style>
  .months {
    opacity: 0
  }

  .nt-plan-group.nt-group-0 .nt-plan-group-summary {
    opacity: 0
  }

  .nt-timeline-dot .description {
    position: absolute;
    left: 120%;
    font-size: smaller;
    filter: drop-shadow(0 1px 1px black);

    top: 50%;
    transform: translateY(-50%);
  }
</style>

::gantt:: no-years no-quarters no-days month-width=800

- title: ""
  events:
    - title: Month Begin
      time: 2024-01-01
      icon: ":material-calendar-start:"
      description: Month Begin
    - title: Patch Tuesday
      time: 2024-01-09
      icon: ":material-rocket-launch:"
      description: Patch Tuesday
    - title: Month End
      time: 2024-01-31
      icon: ":material-calendar-end:"
      description: "<span style='left: unset; right: 120%'>Month End</span>"
- title: Server Group A
  activities:
    - title: Pre-prod (SAT-TUE)
      start: 2024-01-13
      lasts: 4 days
    - title: Prod (SAT-SUN)
      start: 2024-01-20
      lasts: 2 days
- title: Server Group B
  activities:
    - title: Pre-prod (TUE)
      start: 2024-01-16
      lasts: 1 day
    - title: Prod (SAT-SUN)
      start: 2024-01-20
      lasts: 2 days

::/gantt::

which results in:

image

RobertoPrevato commented 5 months ago

Hi @changbowen Thank You for your contribution, I like it and I will publish to PyPi soon. Don't mind the failing build, I only need to do some GH workflow maintenance and upgrade to latest version of Black formatter somewhere.

RobertoPrevato commented 5 months ago

Hi @changbowen Your contribution has been published with the last release, and at https://pypi.org/project/neoteroi-mkdocs/1.0.5/