From 378419abf983848400bc04cd2af871e119625847 Mon Sep 17 00:00:00 2001 From: Leo Torres Date: Sun, 12 May 2024 22:35:56 +0200 Subject: [PATCH 1/6] feat: corollary and example nodes. docs: nodeid. also CSS tweaks --- docs/source/reference/rsm.nodes.Abstract.rst | 3 +- docs/source/reference/rsm.nodes.Algorithm.rst | 3 +- docs/source/reference/rsm.nodes.Appendix.rst | 3 +- docs/source/reference/rsm.nodes.Author.rst | 3 +- .../reference/rsm.nodes.BaseParagraph.rst | 3 +- .../reference/rsm.nodes.BaseReference.rst | 3 +- docs/source/reference/rsm.nodes.Bibitem.rst | 3 +- .../reference/rsm.nodes.Bibliography.rst | 3 +- docs/source/reference/rsm.nodes.Caption.rst | 3 +- docs/source/reference/rsm.nodes.Cite.rst | 3 +- .../source/reference/rsm.nodes.ClaimBlock.rst | 3 +- docs/source/reference/rsm.nodes.Code.rst | 3 +- docs/source/reference/rsm.nodes.CodeBlock.rst | 3 +- docs/source/reference/rsm.nodes.Construct.rst | 3 +- docs/source/reference/rsm.nodes.Contents.rst | 3 +- .../source/reference/rsm.nodes.Definition.rst | 3 +- docs/source/reference/rsm.nodes.Draft.rst | 3 +- docs/source/reference/rsm.nodes.Enumerate.rst | 3 +- docs/source/reference/rsm.nodes.Error.rst | 3 +- docs/source/reference/rsm.nodes.Figure.rst | 3 +- docs/source/reference/rsm.nodes.Heading.rst | 3 +- docs/source/reference/rsm.nodes.Item.rst | 3 +- docs/source/reference/rsm.nodes.Itemize.rst | 3 +- docs/source/reference/rsm.nodes.Keyword.rst | 3 +- docs/source/reference/rsm.nodes.Lemma.rst | 3 +- .../source/reference/rsm.nodes.Manuscript.rst | 3 +- docs/source/reference/rsm.nodes.Math.rst | 3 +- docs/source/reference/rsm.nodes.MathBlock.rst | 3 +- docs/source/reference/rsm.nodes.Node.rst | 4 ++- .../reference/rsm.nodes.NodeWithChildren.rst | 3 +- docs/source/reference/rsm.nodes.Note.rst | 3 +- docs/source/reference/rsm.nodes.Paragraph.rst | 3 +- .../reference/rsm.nodes.PendingCite.rst | 3 +- .../reference/rsm.nodes.PendingPrev.rst | 3 +- .../reference/rsm.nodes.PendingReference.rst | 3 +- docs/source/reference/rsm.nodes.Proof.rst | 3 +- .../reference/rsm.nodes.Proposition.rst | 3 +- docs/source/reference/rsm.nodes.Reference.rst | 3 +- docs/source/reference/rsm.nodes.Remark.rst | 3 +- docs/source/reference/rsm.nodes.Section.rst | 3 +- docs/source/reference/rsm.nodes.Sketch.rst | 3 +- .../source/reference/rsm.nodes.SourceCode.rst | 1 + docs/source/reference/rsm.nodes.Span.rst | 3 +- docs/source/reference/rsm.nodes.Statement.rst | 3 +- docs/source/reference/rsm.nodes.Step.rst | 3 +- docs/source/reference/rsm.nodes.Subproof.rst | 3 +- .../source/reference/rsm.nodes.Subsection.rst | 3 +- .../reference/rsm.nodes.Subsubsection.rst | 3 +- docs/source/reference/rsm.nodes.Table.rst | 3 +- docs/source/reference/rsm.nodes.TableBody.rst | 3 +- .../source/reference/rsm.nodes.TableDatum.rst | 3 +- docs/source/reference/rsm.nodes.TableHead.rst | 3 +- docs/source/reference/rsm.nodes.TableRow.rst | 3 +- docs/source/reference/rsm.nodes.Text.rst | 3 +- docs/source/reference/rsm.nodes.Theorem.rst | 3 +- docs/source/reference/rsm.nodes.URL.rst | 3 +- .../reference/rsm.nodes.UnknownBibitem.rst | 3 +- docs/source/reference/rsm.nodes.rst | 4 +++ .../reference/rsm.transformer.Transformer.rst | 1 + .../rsm.translator.HandrailsTranslator.rst | 1 + docs/source/tutorials/special.rst | 23 +++++++++++++++ rsm/nodes.py | 8 ++++++ rsm/static/rsm.css | 2 +- rsm/static/rsm.scss | 4 +-- rsm/tags.py | 4 +++ rsm/translator.py | 28 ++++++++++--------- rsm/tsparser.py | 2 ++ tests/test_paragraph.py | 1 + 68 files changed, 176 insertions(+), 72 deletions(-) diff --git a/docs/source/reference/rsm.nodes.Abstract.rst b/docs/source/reference/rsm.nodes.Abstract.rst index 5a55296..00884a4 100644 --- a/docs/source/reference/rsm.nodes.Abstract.rst +++ b/docs/source/reference/rsm.nodes.Abstract.rst @@ -1,4 +1,4 @@ -Abstract +Abstract ======== Qualified name: ``rsm.nodes.Abstract`` @@ -24,6 +24,7 @@ Qualified name: ``rsm.nodes.Abstract`` ~Abstract.newmetakeys ~Abstract.keywords ~Abstract.msc + ~Abstract.nodeid ~Abstract.label ~Abstract.types ~Abstract.number diff --git a/docs/source/reference/rsm.nodes.Algorithm.rst b/docs/source/reference/rsm.nodes.Algorithm.rst index 4663252..3dbfa55 100644 --- a/docs/source/reference/rsm.nodes.Algorithm.rst +++ b/docs/source/reference/rsm.nodes.Algorithm.rst @@ -1,4 +1,4 @@ -Algorithm +Algorithm ========= Qualified name: ``rsm.nodes.Algorithm`` @@ -22,6 +22,7 @@ Qualified name: ``rsm.nodes.Algorithm`` .. autosummary:: ~Algorithm.autonumber + ~Algorithm.nodeid ~Algorithm.label ~Algorithm.types ~Algorithm.number diff --git a/docs/source/reference/rsm.nodes.Appendix.rst b/docs/source/reference/rsm.nodes.Appendix.rst index 8ee70ff..6a717d3 100644 --- a/docs/source/reference/rsm.nodes.Appendix.rst +++ b/docs/source/reference/rsm.nodes.Appendix.rst @@ -1,4 +1,4 @@ -Appendix +Appendix ======== Qualified name: ``rsm.nodes.Appendix`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Appendix`` .. autosummary:: + ~Appendix.nodeid ~Appendix.label ~Appendix.types ~Appendix.number diff --git a/docs/source/reference/rsm.nodes.Author.rst b/docs/source/reference/rsm.nodes.Author.rst index 5a1c396..87e6837 100644 --- a/docs/source/reference/rsm.nodes.Author.rst +++ b/docs/source/reference/rsm.nodes.Author.rst @@ -1,4 +1,4 @@ -Author +Author ====== Qualified name: ``rsm.nodes.Author`` @@ -25,6 +25,7 @@ Qualified name: ``rsm.nodes.Author`` ~Author.name ~Author.affiliation ~Author.email + ~Author.nodeid ~Author.label ~Author.types ~Author.number diff --git a/docs/source/reference/rsm.nodes.BaseParagraph.rst b/docs/source/reference/rsm.nodes.BaseParagraph.rst index 3a57949..daa1c13 100644 --- a/docs/source/reference/rsm.nodes.BaseParagraph.rst +++ b/docs/source/reference/rsm.nodes.BaseParagraph.rst @@ -1,4 +1,4 @@ -BaseParagraph +BaseParagraph ============= Qualified name: ``rsm.nodes.BaseParagraph`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.BaseParagraph`` .. autosummary:: + ~BaseParagraph.nodeid ~BaseParagraph.label ~BaseParagraph.types ~BaseParagraph.number diff --git a/docs/source/reference/rsm.nodes.BaseReference.rst b/docs/source/reference/rsm.nodes.BaseReference.rst index 06988a4..e46de40 100644 --- a/docs/source/reference/rsm.nodes.BaseReference.rst +++ b/docs/source/reference/rsm.nodes.BaseReference.rst @@ -1,4 +1,4 @@ -BaseReference +BaseReference ============= Qualified name: ``rsm.nodes.BaseReference`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.BaseReference`` .. autosummary:: + ~BaseReference.nodeid ~BaseReference.label ~BaseReference.types ~BaseReference.number diff --git a/docs/source/reference/rsm.nodes.Bibitem.rst b/docs/source/reference/rsm.nodes.Bibitem.rst index 75e73bf..bbff82f 100644 --- a/docs/source/reference/rsm.nodes.Bibitem.rst +++ b/docs/source/reference/rsm.nodes.Bibitem.rst @@ -1,4 +1,4 @@ -Bibitem +Bibitem ======= Qualified name: ``rsm.nodes.Bibitem`` @@ -24,6 +24,7 @@ Qualified name: ``rsm.nodes.Bibitem`` ~Bibitem.autonumber ~Bibitem.classreftext ~Bibitem.newmetakeys + ~Bibitem.nodeid ~Bibitem.label ~Bibitem.types ~Bibitem.number diff --git a/docs/source/reference/rsm.nodes.Bibliography.rst b/docs/source/reference/rsm.nodes.Bibliography.rst index f8fd3f4..ffda199 100644 --- a/docs/source/reference/rsm.nodes.Bibliography.rst +++ b/docs/source/reference/rsm.nodes.Bibliography.rst @@ -1,4 +1,4 @@ -Bibliography +Bibliography ============ Qualified name: ``rsm.nodes.Bibliography`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Bibliography`` .. autosummary:: + ~Bibliography.nodeid ~Bibliography.label ~Bibliography.types ~Bibliography.number diff --git a/docs/source/reference/rsm.nodes.Caption.rst b/docs/source/reference/rsm.nodes.Caption.rst index 4962b55..3d82150 100644 --- a/docs/source/reference/rsm.nodes.Caption.rst +++ b/docs/source/reference/rsm.nodes.Caption.rst @@ -1,4 +1,4 @@ -Caption +Caption ======= Qualified name: ``rsm.nodes.Caption`` @@ -22,6 +22,7 @@ Qualified name: ``rsm.nodes.Caption`` .. autosummary:: ~Caption.possible_parents + ~Caption.nodeid ~Caption.label ~Caption.types ~Caption.number diff --git a/docs/source/reference/rsm.nodes.Cite.rst b/docs/source/reference/rsm.nodes.Cite.rst index 0665aa3..2e8af64 100644 --- a/docs/source/reference/rsm.nodes.Cite.rst +++ b/docs/source/reference/rsm.nodes.Cite.rst @@ -1,4 +1,4 @@ -Cite +Cite ==== Qualified name: ``rsm.nodes.Cite`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Cite`` .. autosummary:: + ~Cite.nodeid ~Cite.label ~Cite.types ~Cite.number diff --git a/docs/source/reference/rsm.nodes.ClaimBlock.rst b/docs/source/reference/rsm.nodes.ClaimBlock.rst index 1686c89..93a2932 100644 --- a/docs/source/reference/rsm.nodes.ClaimBlock.rst +++ b/docs/source/reference/rsm.nodes.ClaimBlock.rst @@ -1,4 +1,4 @@ -ClaimBlock +ClaimBlock ========== Qualified name: ``rsm.nodes.ClaimBlock`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.ClaimBlock`` .. autosummary:: + ~ClaimBlock.nodeid ~ClaimBlock.label ~ClaimBlock.types ~ClaimBlock.number diff --git a/docs/source/reference/rsm.nodes.Code.rst b/docs/source/reference/rsm.nodes.Code.rst index e334332..e712786 100644 --- a/docs/source/reference/rsm.nodes.Code.rst +++ b/docs/source/reference/rsm.nodes.Code.rst @@ -1,4 +1,4 @@ -Code +Code ==== Qualified name: ``rsm.nodes.Code`` @@ -22,6 +22,7 @@ Qualified name: ``rsm.nodes.Code`` .. autosummary:: ~Code.newmetakeys + ~Code.nodeid ~Code.label ~Code.types ~Code.number diff --git a/docs/source/reference/rsm.nodes.CodeBlock.rst b/docs/source/reference/rsm.nodes.CodeBlock.rst index 5cee812..d0f765c 100644 --- a/docs/source/reference/rsm.nodes.CodeBlock.rst +++ b/docs/source/reference/rsm.nodes.CodeBlock.rst @@ -1,4 +1,4 @@ -CodeBlock +CodeBlock ========= Qualified name: ``rsm.nodes.CodeBlock`` @@ -23,6 +23,7 @@ Qualified name: ``rsm.nodes.CodeBlock`` ~CodeBlock.classreftext ~CodeBlock.newmetakeys + ~CodeBlock.nodeid ~CodeBlock.label ~CodeBlock.types ~CodeBlock.number diff --git a/docs/source/reference/rsm.nodes.Construct.rst b/docs/source/reference/rsm.nodes.Construct.rst index 85380d9..8b9a176 100644 --- a/docs/source/reference/rsm.nodes.Construct.rst +++ b/docs/source/reference/rsm.nodes.Construct.rst @@ -1,4 +1,4 @@ -Construct +Construct ========= Qualified name: ``rsm.nodes.Construct`` @@ -23,6 +23,7 @@ Qualified name: ``rsm.nodes.Construct`` ~Construct.keyword ~Construct.kind_to_keyword + ~Construct.nodeid ~Construct.label ~Construct.types ~Construct.number diff --git a/docs/source/reference/rsm.nodes.Contents.rst b/docs/source/reference/rsm.nodes.Contents.rst index b2d6be8..e5f144d 100644 --- a/docs/source/reference/rsm.nodes.Contents.rst +++ b/docs/source/reference/rsm.nodes.Contents.rst @@ -1,4 +1,4 @@ -Contents +Contents ======== Qualified name: ``rsm.nodes.Contents`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Contents`` .. autosummary:: + ~Contents.nodeid ~Contents.label ~Contents.types ~Contents.number diff --git a/docs/source/reference/rsm.nodes.Definition.rst b/docs/source/reference/rsm.nodes.Definition.rst index be693ba..b6f48ef 100644 --- a/docs/source/reference/rsm.nodes.Definition.rst +++ b/docs/source/reference/rsm.nodes.Definition.rst @@ -1,4 +1,4 @@ -Definition +Definition ========== Qualified name: ``rsm.nodes.Definition`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Definition`` .. autosummary:: + ~Definition.nodeid ~Definition.label ~Definition.types ~Definition.number diff --git a/docs/source/reference/rsm.nodes.Draft.rst b/docs/source/reference/rsm.nodes.Draft.rst index 9190d74..f3841b5 100644 --- a/docs/source/reference/rsm.nodes.Draft.rst +++ b/docs/source/reference/rsm.nodes.Draft.rst @@ -1,4 +1,4 @@ -Draft +Draft ===== Qualified name: ``rsm.nodes.Draft`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Draft`` .. autosummary:: + ~Draft.nodeid ~Draft.label ~Draft.types ~Draft.number diff --git a/docs/source/reference/rsm.nodes.Enumerate.rst b/docs/source/reference/rsm.nodes.Enumerate.rst index 3782b59..9c2116a 100644 --- a/docs/source/reference/rsm.nodes.Enumerate.rst +++ b/docs/source/reference/rsm.nodes.Enumerate.rst @@ -1,4 +1,4 @@ -Enumerate +Enumerate ========= Qualified name: ``rsm.nodes.Enumerate`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Enumerate`` .. autosummary:: + ~Enumerate.nodeid ~Enumerate.label ~Enumerate.types ~Enumerate.number diff --git a/docs/source/reference/rsm.nodes.Error.rst b/docs/source/reference/rsm.nodes.Error.rst index 7f46632..98ca209 100644 --- a/docs/source/reference/rsm.nodes.Error.rst +++ b/docs/source/reference/rsm.nodes.Error.rst @@ -1,4 +1,4 @@ -Error +Error ===== Qualified name: ``rsm.nodes.Error`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Error`` .. autosummary:: + ~Error.nodeid ~Error.label ~Error.types ~Error.number diff --git a/docs/source/reference/rsm.nodes.Figure.rst b/docs/source/reference/rsm.nodes.Figure.rst index 5c27cce..9a1e6e9 100644 --- a/docs/source/reference/rsm.nodes.Figure.rst +++ b/docs/source/reference/rsm.nodes.Figure.rst @@ -1,4 +1,4 @@ -Figure +Figure ====== Qualified name: ``rsm.nodes.Figure`` @@ -23,6 +23,7 @@ Qualified name: ``rsm.nodes.Figure`` ~Figure.autonumber ~Figure.newmetakeys + ~Figure.nodeid ~Figure.label ~Figure.types ~Figure.number diff --git a/docs/source/reference/rsm.nodes.Heading.rst b/docs/source/reference/rsm.nodes.Heading.rst index 8cbac38..14395bb 100644 --- a/docs/source/reference/rsm.nodes.Heading.rst +++ b/docs/source/reference/rsm.nodes.Heading.rst @@ -1,4 +1,4 @@ -Heading +Heading ======= Qualified name: ``rsm.nodes.Heading`` @@ -22,6 +22,7 @@ Qualified name: ``rsm.nodes.Heading`` .. autosummary:: ~Heading.newmetakeys + ~Heading.nodeid ~Heading.label ~Heading.types ~Heading.number diff --git a/docs/source/reference/rsm.nodes.Item.rst b/docs/source/reference/rsm.nodes.Item.rst index 36d2f6c..06383f2 100644 --- a/docs/source/reference/rsm.nodes.Item.rst +++ b/docs/source/reference/rsm.nodes.Item.rst @@ -1,4 +1,4 @@ -Item +Item ==== Qualified name: ``rsm.nodes.Item`` @@ -22,6 +22,7 @@ Qualified name: ``rsm.nodes.Item`` .. autosummary:: ~Item.possible_parents + ~Item.nodeid ~Item.label ~Item.types ~Item.number diff --git a/docs/source/reference/rsm.nodes.Itemize.rst b/docs/source/reference/rsm.nodes.Itemize.rst index d59162f..42e6104 100644 --- a/docs/source/reference/rsm.nodes.Itemize.rst +++ b/docs/source/reference/rsm.nodes.Itemize.rst @@ -1,4 +1,4 @@ -Itemize +Itemize ======= Qualified name: ``rsm.nodes.Itemize`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Itemize`` .. autosummary:: + ~Itemize.nodeid ~Itemize.label ~Itemize.types ~Itemize.number diff --git a/docs/source/reference/rsm.nodes.Keyword.rst b/docs/source/reference/rsm.nodes.Keyword.rst index 09f23fc..4ce8a18 100644 --- a/docs/source/reference/rsm.nodes.Keyword.rst +++ b/docs/source/reference/rsm.nodes.Keyword.rst @@ -1,4 +1,4 @@ -Keyword +Keyword ======= Qualified name: ``rsm.nodes.Keyword`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Keyword`` .. autosummary:: + ~Keyword.nodeid ~Keyword.label ~Keyword.types ~Keyword.number diff --git a/docs/source/reference/rsm.nodes.Lemma.rst b/docs/source/reference/rsm.nodes.Lemma.rst index 34614a7..87cae93 100644 --- a/docs/source/reference/rsm.nodes.Lemma.rst +++ b/docs/source/reference/rsm.nodes.Lemma.rst @@ -1,4 +1,4 @@ -Lemma +Lemma ===== Qualified name: ``rsm.nodes.Lemma`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Lemma`` .. autosummary:: + ~Lemma.nodeid ~Lemma.label ~Lemma.types ~Lemma.number diff --git a/docs/source/reference/rsm.nodes.Manuscript.rst b/docs/source/reference/rsm.nodes.Manuscript.rst index 8fd6fae..b37b0cf 100644 --- a/docs/source/reference/rsm.nodes.Manuscript.rst +++ b/docs/source/reference/rsm.nodes.Manuscript.rst @@ -1,4 +1,4 @@ -Manuscript +Manuscript ========== Qualified name: ``rsm.nodes.Manuscript`` @@ -24,6 +24,7 @@ Qualified name: ``rsm.nodes.Manuscript`` ~Manuscript.full_number ~Manuscript.newmetakeys ~Manuscript.nonum + ~Manuscript.nodeid ~Manuscript.label ~Manuscript.types ~Manuscript.number diff --git a/docs/source/reference/rsm.nodes.Math.rst b/docs/source/reference/rsm.nodes.Math.rst index 8e81abb..454884c 100644 --- a/docs/source/reference/rsm.nodes.Math.rst +++ b/docs/source/reference/rsm.nodes.Math.rst @@ -1,4 +1,4 @@ -Math +Math ==== Qualified name: ``rsm.nodes.Math`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Math`` .. autosummary:: + ~Math.nodeid ~Math.label ~Math.types ~Math.number diff --git a/docs/source/reference/rsm.nodes.MathBlock.rst b/docs/source/reference/rsm.nodes.MathBlock.rst index 826de07..5598c1a 100644 --- a/docs/source/reference/rsm.nodes.MathBlock.rst +++ b/docs/source/reference/rsm.nodes.MathBlock.rst @@ -1,4 +1,4 @@ -MathBlock +MathBlock ========= Qualified name: ``rsm.nodes.MathBlock`` @@ -24,6 +24,7 @@ Qualified name: ``rsm.nodes.MathBlock`` ~MathBlock.autonumber ~MathBlock.classreftext ~MathBlock.newmetakeys + ~MathBlock.nodeid ~MathBlock.label ~MathBlock.types ~MathBlock.number diff --git a/docs/source/reference/rsm.nodes.Node.rst b/docs/source/reference/rsm.nodes.Node.rst index 148b7ec..5856b11 100644 --- a/docs/source/reference/rsm.nodes.Node.rst +++ b/docs/source/reference/rsm.nodes.Node.rst @@ -1,4 +1,4 @@ -Node +Node ==== Qualified name: ``rsm.nodes.Node`` @@ -17,6 +17,7 @@ Qualified name: ``rsm.nodes.Node`` ~Node.first_ancestor_of_type ~Node.first_of_type + ~Node.get_child_by_id ~Node.ingest_dict_as_meta ~Node.last_of_type ~Node.metakeys @@ -42,6 +43,7 @@ Qualified name: ``rsm.nodes.Node`` ~Node.parent ~Node.possible_parents ~Node.reftext + ~Node.nodeid ~Node.label ~Node.types ~Node.number diff --git a/docs/source/reference/rsm.nodes.NodeWithChildren.rst b/docs/source/reference/rsm.nodes.NodeWithChildren.rst index 30a33aa..76b17ac 100644 --- a/docs/source/reference/rsm.nodes.NodeWithChildren.rst +++ b/docs/source/reference/rsm.nodes.NodeWithChildren.rst @@ -1,4 +1,4 @@ -NodeWithChildren +NodeWithChildren ================ Qualified name: ``rsm.nodes.NodeWithChildren`` @@ -26,6 +26,7 @@ Qualified name: ``rsm.nodes.NodeWithChildren`` .. autosummary:: ~NodeWithChildren.children + ~NodeWithChildren.nodeid ~NodeWithChildren.label ~NodeWithChildren.types ~NodeWithChildren.number diff --git a/docs/source/reference/rsm.nodes.Note.rst b/docs/source/reference/rsm.nodes.Note.rst index a474647..64733a9 100644 --- a/docs/source/reference/rsm.nodes.Note.rst +++ b/docs/source/reference/rsm.nodes.Note.rst @@ -1,4 +1,4 @@ -Note +Note ==== Qualified name: ``rsm.nodes.Note`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Note`` .. autosummary:: + ~Note.nodeid ~Note.label ~Note.types ~Note.number diff --git a/docs/source/reference/rsm.nodes.Paragraph.rst b/docs/source/reference/rsm.nodes.Paragraph.rst index a8edf8c..cb443f2 100644 --- a/docs/source/reference/rsm.nodes.Paragraph.rst +++ b/docs/source/reference/rsm.nodes.Paragraph.rst @@ -1,4 +1,4 @@ -Paragraph +Paragraph ========= Qualified name: ``rsm.nodes.Paragraph`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Paragraph`` .. autosummary:: + ~Paragraph.nodeid ~Paragraph.label ~Paragraph.types ~Paragraph.number diff --git a/docs/source/reference/rsm.nodes.PendingCite.rst b/docs/source/reference/rsm.nodes.PendingCite.rst index adba38f..3e9b5ba 100644 --- a/docs/source/reference/rsm.nodes.PendingCite.rst +++ b/docs/source/reference/rsm.nodes.PendingCite.rst @@ -1,4 +1,4 @@ -PendingCite +PendingCite =========== Qualified name: ``rsm.nodes.PendingCite`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.PendingCite`` .. autosummary:: + ~PendingCite.nodeid ~PendingCite.label ~PendingCite.types ~PendingCite.number diff --git a/docs/source/reference/rsm.nodes.PendingPrev.rst b/docs/source/reference/rsm.nodes.PendingPrev.rst index 38fe142..1e14227 100644 --- a/docs/source/reference/rsm.nodes.PendingPrev.rst +++ b/docs/source/reference/rsm.nodes.PendingPrev.rst @@ -1,4 +1,4 @@ -PendingPrev +PendingPrev =========== Qualified name: ``rsm.nodes.PendingPrev`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.PendingPrev`` .. autosummary:: + ~PendingPrev.nodeid ~PendingPrev.label ~PendingPrev.types ~PendingPrev.number diff --git a/docs/source/reference/rsm.nodes.PendingReference.rst b/docs/source/reference/rsm.nodes.PendingReference.rst index f136ea6..f69411e 100644 --- a/docs/source/reference/rsm.nodes.PendingReference.rst +++ b/docs/source/reference/rsm.nodes.PendingReference.rst @@ -1,4 +1,4 @@ -PendingReference +PendingReference ================ Qualified name: ``rsm.nodes.PendingReference`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.PendingReference`` .. autosummary:: + ~PendingReference.nodeid ~PendingReference.label ~PendingReference.types ~PendingReference.number diff --git a/docs/source/reference/rsm.nodes.Proof.rst b/docs/source/reference/rsm.nodes.Proof.rst index 86a883d..335d4bf 100644 --- a/docs/source/reference/rsm.nodes.Proof.rst +++ b/docs/source/reference/rsm.nodes.Proof.rst @@ -1,4 +1,4 @@ -Proof +Proof ===== Qualified name: ``rsm.nodes.Proof`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Proof`` .. autosummary:: + ~Proof.nodeid ~Proof.label ~Proof.types ~Proof.number diff --git a/docs/source/reference/rsm.nodes.Proposition.rst b/docs/source/reference/rsm.nodes.Proposition.rst index 555516a..9ac5904 100644 --- a/docs/source/reference/rsm.nodes.Proposition.rst +++ b/docs/source/reference/rsm.nodes.Proposition.rst @@ -1,4 +1,4 @@ -Proposition +Proposition =========== Qualified name: ``rsm.nodes.Proposition`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Proposition`` .. autosummary:: + ~Proposition.nodeid ~Proposition.label ~Proposition.types ~Proposition.number diff --git a/docs/source/reference/rsm.nodes.Reference.rst b/docs/source/reference/rsm.nodes.Reference.rst index 4ada764..00977d3 100644 --- a/docs/source/reference/rsm.nodes.Reference.rst +++ b/docs/source/reference/rsm.nodes.Reference.rst @@ -1,4 +1,4 @@ -Reference +Reference ========= Qualified name: ``rsm.nodes.Reference`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Reference`` .. autosummary:: + ~Reference.nodeid ~Reference.label ~Reference.types ~Reference.number diff --git a/docs/source/reference/rsm.nodes.Remark.rst b/docs/source/reference/rsm.nodes.Remark.rst index 23d1f40..c5647e4 100644 --- a/docs/source/reference/rsm.nodes.Remark.rst +++ b/docs/source/reference/rsm.nodes.Remark.rst @@ -1,4 +1,4 @@ -Remark +Remark ====== Qualified name: ``rsm.nodes.Remark`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Remark`` .. autosummary:: + ~Remark.nodeid ~Remark.label ~Remark.types ~Remark.number diff --git a/docs/source/reference/rsm.nodes.Section.rst b/docs/source/reference/rsm.nodes.Section.rst index 871425e..c672ca3 100644 --- a/docs/source/reference/rsm.nodes.Section.rst +++ b/docs/source/reference/rsm.nodes.Section.rst @@ -1,4 +1,4 @@ -Section +Section ======= Qualified name: ``rsm.nodes.Section`` @@ -23,6 +23,7 @@ Qualified name: ``rsm.nodes.Section`` ~Section.autonumber ~Section.level + ~Section.nodeid ~Section.label ~Section.types ~Section.number diff --git a/docs/source/reference/rsm.nodes.Sketch.rst b/docs/source/reference/rsm.nodes.Sketch.rst index f938c3c..dc23a1c 100644 --- a/docs/source/reference/rsm.nodes.Sketch.rst +++ b/docs/source/reference/rsm.nodes.Sketch.rst @@ -1,4 +1,4 @@ -Sketch +Sketch ====== Qualified name: ``rsm.nodes.Sketch`` @@ -22,6 +22,7 @@ Qualified name: ``rsm.nodes.Sketch`` .. autosummary:: ~Sketch.possible_parents + ~Sketch.nodeid ~Sketch.label ~Sketch.types ~Sketch.number diff --git a/docs/source/reference/rsm.nodes.SourceCode.rst b/docs/source/reference/rsm.nodes.SourceCode.rst index 41b5784..4a0a588 100644 --- a/docs/source/reference/rsm.nodes.SourceCode.rst +++ b/docs/source/reference/rsm.nodes.SourceCode.rst @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.SourceCode`` .. autosummary:: + ~SourceCode.nodeid ~SourceCode.label ~SourceCode.types ~SourceCode.number diff --git a/docs/source/reference/rsm.nodes.Span.rst b/docs/source/reference/rsm.nodes.Span.rst index 287cdd8..4c3456e 100644 --- a/docs/source/reference/rsm.nodes.Span.rst +++ b/docs/source/reference/rsm.nodes.Span.rst @@ -1,4 +1,4 @@ -Span +Span ==== Qualified name: ``rsm.nodes.Span`` @@ -23,6 +23,7 @@ Qualified name: ``rsm.nodes.Span`` ~Span.attr_to_tag ~Span.newmetakeys + ~Span.nodeid ~Span.label ~Span.types ~Span.number diff --git a/docs/source/reference/rsm.nodes.Statement.rst b/docs/source/reference/rsm.nodes.Statement.rst index 9c7b351..8b12e1b 100644 --- a/docs/source/reference/rsm.nodes.Statement.rst +++ b/docs/source/reference/rsm.nodes.Statement.rst @@ -1,4 +1,4 @@ -Statement +Statement ========= Qualified name: ``rsm.nodes.Statement`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Statement`` .. autosummary:: + ~Statement.nodeid ~Statement.label ~Statement.types ~Statement.number diff --git a/docs/source/reference/rsm.nodes.Step.rst b/docs/source/reference/rsm.nodes.Step.rst index 685fcaa..b58525a 100644 --- a/docs/source/reference/rsm.nodes.Step.rst +++ b/docs/source/reference/rsm.nodes.Step.rst @@ -1,4 +1,4 @@ -Step +Step ==== Qualified name: ``rsm.nodes.Step`` @@ -23,6 +23,7 @@ Qualified name: ``rsm.nodes.Step`` ~Step.autonumber ~Step.possible_parents + ~Step.nodeid ~Step.label ~Step.types ~Step.number diff --git a/docs/source/reference/rsm.nodes.Subproof.rst b/docs/source/reference/rsm.nodes.Subproof.rst index c4e74c9..9711d96 100644 --- a/docs/source/reference/rsm.nodes.Subproof.rst +++ b/docs/source/reference/rsm.nodes.Subproof.rst @@ -1,4 +1,4 @@ -Subproof +Subproof ======== Qualified name: ``rsm.nodes.Subproof`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Subproof`` .. autosummary:: + ~Subproof.nodeid ~Subproof.label ~Subproof.types ~Subproof.number diff --git a/docs/source/reference/rsm.nodes.Subsection.rst b/docs/source/reference/rsm.nodes.Subsection.rst index 02f1613..bb26b0f 100644 --- a/docs/source/reference/rsm.nodes.Subsection.rst +++ b/docs/source/reference/rsm.nodes.Subsection.rst @@ -1,4 +1,4 @@ -Subsection +Subsection ========== Qualified name: ``rsm.nodes.Subsection`` @@ -23,6 +23,7 @@ Qualified name: ``rsm.nodes.Subsection`` ~Subsection.classreftext ~Subsection.level + ~Subsection.nodeid ~Subsection.label ~Subsection.types ~Subsection.number diff --git a/docs/source/reference/rsm.nodes.Subsubsection.rst b/docs/source/reference/rsm.nodes.Subsubsection.rst index ccef15b..0ca8b7f 100644 --- a/docs/source/reference/rsm.nodes.Subsubsection.rst +++ b/docs/source/reference/rsm.nodes.Subsubsection.rst @@ -1,4 +1,4 @@ -Subsubsection +Subsubsection ============= Qualified name: ``rsm.nodes.Subsubsection`` @@ -23,6 +23,7 @@ Qualified name: ``rsm.nodes.Subsubsection`` ~Subsubsection.classreftext ~Subsubsection.level + ~Subsubsection.nodeid ~Subsubsection.label ~Subsubsection.types ~Subsubsection.number diff --git a/docs/source/reference/rsm.nodes.Table.rst b/docs/source/reference/rsm.nodes.Table.rst index a704b7d..8ea7446 100644 --- a/docs/source/reference/rsm.nodes.Table.rst +++ b/docs/source/reference/rsm.nodes.Table.rst @@ -1,4 +1,4 @@ -Table +Table ===== Qualified name: ``rsm.nodes.Table`` @@ -22,6 +22,7 @@ Qualified name: ``rsm.nodes.Table`` .. autosummary:: ~Table.autonumber + ~Table.nodeid ~Table.label ~Table.types ~Table.number diff --git a/docs/source/reference/rsm.nodes.TableBody.rst b/docs/source/reference/rsm.nodes.TableBody.rst index 4fbe75f..22a320b 100644 --- a/docs/source/reference/rsm.nodes.TableBody.rst +++ b/docs/source/reference/rsm.nodes.TableBody.rst @@ -1,4 +1,4 @@ -TableBody +TableBody ========= Qualified name: ``rsm.nodes.TableBody`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.TableBody`` .. autosummary:: + ~TableBody.nodeid ~TableBody.label ~TableBody.types ~TableBody.number diff --git a/docs/source/reference/rsm.nodes.TableDatum.rst b/docs/source/reference/rsm.nodes.TableDatum.rst index 54d4070..7c7fc77 100644 --- a/docs/source/reference/rsm.nodes.TableDatum.rst +++ b/docs/source/reference/rsm.nodes.TableDatum.rst @@ -1,4 +1,4 @@ -TableDatum +TableDatum ========== Qualified name: ``rsm.nodes.TableDatum`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.TableDatum`` .. autosummary:: + ~TableDatum.nodeid ~TableDatum.label ~TableDatum.types ~TableDatum.number diff --git a/docs/source/reference/rsm.nodes.TableHead.rst b/docs/source/reference/rsm.nodes.TableHead.rst index 21390ed..4b2ac17 100644 --- a/docs/source/reference/rsm.nodes.TableHead.rst +++ b/docs/source/reference/rsm.nodes.TableHead.rst @@ -1,4 +1,4 @@ -TableHead +TableHead ========= Qualified name: ``rsm.nodes.TableHead`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.TableHead`` .. autosummary:: + ~TableHead.nodeid ~TableHead.label ~TableHead.types ~TableHead.number diff --git a/docs/source/reference/rsm.nodes.TableRow.rst b/docs/source/reference/rsm.nodes.TableRow.rst index 39acc29..0853351 100644 --- a/docs/source/reference/rsm.nodes.TableRow.rst +++ b/docs/source/reference/rsm.nodes.TableRow.rst @@ -1,4 +1,4 @@ -TableRow +TableRow ======== Qualified name: ``rsm.nodes.TableRow`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.TableRow`` .. autosummary:: + ~TableRow.nodeid ~TableRow.label ~TableRow.types ~TableRow.number diff --git a/docs/source/reference/rsm.nodes.Text.rst b/docs/source/reference/rsm.nodes.Text.rst index 8b1de27..5b6cf19 100644 --- a/docs/source/reference/rsm.nodes.Text.rst +++ b/docs/source/reference/rsm.nodes.Text.rst @@ -1,4 +1,4 @@ -Text +Text ==== Qualified name: ``rsm.nodes.Text`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.Text`` .. autosummary:: + ~Text.nodeid ~Text.label ~Text.types ~Text.number diff --git a/docs/source/reference/rsm.nodes.Theorem.rst b/docs/source/reference/rsm.nodes.Theorem.rst index 2e49c4c..1d94078 100644 --- a/docs/source/reference/rsm.nodes.Theorem.rst +++ b/docs/source/reference/rsm.nodes.Theorem.rst @@ -1,4 +1,4 @@ -Theorem +Theorem ======= Qualified name: ``rsm.nodes.Theorem`` @@ -24,6 +24,7 @@ Qualified name: ``rsm.nodes.Theorem`` ~Theorem.autonumber ~Theorem.newmetakeys ~Theorem.title + ~Theorem.nodeid ~Theorem.label ~Theorem.types ~Theorem.number diff --git a/docs/source/reference/rsm.nodes.URL.rst b/docs/source/reference/rsm.nodes.URL.rst index 09442c2..d688473 100644 --- a/docs/source/reference/rsm.nodes.URL.rst +++ b/docs/source/reference/rsm.nodes.URL.rst @@ -1,4 +1,4 @@ -URL +URL === Qualified name: ``rsm.nodes.URL`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.URL`` .. autosummary:: + ~URL.nodeid ~URL.label ~URL.types ~URL.number diff --git a/docs/source/reference/rsm.nodes.UnknownBibitem.rst b/docs/source/reference/rsm.nodes.UnknownBibitem.rst index 8af7033..dcea323 100644 --- a/docs/source/reference/rsm.nodes.UnknownBibitem.rst +++ b/docs/source/reference/rsm.nodes.UnknownBibitem.rst @@ -1,4 +1,4 @@ -UnknownBibitem +UnknownBibitem ============== Qualified name: ``rsm.nodes.UnknownBibitem`` @@ -21,6 +21,7 @@ Qualified name: ``rsm.nodes.UnknownBibitem`` .. autosummary:: + ~UnknownBibitem.nodeid ~UnknownBibitem.label ~UnknownBibitem.types ~UnknownBibitem.number diff --git a/docs/source/reference/rsm.nodes.rst b/docs/source/reference/rsm.nodes.rst index 70bddd7..16ed66c 100644 --- a/docs/source/reference/rsm.nodes.rst +++ b/docs/source/reference/rsm.nodes.rst @@ -47,6 +47,8 @@ Contents + Corollary + Definition Draft @@ -55,6 +57,8 @@ Error + Example + Figure Heading diff --git a/docs/source/reference/rsm.transformer.Transformer.rst b/docs/source/reference/rsm.transformer.Transformer.rst index d636941..8df8178 100644 --- a/docs/source/reference/rsm.transformer.Transformer.rst +++ b/docs/source/reference/rsm.transformer.Transformer.rst @@ -17,6 +17,7 @@ Qualified name: ``rsm.transformer.Transformer`` ~Transformer.add_keywords_to_constructs ~Transformer.add_necessary_subproofs + ~Transformer.assign_node_ids ~Transformer.autonumber_nodes ~Transformer.collect_labels ~Transformer.make_toc diff --git a/docs/source/reference/rsm.translator.HandrailsTranslator.rst b/docs/source/reference/rsm.translator.HandrailsTranslator.rst index ab5e3d8..3e5a573 100644 --- a/docs/source/reference/rsm.translator.HandrailsTranslator.rst +++ b/docs/source/reference/rsm.translator.HandrailsTranslator.rst @@ -21,6 +21,7 @@ Qualified name: ``rsm.translator.HandrailsTranslator`` ~HandrailsTranslator.visit_contents ~HandrailsTranslator.visit_manuscript ~HandrailsTranslator.visit_mathblock + ~HandrailsTranslator.visit_paragraph ~HandrailsTranslator.visit_proof ~HandrailsTranslator.visit_section ~HandrailsTranslator.visit_step diff --git a/docs/source/tutorials/special.rst b/docs/source/tutorials/special.rst index cb6ddc7..a295473 100644 --- a/docs/source/tutorials/special.rst +++ b/docs/source/tutorials/special.rst @@ -146,3 +146,26 @@ where the Appendix starts. Among other things, the ``:appendix:`` stamp restarts the numbering of the following sections and changes it from arabic to roman numerals. + + +Paragraphs +********** + +Paragraphs of text need no tag. However, if you want to refer to an entire paragraph of +text, you need to add a label to you. Labels can only be specified in meta tags, and +meta tags can only go immediately after the opening tag of a block or inline. Then how +can we label a paragraph of text? + +The ``:paragraph:`` tag exists for this reason. Similar to the ``:item:`` tag, it does +not need a closing Halmos. Note that if it us used, then some meta tags *must* be +added. + +.. rsm:: + + :manuscript: + + :paragraph: {:label:my-para} This is how you refer to a paragraph of text. + + And now we refer to the entire previous :ref:my-para,paragraph::. + + :: diff --git a/rsm/nodes.py b/rsm/nodes.py index 06ebbc4..7e7dc0d 100644 --- a/rsm/nodes.py +++ b/rsm/nodes.py @@ -1460,6 +1460,14 @@ class Lemma(Theorem): _number_as = Theorem +class Corollary(Theorem): + _number_as = Theorem + + +class Example(Theorem): + _number_as = Theorem + + class Proposition(Theorem): _number_as = Theorem diff --git a/rsm/static/rsm.css b/rsm/static/rsm.css index 2268c75..24b5193 100644 --- a/rsm/static/rsm.css +++ b/rsm/static/rsm.css @@ -386,7 +386,7 @@ .manuscriptwrapper .mathblock { display: flex; align-items: center; - justify-content: space-around; } + justify-content: space-between; } .manuscriptwrapper .mathblock__number { color: var(--lgt-gray); } .manuscriptwrapper .mathblock:hover .manuscriptwrapper .mathblock__number { diff --git a/rsm/static/rsm.scss b/rsm/static/rsm.scss index 00328d0..ab76351 100644 --- a/rsm/static/rsm.scss +++ b/rsm/static/rsm.scss @@ -89,7 +89,7 @@ color: var(--gray-200); cursor: pointer; } - + } @@ -563,7 +563,7 @@ .mathblock { display: flex; align-items: center; - justify-content: space-around; + justify-content: space-between; &__number { color: var(--lgt-gray); diff --git a/rsm/tags.py b/rsm/tags.py index 0d13507..28fcf6a 100644 --- a/rsm/tags.py +++ b/rsm/tags.py @@ -23,10 +23,14 @@ """List of bibliography items.""" codeblock = BlockTagInfo(None) """Code listing.""" +corollary = BlockTagInfo(None) +"""Corollary.""" definition = BlockTagInfo(None) """Definition.""" enumerate = BlockTagInfo(None) # pylint: disable=redefined-builtin """Numbered list.""" +example = BlockTagInfo(None) +"""Example.""" figure = BlockTagInfo(None) """Figure float.""" itemize = BlockTagInfo(None) diff --git a/rsm/translator.py b/rsm/translator.py index f6c33c9..5d1f633 100644 --- a/rsm/translator.py +++ b/rsm/translator.py @@ -128,12 +128,12 @@ class RSMTranslatorError(Exception): def _make_tag( - tag: str, - id_: str, - classes: Iterable, - is_selectable: bool = False, - nodeid: int | None = None, - **kwargs: Any, + tag: str, + id_: str, + classes: Iterable, + is_selectable: bool = False, + nodeid: int | None = None, + **kwargs: Any, ) -> str: text = f"<{tag}" if id_: @@ -251,12 +251,10 @@ def __init__( def make_text(self) -> str: outer = "\n" if self.newline_outer else "" inner = "\n" if self.newline_inner else "" - tag = _make_tag(self.tag, self.id, self.classes, self.is_selectable, **self.custom_attrs) - return ( - outer + tag - + inner + self.content - + inner + f"" + outer + tag = _make_tag( + self.tag, self.id, self.classes, self.is_selectable, **self.custom_attrs ) + return outer + tag + inner + self.content + inner + f"" + outer def __repr__(self) -> str: return self._edit_command_repr(["tag", "content", "id", "classes"]) @@ -288,7 +286,9 @@ def __init__( def make_text(self) -> str: outer = "\n" if self.newline_outer else "" inner = "\n" if self.newline_inner else "" - tag = _make_tag(self.tag, self.id, self.classes, self.is_selectable, *self.custom_attrs) + tag = _make_tag( + self.tag, self.id, self.classes, self.is_selectable, *self.custom_attrs + ) return outer + tag + inner + self.content def __repr__(self) -> str: @@ -326,7 +326,9 @@ def __init__( def make_text(self) -> str: outer = "\n" if self.newline_outer else "" inner = "\n" if self.newline_inner else "" - tag = _make_tag(self.tag, self.id, self.classes, self.is_selectable, **self.custom_attrs) + tag = _make_tag( + self.tag, self.id, self.classes, self.is_selectable, **self.custom_attrs + ) return outer + tag + inner def make_deferred_text(self) -> str: diff --git a/rsm/tsparser.py b/rsm/tsparser.py index e98b90d..8e4258a 100644 --- a/rsm/tsparser.py +++ b/rsm/tsparser.py @@ -249,8 +249,10 @@ def print_cst(tree: TSTree, named_only: bool = False): "cite": nodes.PendingCite, "code": nodes.Code, "codeblock": nodes.CodeBlock, + "corollary": nodes.Corollary, "definition": nodes.Definition, "draft": nodes.Draft, + "example": nodes.Example, "item": nodes.Item, "itemize": nodes.Itemize, "caption": nodes.Caption, diff --git a/tests/test_paragraph.py b/tests/test_paragraph.py index 8443c2c..650a295 100644 --- a/tests/test_paragraph.py +++ b/tests/test_paragraph.py @@ -1,5 +1,6 @@ import pytest from conftest import compare_have_want + import rsm From 5fcd7d49a425402132cad7ad7ea9a06a4b5ebdd2 Mon Sep 17 00:00:00 2001 From: Leo Torres Date: Sun, 12 May 2024 22:36:40 +0200 Subject: [PATCH 2/6] chore: add two new SVGs, as of yet not used. test: check that the :paragraph: tag needs no meta at the end of the paragraph --- rsm/translator.py | 23 ++++++++++++++++++++++- tests/test_paragraph.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/rsm/translator.py b/rsm/translator.py index 5d1f633..d2ece03 100644 --- a/rsm/translator.py +++ b/rsm/translator.py @@ -1094,9 +1094,30 @@ class HandrailsTranslator(Translator): """, + "widen": """ + + + + + + """, + "narrow": """ + + + + + + + """, } - def __init__(self, quiet: bool = False, hidden_handrails: bool = True, sidebar: bool = True, add_source: bool = True): + def __init__( + self, + quiet: bool = False, + hidden_handrails: bool = True, + sidebar: bool = True, + add_source: bool = True, + ): super().__init__(quiet) self.hidden_handrails = hidden_handrails self.sidebar = sidebar diff --git a/tests/test_paragraph.py b/tests/test_paragraph.py index 650a295..320da64 100644 --- a/tests/test_paragraph.py +++ b/tests/test_paragraph.py @@ -64,6 +64,36 @@ def test_succeeding_blankline_with_tag(): ) +def test_tag_no_meta(): + compare_have_want( + have="""\ + :manuscript: + + :paragraph: This is a paragraph. + :: + """, + want=""" + + +
+ +
+ +
+ [CST error at (2, 0) - (2, 11)] +

This is a paragraph.

+ +
+ +
+ +
+ + + """, + ) + + def test_start_with_tag(): compare_have_want( have="""\ From ff081532b810aa5198541af9fc195885ab7172a2 Mon Sep 17 00:00:00 2001 From: Leo Torres Date: Sun, 12 May 2024 22:36:57 +0200 Subject: [PATCH 3/6] add new docs --- docs/source/reference/rsm.nodes.Corollary.rst | 30 +++++++++++++++++++ docs/source/reference/rsm.nodes.Example.rst | 30 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 docs/source/reference/rsm.nodes.Corollary.rst create mode 100644 docs/source/reference/rsm.nodes.Example.rst diff --git a/docs/source/reference/rsm.nodes.Corollary.rst b/docs/source/reference/rsm.nodes.Corollary.rst new file mode 100644 index 0000000..0227b5d --- /dev/null +++ b/docs/source/reference/rsm.nodes.Corollary.rst @@ -0,0 +1,30 @@ +Corollary +========= + +Qualified name: ``rsm.nodes.Corollary`` + +.. currentmodule:: rsm.nodes + +.. autoclass:: Corollary + :show-inheritance: + :members: + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Corollary.nodeid + ~Corollary.label + ~Corollary.types + ~Corollary.number + ~Corollary.nonum + ~Corollary.reftext_template + \ No newline at end of file diff --git a/docs/source/reference/rsm.nodes.Example.rst b/docs/source/reference/rsm.nodes.Example.rst new file mode 100644 index 0000000..f5292dc --- /dev/null +++ b/docs/source/reference/rsm.nodes.Example.rst @@ -0,0 +1,30 @@ +Example +======= + +Qualified name: ``rsm.nodes.Example`` + +.. currentmodule:: rsm.nodes + +.. autoclass:: Example + :show-inheritance: + :members: + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Example.nodeid + ~Example.label + ~Example.types + ~Example.number + ~Example.nonum + ~Example.reftext_template + \ No newline at end of file From 48db352a5a00a5c5fe68a0422cfbdde7f253f211 Mon Sep 17 00:00:00 2001 From: Leo Torres Date: Sun, 12 May 2024 23:06:30 +0200 Subject: [PATCH 4/6] flaky test --- tests/test_tags.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_tags.py b/tests/test_tags.py index 3331cb6..03cb584 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -40,3 +40,5 @@ def test_all_tags_are_documented(): grammar_tags = extract_grammar_tags() documented_tags = extract_documented_tags() assert grammar_tags == documented_tags + print(sorted(grammar_tags)) + print(sorted(documented_tags)) From 01469fbdc5363995d8db84808b5c8e94590bba0b Mon Sep 17 00:00:00 2001 From: Leo Torres Date: Sun, 12 May 2024 23:10:04 +0200 Subject: [PATCH 5/6] update --- tree-sitter-rsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree-sitter-rsm b/tree-sitter-rsm index 0c7bc93..ae2e38c 160000 --- a/tree-sitter-rsm +++ b/tree-sitter-rsm @@ -1 +1 @@ -Subproject commit 0c7bc938aaccdabe2381d0e2ac735972bc1627a1 +Subproject commit ae2e38c97935174b97fa5ace05a696df320e34d2 From b6db9c8601dd87013636bc7f9e4ba88ce2b6d676 Mon Sep 17 00:00:00 2001 From: Leo Torres Date: Sun, 12 May 2024 23:10:19 +0200 Subject: [PATCH 6/6] undo --- tests/test_tags.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_tags.py b/tests/test_tags.py index 03cb584..3331cb6 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -40,5 +40,3 @@ def test_all_tags_are_documented(): grammar_tags = extract_grammar_tags() documented_tags = extract_documented_tags() assert grammar_tags == documented_tags - print(sorted(grammar_tags)) - print(sorted(documented_tags))