From 14acbf0b035af6ec4f335c933d656c6fa2fc2d32 Mon Sep 17 00:00:00 2001 From: Nick Nicholas Date: Thu, 5 Sep 2024 22:35:51 +1000 Subject: [PATCH] documentation: /~https://github.com/metanorma/metanorma-model-iso/issues/82 --- grammars/basicdoc.rnc | 22 +-- grammars/basicdoc.rng | 323 +++++++++++++++++++++--------------------- 2 files changed, 178 insertions(+), 167 deletions(-) diff --git a/grammars/basicdoc.rnc b/grammars/basicdoc.rnc index e8f8ab4..1af0a8f 100644 --- a/grammars/basicdoc.rnc +++ b/grammars/basicdoc.rnc @@ -42,14 +42,17 @@ LocaleType = text ## Group of blocks within text, which is a leaf node in the hierarchical organisation of text (does not contain any sections of its own) Basic-Section = - OptionalId, - LocalizedStringAttributes, + Basic-Section-Attributes, ## Title of the section section-title?, ## Blocks, containing the textual content of the section ## (but excluding subsections, which are only present in Hierarchical Sections) BasicBlock* +Basic-Section-Attributes = + OptionalId, + LocalizedStringAttributes + ## Sections containing zero or more bibliographical items (as described in Relaton), along with any prefatory text references = element references { @@ -204,7 +207,7 @@ note-no-id = NoteNoIdBody } -NoteAttributes = empty +NoteAttributes = NumberingAttrs NoteBody = paragraph+ @@ -674,8 +677,6 @@ FigureAttributes = attribute class { text }? FigureBody = - ## A URI or other reference intended to link to an externally hosted image (or equivalent) - source?, ## The caption of the block tname?, ## Content of the figure @@ -686,6 +687,8 @@ FigureBody = dl?, ## Notes whose scope is the current block note* + ## A URI or other reference intended to link to an externally hosted image (or equivalent) + source?, FigureNoIdBody = ## A URI or other reference intended to link to an externally hosted image (or equivalent) @@ -870,6 +873,7 @@ erefAttributes = hyperlink = element link { HyperlinkAttributes, + ## The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `my link text`) PureTextElement+ } @@ -880,7 +884,6 @@ HyperlinkAttributes = attribute type { ReferenceFormat }, ## Alternate text, used for accessibility attribute alt { text }? - ## The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `my link text`) ## Inline element, which references an identifier of a document, a block in a document, or an element in a document xref = @@ -1026,12 +1029,15 @@ MediaAccessibilityAttributes = ## Mathematically formatted text stem = element stem { - ## The notation used to mathematically format the text - attribute type { "MathML" | "AsciiMath" | "LaTeX" }, + StemAttributes, ## The content of the mathematically formatted text ( text | AnyElement )+ } +StemAttributes = + ## The notation used to mathematically format the text + attribute type { "MathML" | "AsciiMath" | "LaTeX" }, + annotation = element annotation { RequiredId, diff --git a/grammars/basicdoc.rng b/grammars/basicdoc.rng index 2ddc153..73e35c8 100644 --- a/grammars/basicdoc.rng +++ b/grammars/basicdoc.rng @@ -61,7 +61,7 @@ so the hierarchical arrangement of sections can be arbitrarily deep Group of blocks within text, which is a leaf node in the hierarchical organisation of text (does not contain any sections of its own) - + Title of the section @@ -278,7 +278,7 @@ in a document (e.g. sourcecode annotations) - + The alignment of the paragraph against the margins of the document @@ -288,7 +288,7 @@ in a document (e.g. sourcecode annotations) - + @@ -326,7 +326,7 @@ in a document (e.g. sourcecode annotations) Paragraph containing no footnotes: optional ID attributes (for use in Relaton, metadata) - + @@ -334,7 +334,7 @@ in a document (e.g. sourcecode annotations) A paragraph which may contain footnotes. - + @@ -342,7 +342,7 @@ in a document (e.g. sourcecode annotations) A paragraph which may contain footnotes: optional ID attributes (for use in Relaton, metadata) - + @@ -350,7 +350,7 @@ in a document (e.g. sourcecode annotations) Note block - + @@ -358,11 +358,11 @@ in a document (e.g. sourcecode annotations) Note block: optional ID attributes (for use in Relaton, metadata) - + - + @@ -433,7 +433,7 @@ with the same number and in a subsequence: 7a, 7b, 7c etc Block containing a mathematical expression or other formulas - + @@ -441,11 +441,11 @@ with the same number and in a subsequence: 7a, 7b, 7c etc Block containing a mathematical expression or other formulas: optional ID attributes (for use in Relaton, metadata) - + - + @@ -488,7 +488,7 @@ with the same number and in a subsequence: 7a, 7b, 7c etc Block quotation, containing extensive textual content originally authored outside of the current document - + @@ -496,11 +496,11 @@ with the same number and in a subsequence: 7a, 7b, 7c etc Block quotation: optional ID attributes (for use in Relaton, metadata) - + - + The alignment of the quote against the margins of the document @@ -570,7 +570,7 @@ It is included for convenience, in case processing the citation to extract the a Block containing computer code or comparable text - + @@ -578,11 +578,11 @@ It is included for convenience, in case processing the citation to extract the a Block containing computer code or comparable text: optional ID attributes (for use in Relaton, metadata) - + - + @@ -655,7 +655,7 @@ standards documents), and computer output. In most cases, sourcecode blocks are as it is more clearly motivated semantically - + @@ -663,11 +663,11 @@ as it is more clearly motivated semantically Pre-formatted block: optional ID attributes (for use in Relaton, metadata) - + - + Accessible description of the preformatted text @@ -708,7 +708,7 @@ as it is more clearly motivated semantically Tabular arrangement of text - + @@ -716,11 +716,11 @@ as it is more clearly motivated semantically Tabular arrangement of text: optional ID attributes recursively (for use in Relaton, metadata) - + - + @@ -882,18 +882,18 @@ in case the table cannot be rendered accessibly (HTML 5) Textual content constituting a basic building block of a table: data cell - + Data cell: optional ID attributes recursively (for use in Relaton, metadata) - + - + Number of columns in the underlying table grid which the cell spans @@ -959,19 +959,19 @@ in case the table cannot be rendered accessibly (HTML 5) Textual content constituting a basic building block of a table, treated as a header: header cell - + Header cell: optional ID attributes recursively (for use in Relaton, metadata) - + - - + + @@ -983,7 +983,7 @@ in case the table cannot be rendered accessibly (HTML 5) Block containing an example illustrating a claim made in the main flow of text - + @@ -991,11 +991,11 @@ in case the table cannot be rendered accessibly (HTML 5) Example block: optional ID attributes recursively (for use in Relaton, metadata) - + - + @@ -1050,7 +1050,7 @@ in case the table cannot be rendered accessibly (HTML 5) A sidebar block outside of the main flow of text, conveying particular warnings or supplementary text to the reader - + @@ -1058,11 +1058,11 @@ in case the table cannot be rendered accessibly (HTML 5) A sidebar block outside of the main flow of text: optional ID attributes recursively (for use in Relaton, metadata) - + - + Subclass of admonition determining how it is to be rendered. Distinct admonition types are often associated with distinct icons or rendering @@ -1135,7 +1135,7 @@ Typically is a subclass of an admonition type Block containing a figure: a visual rather than textual asset, possibly with accompanying text - + @@ -1143,11 +1143,11 @@ Typically is a subclass of an admonition type Block containing a figure: optional ID attributes recursively (for use in Relaton, metadata) - + - + @@ -1499,28 +1499,15 @@ to indicate that the index range covers a range of locations between the current - + Primary index term to be recorded at the current location - - - - - - - Secondary index term to be recorded at the current location - - - - - - - - Tertiary index term to be recorded at the current - - - - - + + + Secondary index term to be recorded at the current location + + + Tertiary index term to be recorded at the current + @@ -1532,28 +1519,15 @@ The text in the inline element is the primary index term to be be cross-referenc The cross-reference is to be treated as "see also" rather than as "see" - + The primary index term to be cross-referenced - - - - - - - The secondary index term to be cross-referenced - - - - - - - - The tertiary index term to be cross-referenced - - - - - + + + The secondary index term to be cross-referenced + + + The tertiary index term to be cross-referenced + The index term to be cross-referenced to @@ -1562,9 +1536,29 @@ The text in the inline element is the primary index term to be be cross-referenc + + + + + + + + + + + + + + + + + + + + + - Anchor for cross-references which do not have scope over blocks or sections. -Anchors within a block under the BasicDocument model cannot span across a number of inline elements; + Anchors within a block under the BasicDocument model cannot span across a number of inline elements; bookmarks are intended as point anchors. For that reason, the Review block has a starting reference and an optional ending reference, which can be bookmarks as well as block or section references @@ -1592,6 +1586,15 @@ which can be bookmarks as well as block or section references + + + Reference cross-reference: modelled as cross-reference to the corresponding bibliographical item in a References section + + + The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `<xx>my link text</xx>`) + + + Whether the reference is to be treated as normative or informative, particularly in the context of normative documents such as standards @@ -1601,70 +1604,72 @@ which can be bookmarks as well as block or section references Form that the bibliographic citation should take when it is rendered - - The type of Reference Element, prescribing how it is to be rendered - - + + + The type of Reference Element, prescribing how it is to be rendered + + + Alternate text, used for accessibility - - Reference cross-reference: modelled as cross-reference to the corresponding bibliographical item in a References section - - - - The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `<xx>my link text</xx>`) - - A reference to an external document or resource - - The location or online identifier of the external document or resource - - - - The type of Reference Element, prescribing how it is to be rendered - - - - - Alternate text, used for accessibility - - + - - The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `<xx>my link text</xx>`) - + + + + The location or online identifier of the external document or resource + + + + The type of Reference Element, prescribing how it is to be rendered + + + + + Alternate text, used for accessibility + + + + The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `<xx>my link text</xx>`) Inline element, which references an identifier of a document, a block in a document, or an element in a document - - The identifier of a section, block or inlined element being referenced - - - - The type of Reference Element, prescribing how it is to be rendered - - - - - Alternate text, used for accessibility - - - - - The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `<xx>my link text</xx>`) - - + + + + + The identifier of a section, block or inlined element being referenced + + + + The type of Reference Element, prescribing how it is to be rendered + + + + + Alternate text, used for accessibility + + + + + + + The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `<xx>my link text</xx>`) + + + Inline reference to a paragraph or paragraphs, appearing as a footnote. The target of a footnote is the location it is embedded in within the text @@ -1696,19 +1701,19 @@ the extent of the target is not expressed overtly Container for image content - + Container for image content: optional ID attributes recursively (for use in Relaton, metadata) - + - - - + + + Height of image @@ -1741,7 +1746,7 @@ or as the string "auto" Container for video content - + @@ -1749,13 +1754,13 @@ or as the string "auto" Container for video content: optional ID attributes recursively (for use in Relaton, metadata) - + - - - + + + Width of video @@ -1780,7 +1785,7 @@ or as the string "auto" Container for audio content - + @@ -1788,13 +1793,13 @@ or as the string "auto" Container for audio content: optional ID attributes recursively (for use in Relaton, metadata) - + - - - + + + @@ -1806,10 +1811,10 @@ or as the string "auto" Alternative file to use as media - + - + URI of the media file @@ -1825,7 +1830,7 @@ or as the string "auto" - + Alternate text, supplied for accessibility @@ -1875,7 +1880,7 @@ or as the string "auto" Unordered list block - + @@ -1883,11 +1888,11 @@ or as the string "auto" Unordered list block: optional ID attributes recursively (for use in Relaton, metadata) - + - + @@ -1918,7 +1923,7 @@ or as the string "auto" Item in a list block - + @@ -1926,11 +1931,11 @@ or as the string "auto" Item in a list block: optional ID attributes recursively (for use in Relaton, metadata) - + - + @@ -1947,7 +1952,7 @@ or as the string "auto" Ordered list, with numbering applied to the list items - + @@ -1955,11 +1960,11 @@ or as the string "auto" Ordered list: optional ID attributes recursively (for use in Relaton, metadata) - + - + Type of numbering to be applied to the list items @@ -2005,7 +2010,7 @@ and is mapped to the ordinal represented in the type Definition list, composed of definitions rather than list items - + @@ -2016,7 +2021,7 @@ and is mapped to the ordinal represented in the type - +