Add Link
https://docs.pytorch.org/tutorials/beginner/basics/optimization_tutorial.html
Describe the bug
Description
Bullet lists in the optimization_tutorial.py sphinx-gallery source produce broken markdown in the generated Jupyter notebook (.ipynb), causing incorrect rendering on Google Colab.
Root Cause
Two compounding issues in the sphinx-gallery to pypandoc pipeline:
1. Wrong indentation after #
The source used indentation that produced a leading space before the bullet marker after sphinx-gallery stripped # :
# - **Number of Epochs** - ... # 2 spaces after #
After stripping: - **Number of Epochs** - ... (space before dash)
Pandoc treats this as a block quote (> - ...) instead of a top-level bullet list, because the - is not at column 0.
2. Missing blank line before the list
Even with correct column-0 dashes, pandoc joins everything into one run-on paragraph if there is no blank line between the preceding sentence and the list:
We define the following hyperparameters for training:
- **Number of Epochs** - ...
this produces inline text, not a list.
What the generated notebook showed (broken)
We define the following hyperparameters for training: - **Number of
Epochs** - the number of times to iterate over the dataset - **Batch
Size** - ...
What it should show
We define the following hyperparameters for training:
- **Number of Epochs** - the number of times to iterate over the dataset
- **Batch Size** - the number of data samples ...
- **Learning Rate** - ...
Describe your environment
Google Colab
Add Link
https://docs.pytorch.org/tutorials/beginner/basics/optimization_tutorial.html
Describe the bug
Description
Bullet lists in the
optimization_tutorial.pysphinx-gallery source produce broken markdown in the generated Jupyter notebook (.ipynb), causing incorrect rendering on Google Colab.Root Cause
Two compounding issues in the sphinx-gallery to pypandoc pipeline:
1. Wrong indentation after
#The source used indentation that produced a leading space before the bullet marker after sphinx-gallery stripped
#:# - **Number of Epochs** - ... # 2 spaces after #After stripping:
- **Number of Epochs** - ...(space before dash)Pandoc treats this as a block quote (
> - ...) instead of a top-level bullet list, because the-is not at column 0.2. Missing blank line before the list
Even with correct column-0 dashes, pandoc joins everything into one run-on paragraph if there is no blank line between the preceding sentence and the list:
this produces inline text, not a list.
What the generated notebook showed (broken)
What it should show
Describe your environment
Google Colab