jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
219 stars 64 forks source link

Hide list of authors on particular pages #1664

Open santisoler opened 1 week ago

santisoler commented 1 week ago

Hi everyone! First of all, thanks for developing MyST and the whole environment for Jupyter Books, amazing work!

This is a question/feature proposal. I was wondering if there's a way to hide the list of authors from particular pages. My main use case for it is to have "index" pages that point to several different notebooks (see the following file tree as example). I would like to list all the authors in myst.yml, and list the authors of each notebook (.ipynb file), but avoid having the list of authors in the notebooks/index.md.

.
├── index.md
├── myst.yml
└── notebooks
    ├── content.ipynb
    └── index.md

I know I can override the authors list in the yml header of each notebook or Markdown file. This is useful when trying to specify which person contributed to each particular notebook. But I'm wondering if there's a way to actually hide it.

So long, I found a hacky way to do so by overriding the authors list in the header of the index.md file:

authors: {}

But, an emtpy <header> tag is still created in the HTML file:

<header class="mt-4 not-prose">
  <div>
    <span class="font-semibold text-sm inline-block"
      ><button
        class="focus:shadow-[0_0_0_2px] focus:shadow-black outline-none hover:underline"
        aria-label="Author Details"
        type="button"
        aria-haspopup="dialog"
        aria-expanded="false"
        aria-controls="radix-:R3kfop:"
        data-state="closed"
      ></button
    ></span>
  </div>
</header>

So: is there a way to actually hide the list of authors (without generating an empty header tag)?

Proposal

If currently there's no way to do, I would suggest adding a way of setting authors as an empty list, like:

authors: []

That would hide the list of authors.