mirror of
https://github.com/boostorg/quickbook.git
synced 2026-01-30 20:12:37 +00:00
[include] has optional :doc_id argument, fix doc_type include bug
[SVN r29175]
This commit is contained in:
@@ -936,9 +936,10 @@ namespace quickbook
|
||||
void operator()(Iterator first, Iterator last) const
|
||||
{
|
||||
std::string filein(first, last);
|
||||
std::string doc_id, doc_dirname, doc_last_revision;
|
||||
std::string doc_type, doc_id, doc_dirname, doc_last_revision;
|
||||
|
||||
// save the doc info strings
|
||||
actions.doc_type.swap(doc_type);
|
||||
actions.doc_id.swap(doc_id);
|
||||
actions.doc_dirname.swap(doc_dirname);
|
||||
actions.doc_last_revision.swap(doc_last_revision);
|
||||
@@ -946,6 +947,14 @@ namespace quickbook
|
||||
// scope the macros
|
||||
macros_type macro = actions.macro;
|
||||
|
||||
// if an id is specified in this include (in in [include:id foo.qbk]
|
||||
// then use it as the doc_id.
|
||||
if(!actions.include_doc_id.empty())
|
||||
{
|
||||
actions.doc_id = actions.include_doc_id;
|
||||
actions.include_doc_id.clear();
|
||||
}
|
||||
|
||||
// update the __FILENAME__ macro
|
||||
*boost::spirit::find(actions.macro, "__FILENAME__") = filein;
|
||||
|
||||
@@ -953,6 +962,7 @@ namespace quickbook
|
||||
quickbook::parse(filein.c_str(), actions, true);
|
||||
|
||||
// restore the values
|
||||
actions.doc_type.swap(doc_type);
|
||||
actions.doc_id.swap(doc_id);
|
||||
actions.doc_dirname.swap(doc_dirname);
|
||||
actions.doc_last_revision.swap(doc_last_revision);
|
||||
|
||||
@@ -149,6 +149,7 @@ namespace quickbook
|
||||
author_list doc_authors;
|
||||
std::string doc_license;
|
||||
std::string doc_last_revision;
|
||||
std::string include_doc_id;
|
||||
|
||||
std::string page_title;
|
||||
std::string section_id;
|
||||
|
||||
@@ -247,6 +247,12 @@ namespace quickbook
|
||||
include =
|
||||
"include"
|
||||
>> hard_space
|
||||
>>
|
||||
!(
|
||||
':'
|
||||
>> (*((alnum_p | '_') - space_p))[assign_a(self.actions.include_doc_id)]
|
||||
>> space
|
||||
)
|
||||
>> (*(anychar_p -
|
||||
close_bracket)) [self.actions.include]
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user