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

Abstracts are placed outside "info" in DocBook #3602

Closed
gsmecher opened this issue Mar 18, 2020 · 3 comments
Closed

Abstracts are placed outside "info" in DocBook #3602

gsmecher opened this issue Mar 18, 2020 · 3 comments
Assignees
Labels
area/docbook Issues related to DocBook output and the DocBook converter compliance v2.0.21 Issues resolved in the 2.0.21 release
Milestone

Comments

@gsmecher
Copy link

In an attempt to generate a DocBook tag, I'm approximating the advice given in the manual (https://asciidoctor.org/docs/user-manual/#user-abstract):

= Article Title

[abstract]
--
Paragraph 1.

Paragraph 2.
--

== First Section

In a DocBook flow, this ends up non-compliant XML:

$ asciidoctor -b docbook5 test.adoc
$ jing docbook.rng test.xml
test.xml:9:30: error: element "abstract" not allowed here; expected element "acknowledgements", "address", "anchor", "annotation", "appendix", "bibliography", "bibliolist", "blockquote", "bridgehead", "calloutlist", "caution", "classsynopsis", "cmdsynopsis", "colophon", "constraintdef", "constructorsynopsis", "destructorsynopsis", "epigraph", "equation", "example", "fieldsynopsis", "figure", "formalpara", "funcsynopsis", "glossary", "glosslist", "important", "index", "indexterm", "informalequation", "informalexample", "informalfigure", "informaltable", "itemizedlist", "literallayout", "mediaobject", "methodsynopsis", "msgset", "note", "orderedlist", "para", "procedure", "productionset", "programlisting", "programlistingco", "qandaset", "refentry", "remark", "revhistory", "screen", "screenco", "screenshot", "sect1", "section", "segmentedlist", "sidebar", "simpara", "simplelist", "simplesect", "synopsis", "table", "task", "tip", "toc", "variablelist" or "warning"

The DocBook XML is pretty straightforward:

<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc?>
<?asciidoc-numbered?>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>Article Title</title>
<date>2020-03-18</date>
</info>
<abstract>
<simpara>Paragraph 1.</simpara>
<simpara>Paragraph 2.</simpara>
</abstract>
<section xml:id="_first_section">
<title>First Section</title>

</section>
</article>

The "abstract" tag falls outside the "info" scope, where it's not allowed.

Thanks (as always) for your hard work on asciidoctor. It's an amazing tool.

@graphitefriction graphitefriction added the area/docbook Issues related to DocBook output and the DocBook converter label Apr 9, 2021
@mojavelinux
Copy link
Member

mojavelinux commented Oct 27, 2023

Ah, this was a change in DocBook 5. (See https://tdg.docbook.org/tdg/4.5/abstract vs https://tdg.docbook.org/tdg/5.1/abstract) It was allowed as child of article in DocBook 4.5.

Since the DocBook 4.5 converter was created first, the DocBook 5 converter inherited this placement. Now that the DocBook 4.5 converter has been pulled out of this repository, we can make this update directly to the DocBook 5 converter without the need for any special logic.

@mojavelinux
Copy link
Member

mojavelinux commented Oct 27, 2023

I'll admit, this change is really unfortunate because it breaks the document traversal that the converter does. There's an assumption in that hierarchy that the abstract is part of the body, not the header. And there's a lot of places the abstract can be defined that we now have to account for.

mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Oct 27, 2023
@mojavelinux mojavelinux self-assigned this Oct 27, 2023
@mojavelinux mojavelinux added this to the v2.0.x milestone Oct 27, 2023
@mojavelinux
Copy link
Member

The only way I could figure out how to do this is to remove the abstract from the document tree then restore it afterwards. It's not pretty, but it gets the job done.

mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Oct 27, 2023
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Feb 19, 2024
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Feb 19, 2024
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Feb 19, 2024
@mojavelinux mojavelinux added v2.0.21 Issues resolved in the 2.0.21 release compliance labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docbook Issues related to DocBook output and the DocBook converter compliance v2.0.21 Issues resolved in the 2.0.21 release
Projects
None yet
Development

No branches or pull requests

3 participants