text-crossrefs: Typst + testing, coding and documentation improvements

This commit is contained in:
Bastien Dumont
2025-12-21 16:59:06 +01:00
parent 078b6ae71e
commit af22b6e167
15 changed files with 3236 additions and 207 deletions

View File

@ -0,0 +1,592 @@
[ Para
[ Str "(About"
, Space
, Str "the"
, Space
, Str "notes,"
, Space
, Str "see"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "context")
"\\crossrefenum[page]{toc-notes-begin>toc-notes-end}"
]
, Str ".)"
]
, Para
[ Str "\201mile"
, Space
, Str "Gaboriau"
, Space
, Str "published"
, Space
, Str ""
, Span
( "publication" , [] , [] )
[ Emph [ Str "L\8217Affaire" , Space , Str "Lerouge" ]
, Space
, Str "in"
, SoftBreak
, Str "1866"
]
, Str "."
, RawInline
(Format "context") "\\withfirstopt[note:my-evaluation]"
, Note
[ Para
[ Str "It"
, Space
, Str "is"
, Space
, Str "a"
, Space
, Str "very"
, Space
, Str ""
, Span
( "my-evaluation" , [] , [] )
[ Str "fine"
, Space
, Str "piece"
, Space
, Str "of"
, Space
, Str "literature"
]
, Str "."
]
]
, RawInline (Format "context") ""
]
, Para
[ Str ""
, Span
( "reception" , [] , [] )
[ Str "It"
, Space
, Str "was"
, Space
, Str "very"
, Space
, Str "popular."
]
]
, Para
[ Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "context") "\\crossrefenum[page]{publication}"
]
, Space
, Str "for"
, Space
, Str "the"
, Space
, Str "publication"
, Space
, Str "date."
, Space
, Str "I"
, Space
, Str "expressed"
, SoftBreak
, Str "my"
, Space
, Str "thoughts"
, Space
, Str "about"
, Space
, Str "it"
, Space
, Str "in"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "pagenote" ) ] )
[ RawInline
(Format "context") "\\crossrefenum[pagenote]{my-evaluation}"
]
, Str "."
]
, Para
[ Str "If"
, Space
, Str "you"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "know"
, Space
, Str "more"
, Space
, Str "about"
, Space
, Emph [ Str "L\8217Affaire" , Space , Str "Lerouge" ]
, Str ","
, Space
, Str "see"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "context")
"\\crossrefenum[page]{publication>reception}"
]
, Str "."
]
, Para
[ Str "Here"
, Space
, Str "are"
, Space
, Str "some"
, Space
, Str "precisions."
, RawInline (Format "context") "\\withfirstopt[note:format]"
, Note
[ Para
[ Str ""
, Span
( "format" , [] , [] )
[ Str "Whatever" , Space , Str "format" ]
, Space
, Str "you"
, Space
, Str "choose,"
, Space
, Str "you"
, Space
, Str "can"
, Space
, Str ""
, Span
( "refer-to-note" , [] , [] )
[ Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
]
, Space
, Str "by"
, Space
, Str "the"
, Space
, Str "identifier"
, Space
, Str "of"
, Space
, Str ""
, Span
( "which-identifier" , [] , [] )
[ Str "any"
, Space
, Str "of"
, Space
, Str "its"
, Space
, Str "spans."
, Space
, Str "You"
, Space
, Str "can"
, Space
, Str "even"
, Space
, Str ""
, Span
( "nested-spans" , [] , [] )
[ Str "nest" , Space , Str "spans" ]
, Str "!"
]
]
]
, RawInline (Format "context") ""
]
, Para
[ Str ""
, Span
( "toc-notes-begin" , [] , [] )
[ Str "I"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
]
, Str ":"
]
, BulletList
[ [ Plain
[ Str "How"
, Space
, Str "can"
, Space
, Str "I"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
, Space
, Str "by"
, Space
, Str "its"
, Space
, Str "number?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "context")
"\\crossrefenum[page]{refer-to-note}"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "formats"
, Space
, Str "are"
, Space
, Str "supported?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "context") "\\crossrefenum[page]{format}"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "if"
, Space
, Str "the"
, Space
, Str "note"
, Space
, Str "contains"
, Space
, Str "multiple"
, Space
, Str "spans"
, Space
, Str "with"
, Space
, Str "identifiers?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "context")
"\\crossrefenum[page]{which-identifier}"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "happens"
, Space
, Str "if"
, Space
, Str "a"
, Space
, Str "span"
, Space
, Str "is"
, Space
, Str "contained"
, Space
, Str "in"
, Space
, Str "a"
, Space
, Str "span?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "context")
"\\crossrefenum[page]{nested-spans}"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "are"
, Space
, Str "the"
, Space
, Str "notes?"
, Space
, Str "\8594"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "context")
"\\crossrefenum{my-evaluation, format, refer-to-note}"
]
]
]
, [ Plain
[ Str "Where"
, Space
, Str "are"
, Space
, Str "the"
, Space
, Str "notes?"
, Space
, Str "\8594"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "context")
"\\crossrefenum[page]{my-evaluation, format}"
]
]
]
]
, Para [ Str "" , Span ( "toc-notes-end" , [] , [] ) [] ]
, Para
[ Str ""
, Span
( "doubledlbl" , [] , [ ( "refanchor" , "both" ) ] )
[ Str ""
, Span ( "doubledlbl-beg" , [] , [] ) []
, Str "A"
, Space
, Str "portion"
, Space
, Str "of"
, Space
, Str "text"
, Space
, Str "that"
, Space
, Str "may"
, Space
, Str "cross"
, Space
, Str "a"
, Space
, Str "page"
, Space
, Str "break."
, Str ""
, Span ( "doubledlbl-end" , [] , [] ) []
]
]
, Para
[ Span
( "" , [] , [ ( "refanchor" , "end" ) ] )
[ Str "And"
, Space
, Str "this"
, Space
, Str "one"
, Space
, Str "is"
, Space
, Str "labelized"
, Space
, Str "at"
, Space
, Str "the"
, Space
, Str "end."
, Str ""
, Span ( "lblatend" , [] , [] ) []
]
]
, Para
[ Str "What"
, Space
, Str "if"
, Space
, Str "you"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "the"
, Space
, Str "last"
, Space
, Str "line,"
, Space
, Str "i.e.\160"
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "line" ) ] )
[ RawInline
(Format "context") "\\crossrefenum[line]{lblatend}"
]
, Str "?"
]
, Para
[ Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "context")
"\\crossrefenum[page]{doubledlbl-beg>doubledlbl-end}"
]
, Str "."
]
, Para
[ Quoted
DoubleQuote
[ Str "TESTED_FORMAT=typst"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-typst.native"
, Space
, Str "sample.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=typst"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-typst-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=opendocument"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-opendocument-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=context"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-context-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=latex"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-latex-with-options.native"
, Space
, Str "sample-with-options.md"
]
]
]

View File

@ -11,7 +11,7 @@
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "context")
"\\crossrefenum{{toc-notes-begin to toc-notes-end}}"
"\\crossrefenum{toc-notes-begin to toc-notes-end}"
]
, Str ".)"
]
@ -78,8 +78,7 @@
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "context") "\\crossrefenum{{publication}}"
[ RawInline (Format "context") "\\crossrefenum{publication}"
]
, Space
, Str "for"
@ -107,8 +106,7 @@
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "pagenote" ) ] )
[ RawInline
(Format "context")
"\\crossrefenum[pagenote]{{my-evaluation}}"
(Format "context") "\\crossrefenum[pagenote]{my-evaluation}"
]
, Str "."
]
@ -136,7 +134,7 @@
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "context")
"\\crossrefenum{{publication to reception}}"
"\\crossrefenum{publication to reception}"
]
, Str "."
]
@ -260,7 +258,7 @@
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "context") "\\crossrefenum{{refer-to-note}}"
(Format "context") "\\crossrefenum{refer-to-note}"
]
, Str "."
]
@ -280,8 +278,7 @@
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline (Format "context") "\\crossrefenum{{format}}"
]
[ RawInline (Format "context") "\\crossrefenum{format}" ]
, Str "."
]
]
@ -311,8 +308,7 @@
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "context")
"\\crossrefenum{{which-identifier}}"
(Format "context") "\\crossrefenum{which-identifier}"
]
, Str "."
]
@ -328,7 +324,7 @@
, Space
, Str "span"
, Space
, Str "in"
, Str "is"
, Space
, Str "contained"
, Space
@ -345,7 +341,7 @@
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "context") "\\crossrefenum{{nested-spans}}"
(Format "context") "\\crossrefenum{nested-spans}"
]
, Str "."
]
@ -365,7 +361,7 @@
( "" , [ "tcrf" ] , [ ( "reftype" , "note" ) ] )
[ RawInline
(Format "context")
"\\crossrefenum[note]{{my-evaluation}{format}{refer-to-note}}"
"\\crossrefenum[note]{my-evaluation, format, refer-to-note}"
]
]
]
@ -384,7 +380,7 @@
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "context")
"\\crossrefenum{{my-evaluation}{format}}"
"\\crossrefenum{my-evaluation, format}"
]
]
]
@ -420,9 +416,8 @@
]
]
, Para
[ Str ""
, Span
( "lblatend" , [] , [ ( "refanchor" , "end" ) ] )
[ Span
( "" , [] , [ ( "refanchor" , "end" ) ] )
[ Str "And"
, Space
, Str "this"
@ -449,7 +444,7 @@
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "context")
"\\crossrefenum{{doubledlbl-beg to doubledlbl-end}}"
"\\crossrefenum{doubledlbl-beg to doubledlbl-end}"
]
, Str "."
]

View File

@ -0,0 +1,589 @@
[ Para
[ Str "(About"
, Space
, Str "the"
, Space
, Str "notes,"
, Space
, Str "see"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "latex")
"\\crossrefenum[page]{toc-notes-begin>toc-notes-end}"
]
, Str ".)"
]
, Para
[ Str "\201mile"
, Space
, Str "Gaboriau"
, Space
, Str "published"
, Space
, Str ""
, Span
( "publication" , [] , [] )
[ Emph [ Str "L\8217Affaire" , Space , Str "Lerouge" ]
, Space
, Str "in"
, SoftBreak
, Str "1866"
]
, Str "."
, RawInline (Format "latex") ""
, Note
[ Para
[ Str "It"
, Space
, Str "is"
, Space
, Str "a"
, Space
, Str "very"
, Space
, Str ""
, Span
( "my-evaluation" , [] , [] )
[ Str "fine"
, Space
, Str "piece"
, Space
, Str "of"
, Space
, Str "literature"
]
, Str "."
]
]
, RawInline (Format "latex") ""
]
, Para
[ Str ""
, Span
( "reception" , [] , [] )
[ Str "It"
, Space
, Str "was"
, Space
, Str "very"
, Space
, Str "popular."
]
]
, Para
[ Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "latex") "\\crossrefenum[page]{publication}"
]
, Space
, Str "for"
, Space
, Str "the"
, Space
, Str "publication"
, Space
, Str "date."
, Space
, Str "I"
, Space
, Str "expressed"
, SoftBreak
, Str "my"
, Space
, Str "thoughts"
, Space
, Str "about"
, Space
, Str "it"
, Space
, Str "in"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "pagenote" ) ] )
[ RawInline
(Format "latex") "\\crossrefenum[pagenote]{my-evaluation}"
]
, Str "."
]
, Para
[ Str "If"
, Space
, Str "you"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "know"
, Space
, Str "more"
, Space
, Str "about"
, Space
, Emph [ Str "L\8217Affaire" , Space , Str "Lerouge" ]
, Str ","
, Space
, Str "see"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "latex")
"\\crossrefenum[page]{publication>reception}"
]
, Str "."
]
, Para
[ Str "Here"
, Space
, Str "are"
, Space
, Str "some"
, Space
, Str "precisions."
, RawInline (Format "latex") ""
, Note
[ Para
[ Str ""
, Span
( "format" , [] , [] )
[ Str "Whatever" , Space , Str "format" ]
, Space
, Str "you"
, Space
, Str "choose,"
, Space
, Str "you"
, Space
, Str "can"
, Space
, Str ""
, Span
( "refer-to-note" , [] , [] )
[ Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
]
, Space
, Str "by"
, Space
, Str "the"
, Space
, Str "identifier"
, Space
, Str "of"
, Space
, Str ""
, Span
( "which-identifier" , [] , [] )
[ Str "any"
, Space
, Str "of"
, Space
, Str "its"
, Space
, Str "spans."
, Space
, Str "You"
, Space
, Str "can"
, Space
, Str "even"
, Space
, Str ""
, Span
( "nested-spans" , [] , [] )
[ Str "nest" , Space , Str "spans" ]
, Str "!"
]
]
]
, RawInline (Format "latex") ""
]
, Para
[ Str ""
, Span
( "toc-notes-begin" , [] , [] )
[ Str "I"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
]
, Str ":"
]
, BulletList
[ [ Plain
[ Str "How"
, Space
, Str "can"
, Space
, Str "I"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
, Space
, Str "by"
, Space
, Str "its"
, Space
, Str "number?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "latex") "\\crossrefenum[page]{refer-to-note}"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "formats"
, Space
, Str "are"
, Space
, Str "supported?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "latex") "\\crossrefenum[page]{format}"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "if"
, Space
, Str "the"
, Space
, Str "note"
, Space
, Str "contains"
, Space
, Str "multiple"
, Space
, Str "spans"
, Space
, Str "with"
, Space
, Str "identifiers?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "latex")
"\\crossrefenum[page]{which-identifier}"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "happens"
, Space
, Str "if"
, Space
, Str "a"
, Space
, Str "span"
, Space
, Str "is"
, Space
, Str "contained"
, Space
, Str "in"
, Space
, Str "a"
, Space
, Str "span?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "latex") "\\crossrefenum[page]{nested-spans}"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "are"
, Space
, Str "the"
, Space
, Str "notes?"
, Space
, Str "\8594"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "latex")
"\\crossrefenum{my-evaluation, format, refer-to-note}"
]
]
]
, [ Plain
[ Str "Where"
, Space
, Str "are"
, Space
, Str "the"
, Space
, Str "notes?"
, Space
, Str "\8594"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "latex")
"\\crossrefenum[page]{my-evaluation, format}"
]
]
]
]
, Para [ Str "" , Span ( "toc-notes-end" , [] , [] ) [] ]
, Para
[ Str ""
, Span
( "doubledlbl" , [] , [ ( "refanchor" , "both" ) ] )
[ Str ""
, Span ( "doubledlbl-beg" , [] , [] ) []
, Str "A"
, Space
, Str "portion"
, Space
, Str "of"
, Space
, Str "text"
, Space
, Str "that"
, Space
, Str "may"
, Space
, Str "cross"
, Space
, Str "a"
, Space
, Str "page"
, Space
, Str "break."
, Str ""
, Span ( "doubledlbl-end" , [] , [] ) []
]
]
, Para
[ Span
( "" , [] , [ ( "refanchor" , "end" ) ] )
[ Str "And"
, Space
, Str "this"
, Space
, Str "one"
, Space
, Str "is"
, Space
, Str "labelized"
, Space
, Str "at"
, Space
, Str "the"
, Space
, Str "end."
, Str ""
, Span ( "lblatend" , [] , [] ) []
]
]
, Para
[ Str "What"
, Space
, Str "if"
, Space
, Str "you"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "the"
, Space
, Str "last"
, Space
, Str "line,"
, Space
, Str "i.e.\160"
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "line" ) ] )
[ RawInline
(Format "latex") "\\crossrefenum[line]{lblatend}"
]
, Str "?"
]
, Para
[ Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "latex")
"\\crossrefenum[page]{doubledlbl-beg>doubledlbl-end}"
]
, Str "."
]
, Para
[ Quoted
DoubleQuote
[ Str "TESTED_FORMAT=typst"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-typst.native"
, Space
, Str "sample.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=typst"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-typst-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=opendocument"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-opendocument-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=context"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-context-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=latex"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-latex-with-options.native"
, Space
, Str "sample-with-options.md"
]
]
]

View File

@ -11,7 +11,7 @@
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "latex")
"\\crossrefenum{{toc-notes-begin to toc-notes-end}}"
"\\crossrefenum{toc-notes-begin to toc-notes-end}"
]
, Str ".)"
]
@ -77,8 +77,7 @@
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline (Format "latex") "\\crossrefenum{{publication}}"
]
[ RawInline (Format "latex") "\\crossrefenum{publication}" ]
, Space
, Str "for"
, Space
@ -105,7 +104,7 @@
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "pagenote" ) ] )
[ RawInline
(Format "latex") "\\crossrefenum[pagenote]{{my-evaluation}}"
(Format "latex") "\\crossrefenum[pagenote]{my-evaluation}"
]
, Str "."
]
@ -132,8 +131,7 @@
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "latex")
"\\crossrefenum{{publication to reception}}"
(Format "latex") "\\crossrefenum{publication to reception}"
]
, Str "."
]
@ -257,7 +255,7 @@
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "latex") "\\crossrefenum{{refer-to-note}}"
(Format "latex") "\\crossrefenum{refer-to-note}"
]
, Str "."
]
@ -277,7 +275,7 @@
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline (Format "latex") "\\crossrefenum{{format}}" ]
[ RawInline (Format "latex") "\\crossrefenum{format}" ]
, Str "."
]
]
@ -307,7 +305,7 @@
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "latex") "\\crossrefenum{{which-identifier}}"
(Format "latex") "\\crossrefenum{which-identifier}"
]
, Str "."
]
@ -323,7 +321,7 @@
, Space
, Str "span"
, Space
, Str "in"
, Str "is"
, Space
, Str "contained"
, Space
@ -340,7 +338,7 @@
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "latex") "\\crossrefenum{{nested-spans}}"
(Format "latex") "\\crossrefenum{nested-spans}"
]
, Str "."
]
@ -360,7 +358,7 @@
( "" , [ "tcrf" ] , [ ( "reftype" , "note" ) ] )
[ RawInline
(Format "latex")
"\\crossrefenum[note]{{my-evaluation}{format}{refer-to-note}}"
"\\crossrefenum[note]{my-evaluation, format, refer-to-note}"
]
]
]
@ -379,7 +377,7 @@
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "latex")
"\\crossrefenum{{my-evaluation}{format}}"
"\\crossrefenum{my-evaluation, format}"
]
]
]
@ -415,9 +413,8 @@
]
]
, Para
[ Str ""
, Span
( "lblatend" , [] , [ ( "refanchor" , "end" ) ] )
[ Span
( "" , [] , [ ( "refanchor" , "end" ) ] )
[ Str "And"
, Space
, Str "this"
@ -444,7 +441,7 @@
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "latex")
"\\crossrefenum{{doubledlbl-beg to doubledlbl-end}}"
"\\crossrefenum{doubledlbl-beg to doubledlbl-end}"
]
, Str "."
]

View File

@ -0,0 +1,595 @@
[ Para
[ Str "(About"
, Space
, Str "the"
, Space
, Str "notes,"
, Space
, Str "see"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "opendocument")
"pages\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"toc-notes-begin\">000</text:bookmark-ref>-<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"toc-notes-end\">000</text:bookmark-ref>"
]
, Str ".)"
]
, Para
[ Str "\201mile"
, Space
, Str "Gaboriau"
, Space
, Str "published"
, Space
, Str ""
, Span
( "publication" , [] , [] )
[ Emph [ Str "L\8217Affaire" , Space , Str "Lerouge" ]
, Space
, Str "in"
, SoftBreak
, Str "1866"
]
, Str "."
, RawInline (Format "opendocument") ""
, Note
[ Para
[ Str "It"
, Space
, Str "is"
, Space
, Str "a"
, Space
, Str "very"
, Space
, Str ""
, Span
( "my-evaluation" , [] , [] )
[ Str "fine"
, Space
, Str "piece"
, Space
, Str "of"
, Space
, Str "literature"
]
, Str "."
]
]
, RawInline (Format "opendocument") ""
]
, Para
[ Str ""
, Span
( "reception" , [] , [] )
[ Str "It"
, Space
, Str "was"
, Space
, Str "very"
, Space
, Str "popular."
]
]
, Para
[ Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "opendocument")
"page\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"publication\">000</text:bookmark-ref>"
]
, Space
, Str "for"
, Space
, Str "the"
, Space
, Str "publication"
, Space
, Str "date."
, Space
, Str "I"
, Space
, Str "expressed"
, SoftBreak
, Str "my"
, Space
, Str "thoughts"
, Space
, Str "about"
, Space
, Str "it"
, Space
, Str "in"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "pagenote" ) ] )
[ RawInline
(Format "opendocument")
"note\160<text:note-ref text:note-class=\"footnote\" text:reference-format=\"text\" text:ref-name=\"ftn0\">000</text:note-ref> (page\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"my-evaluation\">000</text:bookmark-ref>)"
]
, Str "."
]
, Para
[ Str "If"
, Space
, Str "you"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "know"
, Space
, Str "more"
, Space
, Str "about"
, Space
, Emph [ Str "L\8217Affaire" , Space , Str "Lerouge" ]
, Str ","
, Space
, Str "see"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "opendocument")
"pages\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"publication\">000</text:bookmark-ref>-<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"reception\">000</text:bookmark-ref>"
]
, Str "."
]
, Para
[ Str "Here"
, Space
, Str "are"
, Space
, Str "some"
, Space
, Str "precisions."
, RawInline (Format "opendocument") ""
, Note
[ Para
[ Str ""
, Span
( "format" , [] , [] )
[ Str "Whatever" , Space , Str "format" ]
, Space
, Str "you"
, Space
, Str "choose,"
, Space
, Str "you"
, Space
, Str "can"
, Space
, Str ""
, Span
( "refer-to-note" , [] , [] )
[ Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
]
, Space
, Str "by"
, Space
, Str "the"
, Space
, Str "identifier"
, Space
, Str "of"
, Space
, Str ""
, Span
( "which-identifier" , [] , [] )
[ Str "any"
, Space
, Str "of"
, Space
, Str "its"
, Space
, Str "spans."
, Space
, Str "You"
, Space
, Str "can"
, Space
, Str "even"
, Space
, Str ""
, Span
( "nested-spans" , [] , [] )
[ Str "nest" , Space , Str "spans" ]
, Str "!"
]
]
]
, RawInline (Format "opendocument") ""
]
, Para
[ Str ""
, Span
( "toc-notes-begin" , [] , [] )
[ Str "I"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
]
, Str ":"
]
, BulletList
[ [ Plain
[ Str "How"
, Space
, Str "can"
, Space
, Str "I"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
, Space
, Str "by"
, Space
, Str "its"
, Space
, Str "number?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "opendocument")
"page\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"refer-to-note\">000</text:bookmark-ref>"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "formats"
, Space
, Str "are"
, Space
, Str "supported?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "opendocument")
"page\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"format\">000</text:bookmark-ref>"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "if"
, Space
, Str "the"
, Space
, Str "note"
, Space
, Str "contains"
, Space
, Str "multiple"
, Space
, Str "spans"
, Space
, Str "with"
, Space
, Str "identifiers?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "opendocument")
"page\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"which-identifier\">000</text:bookmark-ref>"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "happens"
, Space
, Str "if"
, Space
, Str "a"
, Space
, Str "span"
, Space
, Str "is"
, Space
, Str "contained"
, Space
, Str "in"
, Space
, Str "a"
, Space
, Str "span?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "opendocument")
"page\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"nested-spans\">000</text:bookmark-ref>"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "are"
, Space
, Str "the"
, Space
, Str "notes?"
, Space
, Str "\8594"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "opendocument")
"notes\160<text:note-ref text:note-class=\"footnote\" text:reference-format=\"text\" text:ref-name=\"ftn0\">000</text:note-ref>; <text:note-ref text:note-class=\"footnote\" text:reference-format=\"text\" text:ref-name=\"ftn1\">000</text:note-ref>; and <text:note-ref text:note-class=\"footnote\" text:reference-format=\"text\" text:ref-name=\"ftn1\">000</text:note-ref>"
]
]
]
, [ Plain
[ Str "Where"
, Space
, Str "are"
, Space
, Str "the"
, Space
, Str "notes?"
, Space
, Str "\8594"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "opendocument")
"pages\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"my-evaluation\">000</text:bookmark-ref>; and <text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"format\">000</text:bookmark-ref>"
]
]
]
]
, Para [ Str "" , Span ( "toc-notes-end" , [] , [] ) [] ]
, Para
[ Str ""
, Span
( "doubledlbl" , [] , [ ( "refanchor" , "both" ) ] )
[ Str ""
, Span ( "doubledlbl-beg" , [] , [] ) []
, Str "A"
, Space
, Str "portion"
, Space
, Str "of"
, Space
, Str "text"
, Space
, Str "that"
, Space
, Str "may"
, Space
, Str "cross"
, Space
, Str "a"
, Space
, Str "page"
, Space
, Str "break."
, Str ""
, Span ( "doubledlbl-end" , [] , [] ) []
]
]
, Para
[ Span
( "" , [] , [ ( "refanchor" , "end" ) ] )
[ Str "And"
, Space
, Str "this"
, Space
, Str "one"
, Space
, Str "is"
, Space
, Str "labelized"
, Space
, Str "at"
, Space
, Str "the"
, Space
, Str "end."
, Str ""
, Span ( "lblatend" , [] , [] ) []
]
]
, Para
[ Str "What"
, Space
, Str "if"
, Space
, Str "you"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "the"
, Space
, Str "last"
, Space
, Str "line,"
, Space
, Str "i.e.\160"
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "line" ) ] )
[ RawInline
(Format "opendocument")
"note\160<text:note-ref text:note-class=\"footnote\" text:reference-format=\"text\" text:ref-name=\"\">000</text:note-ref>"
]
, Str "?"
]
, Para
[ Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "opendocument")
"pages\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"doubledlbl-beg\">000</text:bookmark-ref>-<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"doubledlbl-end\">000</text:bookmark-ref>"
]
, Str "."
]
, Para
[ Quoted
DoubleQuote
[ Str "TESTED_FORMAT=typst"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-typst.native"
, Space
, Str "sample.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=typst"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-typst-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=opendocument"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-opendocument-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=context"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-context-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=latex"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-latex-with-options.native"
, Space
, Str "sample-with-options.md"
]
]
]

View File

@ -331,7 +331,7 @@
, Space
, Str "span"
, Space
, Str "in"
, Str "is"
, Space
, Str "contained"
, Space
@ -424,9 +424,8 @@
]
]
, Para
[ Str ""
, Span
( "lblatend" , [] , [ ( "refanchor" , "end" ) ] )
[ Span
( "" , [] , [ ( "refanchor" , "end" ) ] )
[ Str "And"
, Space
, Str "this"

View File

@ -0,0 +1,594 @@
[ Para
[ Str "(About"
, Space
, Str "the"
, Space
, Str "notes,"
, Space
, Str "see"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "typst")
"pages\160#ref(form: \"page\", <toc-notes-begin>)-#ref(form: \"page\", <toc-notes-end>)"
]
, Str ".)"
]
, Para
[ Str "\201mile"
, Space
, Str "Gaboriau"
, Space
, Str "published"
, Space
, Str ""
, Span
( "publication" , [] , [] )
[ Emph [ Str "L\8217Affaire" , Space , Str "Lerouge" ]
, Space
, Str "in"
, SoftBreak
, Str "1866"
]
, Str "."
, RawInline (Format "typst") ""
, Note
[ Para
[ Str "It"
, Space
, Str "is"
, Space
, Str "a"
, Space
, Str "very"
, Space
, Str ""
, Span
( "my-evaluation" , [] , [] )
[ Str "fine"
, Space
, Str "piece"
, Space
, Str "of"
, Space
, Str "literature"
]
, Str "."
]
]
, RawInline (Format "typst") "<note:my-evaluation>"
]
, Para
[ Str ""
, Span
( "reception" , [] , [] )
[ Str "It"
, Space
, Str "was"
, Space
, Str "very"
, Space
, Str "popular."
]
]
, Para
[ Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "typst")
"page\160#ref(form: \"page\", <publication>)"
]
, Space
, Str "for"
, Space
, Str "the"
, Space
, Str "publication"
, Space
, Str "date."
, Space
, Str "I"
, Space
, Str "expressed"
, SoftBreak
, Str "my"
, Space
, Str "thoughts"
, Space
, Str "about"
, Space
, Str "it"
, Space
, Str "in"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "pagenote" ) ] )
[ RawInline
(Format "typst")
"note\160#ref(form: \"normal\", <note:my-evaluation>) (page\160#ref(form: \"page\", <my-evaluation>))"
]
, Str "."
]
, Para
[ Str "If"
, Space
, Str "you"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "know"
, Space
, Str "more"
, Space
, Str "about"
, Space
, Emph [ Str "L\8217Affaire" , Space , Str "Lerouge" ]
, Str ","
, Space
, Str "see"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "typst")
"pages\160#ref(form: \"page\", <publication>)-#ref(form: \"page\", <reception>)"
]
, Str "."
]
, Para
[ Str "Here"
, Space
, Str "are"
, Space
, Str "some"
, Space
, Str "precisions."
, RawInline (Format "typst") ""
, Note
[ Para
[ Str ""
, Span
( "format" , [] , [] )
[ Str "Whatever" , Space , Str "format" ]
, Space
, Str "you"
, Space
, Str "choose,"
, Space
, Str "you"
, Space
, Str "can"
, Space
, Str ""
, Span
( "refer-to-note" , [] , [] )
[ Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
]
, Space
, Str "by"
, Space
, Str "the"
, Space
, Str "identifier"
, Space
, Str "of"
, Space
, Str ""
, Span
( "which-identifier" , [] , [] )
[ Str "any"
, Space
, Str "of"
, Space
, Str "its"
, Space
, Str "spans."
, Space
, Str "You"
, Space
, Str "can"
, Space
, Str "even"
, Space
, Str ""
, Span
( "nested-spans" , [] , [] )
[ Str "nest" , Space , Str "spans" ]
, Str "!"
]
]
]
, RawInline (Format "typst") "<note:format>"
]
, Para
[ Str ""
, Span
( "toc-notes-begin" , [] , [] )
[ Str "I"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
]
, Str ":"
]
, BulletList
[ [ Plain
[ Str "How"
, Space
, Str "can"
, Space
, Str "I"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
, Space
, Str "by"
, Space
, Str "its"
, Space
, Str "number?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "typst")
"page\160#ref(form: \"page\", <refer-to-note>)"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "formats"
, Space
, Str "are"
, Space
, Str "supported?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "typst")
"page\160#ref(form: \"page\", <format>)"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "if"
, Space
, Str "the"
, Space
, Str "note"
, Space
, Str "contains"
, Space
, Str "multiple"
, Space
, Str "spans"
, Space
, Str "with"
, Space
, Str "identifiers?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "typst")
"page\160#ref(form: \"page\", <which-identifier>)"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "happens"
, Space
, Str "if"
, Space
, Str "a"
, Space
, Str "span"
, Space
, Str "is"
, Space
, Str "contained"
, Space
, Str "in"
, Space
, Str "a"
, Space
, Str "span?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "typst")
"page\160#ref(form: \"page\", <nested-spans>)"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "are"
, Space
, Str "the"
, Space
, Str "notes?"
, Space
, Str "\8594"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "typst")
"notes\160#ref(form: \"normal\", <note:my-evaluation>); #ref(form: \"normal\", <note:format>); and #ref(form: \"normal\", <note:format>)"
]
]
]
, [ Plain
[ Str "Where"
, Space
, Str "are"
, Space
, Str "the"
, Space
, Str "notes?"
, Space
, Str "\8594"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "typst")
"pages\160#ref(form: \"page\", <my-evaluation>); and #ref(form: \"page\", <format>)"
]
]
]
]
, Para [ Str "" , Span ( "toc-notes-end" , [] , [] ) [] ]
, Para
[ Str ""
, Span
( "doubledlbl" , [] , [ ( "refanchor" , "both" ) ] )
[ Str ""
, Span ( "doubledlbl-beg" , [] , [] ) []
, Str "A"
, Space
, Str "portion"
, Space
, Str "of"
, Space
, Str "text"
, Space
, Str "that"
, Space
, Str "may"
, Space
, Str "cross"
, Space
, Str "a"
, Space
, Str "page"
, Space
, Str "break."
, Str ""
, Span ( "doubledlbl-end" , [] , [] ) []
]
]
, Para
[ Span
( "" , [] , [ ( "refanchor" , "end" ) ] )
[ Str "And"
, Space
, Str "this"
, Space
, Str "one"
, Space
, Str "is"
, Space
, Str "labelized"
, Space
, Str "at"
, Space
, Str "the"
, Space
, Str "end."
, Str ""
, Span ( "lblatend" , [] , [] ) []
]
]
, Para
[ Str "What"
, Space
, Str "if"
, Space
, Str "you"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "the"
, Space
, Str "last"
, Space
, Str "line,"
, Space
, Str "i.e.\160"
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "line" ) ] )
[ RawInline
(Format "typst") "note\160#ref(form: \"normal\", <note:>)"
]
, Str "?"
]
, Para
[ Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "page" ) ] )
[ RawInline
(Format "typst")
"pages\160#ref(form: \"page\", <doubledlbl-beg>)-#ref(form: \"page\", <doubledlbl-end>)"
]
, Str "."
]
, Para
[ Quoted
DoubleQuote
[ Str "TESTED_FORMAT=typst"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-typst.native"
, Space
, Str "sample.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=typst"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-typst-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=opendocument"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-opendocument-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=context"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-context-with-options.native"
, Space
, Str "sample-with-options.md"
]
, SoftBreak
, Quoted
DoubleQuote
[ Str "TESTED_FORMAT=latex"
, Space
, Str "pandoc"
, Space
, Str "-L"
, Space
, Str "text-crossrefs.lua"
, Space
, Str "-t"
, Space
, Str "native"
, Space
, Str "-o"
, Space
, Str "test/sample-latex-with-options.native"
, Space
, Str "sample-with-options.md"
]
]
]

View File

@ -0,0 +1,458 @@
[ Para
[ Str "(About"
, Space
, Str "the"
, Space
, Str "notes,"
, Space
, Str "see"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "typst")
"pp.\160#ref(form: \"page\", <toc-notes-begin>)\8211#ref(form: \"page\", <toc-notes-end>)"
]
, Str ".)"
]
, Para
[ Str "\201mile"
, Space
, Str "Gaboriau"
, Space
, Str "published"
, Space
, Str ""
, Span
( "publication" , [] , [] )
[ Emph [ Str "L\8217Affaire" , Space , Str "Lerouge" ]
, Space
, Str "in"
, SoftBreak
, Str "1866"
]
, Str "."
, RawInline (Format "typst") ""
, Note
[ Para
[ Str "It"
, Space
, Str "is"
, Space
, Str "a"
, Space
, Str "very"
, Space
, Str ""
, Span
( "my-evaluation" , [] , [] )
[ Str "fine"
, Space
, Str "piece"
, Space
, Str "of"
, Space
, Str "literature"
]
, Str "."
]
]
, RawInline (Format "typst") "<note:my-evaluation>"
]
, Para
[ Str ""
, Span
( "reception" , [] , [] )
[ Str "It"
, Space
, Str "was"
, Space
, Str "very"
, Space
, Str "popular."
]
]
, Para
[ Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "typst") "p.\160#ref(form: \"page\", <publication>)"
]
, Space
, Str "for"
, Space
, Str "the"
, Space
, Str "publication"
, Space
, Str "date."
, Space
, Str "I"
, Space
, Str "expressed"
, SoftBreak
, Str "my"
, Space
, Str "thoughts"
, Space
, Str "about"
, Space
, Str "it"
, Space
, Str "in"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "pagenote" ) ] )
[ RawInline
(Format "typst")
"p.\160#ref(form: \"page\", <my-evaluation>)\160(n.\160#ref(form: \"normal\", <note:my-evaluation>))"
]
, Str "."
]
, Para
[ Str "If"
, Space
, Str "you"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "know"
, Space
, Str "more"
, Space
, Str "about"
, Space
, Emph [ Str "L\8217Affaire" , Space , Str "Lerouge" ]
, Str ","
, Space
, Str "see"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "typst")
"pp.\160#ref(form: \"page\", <publication>)\8211#ref(form: \"page\", <reception>)"
]
, Str "."
]
, Para
[ Str "Here"
, Space
, Str "are"
, Space
, Str "some"
, Space
, Str "precisions."
, RawInline (Format "typst") ""
, Note
[ Para
[ Str ""
, Span
( "format" , [] , [] )
[ Str "Whatever" , Space , Str "format" ]
, Space
, Str "you"
, Space
, Str "choose,"
, Space
, Str "you"
, Space
, Str "can"
, Space
, Str ""
, Span
( "refer-to-note" , [] , [] )
[ Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
]
, Space
, Str "by"
, Space
, Str "the"
, Space
, Str "identifier"
, Space
, Str "of"
, Space
, Str ""
, Span
( "which-identifier" , [] , [] )
[ Str "any"
, Space
, Str "of"
, Space
, Str "its"
, Space
, Str "spans."
, Space
, Str "You"
, Space
, Str "can"
, Space
, Str "even"
, Space
, Str ""
, Span
( "nested-spans" , [] , [] )
[ Str "nest" , Space , Str "spans" ]
, Str "!"
]
]
]
, RawInline (Format "typst") "<note:format>"
]
, Para
[ Str ""
, Span
( "toc-notes-begin" , [] , [] )
[ Str "I"
, Space
, Str "want"
, Space
, Str "to"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
]
, Str ":"
]
, BulletList
[ [ Plain
[ Str "How"
, Space
, Str "can"
, Space
, Str "I"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Str "a"
, Space
, Str "note"
, Space
, Str "by"
, Space
, Str "its"
, Space
, Str "number?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "typst")
"p.\160#ref(form: \"page\", <refer-to-note>)"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "formats"
, Space
, Str "are"
, Space
, Str "supported?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "typst")
"p.\160#ref(form: \"page\", <format>)"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "if"
, Space
, Str "the"
, Space
, Str "note"
, Space
, Str "contains"
, Space
, Str "multiple"
, Space
, Str "spans"
, Space
, Str "with"
, Space
, Str "identifiers?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "typst")
"p.\160#ref(form: \"page\", <which-identifier>)"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "happens"
, Space
, Str "if"
, Space
, Str "a"
, Space
, Str "span"
, Space
, Str "is"
, Space
, Str "contained"
, Space
, Str "in"
, Space
, Str "a"
, Space
, Str "span?"
, Space
, Str "\8594"
, Space
, Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "typst")
"p.\160#ref(form: \"page\", <nested-spans>)"
]
, Str "."
]
]
, [ Plain
[ Str "What"
, Space
, Str "are"
, Space
, Str "the"
, Space
, Str "notes?"
, Space
, Str "\8594"
, Space
, Span
( "" , [ "tcrf" ] , [ ( "reftype" , "note" ) ] )
[ RawInline
(Format "typst")
"nn.\160#ref(form: \"normal\", <note:my-evaluation>), #ref(form: \"normal\", <note:format>) and #ref(form: \"normal\", <note:format>)"
]
]
]
, [ Plain
[ Str "Where"
, Space
, Str "are"
, Space
, Str "the"
, Space
, Str "notes?"
, Space
, Str "\8594"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "typst")
"pp.\160#ref(form: \"page\", <my-evaluation>) and #ref(form: \"page\", <format>)"
]
]
]
]
, Para [ Str "" , Span ( "toc-notes-end" , [] , [] ) [] ]
, Para
[ Str ""
, Span
( "doubledlbl" , [] , [ ( "refanchor" , "both" ) ] )
[ Str ""
, Span ( "doubledlbl-beg" , [] , [] ) []
, Str "A"
, Space
, Str "portion"
, Space
, Str "of"
, Space
, Str "text"
, Space
, Str "that"
, Space
, Str "may"
, Space
, Str "cross"
, Space
, Str "a"
, Space
, Str "page"
, Space
, Str "break."
, Str ""
, Span ( "doubledlbl-end" , [] , [] ) []
]
]
, Para
[ Span
( "" , [] , [ ( "refanchor" , "end" ) ] )
[ Str "And"
, Space
, Str "this"
, Space
, Str "one"
, Space
, Str "is"
, Space
, Str "labelized"
, Space
, Str "at"
, Space
, Str "the"
, Space
, Str "end."
, Str ""
, Span ( "lblatend" , [] , [] ) []
]
]
, Para
[ Str "See"
, Space
, Span
( "" , [ "tcrf" ] , [] )
[ RawInline
(Format "typst")
"pp.\160#ref(form: \"page\", <doubledlbl-beg>)\8211#ref(form: \"page\", <doubledlbl-end>)"
]
, Str "."
]
]

View File

@ -1,36 +1,41 @@
local refs
local function test(called, expected)
assert(called == expected,
'Test failed: "' .. tostring(expected) .. '" expected, got "' .. tostring(called) .. '".')
end
refs = parse_references_enum('mylabel')
assert(#refs == 1)
assert(refs[1].anchor == 'mylabel')
assert(not refs[1].end_of_range)
assert(make_raw_content_tex(refs, 'page', true)
== '\\crossrefenum{{mylabel}}')
assert(make_raw_content_tex(refs, 'page', false)
== '\\crossrefenum[noprefix]{{mylabel}}')
assert(make_raw_content_tex(refs, 'note', true)
== '\\crossrefenum[note]{{mylabel}}')
assert(make_raw_content_tex(refs, 'note', false)
== '\\crossrefenum[note][noprefix]{{mylabel}}')
test(#refs, 1)
test(refs[1].anchor, 'mylabel')
test(not refs[1].end_of_range, true)
test(make_crossrefenum(refs, 'page', true),
'\\crossrefenum{mylabel}')
test(make_crossrefenum(refs, 'page', false),
'\\crossrefenum[noprefix]{mylabel}')
test(make_crossrefenum(refs, 'note', true),
'\\crossrefenum[note]{mylabel}')
test(make_crossrefenum(refs, 'note', false),
'\\crossrefenum[note][noprefix]{mylabel}')
refs = parse_references_enum('rangebeg>rangeend')
assert(#refs == 1)
assert(refs[1].anchor == 'rangebeg')
assert(refs[1].end_of_range == 'rangeend')
assert(make_raw_content_tex(refs, 'page', true)
== '\\crossrefenum{{rangebeg to rangeend}}')
test(#refs, 1)
test(refs[1].anchor, 'rangebeg')
test(refs[1].end_of_range, 'rangeend')
test(make_crossrefenum(refs, 'page', true),
'\\crossrefenum{rangebeg to rangeend}')
refs = parse_references_enum('first, second')
assert(#refs == 2)
assert(refs[1].anchor == 'first')
assert(refs[2].anchor == 'second')
assert(make_raw_content_tex(refs, 'page', true)
== '\\crossrefenum{{first}{second}}')
test(#refs, 2)
test(refs[1].anchor, 'first')
test(refs[2].anchor, 'second')
test(make_crossrefenum(refs, 'page', true),
'\\crossrefenum{first, second}')
refs = parse_references_enum('first, rangebeg>rangeend')
assert(#refs == 2)
assert(refs[1].anchor == 'first')
assert(refs[2].anchor == 'rangebeg')
assert(refs[2].end_of_range == 'rangeend')
assert(make_raw_content_tex(refs, 'page', true)
== '\\crossrefenum{{first}{rangebeg to rangeend}}')
test(#refs, 2)
test(refs[1].anchor, 'first')
test(refs[2].anchor, 'rangebeg')
test(refs[2].end_of_range, 'rangeend')
test(make_crossrefenum(refs, 'page', true),
'\\crossrefenum{first, rangebeg to rangeend}')