Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75438 - branches/quickbook-dev/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-11-10 13:14:36


Author: danieljames
Date: 2011-11-10 13:14:34 EST (Thu, 10 Nov 2011)
New Revision: 75438
URL: http://svn.boost.org/trac/boost/changeset/75438

Log:
Quickbook: no-self-linked-headers flag.
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/actions.cpp | 14 +++++++-------
   branches/quickbook-dev/tools/quickbook/src/quickbook.cpp | 4 ++++
   branches/quickbook-dev/tools/quickbook/src/quickbook.hpp | 1 +
   3 files changed, 12 insertions(+), 7 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/actions.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions.cpp 2011-11-10 13:14:34 EST (Thu, 10 Nov 2011)
@@ -379,7 +379,7 @@
                 id_category::explicit_id);
 
             write_bridgehead(actions, level,
- content.get_boostbook(), anchor, true);
+ content.get_boostbook(), anchor, self_linked_headers);
         }
         else if (!generic && actions.ids.compatibility_version() < 103) // version 1.2 and below
         {
@@ -405,7 +405,7 @@
                 id_category::generated_heading);
 
             write_bridgehead(actions, level,
- content.get_boostbook(), anchor, true);
+ content.get_boostbook(), anchor, self_linked_headers);
         }
     }
 
@@ -1618,17 +1618,17 @@
 
         write_anchors(actions, actions.out);
 
- if (actions.ids.compatibility_version() < 103) // version 1.2 and below
- {
- actions.out << content.get_boostbook();
- }
- else // version 1.3 and above
+ if (self_linked_headers && actions.ids.compatibility_version() >= 103)
         {
             actions.out << "<link linkend=\"" << full_id << "\">"
                 << content.get_boostbook()
                 << "</link>"
                 ;
         }
+ else
+ {
+ actions.out << content.get_boostbook();
+ }
         
         actions.out << "</title>\n";
     }

Modified: branches/quickbook-dev/tools/quickbook/src/quickbook.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/quickbook.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/quickbook.cpp 2011-11-10 13:14:34 EST (Thu, 10 Nov 2011)
@@ -46,6 +46,7 @@
     tm* current_time; // the current time
     tm* current_gm_time; // the current UTC time
     bool debug_mode; // for quickbook developers only
+ bool self_linked_headers;
     bool ms_errors = false; // output errors/warnings as if for VS
     std::vector<fs::path> include_path;
     std::vector<std::string> preset_defines;
@@ -223,6 +224,7 @@
             ("help", "produce help message")
             ("version", "print version string")
             ("no-pretty-print", "disable XML pretty printing")
+ ("no-self-linked-headers", "stop headers linking to themselves")
             ("indent", PO_VALUE<int>(), "indent spaces")
             ("linewidth", PO_VALUE<int>(), "line width")
             ("input-file", PO_VALUE<input_string>(), "input file")
@@ -313,6 +315,8 @@
         if (vm.count("no-pretty-print"))
             pretty_print = false;
 
+ quickbook::self_linked_headers = !vm.count("no-self-link-headers");
+
         if (vm.count("indent"))
             indent = vm["indent"].as<int>();
 

Modified: branches/quickbook-dev/tools/quickbook/src/quickbook.hpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/quickbook.hpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/quickbook.hpp 2011-11-10 13:14:34 EST (Thu, 10 Nov 2011)
@@ -26,6 +26,7 @@
     extern tm* current_time; // the current time
     extern tm* current_gm_time; // the current UTC time
     extern bool debug_mode;
+ extern bool self_linked_headers;
     extern std::vector<fs::path> include_path;
     extern std::vector<std::string> preset_defines;
 


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