Commit Graph

53 Commits

Author SHA1 Message Date
Daniel James
c55b7ccc9f Decode basic xml markup
Doesn't support things like custom entities, but should be good enough
for the boostbook/docbook that quickbook generates.
2017-12-30 21:10:58 +00:00
Daniel James
19ccdd6cbd Reformat 2017-12-24 12:46:59 +00:00
Daniel James
f1cc90ee1e Fix some Visual C++ warnings 2017-10-15 11:53:12 +01:00
Daniel James
5152ca4d34 That test case is probably fine 2017-10-04 18:55:46 +01:00
Daniel James
916f106afa Use string_view instead of silly string rvalue optimisation
And lightly test the functions.
2017-10-04 18:49:33 +01:00
Daniel James
b11a35b5ce Rename linkify_test to utils_test 2017-10-04 18:47:29 +01:00
Daniel James
476aa61984 Improved file_path_to_url for windows edge cases
Really not sure about this, but filesystem doesn't have great support
anyway[1], and this handles some unusual cases better.

[1]: https://svn.boost.org/trac10/ticket/5448
2017-10-04 18:05:00 +01: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
c5b8ad6d38 Fix xmlbase when it's the same as current xinclude base 2017-10-04 02:11:35 +01:00
Daniel James
974b5b5f01 This was fixed in 4ff7f3a9 2017-10-03 19:44:00 +01:00
Daniel James
8bad86f81c Throw an exception for invalid globs in 'glob'
Before the idea was that check_glob would throw out any invalid globs, and then
if they somehow got through glob would just fail to match. I now feel it would
be better if it also complained on finding an invalid glob, although it will
only detect an invalid glob if the pattern matches up to that point.
2017-10-03 19:44:00 +01:00
Daniel James
595182b0c7 Stop normalizing the path of dependencies
It was incorrect because it was following symlinks. That means that a
build system wouldn't detect is a symlink changed. It's probably best
not to do any normalization at all and leave it to the build system.
2017-09-15 19:21:30 +01:00
Daniel James
b913b0192b Some path_difference tests + fix non-existent directories 2017-08-09 20:12:56 +01:00
Daniel James
7ef7909d5e Add tests for normalize_path 2017-08-09 20:12:56 +01:00
Daniel James
ba64e37ae4 Rename file_path_to_url_test.cpp to path_test.cpp 2017-08-09 20:12:56 +01:00
Daniel James
433295308e Restore file_path_to_url_test 2017-08-09 20:12:55 +01:00
Daniel James
af70e87f44 Reimplement quickbook::cleanup to be dependency free
Specifically std::auto_ptr. The master branch of spirit still dependends
on std::auto_ptr, but develop doesn't, and hopefully that will be merged
eventually.

This implementation uses a linked list, which isn't the fastest
implementation but is simple to implement.
2017-05-20 17:09:33 +01:00
Daniel James
770840b926 In linkify, only add lins when there aren't any already
It was trying to link unlinked text, but got in a bit of a mess when
links are nested in other markup. Also reads the 'quickbook-escape'
content, now it's just checking for the presence of links that should be
fine.
2017-05-11 22:11:11 +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
38e5c35294 Wrapper for boost::string_view
Can be constructed from an rvalue std::string.
2017-03-26 19:55:21 +01:00
Daniel James
066177a959 Move file_paths_to_url include include_paths.cpp
Which messes up testing. `include_paths.cpp` depends on `quickbook.cpp`
which depends on `program_options`. These kind of problems are mainly
with the use of globals, so I'll need to sort that out sooner or later.
2015-12-20 12:40:58 +00:00
Daniel James
93e334e25a Start to test file_path_to_url.
Not sure when (or if) I'll get round to doing windows paths, but it
seems to work okay there at the moment.
2015-12-19 14:08:31 +00:00
Daniel James
792dd11f7d Remove old BOOST_DETAIL_CONTAINER_FWD define. 2015-11-18 21:37:11 +00:00
Daniel James
bd5338ee9e Validate globs.
[SVN r86705]
2013-11-14 19:23:26 +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
919e42eafb Better project names.
[SVN r84564]
2013-05-30 21:47:02 +00:00
Daniel James
13023a2ed3 Fix unindenting trailing spaces in code blocks.
[SVN r84187]
2013-05-07 23:25:47 +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
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
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
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
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
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
a2b3c3aa04 Quickbook: Merge from trunk to quickbook-dev.
[SVN r73365]
2011-07-25 21:41:36 +00:00
Daniel James
bf1d753dba Merge tools directory from trunk.
[SVN r72698]
2011-06-20 19:19:56 +00:00
Daniel James
40821d55d8 Quickbook: Don't use null node in symbol table.
Since it isn't using a union for the value/middle pointer, there's no
need to have special terminating nodes.

[SVN r71063]
2011-04-07 00:15:38 +00:00
Daniel James
8bdaab2f37 Quickbook: Detab
[SVN r71014]
2011-04-05 20:06:11 +00:00
Daniel James
de2fc3754c Quickbook: Overwrite duplicate macros in 1.6
[SVN r70977]
2011-04-04 22:10:45 +00:00
Daniel James
87d71d0633 Quickbook: Alternative tst that's cheaper to copy.
[SVN r70871]
2011-04-02 17:45:09 +00:00
Daniel James
abb793e3b6 Quickbook: Iterator tests. Equality operator for values.
The equality operator is pretty inefficient. Just for testing really.

[SVN r70565]
2011-03-26 11:13:07 +00:00
Daniel James
352a9ca028 Quickbook: Release lists from list builder.
[SVN r70562]
2011-03-26 11:11:58 +00:00