Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MUYSC
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jorge Alfredo Jaimes Teherán
MUYSC
Commits
8a791f82
Unverified
Commit
8a791f82
authored
4 years ago
by
mmcky
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
DOCS: Updates to code-cell docs (#1075)
Co-authored-by:
Chris Holdgraf
<
choldgraf@berkeley.edu
>
parent
8cdbe1e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/content/code-outputs.md
+29
-0
29 additions, 0 deletions
docs/content/code-outputs.md
docs/content/layout.md
+17
-32
17 additions, 32 deletions
docs/content/layout.md
docs/reference/cheatsheet.md
+1
-0
1 addition, 0 deletions
docs/reference/cheatsheet.md
with
47 additions
and
32 deletions
docs/content/code-outputs.md
+
29
−
0
View file @
8a791f82
...
...
@@ -16,10 +16,39 @@ kernelspec:
The formatting of code outputs is highly configurable.
Below we give examples of how to format particular outputs and even insert outputs into other locations of the document.
The
[
MyST cheat sheet
](
myst_cheatsheet
)
provides a
[
list of `code-cell` tags available
](
myst_cheatsheet:code-cell:tags
)
:::{seealso}
The
[
MyST-NB documentation
](
myst-nb:use/format/cutomise
)
, for how to fully customize the output renderer.
:::
(content:code-outputs:scrolling)=
## Scrolling cell outputs
The traditional Jupyter Notebook interface allows you to toggle
**output scrolling**
for your cells. This allows you to visualize part of a long output without it taking up
the entire page.
You can trigger this behavior in Jupyter Book by adding the following
tag to a cell's metadata:
```
json
{
"tags"
:
[
"output_scroll"
,
]
}
```
For example, the following cell has a long output, but will be scrollable in the book:
```
{code-cell} ipython3
:tags: [output_scroll]
for ii in range(40):
print(f"this is output line {ii}")
```
(content:code-outputs:images)=
## Images
...
...
This diff is collapsed.
Click to expand it.
docs/content/layout.md
+
17
−
32
View file @
8a791f82
...
...
@@ -118,8 +118,10 @@ which we'll cover below.
### Margins with code cells
You can make a code cell move to the right margin by adding
`margin`
to your
cell's tags.
Here's what the cell metadata for a margin cell looks like:
cell's tags.
````
{tabbed} Jupyter Notebook
Here's what the cell metadata for a margin cell looks like:
```json
{
"tags": [
...
...
@@ -127,6 +129,19 @@ cell's tags. Here's what the cell metadata for a margin cell looks like:
]
}
```
:::{seealso}
[](jupyter-cell-tags)
:::
````
`````
{tabbed} MyST Text File
For a MyST text file these tags can be added to the `code-cell`
````md
```{code-cell} <language>
:tags: [margin]
```
````
`````
For example, we'll re-display the figure above, and add a
`margin`
tag to the code cell.
...
...
@@ -138,37 +153,7 @@ make_fig(figsize=(10, 5))
This can be combined with other tags like
`remove-input`
to
**only display the figure**
.
:::{seealso}
[](
jupyter-cell-tags
)
:::
+++
## Scrolling cell outputs
The traditional Jupyter Notebook interface allows you to toggle
**output scrolling**
for your cells. This allows you to visualize part of a long output without it taking up
the entire page.
You can trigger this behavior in Jupyter Book by adding the following
tag to a cell's metadata:
```
json
{
"tags"
:
[
"output_scroll"
,
]
}
```
For example, the following cell has a long output, but will be scrollable in the book:
```
{code-cell} ipython3
:tags: [output_scroll]
for ii in range(40):
print(f"this is output line {ii}")
```
The
[
MyST cheat sheet
](
myst_cheatsheet
)
provides a
[
list of `code-cell` tags available
](
myst_cheatsheet:code-cell:tags
)
## Full-width content
...
...
This diff is collapsed.
Click to expand it.
docs/reference/cheatsheet.md
+
1
−
0
View file @
8a791f82
...
...
@@ -849,6 +849,7 @@ print(note)
See {doc}
`../file-types/myst-notebooks`
for more information.
(myst_cheatsheet:code-cell:tags)=
#### Tags
The following
`tags`
can be applied to code cells by introducing them as options:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment