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

[Bug] Embedded code is not part of examples #24

Open
Geod24 opened this issue Sep 28, 2015 · 0 comments
Open

[Bug] Embedded code is not part of examples #24

Geod24 opened this issue Sep 28, 2015 · 0 comments
Assignees

Comments

@Geod24
Copy link
Member

Geod24 commented Sep 28, 2015

I took a fresh look at the docs and what DMD is doing. We currently make embedded code (aka code within ---) as belonging to the examples section where they really aren't (I've no idea why I implemented it this way to start with).

DMD is really doing the right thing here. I tried with the command dmd -c -Dffoo.html test.d debug.ddoc
debug.ddoc:

DDOC=$(BODY)
DDOC_SUMMARY=[SUMMARY $0]
DDOC_DESCRIPTION=[DESCRIPTION $0]
DDOC_THROWS=[THROWS $0]

test.d:

/**
 * Module title
 *
 * This is the description
 * ----
 * // This really is part of the description
 * ----
 * Moar description
 *
 * Throws:
 * Exception obviously
 * ---
 * auto exception = new Exception("This is part of Throws too");
 * ---
 */
module doc.test;

Output:

<!-- Generated by Ddoc from test.d -->
[SUMMARY Module title
]
[DESCRIPTION  This is the description
<pre class="d_code"><font color=green>// This really is part of the description
</font></pre>
 Moar description

]
[THROWS  Exception obviously
<pre class="d_code"><font color=blue>auto</font> exception = <font color=blue>new</font> Exception(<font color=red>"This is part of Throws too"</font>);
</pre>
]

This should hopefully simplify section parsing quite a bit. Will it have a big impact on harbored ?

@Hackerpilot Hackerpilot self-assigned this Sep 28, 2015
Geod24 referenced this issue Sep 29, 2015
@Geod24 Geod24 changed the title Embedded code is not part of examples [Bug] Embedded code is not part of examples Sep 29, 2015
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

No branches or pull requests

2 participants