Bug 16110 – ddoc should emit paragraphs not hard-coded line-breaks

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-06-01T10:09:27Z
Last change time
2024-12-13T18:48:14Z
Assigned to
No Owner
Creator
Seb
Moved to GitHub: dmd#19137 →

Comments

Comment #0 by greensunny12 — 2016-06-01T10:09:27Z
There are many pages which are not visually appealing, like https://dlang.org/phobos/std_format.html http://dlang.org/phobos/std_digest_md.html http://dlang.org/phobos/std_bigint.html http://dlang.org/phobos/std_datetime.html http://dlang.org/phobos/std_experimental_logger.html ... For a detailed list either browse the docs or see [1]. Imho ddoc should learn from the markdown approach and translate block to paragraphs and not insert hard-coded newlines. a b c <p>a b c</p> https://daringfireball.net/projects/markdown/syntax#p [1] https://github.com/dlang/phobos/pull/4358/files
Comment #1 by ag0aep6g — 2016-06-01T10:46:16Z
(In reply to greensunny12 from comment #0) > There are many pages which are not visually appealing, like > > https://dlang.org/phobos/std_format.html > http://dlang.org/phobos/std_digest_md.html > http://dlang.org/phobos/std_bigint.html > http://dlang.org/phobos/std_datetime.html > http://dlang.org/phobos/std_experimental_logger.html > ... For the visuals I have a pull request against dlang.org: https://github.com/dlang/dlang.org/pull/1317 The generated HTML still isn't the nicest, though. > For a detailed list either browse the docs or see [1]. > > Imho ddoc should learn from the markdown approach and translate block to > paragraphs and not insert hard-coded newlines. > > a > b > c > > <p>a b c</p> One problem with that is that Ddoc isn't aware of lists, tables, etc. It can't emit a <p> element for every paragraph it sees, because what's a paragraph to Ddoc may become a list in HTML which must not be wrapped in <p>. Making Ddoc drastically more content aware, i.e. going full Markdown, would be a solution. It would need to be a separate documentation generator, though. A sort of Ddoc2 with a opt-in compiler switch. Another, less principled solution could be to emit something like <div class="ddoc-paragraph"> instead of <p>. That is, Ddoc wraps every paragraph it sees in a `DDOC_PARAGRAPH` macro with a nop default definition: DDOC_PARAGRAPH = $0 On dlang.org, we then redefine things like so: DDOC_BLANKLINE = DDOC_PARAGRAPH = <div class="ddoc-paragraph">$0</div>
Comment #2 by robert.schadek — 2024-12-13T18:48:14Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19137 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB