diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2012-09-07 08:35:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-07 14:09:55 (GMT) |
commit | dbfe335099bd80e38830846c401d5651c64d15e5 (patch) | |
tree | ee5c8e8ea413e0eeee2b0490197806e713c2b0c8 /Source/cmDocumentationFormatterDocbook.h | |
parent | cffa899a47e83599bbe081c9f8070b7e35de1d58 (diff) | |
download | CMake-dbfe335099bd80e38830846c401d5651c64d15e5.zip CMake-dbfe335099bd80e38830846c401d5651c64d15e5.tar.gz CMake-dbfe335099bd80e38830846c401d5651c64d15e5.tar.bz2 |
docbook: Factor out code to write valid DocBook IDs
Attributes in XML may contain alphanumeric characters, underscores,
colons and dots. When DocBook is chunked, the dot is often used as a
path separator. To generate a valid ID, we take the title of the
section, transform all non-alphanumeric characters to underscores and
then add a prefix separated with dots. We also add the document name as
a prefix, in order to 'xinclude' eg. cmake.docbook and ctest.docbook in
the same document. IDs are written in multiple places, so the code is
factored to a function.
Diffstat (limited to 'Source/cmDocumentationFormatterDocbook.h')
-rw-r--r-- | Source/cmDocumentationFormatterDocbook.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmDocumentationFormatterDocbook.h b/Source/cmDocumentationFormatterDocbook.h index 213948d..6c96900 100644 --- a/Source/cmDocumentationFormatterDocbook.h +++ b/Source/cmDocumentationFormatterDocbook.h @@ -35,7 +35,9 @@ public: virtual void PrintPreformatted(std::ostream& os, const char* text); virtual void PrintParagraph(std::ostream& os, const char* text); private: + void PrintId(std::ostream& os, const char* prefix, std::string id); std::set<std::string> EmittedLinkIds; + std::string docname; }; #endif |