digitalmars.D.learn - ddoc and CODE_HIGHLIGHT macro
- Nick Treleaven (16/16) Jul 26 2014 Hi,
- Alix Pexton (13/29) Jul 27 2014 This is because the macro is used within a comment in a code section
- Nick Treleaven (4/39) Jul 27 2014 Interesting, so assuming the site docs were generated on Linux that's
Hi, Ddoc doesn't seem to expand a macro near top of http://dlang.org/hash-map.html: // The $(CODE_HIGHLIGHT KeyType) is string Which is weird because it expands it for 'remove' on this line not far below it: b.remove("hello"); Maybe a bug in dmd? Also, I build some dlang.org docs individually and CODE_HIGHLIGHT is inserting a line break in the html. I think this is because the macro has an empty line after it: CODE_HIGHLIGHT=$(B $(I $0)) MDASH=<nobr> — </nobr> I can't tell from git blame when it was introduced, the website html doesn't show the line break. Is there a workaround, or just remove the empty line?
Jul 26 2014
On 26/07/2014 4:31 PM, Nick Treleaven wrote:Hi, Ddoc doesn't seem to expand a macro near top of http://dlang.org/hash-map.html: // The $(CODE_HIGHLIGHT KeyType) is string Which is weird because it expands it for 'remove' on this line not far below it: b.remove("hello"); Maybe a bug in dmd?This is because the macro is used within a comment in a code section (between lines of hyphens). Macros are normally expanded within code sections, but inside comments they get ignored. I filed an enhancement request. https://issues.dlang.org/show_bug.cgi?id=13211Also, I build some dlang.org docs individually and CODE_HIGHLIGHT is inserting a line break in the html. I think this is because the macro has an empty line after it: CODE_HIGHLIGHT=$(B $(I $0)) MDASH=<nobr> — </nobr> I can't tell from git blame when it was introduced, the website html doesn't show the line break. Is there a workaround, or just remove the empty line?I've reproduced this, it seems it is related to the platform of the file, ie a macro with a blank line after it declared in a file with windows line endings (CR; + LF;) will have a line break on the end but one in file with single character line breaks won't. I filed that one as a bug. https://issues.dlang.org/show_bug.cgi?id=13212 A...
Jul 27 2014
On 27/07/2014 09:44, Alix Pexton wrote:On 26/07/2014 4:31 PM, Nick Treleaven wrote:OK, great.Hi, Ddoc doesn't seem to expand a macro near top of http://dlang.org/hash-map.html: // The $(CODE_HIGHLIGHT KeyType) is string Which is weird because it expands it for 'remove' on this line not far below it: b.remove("hello"); Maybe a bug in dmd?This is because the macro is used within a comment in a code section (between lines of hyphens). Macros are normally expanded within code sections, but inside comments they get ignored. I filed an enhancement request. https://issues.dlang.org/show_bug.cgi?id=13211Interesting, so assuming the site docs were generated on Linux that's why they are OK. Git on Windows checks out the file as CRLF automagically.Also, I build some dlang.org docs individually and CODE_HIGHLIGHT is inserting a line break in the html. I think this is because the macro has an empty line after it: CODE_HIGHLIGHT=$(B $(I $0)) MDASH=<nobr> — </nobr> I can't tell from git blame when it was introduced, the website html doesn't show the line break. Is there a workaround, or just remove the empty line?I've reproduced this, it seems it is related to the platform of the file, ie a macro with a blank line after it declared in a file with windows line endings (CR; + LF;) will have a line break on the end but one in file with single character line breaks won't. I filed that one as a bug. https://issues.dlang.org/show_bug.cgi?id=13212
Jul 27 2014