Skip to content

Conversation

michaelpj
Copy link
Contributor

Fixes #1234.

This parses admonitions not as a blockquote, but rather as a div with an
appropriate class. We also handle titles for admonitions as a nested div
with the "title" class.

(I followed the behaviour of other docbook-to-html converters in this -
there are clearly other ways you could encode it.)

In general, the handling of elements with nested title elements is very
inconsistent. I think we should make it consistent, but I'm leaivng that
for later to make this a small change.

Example:

<warning xml:id="someId">
<title>My title</title>
<simpara>An admonition block</simpara>
</warning>

goes to

<div id="someId" class="warning">
<div class="title">My title</div>
<p>An admonition block</p>
</div>

Fixes jgm#1234.

This parses admonitions not as a blockquote, but rather as a div with an
appropriate class. We also handle titles for admonitions as a nested div
with the "title" class.

(I followed the behaviour of other docbook-to-html converters in this -
there are clearly other ways you could encode it.)

In general, the handling of elements with nested title elements is very
inconsistent. I think we should make it consistent, but I'm leaivng that
for later to make this a small change.

Example:
```docbook
<warning xml:id="someId">
<title>My title</title>
<simpara>An admonition block</simpara>
</warning>
```

goes to

```html
<div id="someId" class="warning">
<div class="title">My title</div>
<p>An admonition block</p>
</div>
```
@mb21
Copy link
Collaborator

mb21 commented Jun 18, 2019

Thanks! Maybe you could add a test case to tests/commands/1234.md? (yes, that's the issue number)

@jgm
Copy link
Owner

jgm commented Jun 25, 2019

For comparison, pandoc's current output for this is

<blockquote>
<p><strong>Warning</strong></p>
<p>An admonition block</p>
</blockquote>

This has the advantage of giving a better render out of the box, without special CSS, but in other respects it's inferior.

@jgm jgm merged commit 9b5082b into jgm:master Aug 23, 2019
@jgm
Copy link
Owner

jgm commented Aug 23, 2019

Thanks!

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

Successfully merging this pull request may close these issues.

DocBook: admonition-like environments
3 participants