[Boost-docs] [quickbook] Direct code import...

Subject: [Boost-docs] [quickbook] Direct code import...
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2011-10-29 02:48:45


As I mentioned in my original post about code snippets inclusion.. And
my wrong impression that they worked as some form of automatic
extraction and injection into a quickbook document.. I've implemented
the functionality to allow the use of "/*'"+"/*" comments to
automatically inject their quickbook content into the current quickbook
document (Took a while as it was 15 minute intervals at a time while I
was on the train)

I also implemented the ability to import multiple files at once through
the use of a basic regular expression as the searched file name.

For example I use it as such:

===
[section Reference]
[import ../../../boost/predef/version_number.h]
[import ../../../boost/predef/architecture/.*\.h]
[import ../../../boost/predef/compiler/.*\.h]
[import ../../../boost/predef/library/.*/.*\.h]
[import ../../../boost/predef/os/.*\.h]
[endsect]
===

The only caveat at the moment is the problem I mentioned last night of
not being able to use "]" in the regular expression. Which prevents
using regexs with character range matches. But it's still generally
useful with that limitation.

The changes involved for this are actually rather minor
<https://svn.boost.org/trac/boost/changeset/75163> (part of that is an
indentation change). And the multi-file inclusion feature can very
easily be applied to other places where we have files, i.e. the
"include", as it's a 2 line change for each occurrence.

If you want to play around with this the easiest way to get the code is to:

---
cd BOOST_ROOT/tools/quickbook
svn switch https://svn.boost.org/svn/boost/branches/quickbook/literate
---
Enjoy.
-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org (msn) - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim,yahoo,skype,efnet,gmail

This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:41 UTC