Commit Graph

1426 Commits

Author SHA1 Message Date
Daniel James
e98b64269f Simpler, less efficient, id generation.
I noticed a bug for an edge case in the id generator. Wouldn't be too
hard to fix, but the implementation was too complicated with some really
pointless optimizations, so I rewrote it using a simpler brute force
method. Will be fine for now unless something has a lot of duplicate ids.

[SVN r85368]
2013-08-16 17:31:26 +00:00
Daniel James
d829f1e251 Add note about hack.
[SVN r85367]
2013-08-16 17:31:08 +00:00
Daniel James
10899c08d3 Hard-code which collector is written to.
[SVN r85366]
2013-08-16 17:30:49 +00:00
Daniel James
aabaaf9699 Revert and clean up some of the list changes.
Now that I've fixed my mistakes I can clean up a lot of the rubbish.

[SVN r85342]
2013-08-13 22:22: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
8e8635dc79 Make list generation state part of the output state.
Which sounds obvious when it's put like that. But I originally did this
in the parser because the parser was tracking lists anyway. But that
made a mess of handling `[ordered_list]` and `[itemized_list]`, I tried
fixing that but made a pig's ear of it.

The code for handling 'explicit lists' will still be a bit messy because
the generator is currently oblivious to what type of block element it's
generating markup for, and it needs to be aware for lists.

[SVN r85339]
2013-08-13 22:21:39 +00:00
Daniel James
850458074a Stop saving phrase and block output separately.
[SVN r85338]
2013-08-13 22:21:17 +00:00
Daniel James
6f06a8d7a6 Remove incorrect note about document id.
The document id has never been generated from the filename. It comes
from the docinfo `id` attribute, or if that doesn't exist, it's
generated from the document title. Although, thanks to bugs, it's a bit
more complicated than that.

[SVN r85328]
2013-08-12 21:42:20 +00:00
Daniel James
55d7447469 Fix single entity source mode notes.
[SVN r85327]
2013-08-12 21:42:01 +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
29ee34d4b7 Split up the language version chapter.
[SVN r85288]
2013-08-10 19:18:25 +00:00
Daniel James
c784dcbc44 Some notes about recent quickbook changes.
[SVN r85287]
2013-08-10 19:17:51 +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
be7a77711b Split up the id manager file.
[SVN r85270]
2013-08-10 09:07:55 +00:00
Daniel James
c92356d7ef Make entity data const where possible.
[SVN r85269]
2013-08-10 09:07:31 +00:00
Daniel James
2851da15a8 Mark up const use of id_state and id_placeholder.
[SVN r85268]
2013-08-10 09:07:15 +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
05879218c5 Stop storing generated ids in id_placeholder.
Placeholders are now completely constant.

[SVN r85266]
2013-08-10 09:06:36 +00:00
Daniel James
0b981780c3 Pull the resolved state from id_placeholder.
[SVN r85265]
2013-08-10 09:06:18 +00:00
Daniel James
2d52fa9d71 Combine 'child' and 'unresolved' id states.
[SVN r85264]
2013-08-10 09:06:02 +00:00
Daniel James
224711c244 Extract id_data from id_placeholder.
[SVN r85263]
2013-08-10 09:05:45 +00:00
Daniel James
89677768e9 Extract 'order' from id_placeholder.
[SVN r85262]
2013-08-10 09:05:28 +00:00
Daniel James
31f96e632b Clean final id generation.
[SVN r85261]
2013-08-10 09:05:11 +00:00
Daniel James
c7db08a00c Clean header id generation.
[SVN r85260]
2013-08-10 09:04:53 +00:00
Daniel James
de35add4e5 Improve some id_manager comments.
[SVN r85259]
2013-08-10 09:04:25 +00:00
Daniel James
b29fa77158 Remove old forward declaration.
[SVN r85258]
2013-08-10 09:04:05 +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
c5e77194c0 Single state saver.
It's always okay to save `template_depth` and `min_section_level`
because they only change at template calls, and template calls are
always cleanly nested.

[SVN r85129]
2013-07-23 08:23:07 +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
d4905fdd6b Better element handling in syntactic_block_item.
Now all elements are handled within local.common.

[SVN r85115]
2013-07-22 19:33:38 +00:00
Daniel James
de829cab78 Rename some local variables.
Just to reduce confusion between the paragraph rule and the paragraph
action. Should possibly do this for all such local variables. I'll see
how it goes.

[SVN r85114]
2013-07-22 19:33:21 +00:00
Daniel James
dd1d5633e3 Rename a few grammar wide variables.
Partly for clarity, and partly because there are too many things called
'block' and 'phrase'. The grammar names aren't great, but at least they
match. Might rething once I've done a lot of the 1.7 things.

[SVN r85113]
2013-07-22 19:33:05 +00:00
Daniel James
ab6cf3553a Use a value in local for context.
[SVN r85112]
2013-07-22 19:32:43 +00:00
Daniel James
56ecf967ef Use a value in local for still_in_block.
Allows `paragraph_item` and `list_item` to be merged into a single rule.

[SVN r85111]
2013-07-22 19:32:21 +00:00
Daniel James
380efdd3c4 Use a value in local for simple_markup's mark.
Feels a little better to me. Although it isn't as stronly associated with the
rule.

[SVN r85110]
2013-07-22 19:32:05 +00:00
Daniel James
b47ef26a6c Generic 'scoped_no_eols' implementation.
So that it can be reused for other state variables.

[SVN r85109]
2013-07-22 19:31:48 +00:00
Daniel James
202b0f90e7 Merge quickbook. Starting 1.6 alpha, plus some 1.7 development.
[SVN r85050]
2013-07-15 21:45:25 +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