From 474592969345c99ac9befe3cbbea6d6005ba5306 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Wed, 17 Aug 2022 11:53:13 +1000 Subject: [PATCH 1/4] chore: yestests --- tests/valid/docfile.html | 12 ++++++------ tests/valid/draft-miek-test.html | 8 ++++---- tests/valid/draft-template.html | 8 ++++---- tests/valid/indexes.pages.text | 12 ++++++------ tests/valid/indexes.prepped.xml | 8 ++++---- tests/valid/indexes.text | 6 +++--- tests/valid/indexes.v3.html | 10 +++++----- tests/valid/manpage.txt | 10 +++++----- tests/valid/rfc7911.html | 8 ++++---- tests/valid/sourcecode.pages.text | 14 +++++++------- tests/valid/sourcecode.prepped.xml | 8 ++++---- tests/valid/sourcecode.text | 6 +++--- tests/valid/sourcecode.v3.html | 10 +++++----- 13 files changed, 60 insertions(+), 60 deletions(-) diff --git a/tests/valid/docfile.html b/tests/valid/docfile.html index a0c1481b4..d19f6125b 100644 --- a/tests/valid/docfile.html +++ b/tests/valid/docfile.html @@ -4,15 +4,15 @@ -Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.13.1 +Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.14.0 - - + + @@ -45,7 +45,7 @@ -

Xml2rfc Vocabulary Version 3 Schema
xml2rfc release 3.13.1

+

Xml2rfc Vocabulary Version 3 Schema
xml2rfc release 3.14.0

Abstract

@@ -367,7 +367,7 @@

The latest version of this documentation is available in HTML form at https://ietf-tools.github.io/xml2rfc/.

- This documentation applies to xml2rfc version 3.13.1.

+ This documentation applies to xml2rfc version 3.14.0.

@@ -6351,7 +6351,7 @@

The following variables are available for use in an xml2rfc - manpage Jinja2 template, as of xml2rfc version 3.13.1:

+ manpage Jinja2 template, as of xml2rfc version 3.14.0:

{{ bare_latin_tags }}:
diff --git a/tests/valid/draft-miek-test.html b/tests/valid/draft-miek-test.html index 1e05ee171..49492bc36 100644 --- a/tests/valid/draft-miek-test.html +++ b/tests/valid/draft-miek-test.html @@ -16,7 +16,7 @@ This version is adapted to work with "xml2rfc" version 2.x. ' name="description"> - + @@ -26,8 +26,8 @@ diff --git a/tests/valid/draft-template.html b/tests/valid/draft-template.html index 98ab0f509..9fe80af7d 100644 --- a/tests/valid/draft-template.html +++ b/tests/valid/draft-template.html @@ -11,12 +11,12 @@ Insert an abstract: MANDATORY. This template is for creating an Internet Draft. " name="description"> - + diff --git a/tests/valid/indexes.pages.text b/tests/valid/indexes.pages.text index a6e6aa32f..c1db2ca02 100644 --- a/tests/valid/indexes.pages.text +++ b/tests/valid/indexes.pages.text @@ -3,9 +3,9 @@ Network Working Group H. Person, Ed. -Internet-Draft August 9, 2022 +Internet-Draft August 17, 2022 Intended status: Experimental -Expires: February 10, 2023 +Expires: February 18, 2023 xml2rfc index tests @@ -26,7 +26,7 @@ Status of This Memo time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on February 10, 2023. + This Internet-Draft will expire on February 18, 2023. Copyright Notice @@ -53,7 +53,7 @@ Table of Contents -Person Expires February 10, 2023 [Page 1] +Person Expires February 18, 2023 [Page 1] Internet-Draft xml2rfc index tests August 2022 @@ -109,7 +109,7 @@ Index -Person Expires February 10, 2023 [Page 2] +Person Expires February 18, 2023 [Page 2] Internet-Draft xml2rfc index tests August 2022 @@ -165,4 +165,4 @@ Author's Address -Person Expires February 10, 2023 [Page 3] +Person Expires February 18, 2023 [Page 3] diff --git a/tests/valid/indexes.prepped.xml b/tests/valid/indexes.prepped.xml index 1bb3839a9..75cc9383d 100644 --- a/tests/valid/indexes.prepped.xml +++ b/tests/valid/indexes.prepped.xml @@ -1,6 +1,6 @@ - - + + @@ -20,7 +20,7 @@ - +
Status of This Memo @@ -41,7 +41,7 @@ material or to cite them other than as "work in progress." - This Internet-Draft will expire on 10 February 2023. + This Internet-Draft will expire on 18 February 2023.
diff --git a/tests/valid/indexes.text b/tests/valid/indexes.text index 75e4440ec..e562eb62f 100644 --- a/tests/valid/indexes.text +++ b/tests/valid/indexes.text @@ -3,9 +3,9 @@ Network Working Group H. Person, Ed. -Internet-Draft August 9, 2022 +Internet-Draft August 17, 2022 Intended status: Experimental -Expires: February 10, 2023 +Expires: February 18, 2023 xml2rfc index tests @@ -26,7 +26,7 @@ Status of This Memo time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on February 10, 2023. + This Internet-Draft will expire on February 18, 2023. Copyright Notice diff --git a/tests/valid/indexes.v3.html b/tests/valid/indexes.v3.html index 927e2e045..fe30da994 100644 --- a/tests/valid/indexes.v3.html +++ b/tests/valid/indexes.v3.html @@ -6,7 +6,7 @@ xml2rfc index tests - + @@ -23,7 +23,7 @@ Person -Expires February 10, 2023 +Expires February 18, 2023 [Page] @@ -36,12 +36,12 @@
indexes-00
Published:
- +
Intended Status:
Experimental
Expires:
-
+
Author:
@@ -71,7 +71,7 @@

time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

- This Internet-Draft will expire on February 10, 2023.

+ This Internet-Draft will expire on February 18, 2023.

def render_section(self, h, x): - section = add(x.tag, h, x) anchor = x.get('anchor') + if anchor == 'rfc.index': + cls = 'index' + else: + cls = '' + section = add(x.tag, h, x, classes=cls) if anchor == 'toc': add.a(section, None, "\u25b2", href="#", onclick="scroll(0,0)", classes="toplink") for c in x.getchildren(): diff --git a/xml2rfc/writers/preptool.py b/xml2rfc/writers/preptool.py index 89da1685f..5208e7d53 100644 --- a/xml2rfc/writers/preptool.py +++ b/xml2rfc/writers/preptool.py @@ -2232,7 +2232,7 @@ def index_sort(letters): # done defining helpers, resume back_insert_index() flow if self.index_entries and self.root.get('indexInclude') == 'true': - index = self.element('section', numbered='false', toc='include') + index = self.element('section', numbered='false', toc='include', anchor='rfc.index') name = self.element('name') name.text = 'Index' index.append(name) From baa15ec68828ab5b44380f77283e3a953693eed7 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Wed, 17 Aug 2022 16:47:02 +1000 Subject: [PATCH 3/4] fix: minimal fixes for .index styling This removes a bug where entries would overlap their label. It deletes a defunct .indexIndex rule that did nothing even when enabled. It removes the `-moz-` prefix on the two column code, which is long unsupported, even in Firefox. --- xml2rfc/data/xml2rfc.css | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/xml2rfc/data/xml2rfc.css b/xml2rfc/data/xml2rfc.css index 9adbd4a23..eba61301e 100644 --- a/xml2rfc/data/xml2rfc.css +++ b/xml2rfc/data/xml2rfc.css @@ -420,25 +420,18 @@ nav.toc li { } .index li { margin: 0; - text-indent: -2em; padding-left: 2em; padding-bottom: 5px; } -.indexIndex { - margin: 0.5em 0 1em; -} -.index a { - font-weight: 700; -} /* make the index two-column on all but the smallest screens */ @media (min-width: 600px) { .index ul { - -moz-column-count: 2; - -moz-column-gap: 20px; + column-count: 2; + column-gap: 20px; } .index ul ul { - -moz-column-count: 1; - -moz-column-gap: 0; + column-count: 1; + column-gap: 0; } } From b89f8ec49ac29a56c40b167e36fe2e42fdb4fd34 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Wed, 17 Aug 2022 16:51:11 +1000 Subject: [PATCH 4/4] test: fix tests to expect index anchors and classes --- tests/valid/indexes.prepped.xml | 4 +-- tests/valid/indexes.v3.html | 54 +++++++++++++++++---------------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/tests/valid/indexes.prepped.xml b/tests/valid/indexes.prepped.xml index 75cc9383d..763649824 100644 --- a/tests/valid/indexes.prepped.xml +++ b/tests/valid/indexes.prepped.xml @@ -1,5 +1,5 @@ - + @@ -198,7 +198,7 @@ -
+
Index A diff --git a/tests/valid/indexes.v3.html b/tests/valid/indexes.v3.html index fe30da994..ac163654c 100644 --- a/tests/valid/indexes.v3.html +++ b/tests/valid/indexes.v3.html @@ -228,7 +228,8 @@

-
+
+

Index

@@ -243,14 +244,14 @@

S T

-
    -
  • +
      +
    • A

      -
        -
      • +
          +
        • annotation
          @@ -274,13 +275,13 @@

      • -
      • +
      • B

        -
          -
        • +
            +
          • blockquote
            @@ -292,13 +293,13 @@

        • -
        • +
        • D

          -
            -
          • +
              +
            • dd
              @@ -316,13 +317,13 @@

          • -
          • +
          • E

            -
              -
            • +
                +
              • em
                @@ -334,13 +335,13 @@

            • -
            • +
            • F

              -
                -
              • +
                  +
                • figure
                  @@ -352,13 +353,13 @@

              • -
              • +
              • L

                -
                  -
                • +
                    +
                  • li
                    @@ -385,13 +386,13 @@

                • -
                • +
                • S

                  -
                    -
                  • +
                      +
                    • section
                      @@ -421,13 +422,13 @@

                  • -
                  • +
                  • T

                    -
                      -
                    • +
                        +
                      • t
                        @@ -484,6 +485,7 @@

+