Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Quarto 1.6 _brand.yml #1484

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nbdev/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def proc_nbs(
path = Path(path or cfg.nbs_path)
files = nbglob(path, func=Path, file_glob='', file_re='', **kwargs)
if (path/'_quarto.yml').exists(): files.append(path/'_quarto.yml')
if (path/'_brand.yml').exists(): files.append(path/'_brand.yml')
if (path/'_extensions').exists(): files.extend(nbglob(path/'_extensions', func=Path, file_glob='', file_re='', skip_file_re='^[.]'))

# If settings.ini or filter script newer than cache folder modified, delete cache
Expand Down
1 change: 1 addition & 0 deletions nbs/api/17_serve.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
" path = Path(path or cfg.nbs_path)\n",
" files = nbglob(path, func=Path, file_glob='', file_re='', **kwargs)\n",
" if (path/'_quarto.yml').exists(): files.append(path/'_quarto.yml')\n",
" if (path/'_brand.yml').exists(): files.append(path/'_brand.yml')\n",
" if (path/'_extensions').exists(): files.extend(nbglob(path/'_extensions', func=Path, file_glob='', file_re='', skip_file_re='^[.]'))\n",
"\n",
" # If settings.ini or filter script newer than cache folder modified, delete cache\n",
Expand Down
34 changes: 33 additions & 1 deletion nbs/explanations/docs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,39 @@
"\n",
"By default nbdev automatically generates `sidebar.yml`, which specifies the tree structure of your sidebar. nbdev infers the tree structure by inspecting the directory structure containing your source files. You can see an example of this by inspecting the folder structure of [the notebooks directory in nbdev](https://github.com/fastai/nbdev/tree/master/nbs) and the corresponding left-hand sidebar on this website. Leading numbers in filenames and directories are ignored when naming elements of the sidebar (which you can see examples of in this project's notebooks directory).\n",
"\n",
"To customize the sidebar, you must set `custom_sidebar = true` in `settings.ini`. This will prevent nbdev from regenerating this file every time the docs are re-built. This way, you an edit this file directly instead of overriding the sidebar with `custom.yml`."
"To customize the sidebar, you must set `custom_sidebar = true` in `settings.ini`. This will prevent nbdev from regenerating this file every time the docs are re-built. This way, you an edit this file directly instead of overriding the sidebar with `custom.yml`.\n",
"\n",
"\n",
"### Multiformat Branding with `_brand.yml`\n",
"[Quarto supports `_brand.yml`](https://quarto.org/docs/authoring/brand.html)- a single YAML file that can be used to standardize the appearance of your documentation across formats.\n",
"\n",
"To use this specification, you would create a `brand.yml` in the same location as `_quarto.yml` with these contents:\n",
"\n",
"::: {.py-2 .px-3 .mb-4 fig-align=\"center\" .border .rounded .shadow-sm}\n",
"\n",
"```yaml\n",
"color:\n",
" palette:\n",
" dark-grey: \"#222222\"\n",
" blue: \"#ddeaf1\"\n",
" background: blue\n",
" foreground: dark-grey\n",
" primary: black\n",
"\n",
"logo: \n",
" small: favicon.png\n",
"\n",
"typography:\n",
" fonts:\n",
" - family: Jura\n",
" source: google\n",
" base: Jura\n",
" headings: Jura\n",
"```\n",
"\n",
":::\n",
"\n",
"This file will then change the appearance of your documentation, across formats, to include the fonts, colors and logos specified in the file."
]
},
{
Expand Down