Bug 9731 – Ddoc should output per-paragraph macro instead of $(DDOC_BLANKLINE)

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-15T10:20:38Z
Last change time
2017-08-16T13:23:21Z
Keywords
ddoc, pull
Assigned to
No Owner
Creator
hsteoh
Blocks
2060

Comments

Comment #0 by hsteoh — 2013-03-15T10:20:38Z
Currently, ddoc does not have a direct way of identifying paragraphs in ddoc comments. The only thing support right now is $(DDOC_BLANKLINE), which defaults to <br><br>. This (more-or-less) works for HTML output, but it doesn't work so well for more semantically-driven output formats that want to know paragraph boundaries explicitly. There is a way to hack this to work in HTML by defining DDOC_BLANKLINE=</p><p> and DDOC_SECTION=<p>$0</p>, but this doesn't work if you define DDOC_SECTION_H=<h4>$0</h4>, because then the h4 is nested inside the p, which is non-compliant. Basically, there is no way to correctly support correct element nesting in HTML (or other strictly-nested formats like DocBook) without post-processing (e.g., set DDOC_BLANKLINE to some marker string that gets substituted by an external tool with suitable open/close tags depending on the surrounding context). It would be nice if ddoc could output macros based on paragraph boundaries rather than linebreaks, say $(DDOC_PARAGRAPH) or something similar, so that translation into other formats than HTML 4.x is easier.
Comment #1 by hsteoh — 2014-12-31T00:40:44Z
Andrei proposed on the forum a backward-compatible fix, wherein $(DDOC_BLANKLINE) continues to be emitted, but paragraphs are also wrapped in a paragraph macro.
Comment #2 by hsteoh — 2015-01-25T17:17:59Z
Comment #3 by github-bugzilla — 2015-01-26T04:53:37Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0f97ab5a73241782cc7e621ddca22b6b35909d6b Merge pull request #4338 from quickfur/ddoc_para Issue 9731: implement $(DDOC_PARAGRAPH)
Comment #4 by github-bugzilla — 2015-01-26T07:57:24Z
Commit pushed to revert-4338-ddoc_para at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a7a7095bbbc30021852295eb7ffd1077cc5587c4 Revert "Issue 9731: implement $(DDOC_PARAGRAPH)"
Comment #5 by github-bugzilla — 2015-01-26T14:41:57Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a7a7095bbbc30021852295eb7ffd1077cc5587c4 Revert "Issue 9731: implement $(DDOC_PARAGRAPH)" https://github.com/D-Programming-Language/dmd/commit/3208762f9720ec97b986033be00b11f075763c9f Merge pull request #4342 from D-Programming-Language/revert-4338-ddoc_para Revert "Issue 9731: implement $(DDOC_PARAGRAPH)"
Comment #6 by andrei — 2017-07-04T16:54:26Z
Comment #7 by github-bugzilla — 2017-07-04T16:57:39Z
Commit pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f197169c5a573a3dcef72fac503a35b724775082 Fix Issue 9731 - Ddoc should output per-paragraph macro instead of $(DDOC_BLANKLINE)
Comment #8 by github-bugzilla — 2017-08-07T13:17:17Z
Commit pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f197169c5a573a3dcef72fac503a35b724775082 Fix Issue 9731 - Ddoc should output per-paragraph macro instead of $(DDOC_BLANKLINE)
Comment #9 by github-bugzilla — 2017-08-16T13:23:21Z
Commit pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f197169c5a573a3dcef72fac503a35b724775082 Fix Issue 9731 - Ddoc should output per-paragraph macro instead of $(DDOC_BLANKLINE)