Commit 1b6f608
authored
Fix notebook tables (#1596)
This PR adds a new [Pandoc
filter](https://github.com/jgm/pandocfilters/tree/master) to process the
rst tables in the demos and convert them into Markdown for the
notebooks. Conversion of the demos with tables has been tested locally.
The demos with tables are:
- ahs_aquila
- tutorial_measurement_optimize
- tutorial_neutral_atoms
- tutorial_photonics
- tutorial_quantum_transfer_learning
- tutorial_unitary_synthesis_kak
<img width="595" height="312" alt="Screenshot 2025-11-10 at 3 07 46 PM"
src="https://github.com/user-attachments/assets/18279771-6fd0-4541-b75f-67395e280b36"
/>
<img width="557" height="249" alt="Screenshot 2025-11-10 at 3 07 57 PM"
src="https://github.com/user-attachments/assets/61a02139-7d10-4721-9e73-ab0ee15b6dc6"
/>
Notes:
- Handles figures, links, and math in tables and headers.
- Handles (optional) table caption.
- Handles Sphinx Gallery code execution outputs in a cleaner way. These
are now added as a code block and the auto-generated Sphinx text
(`sphx-glr-script-out`) is removed.
- Two demos had HTML formatting set for the tables (which breaks the
filter). I [tested removing
this](https://pennylane.ai/qml/demonstrations?pr=1596) and it has no
effect, since we do all the rendering on the website anyway.
- The filter responsible for replacing images with URLs to the
cloud-hosted version wasn't working. It is now fixed.
- Some refactoring done to move a few things into a helper file for the
filters.1 parent 7132772 commit 1b6f608
File tree
15 files changed
+235
-86
lines changed- demonstrations_v2
- ahs_aquila
- tutorial_measurement_optimize
- tutorial_neutral_atoms
- tutorial_photonics
- tutorial_quantum_transfer_learning
- tutorial_unitary_synthesis_kak
- documentation/reference_demo
- lib
15 files changed
+235
-86
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | 338 | | |
354 | 339 | | |
355 | 340 | | |
| |||
364 | 349 | | |
365 | 350 | | |
366 | 351 | | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | 352 | | |
372 | 353 | | |
373 | 354 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | 679 | | |
695 | 680 | | |
696 | 681 | | |
| |||
705 | 690 | | |
706 | 691 | | |
707 | 692 | | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | 693 | | |
713 | 694 | | |
714 | 695 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
Lines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
0 commit comments