Commit Graph

239 Commits

Author SHA1 Message Date
Peter Dimov
91f91d51c5 Remove unnecessary include 2024-01-14 19:31:08 +02:00
Peter Dimov
8bd1c3a856 Use boost::core::invoke_swap instead of the deprecated boost::swap 2023-09-30 02:52:51 +03:00
Daniel James
c65d2bc7c3 Use QUICKBOOK_FOR in a few places 2017-12-28 17:04:34 +00:00
Daniel James
9085d2e95a Macro for C++11 range based for loop 2017-12-28 17:04:34 +00:00
Daniel James
19ccdd6cbd Reformat 2017-12-24 12:46:59 +00:00
Daniel James
e0ec41683d Deal with xinclude == xmlbase
It's a silly edge case as you can't xinclude directories, but might as well
make it a little more sane.
2017-10-04 03:08:21 +01:00
Daniel James
074895ab80 Remove some TODO notes
Has been working fine, and not really a worry in retrospect.
2017-10-03 19:44:00 +01:00
Daniel James
62f4b4fcf3 More warnings 2017-09-03 04:50:35 +01:00
Daniel James
6b46281363 Fix some shadow warnings + tweak constructors
Fixed a lot of shadow warnings. Haven't actually turned shadow warnings
on, as there are a lot of warnings in dependencies. Also made some
constructors explicit, and tweaked the initialisers in some places.
2017-09-02 15:03:21 +01:00
Daniel James
b56555b020 Fix some warnings 2017-08-17 20:29:21 +01:00
Daniel James
a45ffc5772 Extract stream and path code from native_text 2017-08-09 20:12:47 +01:00
Daniel James
3a0bfb1559 Make 'to_s' a member of string_view 2017-08-06 14:13:11 +01:00
Daniel James
82dcaa8373 Use the string_iterator typedef 2017-08-06 12:38:11 +01:00
Daniel James
785e80b42d Remove superfluous calls to content.get_encoded for section title 2017-05-22 01:29:24 +01:00
Daniel James
18b37e4045 Don't write out empty section titles
Docbook requires sections to have titles, but if they're empty it writes
out a '???' title, having not title seems cleaner. Can be fooled by
putting empty phrase markup in the title, so might need to be a little
smarter about that.

I'm considering adding a warning, perhaps an error in strict mode.
2017-05-22 01:10:54 +01:00
Daniel James
9d98653e9b Try to be smarter about adding links to section titles
When adding links, don't add them around other links. If there's
anything outside of existing links, they'll still get linked. Although,
maybe it would be better to only add link tags when the title doesn't
contain any links. This might be over-complicated and confusing.
2017-05-11 12:55:14 +01:00
Daniel James
5f8e2a9f5a Fix is_strict_checking name 2017-05-11 00:27:48 +01:00
Daniel James
98f76b00fd Make stray square brackets an error
E.g. if you get the name of a template wrong, it will currently just
write it out, but now with strict mode it'll be an error.
2017-04-25 21:49:45 +01:00
Daniel James
703989a8cd Add optional ids to 'endsect'
Trickier than I thought it would be, I probably over-encapsulated
document_state.
2017-04-22 11:58:42 +01:00
Daniel James
26b7c0d887 Implement negative conditional generation 2017-04-22 11:58:42 +01:00
Daniel James
38e5c35294 Wrapper for boost::string_view
Can be constructed from an rvalue std::string.
2017-03-26 19:55:21 +01:00
Daniel James
c87178fb53 Fix crash calling template with no arguments
Only happend when quickbook file version < 1.5
2017-02-12 11:36:13 +00:00
Daniel James
b7c774187f Cleaner implementation of xinclude path handling.
Split up `calculate_xinclude_path` into a few smaller functions. Also
reuse `quickbook_path` instead of having a special struct just for this
use.
2015-12-20 12:40:58 +00:00
Daniel James
c43999d7bf Move the xinclude path handling stuff into include_paths. 2015-12-20 12:40:57 +00:00
Daniel James
c8fa513bc4 Rename path_to_url to file_path_to_url.
Just to make clear that it isn't appropriate for directories, for which
it would need to add a trailing slash. I don't want to add such a check.
2015-12-19 14:08:30 +00:00
Daniel James
72a39edaa7 First stab at correctly generating URLs from paths. 2015-11-18 21:37:11 +00:00
Daniel James
73fb7e02de Make include file order more consistent on different machines.
Sometimes when including files on the path the same glob will match the
same relative path from different include paths. In this case the paths
were ordered by their absolute paths. Instead use the order they occur
in the include path, which is a little more independent of the local
machine.

[SVN r86708]
2013-11-14 20:00:24 +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
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
f50e048a7a Check that attribute values aren't empty.
Maybe I should also make the parser more lax.

[SVN r86692]
2013-11-13 21:51:25 +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
4dcb1f3e21 Support source code tagging for lists.
[SVN r86665]
2013-11-12 20:34:23 +00:00
Daniel James
8939758300 Stack tagged source modes.
For when one tagged element is inside another.

[SVN r86664]
2013-11-12 20:33:59 +00:00
Daniel James
56d1ffd246 Track the order of source mode tags.
So if there are two clashing source mode tags, then the latter one can
be used.

[SVN r86663]
2013-11-12 20:33:36 +00:00
Daniel James
853af902d6 Create header for syntax highlighting stuff.
[SVN r86662]
2013-11-12 20:33:10 +00:00
Daniel James
c70fb3ed5e Rename input_path.?pp to native_text.
[SVN r86645]
2013-11-12 09:16:18 +00:00
Daniel James
c9a92586bb Rename structs and variables for include paths.
[SVN r86644]
2013-11-12 09:15:40 +00:00
Daniel James
a0061d2f2c Rename path_details to path_parameter.
[SVN r86643]
2013-11-12 09:15:17 +00:00
Daniel James
3983dc9e56 Pull some of the path handling code out of actions.cpp.
[SVN r86642]
2013-11-12 09:14:56 +00:00
Daniel James
c55473b858 Remove unused indent_length.
[SVN r86641]
2013-11-12 09:14:28 +00:00
Daniel James
50f84a32ad Store source mode as tag rather than string.
[SVN r86640]
2013-11-12 09:14:07 +00:00
Daniel James
0b72cf60d8 Rename id_manager to document_state.
[SVN r86635]
2013-11-12 09:12:17 +00:00
Daniel James
ba9e2ed772 Encode the filename macro.
Also tweak the utils string functions.

[SVN r85807]
2013-09-20 19:52:38 +00:00
Daniel James
10899c08d3 Hard-code which collector is written to.
[SVN r85366]
2013-08-16 17:30:49 +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