Commit 4d66ab3
authored
fix(optimization_tutorial): bullet list indentation in colab (#3940)
Fixes #3939
## Description
Bullet lists under "Hyperparameters", "Optimization Loop", and "Inside
the training loop" sections in `optimization_tutorial.py` were rendering
as inline text or blockquotes in the generated Jupyter notebook.
**Root cause:** Two issues in the sphinx-gallery to pypandoc pipeline:
1. The list items used `# -` (3 spaces after `#`). After sphinx-gallery
strips `# `, the dash was not at column 0, causing pandoc to treat the
list as a block quote.
2. There was no blank line between the preceding paragraph and the list,
so pandoc joined everything into one run-on sentence.
**Fix:** Changed the indentation to `# -` (dash at column 0 after
stripping) and added a blank `#` line before each list — matching the
convention used by dozens of other tutorials in this repo.
## Checklist
<!--- Make sure to add `x` to all items in the following checklist: -->
- [x] The issue that is being fixed is referred in the description (see
above "Fixes #ISSUE_NUMBER")
- [x] Only one issue is addressed in this pull request
- [x] Labels from the issue that this PR is fixing are added to this
pull request
- [x] No unnecessary issues are included into this pull request.
## Testing
1. Built the tutorial locally
```
GALLERY_PATTERN="optimization_tutorial.py" sphinx-build -D plot_gallery=0 -b html . _build/html
```
2. Uploaded `_build/html/_downloads/.../optimization_tutorial.ipynb` to
Colab.
Colab link -
https://colab.research.google.com/drive/1pTyCPUD8WJmRs1x54V2GpF4c2ke1DlQf?usp=sharing
### SS
<img width="1851" height="815" alt="image"
src="https://github.com/user-attachments/assets/eccdab10-d5fd-47e3-bde8-0d82b68480d6"
/>1 parent d708b54 commit 4d66ab3
1 file changed
Lines changed: 11 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | | - | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
137 | | - | |
138 | | - | |
139 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
| |||
0 commit comments