-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: port manual source material to MyST markdown #370
Conversation
docs/manual/manual_backend.md
Outdated
``` | ||
|
||
[NoClassicalControlPredicate, NoFastFeedforwardPredicate, NoMidMeasurePredicate, NoSymbolsPredicate, GateSetPredicate:{ U1 noop U2 CX Barrier Measure U3 }, DirectednessPredicate:{ Nodes: 5, Edges: 8 }] | ||
[NoClassicalControlPredicate, NoFastFeedforwardPredicate, GateSetPredicate:{ CU1 CZ CX Unitary2qBox Sdg U1 Unitary1qBox SWAP S U2 CCX Y U3 Z X T noop Tdg Reset H }] | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the extra line and tabs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting these formatting issues.
I fixed them in ad08277
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done! Some of the code cells are inconsistently formatted with whitespace, so the only changes needed are going through to fix that.
I'm presuming from the existing content using MyST that it fully works with CI, i.e. if a cell fails to run CI would report an error?
Appreciate the review! I'll fix the formatting issues shortly.
Yes indeed. The sphinx build should error if the code cell raises and error and cause a C.I. failure. The C.I. has some issues at the moment which should be fixed by #372 . After that is merged I can deliberately make a cell fail as a test to see if its picked up in C.I. |
Added some code which errored out in 0bb46c3 and this caused C.I. to fail with a |
docs/manual/manual_circuit.md
Outdated
```{code-cell} ipython3 | ||
|
||
from pytket.utils.stats import gate_counts | ||
|
||
gate_counts(circ) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this one in the last review, sorry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Will, fixed in 4b7448b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a search to try and rule out other indentation issues, didn't find any but maybe the search pattern could be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to go! Thanks for sorting this out
Description
Porting the manual source to MyST to allow easier use of the MyST library. We now use the MyST-nb library for building both the manual and examples pages. This ensures visual consistency of the example snippets.
Read the docs on markdown only notebooks -> https://myst-nb.readthedocs.io/en/latest/authoring/text-notebooks.html
Instructions for building the html locally -> https://github.com/CQCL/pytket-docs/tree/main/docs#building-the-docs (let me know if these are unclear)
I'd also recommend using the MyST VSCode extension in review -> https://marketplace.visualstudio.com/items?itemName=ExecutableBookProject.myst-highlight
Preview
Most of the conversion can be done in an automated way using rst-to-myst
rst2myst convert docs/manual/*.rst
This works for just about everything apart from
.. jupyter-execute::
directives which I rsubstitue with equivalent `sytax with VSCode find and replace.
Example replacement for jupyter-execute directives
Example replacement for jupyter-input/output directives
Input (truncated)
Output
Example of a cell which raises an error
Related issues
closes #366