仪表板选项
格式
以下文档和格式选项要么是仪表板特定的,要么在仪表板中有特殊行为:
选项 | 描述 |
---|---|
title |
标题(显示在导航栏左上方) |
author |
作者(与标题一起显示,字体较小) |
logo |
徽标(显示在导航栏中标题的左侧) |
orientation |
rows 或 columns (默认:rows ) |
scrolling |
使用滚动而不是填充布局?(默认:false ) |
expandable |
使卡片内容可扩展(默认:true ) |
theme |
仪表板主题(内置或自定义scss) |
nav-buttons |
导航栏右侧显示的按钮。使用 linkedin , facebook , reddit , twitter , github ,或自定义 导航项。 |
例如:
---
title: "仪表板"
author: "Acme, Inc."
logo: images/acme.png
format:
dashboard:
theme: default
orientation: rows
expandable: true
scrolling: false
nav-buttons:
- reddit
- icon: gitlab
href: https://gitlab.com/
---
页面
页面 可以指定与全局方向不同的自定义方向:
选项 | 描述 |
---|---|
orientation |
rows 或 columns (默认使用全局方向) |
scrolling |
true 或 false (默认使用全局滚动) |
例如:
---
"仪表板"
title: format: dashboard
---
# 图表 {orientation="columns" scrolling="true"}
侧边栏
通过将 .sidebar
属性应用于一级标题(用于全局侧边栏)或二级标题(用于页面级侧边栏)来创建 侧边栏。
类 | 描述 |
---|---|
.sidebar |
内容应排列到侧边栏中 |
例如:
---
"仪表板"
title: format: dashboard
---
# 图表 {.sidebar}
行与列
行和列支持自定义布局和尺寸行为的选项。以下类可以用于修改布局行为:
类 | 描述 |
---|---|
.tabset |
内容应排列到 选项卡集 中 |
.fill |
内容应填充可用布局空间 |
.flow |
内容应流到其自然大小 |
请注意,在大多数仪表板中,.fill
和 .flow
是根据卡片内容自动确定的,不需要手动指定。
以下属性可用于显式尺寸:
选项 | 描述 |
---|---|
width |
百分比或绝对像素宽度(默认情况下将空间均匀分布在行中的元素之间) |
height |
百分比或绝对像素高度(默认情况下将空间均匀分布在列中的元素之间) |
例如:
---
title: "仪表板"
format: 仪表板
---
## 行 {height="65%"}
## 行 {height="35%"}
需要注意的是,如果某些组件指定了明确的width
或height
,而其他组件没有指定,那么剩余的空间将均匀分布在这些元素之间。
卡片
卡片选项允许你指定标题和各种布局行为:
选项 | 描述 |
---|---|
title |
显示在卡片标题中的标题 |
padding |
卡片内容周围的填充(默认值:8px ) |
expandable |
使卡片内容可展开(默认值:true ) |
width |
百分比或绝对像素宽度(默认情况下,在一行中的元素之间均匀分配空间) |
height |
百分比或绝对像素高度(默认情况下,在一列中的元素之间均匀分配空间) |
fill |
卡片是否应填充其容器或“流动”,匹配其内容的高度。(Quarto 根据卡片内容确定默认值) |
例如:
```{python}#| title: "预期寿命"
#| padding: 3px
#| expandable: false
#| width: 70%
```
这些相同的选项可以应用于 .card
divs。例如:
="预期寿命" padding="3px"}
::: {.card title
这是内容。 :::
值框
值框 支持以下选项:
选项 | 描述 |
---|---|
title |
显示在值上方的标题 |
icon |
bootstrap 图标中的图标标识符 |
color |
背景颜色——这可以是任何 CSS 颜色或主题特定颜色别名之一(见下文) |
value |
主要显示值 |
color
可用的主题别名包括:
颜色别名 | 默认主题颜色 |
---|---|
primary |
蓝色 |
secondary |
灰色 |
success |
绿色 |
info |
亮蓝色 |
warning |
黄色/橙色 |
danger |
红色 |
light |
浅灰色 |
dark |
黑色 |
请注意,值框选项可以指定为单元格选项,也可以通过打印 dict()
(对于 Python)或 list()
(对于 R)来指定(这在选项需要动态时很有帮助)。有关详细信息,请参阅值框组件文档。
Dashboard
logo |
Logo image (placed on the left side of the navigation bar) |
orientation |
Default orientation for dashboard content (default |
scrolling |
Use scrolling rather than fill layout (default: |
expandable |
Make card content expandable (default: |
nav-buttons |
Links to display on the dashboard navigation bar |
Format Options
theme |
Theme name, theme scss file, or a mix of both. |
css |
One or more CSS style sheets. |
identifier-prefix |
Specify a prefix to be added to all identifiers and internal links in HTML and DocBook output, and to footnote numbers in Markdown and Haddock output. This is useful for preventing duplicate identifiers when generating fragments to be included in other pages. |
email-obfuscation |
Specify a method for obfuscating
|
html-q-tags |
Use |
quarto-required |
A semver version range describing the supported quarto versions for this document or project. Examples:
|
Table of Contents
toc |
Include an automatically generated table of contents (or, in the case of Note that if you are producing a PDF via |
toc-depth |
Specify the number of section levels to include in the table of contents. The default is 3 |
Numbering
number-sections |
Number section headings rendered output. By default, sections are not numbered. Sections with class |
number-depth |
By default, all headings in your document create a numbered section. You customize numbering depth using the For example, to only number sections immediately below the chapter level, use this:
|
number-offset |
Offset for section headings in output (offsets are 0 by default) The first number is added to the section number for top-level headings, the second for second-level headings, and so on. So, for example, if you want the first top-level heading in your document to be numbered “6”, specify |
shift-heading-level-by |
Shift heading levels by a positive or negative integer. For example, with |
Layout
cap-location |
Where to place figure and table captions ( |
fig-cap-location |
Where to place figure captions ( |
tbl-cap-location |
Where to place table captions ( |
classoption |
For LaTeX/PDF output, the options set for the document class. For HTML output using KaTeX, you can render display math equations flush left using |
grid |
Properties of the grid system used to layout Quarto HTML pages. |
max-width |
Adds a css |
margin-left |
For HTML output, sets the For LaTeX output, sets the left margin if For ConTeXt output, sets the left margin if For |
margin-right |
For HTML output, sets the For LaTeX output, sets the right margin if For ConTeXt output, sets the right margin if For |
margin-top |
For HTML output, sets the For LaTeX output, sets the top margin if For ConTeXt output, sets the top margin if For |
margin-bottom |
For HTML output, sets the For LaTeX output, sets the bottom margin if For ConTeXt output, sets the bottom margin if For |
Code
code-fold |
Collapse code into an HTML
|
code-summary |
Summary text to use for code blocks collapsed using |
code-overflow |
Choose how to handle code overflow, when code lines are too wide for their container. One of:
|
code-line-numbers |
Include line numbers in code block output ( For revealjs output only, you can also specify a string to highlight specific lines (and/or animate between sets of highlighted lines).
|
code-copy |
Enable a code copy icon for code blocks.
|
code-link |
Enables hyper-linking of functions within code blocks to their online documentation. Code linking is currently implemented only for the knitr engine (via the downlit package). A limitation of downlit currently prevents code linking if |
code-annotations |
The style to use when displaying code annotations. Set this value to false to hide code annotations. |
highlight-style |
Specifies the coloring style to be used in highlighted source code. Instead of a STYLE name, a JSON file with extension |
syntax-definitions |
KDE language syntax definition files (XML) |
indented-code-classes |
Specify classes to use for all indented code blocks |
Execution
Execution options should be specified within the execute
key. For example:
execute:
echo: false
warning: false
eval |
Evaluate code cells (if
|
echo |
Include cell source code in rendered output.
|
output |
Include the results of executing the code in the output. Possible values:
|
warning |
Include warnings in rendered output. |
error |
Include errors in the output (note that this implies that errors executing code will not halt processing of the document). |
include |
Catch all for preventing any output (code or results) from being included in output. |
cache |
Cache results of computations (using the knitr cache for R documents, and Jupyter Cache for Jupyter documents). Note that cache invalidation is triggered by changes in chunk source code (or other cache attributes you’ve defined).
|
freeze |
Control the re-use of previous computational output when rendering.
|
Figures
fig-align |
Figure horizontal alignment ( |
fig-cap-location |
Where to place figure captions ( |
fig-width |
Default width for figures generated by Matplotlib or R graphics. Note that with the Jupyter engine, this option has no effect when provided at the cell level; it can only be provided with document or project metadata. |
fig-height |
Default height for figures generated by Matplotlib or R graphics. Note that with the Jupyter engine, this option has no effect when provided at the cell level; it can only be provided with document or project metadata. |
fig-format |
Default format for figures generated by Matplotlib or R graphics ( |
fig-dpi |
Default DPI for figures generated by Matplotlib or R graphics. Note that with the Jupyter engine, this option has no effect when provided at the cell level; it can only be provided with document or project metadata. |
fig-asp |
The aspect ratio of the plot, i.e., the ratio of height/width. When The |
fig-responsive |
Whether to make images in this document responsive. |
Tables
tbl-colwidths |
Apply explicit table column widths for markdown grid tables and pipe tables that are more than Some formats (e.g. HTML) do an excellent job automatically sizing table columns and so don’t benefit much from column width specifications. Other formats (e.g. LaTeX) require table column sizes in order to correctly flow longer cell content (this is a major reason why tables > 72 columns wide are assigned explicit widths by Pandoc). This can be specified as:
|
tbl-cap-location |
Where to place table captions ( |
df-print |
Method used to print tables in Knitr engine documents:
The default printing method is |
References
bibliography |
Document bibliography (BibTeX or CSL). May be a single file or a list of files |
csl |
Citation Style Language file to use for formatting references. |
citations-hover |
Enables a hover popup for citation that shows the reference information. |
citeproc |
Turn on built-in citation processing. To use this feature, you will need to have a document containing citations and a source of bibliographic data: either an external bibliography file or a list of |
citation-abbreviations |
JSON file containing abbreviations of journals that should be used in formatted bibliographies when
|
Footnotes
footnotes-hover |
Enables a hover popup for footnotes that shows the footnote contents. |
reference-location |
Specify location for footnotes. Also controls the location of references, if
|
Crossrefs
crossref |
Configuration for crossref labels and prefixes. |
crossrefs-hover |
Enables a hover popup for cross references that shows the item being referenced. |
Citation
citation |
Citation information for the document itself specified as CSL YAML in the document front matter. For more on supported options, see Citation Metadata. |
Language
lang |
Identifies the main language of the document using IETF language tags (following the BCP 47 standard), such as This affects most formats, and controls hyphenation in PDF output when using LaTeX (through |
language |
YAML file containing custom language translations |
dir |
The base script direction for the document ( For bidirectional documents, native pandoc When using LaTeX for bidirectional documents, only the |
Includes
include-before-body |
Include contents at the beginning of the document body (e.g. after the A string value or an object with key “file” indicates a filename whose contents are to be included An object with key “text” indicates textual content to be included |
include-after-body |
Include content at the end of the document body immediately after the markdown content. While it will be included before the closing A string value or an object with key “file” indicates a filename whose contents are to be included An object with key “text” indicates textual content to be included |
include-in-header |
Include contents at the end of the header. This can be used, for example, to include special CSS or JavaScript in HTML documents. A string value or an object with key “file” indicates a filename whose contents are to be included An object with key “text” indicates textual content to be included |
resources |
Path (or glob) to files to publish with this document. |
metadata-files |
Read metadata from the supplied YAML (or JSON) files. This option can be used with every input format, but string scalars in the YAML file will always be parsed as Markdown. Generally, the input will be handled the same as in YAML metadata blocks. Values in files specified later in the list will be preferred over those specified earlier. Metadata values specified inside the document, or by using |
Metadata
keywords |
List of keywords to be included in the document metadata. |
pagetitle |
Sets the title metadata for the document |
title-prefix |
Specify STRING as a prefix at the beginning of the title that appears in the HTML header (but not in the title as it appears at the beginning of the body) |
description-meta |
Sets the description metadata for the document |
author-meta |
Sets the author metadata for the document |
date-meta |
Sets the date metadata for the document |
Rendering
from |
Format to read from. Extensions can be individually enabled or disabled by appending +EXTENSION or -EXTENSION to the format name (e.g. markdown+emoji). |
output-file |
Output file to write to |
output-ext |
Extension to use for generated output file |
template |
Use the specified file as a custom template for the generated document. |
template-partials |
Include the specified files as partials accessible to the template for the generated content. |
embed-resources |
Produce a standalone HTML file with no external dependencies, using |
self-contained-math |
Embed math libraries (e.g. MathJax) within |
filters |
Specify executables or Lua scripts to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written. |
shortcodes |
Specify Lua scripts that implement shortcode handlers |
keep-md |
Keep the markdown file generated by executing code |
keep-ipynb |
Keep the notebook file generated from executing code. |
ipynb-filters |
Filters to pre-process ipynb files before rendering to markdown |
ipynb-shell-interactivity |
Specify which nodes should be run interactively (displaying output from expressions) |
plotly-connected |
If true, use the “notebook_connected” plotly renderer, which downloads its dependencies from a CDN and requires an internet connection to view. |
extract-media |
Extract images and other media contained in or linked from the source document to the path DIR, creating it if necessary, and adjust the images references in the document so they point to the extracted files. Media are downloaded, read from the file system, or extracted from a binary container (e.g. docx), as needed. The original file paths are used if they are relative paths not containing … Otherwise filenames are constructed from the SHA1 hash of the contents. |
resource-path |
List of paths to search for images and other resources. |
default-image-extension |
Specify a default extension to use when image paths/URLs have no extension. This allows you to use the same source for formats that require different kinds of images. Currently this option only affects the Markdown and LaTeX readers. |
abbreviations |
Specifies a custom abbreviations file, with abbreviations one to a line. This list is used when reading Markdown input: strings found in this list will be followed by a nonbreaking space, and the period will not produce sentence-ending space in formats like LaTeX. The strings may not contain spaces. |
dpi |
Specify the default dpi (dots per inch) value for conversion from pixels to inch/ centimeters and vice versa. (Technically, the correct term would be ppi: pixels per inch.) The default is |
html-table-processing |
If |
Text Output
strip-comments |
Strip out HTML comments in the Markdown source, rather than passing them on to Markdown, Textile or HTML output as raw HTML. This does not apply to HTML comments inside raw HTML blocks when the |
ascii |
Use only ASCII characters in output. Currently supported for XML and HTML formats (which use entities instead of UTF-8 when this option is selected), CommonMark, gfm, and Markdown (which use entities), roff ms (which use hexadecimal escapes), and to a limited degree LaTeX (which uses standard commands for accented characters when possible). roff man output uses ASCII by default. |