Hi!
Joel de Guzman wrote:
Lit stuff for QuickBook (proposal)
Here's a rough proposal for literate programming in QuickBook. This was done after a brief chat with Joao on the issue. First, I must admit that I am not familiar with literate programming. So, please excuse my naivete. Comments and suggestions very welcome.
I'll start with the same caveat emptor, I'm not familiar with literate programming...
In our chat, Joel and I also discussed another approach that complements Joel's proposal in this regard. This is the possibility of including code snippets maintained in a separate source file (as opposed to collecting code fragments in the docs).
For this the (proposed) include command would become:
[include file.ext id]
where id is an optional parameter that identifies a snippet;
file.ext is the name of the file to include and ext is used to determine the filetype.
Quickbook files are inserted verbatim and interpreted as quickbook, code files are inserted as syntax-colorized code. Inserting a snippet of a quickbook file could be used to cause a quickbook snippet to be inserted as syntax-colorized quickbook code.
When inserting snippets from files, quickbook searches in *comments* for the snippet delimiters. For instance,
* sample.cpp
#include <iostream>
int main()
{
// qbk [snippet print]std::cout << "this code gets printed" << std::endl;
// qbk [endsnippet]
}* sample.qbk
[/ ... ]
[include sample.cpp print]
[/ ... ]
This also opens the possibility for quickbook to directly test its docs:
* quickbook.qbk
[/ ... ]
[h3 Simple formatting]
Simple markup for formatting text, common in many applications,
is now supported:[include quickbook.qbk simple_formatting]
will generate:
[/ qbk {snippet simple_formatting} ]
/italic/, *bold*, _underline_, =teletype=
[/ qbk {endsnippet} ][/ ... ]
(have to use {} instead of [] inside comments here...)Comments and suggestions, as usual, are welcome!
Cheers!
Jo�o
------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Boost-docs mailing list [email protected] Unsubscribe and other administrative requests: https://lists.sourceforge.net/lists/listinfo/boost-docs
