Age | Commit message (Collapse) | Author | Files | Lines |
|
SubplotError::YamlError is quite generic. We only parse YAML as part
of document metadata, so replace the error with a more specific one.
Sponsored-by: author
|
|
Replace SubplotError::PandocError with ::Pandoc, which is only for
executing the Pandoc program. In reality, so was the old variant, but
the new one is more specific, and also embeds the error from executing
Pandoc as a source error.
The error message is still crap, but that will be fixed later by not
using Pandoc for parsing Markdown.
Sponsored-by: author
|
|
Replace SubplotError::IoError with ::Spawn, ::WriteToChild,
::WaitForChild, ::ReadFile, ::CreateFile, ::Writefile.
IoError was a catchall error and as such, so generic that it didn't
help the user to figure out what actually is wrong. For example, there
was no indication what operation was attempted or on what file. The
new error variants are specific.
Sponsored-by: author
|
|
Replace subplot::Result<T> with Result<T, SubplotError>. I find this
now to be clearer, as I don't need to remind myself which Result is
being used where. This should not be a breaking change.
Sponsored-by: author
|
|
Change everywhere to use the word "diagram" instead of "graph. Diagram
seems like the better word. It's mostly used in comments and
documentation, but there was one filename and one trait name that
needed changing.
I used "rg -iw graph" and "find -iname '*graph*'" to find everywhere
that needed changing.
Sponsored-by: author
|
|
Configure env_logger from environment, including style (colors).
Simplify how log messages are formatted: drop the timestamp and crate
name, as they're just noise for the case of Subplot.
Adjust log messages so that what a user may want to normally know is
info or above, and at level debug if they want to see in more detail
what's happening.
Handle the error from failing to execute pandoc specially, for a
better error message. The default error message from the pandoc crate
was hard for a user to understand. The new message clearly says what
the exit code is, and logs the stderr, but not stdout, as Pandoc
correctly writes errors only to stderr.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Add a --merciful option to subcommands for which this matters. Adjust
tests to invoke subplot with that option as necessary.
Sponsored-by: author
|
|
Change places where warnings used to be written out so the warnings
are pushed into the list in Document instead.
Sponsored-by: author
|
|
We don't use async in Subplot, and the mental overhead of learning
tracing and the code overhead to add support for logging custom
values (implementing the Value trait for Subplot internal types) does
not seem worthwhile.
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Also, sort the dependency list in Cargo.toml so it's tidy.
Sponsored-by: author
|
|
This changes typesetting of scenarios so that when two adjacent
scenario steps have the same keyword, "and" is used on the second one.
This means that when input has
when I do foo
when I do bar
the output will have
when I do foo
and I do bar
I didn't bother to make this configurable. I don't feel that level of
configuration is good.
The "keyword aliases" scenario is repurposed to verify this.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Sponsored-by: author
|
|
This is merely a warning, for now, to stderr. subplot.md has two
embedded files used as examples, and I'm too tired to add a way to
indicate that it's OK for a specific file to not be used. That should
probably be added later, though.
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
As the next step in polyglot documents, this reworks the internals to
expect the metadata of documents to contain an impls mapping from
template name to function filenames for that template. Sadly this does
mean that if there're no function files, the document author will have
to still specify an empty list, but that seems acceptable.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
In order to eventually shift the document metadata to support
more than one template defined for the document this reworks
all the internal APIs to expect templates, and also the external
CLI to be able to provide it.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
The old regex had a wrong, and weird, pattern for lines of YAML. The
new one is simpler and seems more correct: it matches lines not
staring with a dot.
Sponsored-by: author
|
|
Make it easy to generate test code from a subplot in another project's
`build.rs` script.
Move the code to load documents and generate test code from
src/bin/subplot.rs and src/bin/cli/mod.rs to src/doc.rs so it can be
used without using the subplot executable.
Make the add_search_path function public so it can be used outside its
module. The subplot executable arranged for the directory where the
markdown input file resides to be added to the search path via another
way.
Sponsored-by: pep.foundation
|
|
Sequoia wants Rust 1.48.0 and split_once is not in that version. We
can easily accommodate Sequoia's needs here with a simple change.
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
feat: allow the `documentclass` field in document metadata
Closes #237
See merge request subplot/subplot!216
|
|
With the new pulldown-cmark parser for codegen, we are explicit about
what fields we allow in the YAML document metadata block. We currently
don't allow the `documentclass` field. Allow it. It's a useful way for
controlling typesetting vie LaTeX to PDF.
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
This is a first step towards being able to use Subplot codegen from a
project's build.rs, and with only pure-Rust build dependencies.
Replace Pandoc for parsing Markdown input with pulldown-cmark. This is
mostly a drop-in replacement, but not entirely. The YAML parsing is
more strict now.
Note that this is a breaking change. Some subplots that used to work,
and still work with docgen, no longer work with the new parser. Major
differences are:
* Only specific fields are supported. All the Markdown files in the
Subplot source tree work. If anything else is needed, and it likely
is, the new parser needs to be extended.
* The bindings, functions, classes, and bibliography fields MUST be
lists of strings. A single string value will no longer work.
Sponsored-by: pep.foundation
|
|
I needed these to figure out a problem that wasn't in Subplot itself.
I'd like to keep them for the future.
Sponsored-by: author
|
|
Implement polyglot bindings
See merge request subplot/subplot!210
|
|
Actually, we only didn't handle `foo` code markup.
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
From now on, we search $ common/$ then template/$ and as such
we will find common (polyglot) bindings automatically
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Once upon a time, in a galaxy far, far away, we decided to not build
the share/* resource files into the subplot binary, when building it
for a Debian package. Much later, we were much surprised when this was
not the case and tests fail when run during the Debian package build.
Because it's surprising to not build in the resources for a Debian
package, we hereby undo that decision.
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|