Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69894 - in trunk/libs/geometry/doc: . generated html/img reference/algorithms
From: barend.gehrels_at_[hidden]
Date: 2011-03-12 11:20:18


Author: barendgehrels
Date: 2011-03-12 11:20:15 EST (Sat, 12 Mar 2011)
New Revision: 69894
URL: http://svn.boost.org/trac/boost/changeset/69894

Log:
Added about_documentation.qbk
Added generated status including two symbols

Added:
   trunk/libs/geometry/doc/about_documentation.qbk (contents, props changed)
   trunk/libs/geometry/doc/generated/area_status.qbk (contents, props changed)
   trunk/libs/geometry/doc/generated/distance_status.qbk (contents, props changed)
   trunk/libs/geometry/doc/generated/length_status.qbk (contents, props changed)
   trunk/libs/geometry/doc/html/img/nyi.png (contents, props changed)
   trunk/libs/geometry/doc/html/img/ok.png (contents, props changed)
Text files modified:
   trunk/libs/geometry/doc/geometry.qbk | 1 +
   trunk/libs/geometry/doc/reference/algorithms/area.qbk | 2 ++
   2 files changed, 3 insertions(+), 0 deletions(-)

Added: trunk/libs/geometry/doc/about_documentation.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/about_documentation.qbk 2011-03-12 11:20:15 EST (Sat, 12 Mar 2011)
@@ -0,0 +1,114 @@
+[/============================================================================
+ Boost.Geometry (aka GGL, Generic Geometry Library)
+
+ Copyright (c) 2009-2011 Barend Gehrels, Geodan, Amsterdam, the Netherlands.
+ Copyright (c) 2009-2011 Mateusz Loskot (mateusz_at_[hidden])
+ Copyright (c) 2009-2011 Bruno Lalande, Paris, France.
+
+ Use, modification and distribution is subject to the Boost Software License,
+ Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================/]
+
+[section:aboutdoc About this documentation]
+
+Within the Boost community there are several styles of documenting. Most libraries nowadays are using QuickBook, the WikiWiki style documentation.
+
+Boost.Geometry started with Doxygen, and during review it was decided to go to QuickBook. However, it was convenient to keep Doxygen also there: it does a good job of connecting descriptions to function and class declarations.
+
+Doxygen is able to generate XML (besides the normal HTML output), containing all documentation.
+
+So the challenge was to translate the XML generated by doxygen to QuickBook. At least, translate parts of it. Boost contains currently two tools using XSLT to go from Doxygen-XML to BoostBook, or to QuickBook. These tools are used within Boost.Random and Boost.Asio (and maybe more). However, this XSLT process was quite hard, did not deliver (yet) the wished results, and we are all C++ programmers. So another tool was born, this time in C++ using RapidXML, going from Doxygen-XML to QuickBook with the ability to mix both.
+
+[heading The chain]
+The process is as following:
+
+# call doxygen to go from C++ to XML
+# call ['doxygen_xml2qbk] to go from XML to QuickBook
+# call bjam to from QuickBook to HTML
+ # bjam translates QuickBook to BoostBook
+ # bjam then translates from BoostBook to DocBook
+ # bjam then translates from DocBook to HTML
+
+This chain is currently called by "make_qbk.py", a Python script which calls the chain above in the right order. Python ensures that the chain can be handled in both Windows and Linux environments (it is probably possible to call all parts with bjam too).
+
+[heading The reference matrix]
+There reference matrix is the only thing written in BoostBook. It is an XML file with an overview of all Boost.Geometry functionality. Presenting it like this is not possible within QuickBook, therefore BoostBook XML is used here. It is included by the QuickBook code. The Boost.Asio documentation contains a similar reference matrix.
+
+
+[heading Mixing QuickBook into C++ code]
+With Doxygen it is possible to define aliases. Specificly for ['doxygen_xml2qbk], the alias [*\qbk{...}] was defined. This alias [*\qbk{...}] add some XML-tags around the text inside the alias, such that that included part is recognizable by the converter.
+
+So the C++ code might look like this:
+
+[pre
+/*!
+\brief Some explanation
+\ingroup some_group
+\details Some details
+\tparam Geometry Description of the template parameter
+\param geometry Description of the variable
+
+\qbk{ \[include reference/more_documentation.qbk\] }
+ */
+]
+
+First you see normal Doxygen comments. The last line uses the alias \qbk{...} to include a QuickBook file. So most of the documentation can be written in that QuickBook file: behaviour, complexity, examples, related pages, etc.
+
+In the example above a QuickBook include statement is used. But any QuickBook code can be used, the QuickBook code does not have to be stored in a separate file. Two more samples:
+
+[pre
+\qbk{
+/*!
+\[heading Example\]
+\[area_with_strategy\]
+\[area_with_strategy_output\]
+
+\[heading Available Strategies\]
+\[link geometry.reference.strategies.strategy_area_surveyor Surveyor (cartesian)\]
+ */
+]
+
+In this example pieces of QuickBook are included, two headers, two examples (this is the QuickBook way - the examples are defined elsewhere), and a link.
+
+[heading QuickBook within C++ issues]
+There are two issues: the comma and the asterisk. If within the [*\qbk] alias a comma is used, it is recognized by Doxygen as another parameter, and therefore will not deliver the correct results, or result into errors. This is easily solvable by escaping comma's (by putting a backslash directly before the comma, \\, ). It within the [*\qbk] alias an asterisk is used on the first line, it is interpreted by Doxygen as well. This asterisk can be escaped as well, and this time it is ['doxygen_qbk2xml] which handles this escape and translates it back into an asterisk.
+
+[heading Overloads]
+Boost.Geometry contains a lot of overloads, two functions with the same name and, for example, a different number of parameters. Or, as another example, a const and a non-const version. They can be marked specificly to the ['doxygen_xml2qbk] tool with the \qbk alias, by adding a specific description for the overload. So, for example, [*\qbk{distinguish,with strategy}] will result in another page where the text "with strategy" is added, and it is processed as "_with_strategy" within the QuickBook section name.
+
+[heading Overloads and sharing documentation]
+With overloads, part of the documentation must be shared, and other part must not. The descriptions are often the same. But the examples are usually not. So it is a balance between sharing documentation, including shared documentation, avoiding too much separate QuickBook files containing pieces of documentation and avoiding including too much QuickBook code within the C++ code...
+
+[heading Doxygen aliases]
+While documenting a large library, it is unavoidable that you have to document the same parameters in different places. For example, the template parameter [*Geometry], and the variable [*geometry], occur at least 100 times in our library.
+
+To avoid repeating the same text again and again, Doxygen aliases are used. So \tparam_geometry means that the generic description for a template parameter geometry is inserted. \param_geometry does the same for a parameter. This is all handled by Doxygen itself. Those parameters are sometimes also parameterized, for example: [*\return_calc{area}], being expanded to: ['The calculated area]
+
+This is for Doxygen alone and is not related to ['doxygen_xml2qbk] or QuickBook.
+
+[heading QuickBook macros]
+QuickBook has the same functionality for the same purpose: macro's or templates can be defined. Within Boost.Geometry this is used in the QuickBook parts of the documentation. So the general rule would be: where it is possible to use a Doxygen alias, we use a Doxygen alias. If we are outside the scope of Doxygen and we want to define a macro, we use a QuickBook macro.
+
+Stated otherwise, we don't use the generated Doxygen documentation, but if we would, it would look correct and would not be unreadable by unexpanded QuickBook macro's.
+
+[heading Code examples]
+We favour the use of code examples within the generated documentation. Example code must be correct, so examples must compile, run, and produce the correct results. QuickBook has a nice solution to include and present C++ source code, including syntax highlighting. So we generally present the example (a complete example including necessary headerfiles) and the output. Asserts are not used here, these are examples and no tests.
+
+So this is why we did enclose in the \qbk alias above:
+
+[pre
+\[heading Example\]
+\[area_with_strategy\]
+\[area_with_strategy_output\]
+]
+
+We define a heading, we include the example (here denoted by the name "area_with_strategy") and we include the output of the sample "area_with_strategy_output". Note that we simulate that the output is C++ code, a trick giving the appropriate formatting (there might be other ways to get the same effect).
+
+All these QuickBook examples are included in the doc\/src\/examples\/* folders, where also a Jamfile is present. Running bjam there ensures that nothing is broken in the examples.
+
+Some examples, if relevant, are accompagnied by images. The images are generated by the example themselves (though marked as commented out for QuickBook), deliver an SVG file which can be manually converted to a PNG (I'm using InkScape for that which is quite convenient).
+
+
+
+[endsect]

Added: trunk/libs/geometry/doc/generated/area_status.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/generated/area_status.qbk 2011-03-12 11:20:15 EST (Sat, 12 Mar 2011)
@@ -0,0 +1,13 @@
+[heading Supported geometries]
+[table
+[[Geometry][Status]]
+[[Point][ [$img/ok.png ] ]]
+[[Segment][ [$img/ok.png ] ]]
+[[Box][ [$img/ok.png ] ]]
+[[Linestring][ [$img/ok.png ] ]]
+[[Ring][ [$img/ok.png ] ]]
+[[Polygon][ [$img/ok.png ] ]]
+[[MultiPoint][ [$img/ok.png ] ]]
+[[MultiLinestring][ [$img/ok.png ] ]]
+[[MultiPolygon][ [$img/ok.png ] ]]
+]

Added: trunk/libs/geometry/doc/generated/distance_status.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/generated/distance_status.qbk 2011-03-12 11:20:15 EST (Sat, 12 Mar 2011)
@@ -0,0 +1,13 @@
+[heading Supported geometries]
+[table
+[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon]]
+[[Point][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Segment][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Box][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Linestring][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Ring][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Polygon][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiPoint][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiLinestring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiPolygon][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+]

Added: trunk/libs/geometry/doc/generated/length_status.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/generated/length_status.qbk 2011-03-12 11:20:15 EST (Sat, 12 Mar 2011)
@@ -0,0 +1,13 @@
+[heading Supported geometries]
+[table
+[[Geometry][Status]]
+[[Point][ [$img/ok.png ] ]]
+[[Segment][ [$img/ok.png ] ]]
+[[Box][ [$img/ok.png ] ]]
+[[Linestring][ [$img/ok.png ] ]]
+[[Ring][ [$img/ok.png ] ]]
+[[Polygon][ [$img/ok.png ] ]]
+[[MultiPoint][ [$img/ok.png ] ]]
+[[MultiLinestring][ [$img/ok.png ] ]]
+[[MultiPolygon][ [$img/ok.png ] ]]
+]

Modified: trunk/libs/geometry/doc/geometry.qbk
==============================================================================
--- trunk/libs/geometry/doc/geometry.qbk (original)
+++ trunk/libs/geometry/doc/geometry.qbk 2011-03-12 11:20:15 EST (Sat, 12 Mar 2011)
@@ -118,3 +118,4 @@
 [include design_rationale.qbk]
 [include matrix.qbk]
 [include reference.qbk]
+[include about_documentation.qbk]

Added: trunk/libs/geometry/doc/html/img/nyi.png
==============================================================================
Binary file. No diff available.

Added: trunk/libs/geometry/doc/html/img/ok.png
==============================================================================
Binary file. No diff available.

Modified: trunk/libs/geometry/doc/reference/algorithms/area.qbk
==============================================================================
--- trunk/libs/geometry/doc/reference/algorithms/area.qbk (original)
+++ trunk/libs/geometry/doc/reference/algorithms/area.qbk 2011-03-12 11:20:15 EST (Sat, 12 Mar 2011)
@@ -21,6 +21,8 @@
 [[__rev__][[qbk_ret the negative area]]]
 ]
 
+[include generated/area_status.qbk]
+
 [heading Complexity]
 Linear
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk