<br><div class="gmail_quote">On Sat, Jan 5, 2013 at 8:30 PM, Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmail@erdani.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="h5"><br></div></blockquote><div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You know, I always felt Ddoc was a strange sublanguage bolted onto D. An<br>
elegant solution would be to have macros be D code, but I have nothing<br>
to propose here.<br>
</blockquote>
<br></div>
I learned with time that ddoc's macro system is quite coherent and well designed.<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></blockquote><div><br></div><div>Here is my first try for a LaTeX-generating list of Ddoc macros. I'm sure a LaTeX guru would find some of these quite dangerous :)</div><div>The final, global, appearance should be mostly defined in the DDOC macro.</div>
<div><br></div><div>I wonder how to have ddoc produce code highlighting that's compatible with LaTex. </div><div><br></div><div>- Curly braces are a bit special in LaTex, hence using \texttt{} does not work well.</div>
<div>- But using \begin{verbatim} \end{verbatim} disable the coloring code produced by Ddoc.</div><div><br></div><div>For my own docs, I use pygmentize... Else I suppose the listings could also work.</div><div><br></div><div>
I gather some hypothesis (namely, that the end output will be HTML) are a bit hardwired in Ddoc.</div><div><br></div><div>Anyway:</div><div><br></div><div>B=\textbf{$0}</div><div>I=\textit{$0}</div><div>U=\underline{$0}</div>
<div>P= $0</div><div><br></div><div>DL=\begin{description}</div><div>$0</div><div>\end{description}</div><div>DT=\item[$0]</div><div>DD=$0</div><div>TABLE=\begin{tabular}[2]{l|l}</div><div>$0</div><div>\end{tabular}</div>
<div>TR=$0 \\</div><div>TH=$0 &</div><div>TD=$0</div><div>OL=\begin{enumerate}</div><div>$0</div><div>\end{enumerate}</div><div>UL=\begin{itemize}</div><div>$0</div><div>\end{itemize}</div><div>LI=\item $0</div><div>BIG=\large{$0}</div>
<div>SMALL=\small{$0}</div><div>BR=\newline</div><div>LINK=\url{$0}</div><div>LINK2=\href{$1}{$+}</div><div>RED={\color{red}$0}</div><div>BLUE={\color{blue}$0}</div><div>GREEN={\color{green}$0}</div><div>YELLOW={\color{yellow}$0}</div>
<div>BLACK={\color{black}$0}</div><div>WHITE={\color{white}$0}</div><div>D_CODE=\begin{verbatim}</div><div>$0</div><div>\end{verbatim}</div><div>DDOC=\documentclass[11pt]{article}</div><div>\usepackage{color}</div><div><br>
</div><div>\usepackage{hyperref}</div><div>\begin{document}</div><div>\title{$(TITLE)}</div><div>\date{}</div><div>\maketitle</div><div><br></div><div>$(BODY)</div><div>\end{document}</div><div><br></div></div>