Pkgdown: Adding basic docs about styling?

Created on 19 Mar 2019  路  6Comments  路  Source: r-lib/pkgdown

(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:

documentation help wanted

Most helpful comment

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?).

  • Easiest solution, used an existing Bootswatch theme. In the config file
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.

  • assets and templates used once
template:
  path: path/to/templates
  assets: path/to/assets
  default_assets: false
 ```

* assets and templates packaged up

```yaml
template:
  package: mycustompackage

Examples of packages with pkgdown template

All 6 comments

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

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?).

  • Easiest solution, used an existing Bootswatch theme. In the config file
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.

  • assets and templates used once
template:
  path: path/to/templates
  assets: path/to/assets
  default_assets: false
 ```

* assets and templates packaged up

```yaml
template:
  package: mycustompackage

Examples of packages with pkgdown template

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).

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:

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rickhelmus picture rickhelmus  路  3Comments

privefl picture privefl  路  3Comments

espinielli picture espinielli  路  3Comments

maelle picture maelle  路  6Comments

chuxinyuan picture chuxinyuan  路  6Comments