Commit Graph

449 Commits

Author SHA1 Message Date
Daniel James
159ae73072 Make unicode globs invalid.
[SVN r86707]
2013-11-14 19:24:34 +00:00
Daniel James
5c41e67a6d Handle non-globs containing escaped characters.
[SVN r86706]
2013-11-14 19:24:01 +00:00
Daniel James
bd5338ee9e Validate globs.
[SVN r86705]
2013-11-14 19:23:26 +00:00
Daniel James
0998743a60 Error for invalid paths containing escaped slashes.
Note that the test cases are really awkward so this is unlikely to
actually happen normally, but implementation is much easier if it
doesn't have to worry about these cases.

[SVN r86704]
2013-11-14 19:22:48 +00:00
Daniel James
ad43e1eda1 Glob dependency tracking.
[SVN r86703]
2013-11-14 19:22:09 +00:00
Daniel James
351ab07fb8 Fix the platform independent paths for globs.
[SVN r86702]
2013-11-14 19:21:37 +00:00
Daniel James
b593058fa6 Only run glob in existing directories.
Maybe it should be an error if there are no matches.

[SVN r86701]
2013-11-14 19:21:04 +00:00
Daniel James
0587081610 Only match files when the whole glob matches.
[SVN r86700]
2013-11-14 19:20:38 +00:00
Daniel James
9dd649ed9f Add glob support.
This is based on Rene's implementation, but I used my own glob function,
and adjusted a few things since it's now always using ascii. It would be
nice to support unicode, but that would require at the very least a
normalization library, and perhaps more than that.

[SVN r86699]
2013-11-14 19:19:54 +00:00
Daniel James
83e2d34c5a Use quickbook 1.7's attribute value for element ids.
Allows use of templates, and allows more characters, ids now end with
whitespace - like ids in links.

[SVN r86691]
2013-11-13 21:51:05 +00:00
Daniel James
556f06db5f Allow template calls in anchors, roles and includes.
Actually a subtle change, as includes and anchors could previously
contain spaces. Possibly should still alow that, although I expect it's
never used.

[SVN r86688]
2013-11-13 21:49:49 +00:00
Daniel James
c2a0bfcd6f Validate and process link values.
[SVN r86687]
2013-11-13 21:49:05 +00:00
Daniel James
daa229406a New parser for attribute value template calls. Refs #2035.
[SVN r86684]
2013-11-13 21:47:59 +00:00
Daniel James
0ec1072eb3 Only allow phrase templates in attribute values. Refs #2035.
[SVN r86683]
2013-11-13 21:47:28 +00:00
Daniel James
103cf67e08 Support source code tagging for sections.
[SVN r86667]
2013-11-12 20:35:14 +00:00
Daniel James
9b1ec8b2c9 Support source code tagging for paragraphs.
[SVN r86666]
2013-11-12 20:34:46 +00:00
Daniel James
4dcb1f3e21 Support source code tagging for lists.
[SVN r86665]
2013-11-12 20:34:23 +00:00
Daniel James
685a289f41 Remove spurious call to element_action.
[SVN r85808]
2013-09-20 20:06:32 +00:00
Daniel James
3f0ad9cd77 Respect indentation at the start of a file.
Fix bug where a code block at the start of a file was not recognised.
I was actually adding this test to check that the `source_mode_unset`
mechanism in `doc_info_grammar.cpp` was working, but it ended exposing
this bug.

[SVN r85590]
2013-09-07 07:24:47 +00:00
Daniel James
968d8f01a0 Fix bug where list tags were confused with markup lists.
[SVN r85341]
2013-08-13 22:22:28 +00:00
Daniel James
d4c1fbc9d4 More consistent markup for lists in templates in lists.
[SVN r85340]
2013-08-13 22:22:06 +00:00
Daniel James
25e37cd618 Generate simpara for ordered_list and itemized_list.
Also fixes block elements nested in lists.

[SVN r85326]
2013-08-12 21:35:29 +00:00
Daniel James
2de3a59944 Stop mismatched brackets causing an error with old quickbook.
Mismatched brackets are only an error for quickbook 1.6+.

[SVN r85289]
2013-08-10 19:19:02 +00:00
Daniel James
bd3be26138 Be a little smarter about skipping escaped templates.
Only possible since I made escaping punctuation templates illegal.

[SVN r85286]
2013-08-10 19:17:21 +00:00
Daniel James
80e2754a01 Make escaped punctuation templates illegal in 1.6.
There's a minor bug with escaped templates in 1.6 and I don't have time to
fix it, this will help limit its effect. As far as I'm aware no one uses
escaped templates with punctuation templates. Escaped templates are an
undocumented feature anyway.

[SVN r85285]
2013-08-10 19:16:46 +00:00
Daniel James
8dd38db6bd Add tests for escaped template calls.
[SVN r85284]
2013-08-10 19:16:01 +00:00
Daniel James
23bebbecca Improve the handling of file ids.
Instead of messing around with the section's id, leave it alone and
check for a file id whenever looking up the current id.

[SVN r85267]
2013-08-10 09:06:59 +00:00
Daniel James
e75a070a0a Attempt at better list markup.
Doesn't work for: templates in lists or explicit list block elements
(because it detects when it's in a list based on the parser), but it is
usually at least as good as the older version.

This kind of thing would be much easier if I represented the lists in
data rather than translating them as they are parsed. Not sure if I'll
do that soon though.

[SVN r85247]
2013-08-08 21:22:52 +00:00
Daniel James
c76625f66e Fix skipping template body containing an escaped template call.
[SVN r85216]
2013-08-05 22:16:01 +00:00
Daniel James
8dfd18abd4 Expand all phrase templates inline, even if they contain blocks.
Hopefully more intuitive than turning what looks like a phrase into
a block.

[SVN r85130]
2013-07-23 08:23:29 +00:00
Daniel James
0394e8ff48 Disallow paragraph/list markup in phrase templates.
Can still use block tags.

[SVN r85128]
2013-07-23 08:22:49 +00:00
Daniel James
57e59f148a Allow block markup in phrase templates.
[SVN r85127]
2013-07-23 08:22:26 +00:00
Daniel James
2b5f23951e Allow block markup inside nested blocks (e.g. tables)
Since this is often indented, does not treat indented blocks as code
blocks. This is inconsistent for lists, so maybe indented blocks in
lists should always be code, or never be code. Or maybe it should be a
bit smarter about nested indented blocks.

[SVN r85126]
2013-07-23 08:21:56 +00:00
Daniel James
786a8b7625 Copy old template tests to new version.
[SVN r85125]
2013-07-23 08:21:32 +00:00
Daniel James
705605b381 Error if phrase element body doesn't parse.
[SVN r85117]
2013-07-22 19:34:32 +00:00
Daniel James
7dcc517949 Error if element used in incorrect context.
Should be less suprising than just not processing them. Needs more tests.

[SVN r85116]
2013-07-22 19:34:03 +00:00
Daniel James
8e0047f0fb Don't break out of a list after a block tag.
[SVN r84936]
2013-07-01 19:35:37 +00:00
Daniel James
90ff4dd172 Remove 1.7 test, which won't be relevant.
It's about to break because of a 1.6 change, but that doesn't matter because
it's an obsolete test. I've already removed it from my 1.7 development.

[SVN r84935]
2013-07-01 19:35:12 +00:00
Daniel James
0c69657973 Make nested paragraphs/code blocks in lists an error in 1.6.
They're now a 1.7 feature. Will revert to 1.5 behaviour before 1.6 final.

[SVN r84932]
2013-07-01 19:34:07 +00:00
Daniel James
7753fe7da3 Fix typo.
[SVN r84606]
2013-06-01 22:30:43 +00:00
Daniel James
919e42eafb Better project names.
[SVN r84564]
2013-05-30 21:47:02 +00:00
Daniel James
e4ea915cef Fill in more missing quickbook test copyright info.
[SVN r84376]
2013-05-19 18:07:51 +00:00
Daniel James
238f0e4779 Use .quickbook extension for all test files.
[SVN r84252]
2013-05-12 14:34:27 +00:00
Daniel James
11fb4ba99c Add copyright comments to python tests.
Keep inspect happy.

[SVN r84251]
2013-05-12 14:33:46 +00:00
Daniel James
73d4d08aab Add trailing newlines.
[SVN r84250]
2013-05-12 14:33:31 +00:00
Daniel James
13023a2ed3 Fix unindenting trailing spaces in code blocks.
[SVN r84187]
2013-05-07 23:25:47 +00:00
Daniel James
172ff0f4e3 Macros in docinfo blocks for 1.6. Refs #8543.
[SVN r84153]
2013-05-05 13:47:26 +00:00
Daniel James
7e76b65ed8 C++11 keywords. Refs #8541.
[SVN r84152]
2013-05-05 13:46:57 +00:00
Daniel James
852820778d Only recognise preprocessor statements at the start of the line. Refs #8511.
[SVN r84151]
2013-05-05 13:46:38 +00:00
Daniel James
0e4b7dad31 Clean up mixed tabs/spaces when unindenting.
If the whitespace to be removed when unindenting a block is not
consistent, then replace all the indentation in that block with spaces
(i.e. expand tabs). This fixes some odd results that could happen, e.g.

    ....Line 1
    --->Line 2

(dots = spaces, arrow = tab) would become:

    ...Line 1
    Line 2

Because the first character was removed from each line. This now works
okay.

But I don't expand tabs when the whitespace that isn't removed is
inconsistent, which can have odd results, for example:

    ..Line 1
    ..->Line 2
    ......Line 3

Will just remove the first two spaces, resulting in:

    Line 1
    --->Line 2
    ....Line 3

This should be rare, as tabs after spaces are a bit odd. But maybe I
should convert to spaces more often. Perhaps when indentation is
inconsistent, or perhaps whenever a mixture of tabs and spaces are used,
or even always just do it.

[SVN r84150]
2013-05-05 13:46:23 +00:00
Daniel James
e926e24bb7 Support the token pasting operator in C++ code blocks. Refs #8510.
[SVN r84063]
2013-04-28 11:16:11 +00:00
Daniel James
8fa09072c2 Remove whitespace only leading lines from indented blocks.
[SVN r83123]
2013-02-24 11:23:15 +00:00
Daniel James
4ff7f3a9fb Fix mapped position when breaking up indented code.
[SVN r83122]
2013-02-24 11:23:02 +00:00
Daniel James
75842c4f5d Clean up poorly overloaded 'add' method.
[SVN r83120]
2013-02-24 11:22:33 +00:00
Daniel James
f34940b3a7 Store indentation change in source map.
Used to infer it when required, which could go wrong.

[SVN r83118]
2013-02-24 11:22:03 +00:00
Daniel James
a586cd7822 Source map tests.
[SVN r83117]
2013-02-24 11:21:50 +00:00
Daniel James
b2a5262c81 Convert to use boost::string_ref
[SVN r83116]
2013-02-24 11:21:31 +00:00
Daniel James
80e65f66fe Quickbook: Deal with checked paths that aren't present. Refs #6691.
I think that the dependencies should just be files that were loaded, so
I changed it to do that, but added an extra (hidden for now) option to
list all paths that were checked, staring with a `+` for files that are
present, and `-` for files that are absent.

Also fixed a bug with the path resolver.

[SVN r77973]
2012-04-14 17:33:14 +00:00
Daniel James
818aeade78 Quickbook: Use container forwarding for gcc/darwin.
It's usually safe. Especially since we're controlling the build.

[SVN r77830]
2012-04-08 15:27:48 +00:00
Daniel James
23fbf1a714 Quickbook: Further dependencies development. Refs #6691
- Include relevant locations on path where file wasn't found.
- Improve `include_search` while I'm at it.
- Normalize paths for non-existent files.
- Tests, not integrated with Boost.Build yet. Needs to check that
  python is available then run the script with the location of the
  quickbook executable.

[SVN r77598]
2012-03-27 23:00:48 +00:00
Daniel James
0463a93263 Quickbook: Merge from trunk.
Includes blocks in lists fixes, and some documentation changes.


[SVN r77347]
2012-03-16 08:48:10 +00:00
Daniel James
a883a5b13c Quickbook: Initial implementation of templates in link values.
[SVN r76647]
2012-01-22 23:08:21 +00:00
Daniel James
0c0795fcff Quickbook: Escaped markup in docinfo blocks.
[SVN r76645]
2012-01-22 23:07:26 +00:00
Daniel James
69c735145f Quickbook: Merge to quickbook-dev
[SVN r76636]
2012-01-22 17:28:46 +00:00
Daniel James
672caeec17 Quickbook: Code block callouts.
[SVN r75897]
2011-12-11 11:16:01 +00:00
Daniel James
3ed6415296 Quickbook: Support single entity source mode marker.
[SVN r75895]
2011-12-11 11:14:17 +00:00
Daniel James
47eb39d0bc Quickbook: Use values for code blocks.
Also better error report for unclosed code block.

[SVN r75894]
2011-12-11 11:13:24 +00:00
Daniel James
13ce9e9fdb Quickbook: Use 1.7 for everything on dev branch.
Might promote them to 1.6 later.

[SVN r75892]
2011-12-11 11:11:50 +00:00
Daniel James
4c2ad1f909 Quickbook: Merge from trunk to quickbook-dev.
[SVN r75846]
2011-12-07 09:40:30 +00:00
Daniel James
b12549faa9 Quickbook: Spelling correction.
[SVN r75770]
2011-12-02 08:33:46 +00:00
Daniel James
2f1ab31350 Quickbook: More error checking for file handling.
[SVN r75769]
2011-12-02 08:28:57 +00:00
Daniel James
3d27c1c360 Quickbook: Fix xmlbase and xinclude path handling.
[SVN r75766]
2011-12-02 00:05:17 +00:00
Daniel James
7dad879e3d Quickbook: Fix paragraph separator at end of string.
[SVN r75759]
2011-11-30 21:22:41 +00:00
Daniel James
0f051efd8c Quickbook: Allow a single newline at the end of an explicit code block.
Again, less gratuitous changes from older versions (although it's still
different). Also more consistent with generated markup from indented code
blocks.


[SVN r75732]
2011-11-29 22:57:23 +00:00
Daniel James
e94940c9ec Quickbook: Use version switch for image alt text change.
Was comparing the output of different versions of the quickbook executable and
the change seemed gratuitous.


[SVN r75731]
2011-11-29 22:41:10 +00:00
Daniel James
9d4fa2a2fa Quickbook: Fix command line error on windows.
I think it might be a bug that the test was incorrectly failing, but not a
serious one. I'll get back to it later.


[SVN r75730]
2011-11-29 22:15:39 +00:00
Daniel James
cc3ec7f700 Quickbook: Fix list processing bug.
[SVN r75700]
2011-11-28 00:13:10 +00:00
Daniel James
46cd4c2dba Quickbook: Fix error with empty macro defines.
[SVN r75699]
2011-11-27 22:45:55 +00:00
Daniel James
684e03c894 Quickbook: Remove files left over after merge.
[SVN r75697]
2011-11-27 21:41:42 +00:00
Daniel James
ef6628f851 Quickbook: Merge from quickbook-dev to trunk.
[SVN r75696]
2011-11-27 21:34:56 +00:00
Daniel James
73f76e778e Quickbook: Allow block elements in lists.
[SVN r75632]
2011-11-22 23:50:48 +00:00
Daniel James
e779bb6f08 Quickbook: Avoid expanding macros that are now invalid.
The macro syntax has been tightened up in 1.6, so that fewer characters
are available for macro identifiers. But macros can still be defined
using the older quickbook versions When such macros are defined, prevent
them from expanding in a quickbook 1.6 document.

[SVN r75630]
2011-11-22 23:50:17 +00:00
Daniel James
44cdb88eec Quickbook: Deal with unbalanced code snippets.
[SVN r75627]
2011-11-22 23:49:26 +00:00
Daniel James
32721bd39e Quickbook: Deal with invalid command line macros.
[SVN r75624]
2011-11-22 23:48:25 +00:00
Daniel James
1165c7a147 Quickbook: Only use explicit alt text.
[SVN r75620]
2011-11-22 23:47:19 +00:00
Daniel James
a7de315f0c Quickbook: Better string names for value.
`value` doesn't track what a string is encoded as, and sometimes it's
plain text not boostbook. It would be nice to track the encoding and
automatically do the right thing, but I'm not sure if it's worth the
effort just now.

[SVN r75619]
2011-11-22 23:47:02 +00:00
Daniel James
23e168a340 Quickbook: Use intrusive_ptr for files.
[SVN r75616]
2011-11-22 23:46:13 +00:00
Daniel James
650c3088c2 Quickbook: Track position in code blocks and snippets.
[SVN r75614]
2011-11-22 23:45:37 +00:00
Daniel James
a26a70fc7b Quickbook: Don't unindent code blocks in code snippets.
Because code blocks are added in sections, a nested section could be
unindented too far. Code is unindented in the main quickbook actions, so
there's actually no need to do it when extracting code snippets.

But this lead to left over whitespace that would have been stripped. So
change the `start_snippet` and `end_snippet` grammars to swallow up the
line they're on.

I also added a newline before the end of the snippet, this cleaned up
the occasional syntax error.

But due to these changes there is more leading and trailing whitespace
in the generated code blocks, so I just changed the code block grammar
to strip them out. This means there are no newlines at the beginning or
end of code blocks, but that should be fine.

[SVN r75613]
2011-11-22 23:45:16 +00:00
Daniel James
43f9288487 Quickbook: Fix SVG handling.
- Fixes extension check.
- Looks for images relative to quickbook file instead of the current
  working directory, so that it will work when run from another
  directory.
- Allow user to specify the image location.
- Use `bbk_value` for synthesized attributes rather than `qbk_value`.
  It's the right thing to do, but doesn't make any practical difference.

Still not happy with image path handling. I feel that they should be
relative to the quickbook file and be rewritten - in a similar manner to
`xinclude`.

[SVN r75612]
2011-11-22 23:44:57 +00:00
Daniel James
48d023522b Quickbook: Some id_manager clean up.
Tweak the id handling for using 1.5- compatibility mode inside 1.6
documents (you can't see this in the tests).

[SVN r75610]
2011-11-22 23:44:16 +00:00
Daniel James
caf01e40e7 Quickbook: Prevent 'endsect' from ending an include id.
[SVN r75539]
2011-11-17 21:07:16 +00:00
Daniel James
a041edab9c Quickbook: Fail gracefully if document info is missing.
I also tweaked `pre` and `post` a bit while I was at it.

[SVN r75538]
2011-11-17 21:07:01 +00:00
Daniel James
317704c7b7 Quickbook: Fix issue with unbalanced sections.
[SVN r75537]
2011-11-17 21:06:44 +00:00
Daniel James
ad0d5cd69b Quickbook: Another id_manager rewrite.
Now separates file and section tracking, since sections aren't
necessarily cleanly nested in files, and files have some local state.

[SVN r75534]
2011-11-17 21:05:53 +00:00
Daniel James
edc0060910 Quickbook: Empty ids and titles.
[SVN r75532]
2011-11-17 21:05:17 +00:00
Daniel James
d125ab418c Quickbook: Trim trailing space from document title.
[SVN r75529]
2011-11-17 21:04:27 +00:00
Daniel James
476e11c3ab Quickbook: Make source mode a document attribute and fix implementation.
In quickbook 1.6, nested documents default to C++, regardless of the
parent's source mode so that they are interpreted as if they are
standalone documents.

[SVN r75528]
2011-11-17 21:04:02 +00:00
Daniel James
506310c682 Quickbook: Fix the preformatted parser for 1.6.
In the old parser, the `eol` never matched anything because the `space`
would gobble up any newlines, so I'm pretty sure the intent was to use
`blank` to remove any leading spaces. So do that in 1.6.

[SVN r75521]
2011-11-17 21:01:55 +00:00
Daniel James
9711cead8b Quickbook: Parse lists with paragraphs.
Quite a big change. I moved the list logic into the grammar so that it's
easier to tell how to parse different blocks. Also reworked some of the
block vs. phrase stuff - it's a lot cleaner now which helped implement
this.  It generates terrible markup at the moment, but at least the
parser is in place.

[SVN r75446]
2011-11-10 18:17:00 +00:00