Commit Graph

404 Commits

Author SHA1 Message Date
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
Daniel James
5f5c526ea3 Quickbook: Better table titles.
[SVN r75445]
2011-11-10 18:16:37 +00:00
Daniel James
952b3b6550 Quickbook: Support version info outside of document info blocks.
[SVN r75442]
2011-11-10 18:15:49 +00:00
Daniel James
34c053f833 Quickbook: Parse version as for any other docinfo attribute.
[SVN r75441]
2011-11-10 18:15:30 +00:00
Daniel James
0e7874bfb6 Quickbook: Fix some tests.
I use compatibility mode to decide whether to link headers to
themselves. I'm not sure about that.

[SVN r75437]
2011-11-10 18:14:08 +00:00
Daniel James
1e3a88f440 Quickbook: Support escapes in links, anchors, images, includes, imports and exports.
[SVN r75360]
2011-11-06 22:22:42 +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
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
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
1058b13396 Quickbook: Compatibility mode to make upgrading easier.
[SVN r75347]
2011-11-06 22:18:32 +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
1aede8bf77 Quickbook: Make windows paths an error in 1.6
[SVN r75267]
2011-11-02 08:50:53 +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
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
2fb0330405 Quickbook: Trim leading underscores in normalized ids.
[SVN r75257]
2011-11-02 07:59:12 +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
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
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
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
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
2e7921057b Quickbook: New id include test.
[SVN r75233]
2011-11-01 19:17:22 +00:00
Daniel James
291df92b92 Quickbook: Trim trailing whitespace in code blocks.
[SVN r75224]
2011-11-01 19:00:21 +00:00
Daniel James
3c39fbca2e Quickbook: Clean up whitespace prior to programlisting.
[SVN r75223]
2011-11-01 19:00:02 +00:00
Daniel James
7cfb29d18c Quickbook: Fix a test.
[SVN r75222]
2011-11-01 18:59:39 +00:00
Daniel James
77694a9ce4 Quickbook: Close any open sections at end of document.
[SVN r75220]
2011-11-01 18:59:08 +00:00
Daniel James
7ca05863ad Quickbook: Fully qualify footnote and callout ids.
[SVN r75219]
2011-11-01 18:58:47 +00:00
Daniel James
e88f608707 Quickbook: Heading tests for quickbook 1.1
And make the other consistent.

[SVN r75218]
2011-11-01 18:58:28 +00:00
Daniel James
fb279b6fb2 Quickbook: Remove accidental commit.
[SVN r75215]
2011-11-01 18:57:04 +00:00
Daniel James
4a6dd9e97a Quickbook: Port Rene's sort code inclusion to quickbook-dev.
[SVN r75175]
2011-10-30 09:29:56 +00:00
Daniel James
e2a1114fb3 Quickbook: Trim trailing whitespace in code blocks.
[SVN r74349]
2011-09-11 17:00:18 +00:00
Daniel James
79ed68b360 Quickbook: Clean up whitespace prior to programlisting.
[SVN r74348]
2011-09-11 16:59:36 +00:00
Daniel James
ec22c9d052 Quickbook: Fix a test.
[SVN r74347]
2011-09-11 16:58:45 +00:00
Daniel James
bf0a45d4cb Quickbook: Change the anchor markup for headers.
Use a phrase with an id inside the header.

Using an anchor before the heading was causing problems when the heading
wasn't inside a section.

We can't use an anchor inside the header when it links to itself, as it
messes up getting the title for the link. Using an empty phrase means
that it will just get the empty title for the phrase. Thanks to John
Maddock for the idea.

This does generate slightly odd markup. We could possibly use the old
style markup whenever section depth > 0, since we would know that we're
inside a section, but that seems like an unnecessary complication.

[SVN r74346]
2011-09-11 16:58:14 +00:00
Daniel James
62a69acf85 Quickbook: Close any open sections at end of document.
[SVN r74345]
2011-09-11 16:57:23 +00:00
Daniel James
d59a0ccc3b Quickbook: Fully qualify footnote and callout ids.
[SVN r74344]
2011-09-11 16:56:49 +00:00
Daniel James
8e2707b9d4 Quickbook: Heading tests for quickbook 1.1
[SVN r74209]
2011-09-03 15:52:13 +00:00
Daniel James
418b4ff3f5 Quickbook: Remove accidental commit.
[SVN r74107]
2011-08-28 15:37:32 +00:00
Daniel James
4012b1f753 Quickbook: Merge to quickbook-dev.
[SVN r73983]
2011-08-21 13:27:52 +00:00