Commit Graph

1426 Commits

Author SHA1 Message Date
Daniel James
0bd528ce8d Quickbook: Clean up some of the value parser stuff.
Since values are now used in most places, a lot of the complexity became
unnecessary. Some of the string stuff in values.cpp is now redundant,
but I'll leave it alone for now.

[SVN r75358]
2011-11-06 22:21:50 +00:00
Daniel James
1531b4f348 Quickbook: Move more phrase parsing into local.common.
This change has two side effects: anchors are placed slightly better and
non-element/template square brackets are terminated by the end of a
paragraph.

[SVN r75357]
2011-11-06 22:21:32 +00:00
Daniel James
febcb14e01 Quickbook: Some anchor placement tests.
[SVN r75356]
2011-11-06 22:21:17 +00:00
Daniel James
3279b99901 Quickbook: Try make some sense of the various block/phrase rules.
[SVN r75355]
2011-11-06 22:21:01 +00:00
Daniel James
b9f3b68580 Quickbook: No point in using hard_space here.
The difference between `hard_space` and `space` is that `hard_space`
won't have a zero-width match in certain places. But in the `-` part of
a classic spirit rule, zero-width matches don't count so there's
effectively no difference.

[SVN r75354]
2011-11-06 22:20:44 +00:00
Daniel James
99a9e73b4d Quickbook: Rename methods for extracting docinfo values.
[SVN r75353]
2011-11-06 22:20:29 +00:00
Daniel James
e48ed3afe7 Quickbook: xmlbase docinfo attributes.
Useful for escaped `xi:include`.

(does this break horribly if it's given an absolute path?).

[SVN r75352]
2011-11-06 22:20:14 +00:00
Daniel James
4e411e96ce Quickbook: Better punctuation support for various elements.
[SVN r75351]
2011-11-06 22:19:53 +00:00
Daniel James
cdcd5349f6 Quickbook: Better parser for hr.
The old version had issues with multi-line comments.

[SVN r75350]
2011-11-06 22:19:25 +00:00
Daniel James
9fe74a58e4 Quickbook: Use a closure instead of scoped_context.
[SVN r75349]
2011-11-06 22:19:05 +00:00
Daniel James
d5a788063a Quickbook: Fix Visual C++ compile errors.
[SVN r75348]
2011-11-06 22:18:49 +00:00
Daniel James
1058b13396 Quickbook: Compatibility mode to make upgrading easier.
[SVN r75347]
2011-11-06 22:18:32 +00:00
Daniel James
3afae60dd4 Quickbook: Fix old changelog entry.
[SVN r75340]
2011-11-06 09:33:55 +00:00
Daniel James
9f606dc46f Merge to release several changes for 1.48.
[SVN r75293]
2011-11-04 02:31:36 +00:00
Daniel James
a2fe7199c9 Quickbook: Better encoded template support.
- Detect encoded templates in `call_template` so they're handled if
  anything calls it or `call_code_snippet` directly.
- Handle any paragraphs that comebefore a encoded block template.
- Escaped templates should always be inline, it isn't block content.
- Try to support escaped encoded templates. It's a bit of a weird case
  so I wasn't sure what to do. Just wrote out the boostbook in a phrase
  which seems the best option.
- Escapes now override the template type. This should happen as the user
  explictly asks for an escaped template.

[SVN r75270]
2011-11-02 08:52:05 +00:00
Daniel James
af4ea5b066 Quickbook: Deal with blocks following anchors.
Turn anchors into a special type of element that can either be a block
or a phrase, so that when immediately followed by block content, the
parser will do the right thing.

`xinclude` and conditional phrases might need similar treatment,
although they're trickier.

[SVN r75269]
2011-11-02 08:51:41 +00:00
Daniel James
3e91b39fa3 Quickbook: Move scoped_context into main_grammar.
It's only used there so it fits into main_grammar's local state. It
would probably be a good idea to move more parsing stuff out of actions.
Or maybe the document state should be moved out of actions.

[SVN r75268]
2011-11-02 08:51:16 +00:00
Daniel James
1aede8bf77 Quickbook: Make windows paths an error in 1.6
[SVN r75267]
2011-11-02 08:50:53 +00:00
Daniel James
4c9d028578 Quickbook: break_action is no longer deprecateed.
[SVN r75266]
2011-11-02 08:50:30 +00:00
Daniel James
fee3477a76 Quickbook: Move syntax highlight actions.
Plus a little bit of a cleanup. There's a little bit of duplication
caused by this, but I think the clarity is worth it. Really do need a
better way of handling actions.

[SVN r75265]
2011-11-02 08:49:59 +00:00
Daniel James
0ee79fe849 Quickbook: Move escaped phrase handling to the main grammar.
Note there's no need to check for the end of the escapse as the
intersection (`&`) rule only passes the content within the esapse.

[SVN r75264]
2011-11-02 08:49:33 +00:00
Daniel James
5be4962caf Quickbook: Fix issue with mixed version templates.
If a 1.5 template called a 1.4 template, its parent would be its
'dynamic' parent (the 1.5 template), whose parent would be its lexical
parent - breaking the dynamic lookup. I've changed it so that when
using a dynamic lookup, 1.5+ templates are skipped over. That means
they can use whatever variable names they wish without issues.

It does mean that if a 1.4- template was specifically written to use
dynamic lookup, then it wouldn't be callable from 1.5. So it might
be better if they didn't skip over 1.5+ templates.

Alternatively if might be better to always lexical scoping, even for
older versions, on the assumption that it was a bug.

[SVN r75263]
2011-11-02 08:48:52 +00:00
Daniel James
c9e3ea1ec7 Quickbook: Represent callouts in value tree.
[SVN r75262]
2011-11-02 08:47:31 +00:00
Daniel James
0f28f2da9c Quickbook: Store template_body as just a value.
[SVN r75261]
2011-11-02 08:47:01 +00:00
Daniel James
3ee432e250 Quickbook: Parse templates using the version they were defined for.
Needs to store the version in the file object, since it's only known
after the file is read in, had to make files non-const. Put some checks
in to make sure this isn't abused but pretty messy.

[SVN r75260]
2011-11-02 08:46:38 +00:00
Daniel James
f627c79f88 Quickbook: Add 'block' element.
[SVN r75259]
2011-11-02 08:46:05 +00:00
Daniel James
5530f14171 Quickbook: Fix rebase error in last commit.
In the offline version I had made some changes to string handling that I
decided not to check in. The last change relied on them.

[SVN r75258]
2011-11-02 08:41:09 +00:00
Daniel James
2fb0330405 Quickbook: Trim leading underscores in normalized ids.
[SVN r75257]
2011-11-02 07:59:12 +00:00
Daniel James
e146d8dd90 Quickbook: Prioritize explicit ids.
[SVN r75256]
2011-11-02 07:58:52 +00:00
Daniel James
ea063efe1f Quickbook: role tag for 1.6. Refs #5860.
This implements the markup `[role red Some red text]`. Although I'm not
sure I like it that much. It would be pretty easy to use a template for
the same effect.

This is just the quickbook part of supporting coloured text, to complete
the ticket there needs to be css support for html pages and xsl support
for pdfs.

[SVN r75255]
2011-11-02 07:58:32 +00:00
Daniel James
eec3f7304c Quickbook: Only create the syntax highlighter keywords once.
Symbol tables are really expensive to create, so share between all
instances of `cpp_highlight` and `python_highlight`. It would be better
to create all the grammars just once, but that's trickier as they're quite
stateful and they're not nearly as expensive as the symbol tables.

[SVN r75254]
2011-11-02 07:58:11 +00:00
Daniel James
4dea2a8ad5 Quickbook: Keep files in memory, stop tracking position in iterators.
Files are now permanently loaded. Quickbook substrings are stored as
references into the file. Now positions are stored as iterators into
the original file, the line and column is calculated when messages are
output.

This doesn't have much effect on efficiency but it simplifies a few
things.

[SVN r75253]
2011-11-02 07:57:47 +00:00
Daniel James
84c637c7eb Quickbook: Separate string_ref.
[SVN r75252]
2011-11-02 07:49:52 +00:00
Daniel James
3ae7265139 Quickbook: New version of id_manager. Fixes #1221.
This encapsulates more in the id and section handling code. Fixes a few
edge cases and separates implementation of the new and old section
handling code. Always normalizes and truncates generated ids in quickbook
1.6.

[SVN r75251]
2011-11-02 07:49:22 +00:00
Daniel James
894862e309 Quickbook: Sort a placeholder for doc_id.
[SVN r75250]
2011-11-02 07:45:03 +00:00
Daniel James
fce266f673 Quickbook: Use section_info for ids in doc_info_actions.
[SVN r75249]
2011-11-02 07:44:44 +00:00
Daniel James
cd03beb84e Quickbook: Move doc_id into section_info.
And doc_id state saving into quickbook.cpp.

[SVN r75248]
2011-11-02 07:44:26 +00:00
Daniel James
f892c21d66 Quickbook: Move more section id stuff into section_info.
[SVN r75247]
2011-11-02 07:44:03 +00:00
Daniel James
a44ec6d363 Quickbook: Move section_info into id_generator.
And shuffle things round a bit to avoid adding too many dependents to
id_generator. For 1.6 I want section_info to use id_generator to nest
ids properly when there are duplicate section ids.

[SVN r75246]
2011-11-02 07:43:41 +00:00
Daniel James
3ab3116ee4 Quickbook: Reset section info for nested documents.
So when including a document inside a section, the section's id is not
used. Also cleans up the messy handling of section.min_leveln.

[SVN r75245]
2011-11-02 07:43:03 +00:00
Daniel James
59e67eae30 Quickbook: Put all the section tracking stuff in a struct.
[SVN r75244]
2011-11-02 07:42:37 +00:00
Daniel James
306d53b586 Quickbook: Small start to factoring out id hierarchy.
[SVN r75243]
2011-11-02 07:41:54 +00:00
Daniel James
39e3a6e670 Quickbook: Fix including from inside a section.
It's a bit of a crazy edge case which creates invalid docbook in 1.6.

[SVN r75236]
2011-11-01 19:21:36 +00:00
Daniel James
152fe4fa5d Quickbook: Rename and rearrange some tests.
- More consistent names.
- Not using `.` in basename.
- Run the quickbook manual test last (as when there's an error, the more
  specific tests are more informative).
- Combine some of the code tests.

[SVN r75235]
2011-11-01 19:20:46 +00:00
Daniel James
347e0b817d Quickbook: No longer need to clear doc_id in actions, as it's set correctly in doc_info_actions.cpp
[SVN r75234]
2011-11-01 19:17:38 +00:00
Daniel James
2e7921057b Quickbook: New id include test.
[SVN r75233]
2011-11-01 19:17:22 +00:00
Daniel James
5081a50617 Quickbook: Remove deprecated macro now that trunk is merged.
[SVN r75231]
2011-11-01 19:13:04 +00:00
Daniel James
768b61d35b Quickbook: Fix a duplicate warning.
[SVN r75230]
2011-11-01 19:02:01 +00:00
Daniel James
bdca375f24 Quickbook: Set version for dev.
[SVN r75229]
2011-11-01 19:01:44 +00:00
Daniel James
19e7038643 Quickbook: Add tip clarifying BoostBook, DocBook, need to know.
Merged from change by Beman.

[SVN r75228]
2011-11-01 19:01:27 +00:00