ietf-tools / xml2rfc

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
https://ietf-tools.github.io/xml2rfc/
BSD 3-Clause "New" or "Revised" License
69 stars 38 forks source link

seeking a better way to have a blank line followed by an indented dl #985

Open alicerusso opened 1 year ago

alicerusso commented 1 year ago

Description

Summary: We used <t><br/></t> to get the desired output. Seems that ideally we wouldn't use <br/> for this case. Would be helpful to be able to indent a whole <dl>. Example: https://www.rfc-editor.org/authors/rfc9381.html (e.g., section 4, 4.1, 4.2, 4.3, and others)

Details: For example (original):

   Parameters used:

      (n, e) - RSA public key

      K - RSA private key (its representation is implementation-
      dependent)

      k - length in octets of the RSA modulus n (k must be less than
      2^32)

   Fixed options (specified in Section 4.4):

      Hash - cryptographic hash function

      hLen - output length in octets of hash function Hash

      suite_string - an octet string specifying the RSA-FDH-VRF
      ciphersuite, which determines the above options

With the assumption that we'd like the nested lists to be <dl> bc it's accurate semantically, here are some options: (test files were updated only for the portion above above) A) <dl> for outer items, then nested <dl>

B) <ul bare="true" empty="true"> <li> for outer items, each of which has a nested <dl>

C) <t> for outer items, then a <dl>.

What was done in the original (draft-irtf-cfrg-vrf-15.xml) D) <t> for outer items, then a <ul empty="true">

Potential improvements here

Code of Conduct

cabo commented 1 year ago

On 2023-04-24, at 23:21, Alice Russo @.***> wrote:

B)

  • for outer items, each of which has a nested

I don’t know what @bare is, but @empty is the right way to do this.

• Con: yields good text output, but bad HTML and PDF (bc the

s are not indented)

Can you simply get rid of the bare=“true” (whatever that is)?

v2v3 generates this for me:

  <t>outdented</t>
  <ul empty="true">
    <li>
      <dl>
        <dt>quoted:</dt>
        <dd>
          <t>foo</t>
        </dd>
        <dt>more quoted:</dt>
        <dd>
          <t>bar</t>
        </dd>
      </dl>
    </li>
  </ul>
  <t>outdented</t>

Grüße, Carsten

JayDaley commented 1 year ago

For case C) there is a more general solution that could solve both this and support many other use cases.

As we know, lists are often nested and when those are rendered, each inner list is visually distinct from its outer list, generally through indenting. However, there are many situations when nesting is not possible in the XML, but a list still needs to be rendered as if it were an inner list (e.g. indented). There are also situations where it is necessary to override the automatic separation of inner from outer lists.

Both of these can be achieved by an attribute such as "level-override" added to "dl", "ul" and "ol", which takes a number from 1-5. For now, the only effect of that would be to override the level of indent of the whole list.

cabo commented 1 year ago

On 2023-04-24, at 23:21, Alice Russo @.***> wrote:

a new attribute on

to indicate "put a blank line after dt" (this is not accomplished with newline="true”)

This probably should be a form of newline=“2”

Grüße, Carsten