mirror of
https://github.com/boostorg/quickbook.git
synced 2026-02-02 21:12:15 +00:00
fix up doc_id when parsing an included QBK file to keep links from breaking
[SVN r29072]
This commit is contained in:
@@ -934,7 +934,20 @@ namespace quickbook
|
||||
void operator()(Iterator first, Iterator last) const
|
||||
{
|
||||
std::string filein(first, last);
|
||||
std::string doc_id, doc_dirname, doc_last_revision;
|
||||
|
||||
// save the doc info strings
|
||||
actions.doc_id.swap(doc_id);
|
||||
actions.doc_dirname.swap(doc_dirname);
|
||||
actions.doc_last_revision.swap(doc_last_revision);
|
||||
|
||||
// parse the file
|
||||
quickbook::parse(filein.c_str(), actions, true);
|
||||
|
||||
// restore the values
|
||||
actions.doc_id.swap(doc_id);
|
||||
actions.doc_dirname.swap(doc_dirname);
|
||||
actions.doc_last_revision.swap(doc_last_revision);
|
||||
}
|
||||
|
||||
Actions& actions;
|
||||
@@ -979,12 +992,6 @@ namespace quickbook
|
||||
// The quickbook file has been parsed. Now, it's time to
|
||||
// generate the output. Here's what we'll do *before* anything else.
|
||||
|
||||
// if we're ignoring the document info, do nothing.
|
||||
if (ignore_docinfo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (actions.doc_id.empty())
|
||||
actions.doc_id = detail::make_identifier(
|
||||
actions.doc_title.begin(),actions.doc_title.end());
|
||||
@@ -1007,6 +1014,12 @@ namespace quickbook
|
||||
actions.doc_last_revision = strdate;
|
||||
}
|
||||
|
||||
// if we're ignoring the document info, we're done.
|
||||
if (ignore_docinfo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
<< "<!DOCTYPE library PUBLIC \"-//Boost//DTD BoostBook XML V1.0//EN\"\n"
|
||||
<< " \"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd\">\n"
|
||||
|
||||
Reference in New Issue
Block a user