Add 'text-crossrefs/' from commit '7e09b67aeda54b4f098e8576c203c809572a85bb'
git-subtree-dir: text-crossrefs git-subtree-mainline:02e7a6fef1
git-subtree-split:7e09b67aed
This commit is contained in:
456
text-crossrefs/test/sample-context.native
Normal file
456
text-crossrefs/test/sample-context.native
Normal file
@ -0,0 +1,456 @@
|
||||
[ Para
|
||||
[ Str "(About"
|
||||
, Space
|
||||
, Str "the"
|
||||
, Space
|
||||
, Str "notes,"
|
||||
, Space
|
||||
, Str "see"
|
||||
, Space
|
||||
, Span
|
||||
( "" , [ "tcrf" ] , [] )
|
||||
[ RawInline
|
||||
(Format "context")
|
||||
"\\crossrefenum{{toc-notes-begin to 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" ] , [] )
|
||||
[ RawInline
|
||||
(Format "context") "\\crossrefenum{{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" ] , [] )
|
||||
[ RawInline
|
||||
(Format "context")
|
||||
"\\crossrefenum{{publication to 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" ] , [] )
|
||||
[ RawInline
|
||||
(Format "context") "\\crossrefenum{{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 "context") "\\crossrefenum{{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 "context")
|
||||
"\\crossrefenum{{which-identifier}}"
|
||||
]
|
||||
, Str "."
|
||||
]
|
||||
]
|
||||
, [ Plain
|
||||
[ Str "What"
|
||||
, Space
|
||||
, Str "happens"
|
||||
, Space
|
||||
, Str "if"
|
||||
, Space
|
||||
, Str "a"
|
||||
, Space
|
||||
, Str "span"
|
||||
, Space
|
||||
, Str "in"
|
||||
, Space
|
||||
, Str "contained"
|
||||
, Space
|
||||
, Str "in"
|
||||
, Space
|
||||
, Str "a"
|
||||
, Space
|
||||
, Str "span?"
|
||||
, Space
|
||||
, Str "\8594"
|
||||
, Space
|
||||
, Str "See"
|
||||
, Space
|
||||
, Span
|
||||
( "" , [ "tcrf" ] , [] )
|
||||
[ RawInline
|
||||
(Format "context") "\\crossrefenum{{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 "context")
|
||||
"\\crossrefenum[note]{{my-evaluation}{format}{refer-to-note}}"
|
||||
]
|
||||
]
|
||||
]
|
||||
, [ Plain
|
||||
[ Str "Where"
|
||||
, Space
|
||||
, Str "are"
|
||||
, Space
|
||||
, Str "the"
|
||||
, Space
|
||||
, Str "notes?"
|
||||
, Space
|
||||
, Str "\8594"
|
||||
, Space
|
||||
, Span
|
||||
( "" , [ "tcrf" ] , [] )
|
||||
[ RawInline
|
||||
(Format "context")
|
||||
"\\crossrefenum{{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
|
||||
[ Str ""
|
||||
, Span
|
||||
( "lblatend" , [] , [ ( "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 "context")
|
||||
"\\crossrefenum{{doubledlbl-beg to doubledlbl-end}}"
|
||||
]
|
||||
, Str "."
|
||||
]
|
||||
]
|
454
text-crossrefs/test/sample-latex.native
Normal file
454
text-crossrefs/test/sample-latex.native
Normal file
@ -0,0 +1,454 @@
|
||||
[ Para
|
||||
[ Str "(About"
|
||||
, Space
|
||||
, Str "the"
|
||||
, Space
|
||||
, Str "notes,"
|
||||
, Space
|
||||
, Str "see"
|
||||
, Space
|
||||
, Span
|
||||
( "" , [ "tcrf" ] , [] )
|
||||
[ RawInline
|
||||
(Format "latex")
|
||||
"\\crossrefenum{{toc-notes-begin to toc-notes-end}}"
|
||||
]
|
||||
, Str ".)"
|
||||
]
|
||||
, Para
|
||||
[ Str "\201mile"
|
||||
, Space
|
||||
, Str "Gaboriau"
|
||||
, Space
|
||||
, Str "published"
|
||||
, Space
|
||||
, RawInline (Format "latex") "\\label{publication}"
|
||||
, 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
|
||||
, RawInline (Format "latex") "\\label{my-evaluation}"
|
||||
, Span
|
||||
( "my-evaluation" , [] , [] )
|
||||
[ Str "fine"
|
||||
, Space
|
||||
, Str "piece"
|
||||
, Space
|
||||
, Str "of"
|
||||
, Space
|
||||
, Str "literature"
|
||||
]
|
||||
, Str "."
|
||||
]
|
||||
]
|
||||
, RawInline (Format "latex") ""
|
||||
]
|
||||
, Para
|
||||
[ RawInline (Format "latex") "\\label{reception}"
|
||||
, Span
|
||||
( "reception" , [] , [] )
|
||||
[ Str "It"
|
||||
, Space
|
||||
, Str "was"
|
||||
, Space
|
||||
, Str "very"
|
||||
, Space
|
||||
, Str "popular."
|
||||
]
|
||||
]
|
||||
, Para
|
||||
[ Str "See"
|
||||
, Space
|
||||
, Span
|
||||
( "" , [ "tcrf" ] , [] )
|
||||
[ RawInline (Format "latex") "\\crossrefenum{{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" ] , [] )
|
||||
[ RawInline
|
||||
(Format "latex")
|
||||
"\\crossrefenum{{publication to reception}}"
|
||||
]
|
||||
, Str "."
|
||||
]
|
||||
, Para
|
||||
[ Str "Here"
|
||||
, Space
|
||||
, Str "are"
|
||||
, Space
|
||||
, Str "some"
|
||||
, Space
|
||||
, Str "precisions."
|
||||
, RawInline (Format "latex") ""
|
||||
, Note
|
||||
[ Para
|
||||
[ RawInline (Format "latex") "\\label{format}"
|
||||
, Span
|
||||
( "format" , [] , [] )
|
||||
[ Str "Whatever" , Space , Str "format" ]
|
||||
, Space
|
||||
, Str "you"
|
||||
, Space
|
||||
, Str "choose,"
|
||||
, Space
|
||||
, Str "you"
|
||||
, Space
|
||||
, Str "can"
|
||||
, Space
|
||||
, RawInline (Format "latex") "\\label{refer-to-note}"
|
||||
, 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
|
||||
, RawInline (Format "latex") "\\label{which-identifier}"
|
||||
, Span
|
||||
( "which-identifier" , [] , [] )
|
||||
[ Str "any"
|
||||
, Space
|
||||
, Str "of"
|
||||
, Space
|
||||
, Str "its"
|
||||
, Space
|
||||
, Str "spans."
|
||||
, Space
|
||||
, Str "You"
|
||||
, Space
|
||||
, Str "can"
|
||||
, Space
|
||||
, Str "even"
|
||||
, Space
|
||||
, RawInline (Format "latex") "\\label{nested-spans}"
|
||||
, Span
|
||||
( "nested-spans" , [] , [] )
|
||||
[ Str "nest" , Space , Str "spans" ]
|
||||
, Str "!"
|
||||
]
|
||||
]
|
||||
]
|
||||
, RawInline (Format "latex") ""
|
||||
]
|
||||
, Para
|
||||
[ RawInline (Format "latex") "\\label{toc-notes-begin}"
|
||||
, 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 "latex") "\\crossrefenum{{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 "latex") "\\crossrefenum{{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 "latex") "\\crossrefenum{{which-identifier}}"
|
||||
]
|
||||
, Str "."
|
||||
]
|
||||
]
|
||||
, [ Plain
|
||||
[ Str "What"
|
||||
, Space
|
||||
, Str "happens"
|
||||
, Space
|
||||
, Str "if"
|
||||
, Space
|
||||
, Str "a"
|
||||
, Space
|
||||
, Str "span"
|
||||
, Space
|
||||
, Str "in"
|
||||
, Space
|
||||
, Str "contained"
|
||||
, Space
|
||||
, Str "in"
|
||||
, Space
|
||||
, Str "a"
|
||||
, Space
|
||||
, Str "span?"
|
||||
, Space
|
||||
, Str "\8594"
|
||||
, Space
|
||||
, Str "See"
|
||||
, Space
|
||||
, Span
|
||||
( "" , [ "tcrf" ] , [] )
|
||||
[ RawInline
|
||||
(Format "latex") "\\crossrefenum{{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 "latex")
|
||||
"\\crossrefenum[note]{{my-evaluation}{format}{refer-to-note}}"
|
||||
]
|
||||
]
|
||||
]
|
||||
, [ Plain
|
||||
[ Str "Where"
|
||||
, Space
|
||||
, Str "are"
|
||||
, Space
|
||||
, Str "the"
|
||||
, Space
|
||||
, Str "notes?"
|
||||
, Space
|
||||
, Str "\8594"
|
||||
, Space
|
||||
, Span
|
||||
( "" , [ "tcrf" ] , [] )
|
||||
[ RawInline
|
||||
(Format "latex")
|
||||
"\\crossrefenum{{my-evaluation}{format}}"
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
, Para
|
||||
[ RawInline (Format "latex") "\\label{toc-notes-end}"
|
||||
, Span ( "toc-notes-end" , [] , [] ) []
|
||||
]
|
||||
, Para
|
||||
[ RawInline (Format "latex") "\\label{doubledlbl}"
|
||||
, Span
|
||||
( "doubledlbl" , [] , [ ( "refanchor" , "both" ) ] )
|
||||
[ RawInline (Format "latex") "\\label{doubledlbl-beg}"
|
||||
, 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."
|
||||
, RawInline (Format "latex") "\\label{doubledlbl-end}"
|
||||
, Span ( "doubledlbl-end" , [] , [] ) []
|
||||
]
|
||||
]
|
||||
, Para
|
||||
[ RawInline (Format "latex") "\\label{lblatend}"
|
||||
, Span
|
||||
( "lblatend" , [] , [ ( "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."
|
||||
, RawInline (Format "latex") "\\label{lblatend}"
|
||||
, Span ( "lblatend" , [] , [] ) []
|
||||
]
|
||||
]
|
||||
, Para
|
||||
[ Str "See"
|
||||
, Space
|
||||
, Span
|
||||
( "" , [ "tcrf" ] , [] )
|
||||
[ RawInline
|
||||
(Format "latex")
|
||||
"\\crossrefenum{{doubledlbl-beg to doubledlbl-end}}"
|
||||
]
|
||||
, Str "."
|
||||
]
|
||||
]
|
460
text-crossrefs/test/sample-opendocument.native
Normal file
460
text-crossrefs/test/sample-opendocument.native
Normal file
@ -0,0 +1,460 @@
|
||||
[ Para
|
||||
[ Str "(About"
|
||||
, Space
|
||||
, Str "the"
|
||||
, Space
|
||||
, Str "notes,"
|
||||
, Space
|
||||
, Str "see"
|
||||
, Space
|
||||
, Span
|
||||
( "" , [ "tcrf" ] , [] )
|
||||
[ RawInline
|
||||
(Format "opendocument")
|
||||
"pp.\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"toc-notes-begin\">000</text:bookmark-ref>\8211<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" ] , [] )
|
||||
[ RawInline
|
||||
(Format "opendocument")
|
||||
"p.\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")
|
||||
"p.\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"my-evaluation\">000</text:bookmark-ref>\160(n.\160<text:note-ref text:note-class=\"footnote\" text:reference-format=\"text\" text:ref-name=\"ftn0\">000</text:note-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" ] , [] )
|
||||
[ RawInline
|
||||
(Format "opendocument")
|
||||
"pp.\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"publication\">000</text:bookmark-ref>\8211<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" ] , [] )
|
||||
[ RawInline
|
||||
(Format "opendocument")
|
||||
"p.\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" ] , [] )
|
||||
[ RawInline
|
||||
(Format "opendocument")
|
||||
"p.\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" ] , [] )
|
||||
[ RawInline
|
||||
(Format "opendocument")
|
||||
"p.\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 "in"
|
||||
, Space
|
||||
, Str "contained"
|
||||
, Space
|
||||
, Str "in"
|
||||
, Space
|
||||
, Str "a"
|
||||
, Space
|
||||
, Str "span?"
|
||||
, Space
|
||||
, Str "\8594"
|
||||
, Space
|
||||
, Str "See"
|
||||
, Space
|
||||
, Span
|
||||
( "" , [ "tcrf" ] , [] )
|
||||
[ RawInline
|
||||
(Format "opendocument")
|
||||
"p.\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" ] , [ ( "reftype" , "note" ) ] )
|
||||
[ RawInline
|
||||
(Format "opendocument")
|
||||
"nn.\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" ] , [] )
|
||||
[ RawInline
|
||||
(Format "opendocument")
|
||||
"pp.\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
|
||||
[ Str ""
|
||||
, Span
|
||||
( "lblatend" , [] , [ ( "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 "opendocument")
|
||||
"pp.\160<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"doubledlbl-beg\">000</text:bookmark-ref>\8211<text:bookmark-ref text:reference-format=\"page\" text:ref-name=\"doubledlbl-end\">000</text:bookmark-ref>"
|
||||
]
|
||||
, Str "."
|
||||
]
|
||||
]
|
36
text-crossrefs/test/test-functions.lua
Normal file
36
text-crossrefs/test/test-functions.lua
Normal file
@ -0,0 +1,36 @@
|
||||
local refs
|
||||
|
||||
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}}')
|
||||
|
||||
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}}')
|
||||
|
||||
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}}')
|
||||
|
||||
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}}')
|
Reference in New Issue
Block a user