On 1/5/13 4:38 PM, Philippe Sigaud wrote:
> Btw, I just played a bit with macros and defined a small bunch of
> LaTex-producing macros. I'll post that.
>
> It doesn't help that DMD inserts a HTML comment at the beginning:
>
> <!-- Generated by Ddoc from filename.d -->
>
> HTML hardwired into the final result, whatever the doc says :(

Yah, I also played with producing LaTeX and hit the same problem. Had to
sed away the first line. Walter, could you please fix that - thanks.

Philippe, please share with me as soon as you have anything significant
done in terms of LaTeX production so we don't overlap work.

Thanks,

Andrei

On 1/5/2013 2:50 PM, Philippe Sigaud wrote:
> I must be tired, because the only .ddoc file I find is std.ddoc. No .d article
> on templates, etc: only the .html files.

https://github.com/D-Programming-Language/d-programming-language.org

On 1/5/2013 3:44 PM, Andrei Alexandrescu wrote:
> On 1/5/13 4:38 PM, Philippe Sigaud wrote:
>> Btw, I just played a bit with macros and defined a small bunch of
>> LaTex-producing macros. I'll post that.
>>
>> It doesn't help that DMD inserts a HTML comment at the beginning:
>>
>> <!-- Generated by Ddoc from filename.d -->
>>
>> HTML hardwired into the final result, whatever the doc says :(
>
> Yah, I also played with producing LaTeX and hit the same problem. Had to sed
> away the first line. Walter, could you please fix that - thanks.

C:>grep DDOC_COMMENT *.c
doc.c:DDOC_COMMENT   = <!-- $0 -->\n\ doc.c: buf.printf("$(DDOC_COMMENT Generated by Ddoc from %s)\n",
srcfile->toChars());

I.e. override the DDOC_COMMENT macro.

On 1/5/13 5:17 PM, Walter Bright wrote:
> On 1/5/2013 1:32 PM, Philippe Sigaud wrote:
>> What should it be? Some module to define text transformations?
>> std.regex does
>> this quite well.
>
>
> A text macro system is not std.regex at all. What std.textmacro should
> be is a range that takes a text input stream, an associative array of
> NAME=VALUE pairs, and it outputs a text range with the macros having
> been expanded.

Example: http://www.stringtemplate.org/

Andrei

On 1/5/2013 7:15 PM, Andrei Alexandrescu wrote:
> On 1/5/13 5:17 PM, Walter Bright wrote:
>> On 1/5/2013 1:32 PM, Philippe Sigaud wrote:
>>> What should it be? Some module to define text transformations?
>>> std.regex does
>>> this quite well.
>>
>>
>> A text macro system is not std.regex at all. What std.textmacro should
>> be is a range that takes a text input stream, an associative array of
>> NAME=VALUE pairs, and it outputs a text range with the macros having
>> been expanded.
>
> Example: http://www.stringtemplate.org/

I like the range method better.

On Sun, Jan 6, 2013 at 1:40 AM, Walter Bright <newshound2@digitalmars.com>wrote:

> On 1/5/2013 2:50 PM, Philippe Sigaud wrote:
>
>> I must be tired, because the only .ddoc file I find is std.ddoc. No .d
>> article
>> on templates, etc: only the .html files.
>>
>
> https://github.com/D-**Programming-Language/d-**programming-language.org<https://github.com/D-Programming-Language/d-programming-language.org>
>

Oh, .dd files! I did not search for those, I didn't even know they existed.

Thanks, now I can look how you did some linking and layout.

> Philippe, please share with me as soon as you have anything significant
> done in terms of LaTeX production so we don't overlap work.
>
>
Nothing significant yet, that's my first dib into macro.
I use these, but have a problem for code highlighting: DMD inserts macros
to colour the code, these don't play well with my usual solutions (package
pygmentize or package listings). The same for \verbatim{} instruction.
Here, I just used a simple \texttt{} instruction, but in this case curly
braces are lost :(

B=\textbf{$0} I=\textit{$0}
U=\underline{$0} P=$0
DL=\begin{description}
$0 \end{description} DT=\item[$0]
DD=$0 TABLE=\begin{tabular}[2]{l|l}$0
\end{tabular}
TR=$0 \\ TH=$0 &
TD=$0 OL=\begin{enumerate}$0
\end{enumerate}
UL=\begin{itemize}
$0 \end{itemize} LI=\item$0
BIG=\large{$0} SMALL=\small{$0}
BR=\newline
LINK=\url{$0} LINK2=\href{$1}{$+} RED={\color{red}$0}
BLUE={\color{blue}$0} GREEN={\color{green}$0}
YELLOW={\color{yellow}$0} BLACK={\color{black}$0}
WHITE={\color{white}$0} D_CODE=\texttt{$0}
DDOC_PSYMBOL = $(U$0)
DDOC_ANCHOR = \label{$1} DDOC_DECL =$(DT $0) XREF =$(REF std_$1.html#$2, $(D std.$1.$2)) CXREF =$(REF core_$1.html#$2, $(D core.$1.$2)) LREF = \hyperref[$1]{$1} DDOC=\documentclass[11pt]{article} \usepackage{color} \usepackage{hyperref} \begin{document} \title{$(TITLE)}
\date{}
\maketitle

\$(BODY)
\end{document}

On 1/4/13 7:53 PM, Andrei Alexandrescu wrote:
> Now that the issue of documentation came up, I wonder if there's
> interest in a high-quality PDF rendering of the language spec (e.g.
> similar to the interior design of TDPL itself). Is it worth the effort?
>
> Thanks,
>
> Andrei

I just pushed the first passable PDF documentation generated via LaTeX
with ddoc: http://goo.gl/QIP4t. For now I'm only rendering the TOC and
lex.dd, but at this time we have enough seed for anyone interested to
convert other files.

Take a look at the generated PDF: http://erdani.com/d/dlangspec.pdf

Andrei

On 1/8/2013 2:51 PM, Andrei Alexandrescu wrote:
> I just pushed the first passable PDF documentation generated via LaTeX with
> ddoc: http://goo.gl/QIP4t. For now I'm only rendering the TOC and lex.dd, but at
> this time we have enough seed for anyone interested to convert other files.
>
> Take a look at the generated PDF: http://erdani.com/d/dlangspec.pdf
>
>
> Andrei

Looks good to me.

It's also good to keep in mind that when I prepared the kindle version, which
has a small screen, I had to rather ruthlessly pare down the length of
preformatted lines like the code examples.

On Wed, Jan 9, 2013 at 12:12 AM, Walter Bright
<newshound2@digitalmars.com> wrote:
>> Take a look at the generated PDF: http://erdani.com/d/dlangspec.pdf

> Looks good to me.

Yes, that has indeed quite a palatable appearance. I see you defined 2
or 3-cols tables, that's a good idea. Too bad DDoc macros do not
accept numerical arguments :) I guess in the end a 4-cols version will
be necessary, if only for the big tables in std.algorithm.

I also like your use of the listings package. How did you 'disable'
the automatic colouring DMD insert in code samples?

> It's also good to keep in mind that when I prepared the kindle version,
> which has a small screen, I had to rather ruthlessly pare down the length of
> preformatted lines like the code examples.

Same here. I have a big tutorial on templates on github. Following
your advice, Walter, I found ways to convert it into .epub or .mobi (I
converted it from LaTex to Markdown). And, indeed, even 60-chars lines
tend to be too long for these screens. That's a pretty harsh limit! I
still have to scan the entire doc to find the longest lines.

Maybe I can start converting it to a big Ddoc file...