Skip to content

Commit 6e47c8e

Browse files
author
Marcus Gawronsky
committed
Documentation and proc_nbs for _brand.yml
1 parent 0f66519 commit 6e47c8e

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

nbs/api/17_serve.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
" path = Path(path or cfg.nbs_path)\n",
141141
" files = nbglob(path, func=Path, file_glob='', file_re='', **kwargs)\n",
142142
" if (path/'_quarto.yml').exists(): files.append(path/'_quarto.yml')\n",
143+
" if (path/'_brand.yml').exists(): files.append(path/'_brand.yml')\n",
143144
" if (path/'_extensions').exists(): files.extend(nbglob(path/'_extensions', func=Path, file_glob='', file_re='', skip_file_re='^[.]'))\n",
144145
"\n",
145146
" # If settings.ini or filter script newer than cache folder modified, delete cache\n",

nbs/explanations/docs.ipynb

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,39 @@
135135
"\n",
136136
"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",
137137
"\n",
138-
"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`."
138+
"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",
139+
"\n",
140+
"\n",
141+
"### Multiformat Branding with `_brand.yml`\n",
142+
"[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",
143+
"\n",
144+
"To use this specification, you would create a `brand.yml` in the same location as `_quarto.yml` with these contents:\n",
145+
"\n",
146+
"::: {.py-2 .px-3 .mb-4 fig-align=\"center\" .border .rounded .shadow-sm}\n",
147+
"\n",
148+
"```yaml\n",
149+
"color:\n",
150+
" palette:\n",
151+
" dark-grey: \"#222222\"\n",
152+
" blue: \"#ddeaf1\"\n",
153+
" background: blue\n",
154+
" foreground: dark-grey\n",
155+
" primary: black\n",
156+
"\n",
157+
"logo: \n",
158+
" small: favicon.png\n",
159+
"\n",
160+
"typography:\n",
161+
" fonts:\n",
162+
" - family: Jura\n",
163+
" source: google\n",
164+
" base: Jura\n",
165+
" headings: Jura\n",
166+
"```\n",
167+
"\n",
168+
":::\n",
169+
"\n",
170+
"This file will then change the appearance of your documentation, across formats, to include the fonts, colors and logos specified in the file."
139171
]
140172
},
141173
{

0 commit comments

Comments
 (0)