Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate index in Presentation XML #67

Closed
opoudjis opened this issue Nov 17, 2020 · 19 comments
Closed

Generate index in Presentation XML #67

opoudjis opened this issue Nov 17, 2020 · 19 comments
Assignees
Labels
bug Something isn't working

Comments

@opoudjis
Copy link
Contributor

Presumably it will be realised in Presentation XML as the page-only cross-references we have already been bludgeoned by BIPM into producing.

@ronaldtse
Copy link
Contributor

Note: This functionality also applies to ISO 10303.

@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 10, 2020

Index in Presentation XML shall take the form of a final <clause type="index'> clause, after the bibliography, with a title, a subclause for each initial letter, and each subclause consisting of an unordered list. The unordered list shall contain list entries, each of which shall be the index term, then comma, then a comma-delimited list of pagenumber-only cross-references. As already discussed, and to @Intelligent2013's trepidation, it shall be @Intelligent2013's responsibility to eliminate consecutive cross-references to the same page number.

@opoudjis
Copy link
Contributor Author

BIPM have "X, see Y" entries; I will need to add those to metanorma-standoc

@opoudjis
Copy link
Contributor Author

Fix standoc indexterm: if Asciidoctor index term contains formatting, preserve it in rendered text.

@opoudjis
Copy link
Contributor Author

Index target is converted to bookmark in PresentationXML. Rendering highlights the fact that bookmark targets are rendered as bare GUIDs. They need to be rendered as the containing section, for HTML. @Intelligent2013 that means that I will have <xref pagenumber="true" target="X">Clause 1.4</xref>: ignore the content of any xref with pagenumber=true, and only put in the page number: those xrefs are deliberately meant to be page number only in PDF.

@Intelligent2013
Copy link
Contributor

@Intelligent2013 that means that I will have <xref pagenumber="true" target="X">Clause 1.4</xref>: ignore the content of any xref with pagenumber=true, and only put in the page number: those xrefs are deliberately meant to be page number only in PDF.

@opoudjis FYI, I've made it already for ToC in Appendix 1 for brochure.

@opoudjis
Copy link
Contributor Author

@opoudjis FYI, I've made it already for ToC in Appendix 1 for brochure.

I know, I just wanted to make sure.

opoudjis added a commit to metanorma/isodoc that referenced this issue Dec 10, 2020
opoudjis added a commit to metanorma/isodoc that referenced this issue Dec 10, 2020
@opoudjis
Copy link
Contributor Author

@Intelligent2013 The horrors continue:

ampère (A), 13, 16, 18, 20, 28, 44, 49, 51,
52, 54, 55, 71, 81, 83-86, 89, 91-94, 97,
99, 100, 101, 103-104

if there are more than 2 consecutive numbers, you may be expected to concatenated them into x–y. If you do, please use an en-dash: once again, we are obliged to do better typographically than BIPM.

@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 10, 2020

"X see Y" and "X see also Y" in an index is going to be handled as a new macro, index:see[primary,secondary,tertiary,target] and index:also[primary,secondary,tertiary,target], and a new tag,

<index-xref also="true/false">
  <primary>X</primary>
  <secondary>secondary</secondary>
  <tertiary>tertiary</tertiary>
  <target>target</target> 
</index-xref>

primary, secondary, tertiary are terms of X, and secondary, tertiary are optional.

@Intelligent2013
Copy link
Contributor

@Intelligent2013 The horrors continue:

ampère (A), 13, 16, 18, 20, 28, 44, 49, 51,
52, 54, 55, 71, 81, 83-86, 89, 91-94, 97,
99, 100, 101, 103-104

if there are more than 2 consecutive numbers, you may be expected to concatenated them into x–y. If you do, please use an en-dash: once again, we are obliged to do better typographically than BIPM.

Hmm, then why they put 99, 100, 101 instead of 99-101... Is there a sense?

@ronaldtse
Copy link
Contributor

@Intelligent2013 I believe 99, 100, 101 can be concatenated as 99-101.

@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 10, 2020

Hmm, then why they put 99, 100, 101 instead of 99-101... Is there a sense?

...

Oh God, it's even worse.

It means that the index entry is tagged not to a single word instance, but to an entire span of text discussing it.

That's quite reasonable and commonplace, and it is not supported natively by Asciidoctor. Moreover, it will override clause boundaries, and will have to be handled via a starting and ending bookmark in text. It will not be hard to render, but it will be somewhat ugly to mark up.

... I mean... yuck. But yes, it means I'm not done here.

Span will be term, <xref target="A" to="B" pagenumber="true"/> in Presentation XML, index-range:term[B] in markup (A is the location of the macro in text).

@opoudjis
Copy link
Contributor Author

Secondary index terms are needed.

opoudjis added a commit to metanorma/basicdoc-models that referenced this issue Dec 11, 2020
opoudjis added a commit to CalConnect/cc-lightweight-doc that referenced this issue Dec 11, 2020
opoudjis added a commit to metanorma/basicdoc-models that referenced this issue Dec 11, 2020
opoudjis added a commit to metanorma/metanorma-standoc that referenced this issue Dec 16, 2020
opoudjis added a commit to metanorma/metanorma-ietf that referenced this issue Dec 16, 2020
opoudjis added a commit that referenced this issue Dec 16, 2020
@opoudjis
Copy link
Contributor Author

Span will be term, <xref target="A" to="B" pagenumber="true"/> in Presentation XML, index-range:term[B] in markup (A is the location of the macro in text).

And the semantic XML markup shall be <index to="B">...</index>

opoudjis added a commit to metanorma/basicdoc-models that referenced this issue Dec 16, 2020
opoudjis added a commit to metanorma/basicdoc-models that referenced this issue Dec 16, 2020
opoudjis added a commit to CalConnect/cc-lightweight-doc that referenced this issue Dec 16, 2020
@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 16, 2020

Modify Asciidoc: we want the equivalent of (((primary, secondary, tertiary, to))), with optional secondary and tertiary terms. We will represent this as index-range:TO[(((A, B, C)))]

opoudjis added a commit to metanorma/metanorma.org that referenced this issue Dec 16, 2020
opoudjis added a commit to metanorma/metanorma.org that referenced this issue Dec 16, 2020
opoudjis added a commit to metanorma/metanorma-standoc that referenced this issue Dec 16, 2020
opoudjis added a commit to metanorma/metanorma that referenced this issue Dec 16, 2020
@ronaldtse
Copy link
Contributor

Modify Asciidoc: we want the equivalent of (((primary, secondary, tertiary, to))), with optional secondary and tertiary terms. We will represent this as index-range:TO[(((A, B, C)))]

Why not define the concept of a "spanning anchor" and point the index to it?

@opoudjis
Copy link
Contributor Author

... Because the solution I have already implemented is far more elegant than shoving complexity into the target, and making me go through hoops to extract the information again. It is more complicated for both data entry and for processing, it yields minimal conceptual encapsulation at the cost of much confusion, and I reject it.

@opoudjis
Copy link
Contributor Author

@Intelligent2013 This is ready for you to implement. This is a sample index, as featured in the metanorma-bipm rspec:

<clause type="index" id="_"><title>Index</title><clause id="_"><title>D</title><ul><li><em>Dasein</em>, <em>voir</em> Emancipation, &#xEA;tre</li></ul></clause><clause id="_"><title>E</title><ul><li>&#xE9;long&#xE9;,  <xref target="_" to="End" pagenumber="true">chap&#xEE;tre 1</xref></li><li>Emancipation,  <xref target="_" pagenumber="true">chap&#xEE;tre 1</xref>, <xref target="_" pagenumber="true">section 1.1</xref><ul><li>dans la France,  <xref target="_" pagenumber="true">chap&#xEE;tre 1</xref><ul><li>&#xE0; Paris,  <xref target="_" pagenumber="true">section 1.1</xref></li><li>en Bretagne,  <xref target="_" pagenumber="true">chap&#xEE;tre 1</xref></li></ul></li><li>dans les &#xC9;tats-Unis,  <xref target="_" pagenumber="true">section 1.1</xref></li></ul></li><li>&#xEA;tre<ul><li>Husserl, <em>voir</em> zebra, <em>voir aussi</em> Emancipation, zebra<ul><li>en allemand,  <xref target="_" pagenumber="true">chap&#xEE;tre 1</xref></li></ul></li></ul></li></ul></clause><clause id="_"><title>Z</title><ul><li>zebra,  <xref target="_" pagenumber="true">section 1.1</xref></li></ul></clause></clause>

Note that <xref target="_" to="End" pagenumber="true">chap&#xEE;tre 1</xref> is a page range, as I've previous indicated to you; and, as also previously indicated, you are to ignore the contents of `xref[@pagenumber = 'true'], which are intended for use in HTML, since you will be substituting them with page ranges.

opoudjis added a commit that referenced this issue Dec 18, 2020
opoudjis added a commit that referenced this issue Dec 18, 2020
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Dec 19, 2020
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Dec 19, 2020
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Dec 19, 2020
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Dec 19, 2020
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Dec 19, 2020
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Dec 19, 2020
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Dec 19, 2020
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants