chore: add `Print Pages` to the docs

userquin/feat-add-print-options
userquin 1 year ago
parent 0519e94878
commit 38b8c4dc2e

@ -175,7 +175,8 @@ function sidebarReference(): DefaultTheme.SidebarItem[] {
{ text: 'Edit Link', link: 'edit-link' },
{ text: 'Last Updated Timestamp', link: 'last-updated' },
{ text: 'Search', link: 'search' },
{ text: 'Carbon Ads', link: 'carbon-ads' }
{ text: 'Carbon Ads', link: 'carbon-ads' },
{ text: 'Print Pages', link: 'print-pages' }
]
}
]

@ -0,0 +1,54 @@
# Print Pages
You can control what parts of the pages are printed using the `print` option. VitePress will show the whole page by default, excluding carbon-ads.
Any page with Frontmatter configuration will override the global configuration, for example, the navbar will be hidden when the page containing `navbar: false`.
VitePress has the `screen-only` class to hide elements when printing, you can use it in any component, html or Markdown html content.
```js
export default {
themeConfig: {
// or `print: false` to print only the main content
print: {
outline: true,
navbar: true,
sidebar: true,
footer: true
}
}
}
```
## navbar
- Type: `boolean`
- Details:
This flag will control the navbar visibility when printing, and will be overriden by the Frontmatter navbar option if set to `false` (navbar will not be visible).
## sidebar
- Type: `boolean`
- Details:
This flag will control the left sidebar visibility when printing, and will be overriden by the Frontmatter sidebar option if set to `false` (sidebar will not be visible).
## outline
- Type: `boolean`
- Details:
This flag will control the aside and outline visibility when printing, and will be overriden by the Frontmatter aside and outline options if any set to `false` (right aside will not be visible).
## footer
- Type: `boolean`
- Details:
This flag will control the footer visibility when printing, and will be overriden by the Frontmatter footer option if set to `false` (footer will not be visible).
Loading…
Cancel
Save