r-lib / pkgdown

Generate static html documentation for an R package
https://pkgdown.r-lib.org/
Other
718 stars 336 forks source link

Adding basic docs about styling? #987

Closed maelle closed 3 years ago

maelle commented 5 years ago

(sorry if it's already there and I missed it!)

Docs along the line of the "basics of styling pkgdown" section of https://enpiar.com/2017/12/18/integrating-pkgdown-with-your-personal-website/ would be nice. :smile_cat:

jayhesselberth commented 5 years ago

Yes it would probably be have a styling vignette; that link is a good place to start.

maelle commented 5 years ago

Just keeping some notes here, maybe I could make a PR for such a vignette if I get things right.

4 ways to tweak the styling, that could be used in complement of each other (I'd tend to imagine it's correct for Bootswatch theme + tweaks via extra.css/other assets; maybe less so for package+other assets?).

template:
  params:
    bootswatch: cerulean

More advanced, in both cases for things not described by templates/assets, the default or the chosen Bootswatch theme is used. Develop assets and templates and use them in a single package or in many packages by packaging the assets and templates.

template:
  path: path/to/templates
  assets: path/to/assets
  default_assets: false
template:
  package: mycustompackage

Examples of packages with pkgdown template

maelle commented 5 years ago

To add to further resources of that potential future vignette in my question on RStudio community about pkgdown templates Mara recommended Bootstrap docs since pkgdown uses Bootstrap https://bootswatch.com/ (the link should be added with the mention of the Bootstrap version pkgdown uses).

maelle commented 4 years ago

Maybe I should make a PR of a vignette draft this way I wouldn't open useless issues about things I should have known :woman_facepalming:

maelle commented 4 years ago

Also, if one develops custom CSS/HTML, how does one keep that up to date with the default template.

maelle commented 3 years ago

Theming vs layout. Make it clear what the difference is.