grantmcdermott / tinyplot

Lightweight extension of the base R graphics system
https://grantmcdermott.com/tinyplot
Apache License 2.0
208 stars 7 forks source link

par2 is not indexed on website #102

Closed grantmcdermott closed 5 months ago

grantmcdermott commented 5 months ago

It is rendered (and is an exported function)... but isn't listed among the Functions: menu items on the left. https://grantmcdermott.com/plot2/#/man/par2

Do I need to manually add it to the altdoc YAML somewhere?

cc @etiennebacher

etiennebacher commented 5 months ago

altdoc uses the file altdoc/docsify.md for the website. Currently the functions indexed on the website are hardcoded there:

...
* Functions: 
  - [`plot2`](man/plot2.md)
  - [`draw_legend`](man/draw_legend.md)
...

You have two choices: either add more functions by hand (allows you to control the order, similar to pkgdown workflow), or use * Functions: $ALTDOC_MAN_BLOCK. In the latter case, altdoc will automatically populate the "Functions" section (but you lose flexibility).

grantmcdermott commented 5 months ago

Ah, got it thanks Etienne. I'm wondering if I'm running up against some of the limitations of docsify here. Speaking of which... two questions while I have you:

  1. Can I adjust the width of the figures on the rendered website? They look especially cramped on mobile. I'm happy to write the SCSS if you can just point me to where it belongs.

  2. I do plan to get around to building a gallery, as per #59. I envisage a nested structure with sub-pages like "scatter plots", "distribution plots", etc. giving a variety of examples. Do you have thoughts on which of altdocs various backends would make this easiest (maybe a quarto website)?

etiennebacher commented 5 months ago
  1. I suppose you can adjust figure width with some (S)CSS. You should store the stylesheets in altdoc since all files there are copied to the docs folder. You can then add a link to those stylesheets in altdoc/docsify.html.
  2. I don't really know which one would be appropriate for a gallery, but I particularly like mkdocs-material. It's really good looking and has tons of great options/addins (on a sidenote that would also allow us to check that the workflow for mkdocs works well, for now it's only tested on polars). In mkdocs you can have several tabs (e.g "Articles", "Reference" on r-polars website), and then in each tab you can put a list of plots. There are a lot of config possible with it. I'm almost certain @vincentarelbundock would push for a quarto website though 😄
grantmcdermott commented 5 months ago

Super, thanks. Let me give this some thought and also hear what Vincent has to say.

vincentarelbundock commented 5 months ago

I'm almost certain @vincentarelbundock would push for a quarto website though 😄

Not really, no. The reason I use Quarto for marginaleffects is that I need the "tabset" feature and I couldn't get it to work in MkDocs. The reason I use Quarto for modelsummary is that its functions generate a bunch of raw HTML, and it is not as smooth with Markdown-based websites.

But Grant doesn't want mkdocs, because of Python environment issues. And Docute is no longer maintained. So I think it's between docsify and quarto.

FWIW, I created a gallery with the Lightbox extension for Quarto, and it was super easy:

https://github.com/vincentarelbundock/marginaleffects/blob/main/vignettes/meme.qmd