Skip to content

Commit 75582c3

Browse files
jupyter: table improvements, docs (#1370)
1 parent 49f21bd commit 75582c3

7 files changed

Lines changed: 216 additions & 137 deletions

File tree

znai-docs/znai/layout/jupyter-notebook-two-sides.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ If page `type` is set to `two-sides` you will get automatic split between code a
99

1010
Note: Content below is included using `include-jupyter`
1111

12-
:include-jupyter: snippets/jupyter/simple-notebook.ipynb
12+
:include-jupyter: snippets/jupyter/notebook.ipynb
1313

1414
# Story First
1515

@@ -18,4 +18,4 @@ side and a reader can focus on the story itself.
1818

1919
:include-jupyter: notebook.ipynb {storyFirst: true}
2020

21-
:include-jupyter: src/test/resources/notebook-with-markdown-story.ipynb {storyFirst: true}
21+
:include-jupyter: ../snippets/jupyter/notebook.ipynb {storyFirst: true}

znai-docs/znai/snippets/jupyter-notebook.md

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,47 @@
1-
# Code and Output
1+
# Include Notebook Section
22

3-
Use `include-jupyter` to include [Jupyter](https://jupyter.org/) notebook inside your documentation.
3+
Use `include-jupyter` to include a jupyter notebook or one of its parts.
4+
Here is an example of a notebook:
45

5-
:include-jupyter: jupyter/simple-notebook.ipynb
6-
7-
:include-jupyter: jupyter/simple-notebook.ipynb
6+
:include-image: jupyter/notebook.png {fit: true, border: true}
87

9-
Note: Remember that you can define lookup paths for files like notebooks inside [lookup-paths](flow/lookup-paths) file, so you don't have
10-
to copy and paste notebooks to your documentation directory.
8+
To include one of its sections use,
119

12-
# Seamless Markdown Integration
10+
```
11+
:include-jupyter: jupyter/notebook.ipynb {
12+
includeSection: ["Loading Data From CSV"]
13+
}
14+
```
1315

14-
Markdown from your notebook will be seamlessly integrated into your current page. First level `# headers` will
15-
become part of Table Of Contents and part of a search unit.
16+
Markdown cells will be seamlessly integrated with the current page.
17+
Top level headers become this page top level header.
1618

17-
:include-image: jupyter/notebook.png {fit: true}
19+
Note: without `includeSection`, the entire notebook content will be added.
1820

19-
:include-jupyter: notebook-with-markdown-story.ipynb
21+
:include-jupyter: jupyter/notebook.ipynb {
22+
includeSection: ["Loading Data From CSV"]
23+
}
2024

21-
Note: below text is auto generated, including the **Panda** section
22-
:include-jupyter: src/test/resources/notebook-with-markdown-story.ipynb
25+
Note: Remember that you can define lookup paths for files like notebooks inside [lookup-paths](flow/lookup-paths) file, so you don't have
26+
to copy and paste notebooks to your documentation directory.
2327

24-
# Include Only Specified Sections
28+
# Exclude Section Title
2529

26-
Use `includeSection` to select which sections of the notebook to include.
30+
Use `excludeSectionTitle` to exclude section title. It can be useful when you
31+
want to use section titles as example separators to be included into your guides.
2732

2833
```
29-
:include-jupyter: notebook.ipynb {
30-
includeSection: ["Section One"; "Section Three"],
34+
:include-jupyter: jupyter/notebook.ipynb {
35+
includeSection: ["Average Prcing By Genre"],
3136
excludeSectionTitle: true
3237
}
3338
```
3439

40+
:include-jupyter: jupyter/notebook.ipynb {
41+
includeSection: ["Average Pricing By Genre"],
42+
excludeSectionTitle: true
43+
}
44+
3545
# Two Sides
3646

3747
You will learn about the [Two Sides Layout](layout/two-sides-pages) in the Layout section.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
genre,title,price
2+
RPG,Witcher 3,20.0
3+
FPS,Doom,39.0
4+
Strategy, War Craft,10.0
5+
Cards, Balatro,5.0

znai-docs/znai/snippets/jupyter/notebook.ipynb

Lines changed: 177 additions & 0 deletions
Large diffs are not rendered by default.
33.6 KB
Loading

znai-docs/znai/snippets/jupyter/simple-notebook.ipynb

Lines changed: 0 additions & 117 deletions
This file was deleted.

znai-reactjs/src/doc-elements/jupyter/JupyterHtmlCell.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,7 @@
6666
.jupyter-html tbody tr:last-child td {
6767
border-bottom: none;
6868
}
69+
70+
.jupyter-html .dataframe tbody td {
71+
text-align: right;
72+
}

0 commit comments

Comments
 (0)