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

convert unnumbered sections to docbook's <simplesect> #1402

Closed
miekg opened this issue Jul 3, 2014 · 8 comments · Fixed by #8481
Closed

convert unnumbered sections to docbook's <simplesect> #1402

miekg opened this issue Jul 3, 2014 · 8 comments · Fixed by #8481

Comments

@miekg
Copy link

miekg commented Jul 3, 2014

Right now an unnumbered section: # section {-}

is just converted to a <sectX>. I think it makes sense to convert it to a <simplesect> or maybe a <section> to distinguish it from normal section in the docbook output.

@mpickering
Copy link
Collaborator

Can you please post a source file indicating exactly what you mean by an unumbered section and the command you are using to convert to DocBook.

@miekg
Copy link
Author

miekg commented Jul 3, 2014

% pandoc -t docbook <(echo '# A Section {-}')
<sect1 id="a-section">
  <title>A Section</title>
  <para>
  </para>
</sect1>

And then my proposal is to make this an <simplesect/section>, although no good docbook equivalent exists.

@jgm
Copy link
Owner

jgm commented Jul 5, 2014

simplesect is for sections with no subsections. But pandoc unnumbered sections can have subsections. So that's not a good solution. section could be used, I suppose, but I'm not sure about how section and sectN would interact.

@jgm
Copy link
Owner

jgm commented Jul 5, 2014

Would it be sufficient if the section tag had an attribute that indicated it was not to be numbered? Is there an appropriate docbook attribute, allowed on sectN tags, that would have this meaning?

@miekg
Copy link
Author

miekg commented Jul 5, 2014

Looking through the DocBook spec, there is nothing obvious, however the following seems legal:

<sect1>
    <info role="text"/>
    ....
 </sect1>

Where I propose to make "text" -> "unnumered"

refs:

http://www.docbook.org/tdg5/en/html/sect1.html
http://docbook.org/tdg5/en/html/ref-elements.html#common.attributes

@miekg
Copy link
Author

miekg commented Jul 10, 2014

I can work around this by abusing anchor names, like

# section {#nonumber0}

And check for that in the DocBook output.

@lifeunleaded
Copy link
Contributor

I would say that is best solved by adding role="unnumbered" to the section. Section labelling (i.e. numbering) is controlled by the XSLT stylesheets in DocBook, so not numbering an individual section (rather than stop at a certain depth) would be implemented in a stylesheet customization. But marking the relevant sections would at least allow a custom stylesheet to match precisely.

lifeunleaded added a commit to lifeunleaded/pandoc that referenced this issue Dec 10, 2022
Markdown allows marking a heading as unnumbered, which is stored
as a class token internally. This change will recognize this
particular class token and append it to the role attribute, or
create a role attribute with it if needed. This does not imply
any processing in DocBook but is intended to let customized
stylesheets identify these sections and act accordingly.

fixes jgm#1402
@lifeunleaded
Copy link
Contributor

I made a commit that failed tests; this was because I didn't think a push to my fork would trigger the CI. I've identified the tests failing locally and have a fix coming.

lifeunleaded added a commit to lifeunleaded/pandoc that referenced this issue Dec 11, 2022
Markdown allows marking a heading as unnumbered, which is stored
as a class token internally. This change will recognize this
particular class token and append it to the role attribute, or
create a role attribute with it if needed. This does not imply
any processing in DocBook but is intended to let customized
stylesheets identify these sections and act accordingly.

fixes jgm#1402
lifeunleaded added a commit to lifeunleaded/pandoc that referenced this issue Jan 2, 2023
Markdown allows marking a heading as unnumbered, which is stored
as a class token internally. This change will recognize this
particular class token and append it to the role attribute, or
create a role attribute with it if needed. This does not imply
any processing in DocBook but is intended to let customized
stylesheets identify these sections and act accordingly.

fixes jgm#1402
lifeunleaded added a commit to lifeunleaded/pandoc that referenced this issue Jan 2, 2023
Markdown allows marking a heading as unnumbered, which is stored
as a class token internally. This change will recognize this
particular class token and append it to the role attribute, or
create a role attribute with it if needed. This does not imply
any processing in DocBook but is intended to let customized
stylesheets identify these sections and act accordingly.

fixes jgm#1402
@jgm jgm closed this as completed in #8481 Jan 13, 2023
jgm pushed a commit that referenced this issue Jan 13, 2023
Markdown allows marking a heading as unnumbered, which is stored
as a class token internally. This change will recognize this
particular class token and append it to the role attribute, or
create a role attribute with it if needed. This does not imply
any processing in DocBook but is intended to let customized
stylesheets identify these sections and act accordingly.

Closes #1402
liruqi pushed a commit to chinapedia/pandoc that referenced this issue Mar 3, 2023
Markdown allows marking a heading as unnumbered, which is stored
as a class token internally. This change will recognize this
particular class token and append it to the role attribute, or
create a role attribute with it if needed. This does not imply
any processing in DocBook but is intended to let customized
stylesheets identify these sections and act accordingly.

Closes jgm#1402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants