Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Typeset each step in a scenario, including captures in the steps.
Previously the scenario was just one <pre> element, now things can be
styled with CSS.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
|
|
The --merciful option allows this if the user really wants it.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
|
|
Add a `doc` field to a binding. It's a string meant to contain
markdown.
Add subcommand `subplot libdocgen YAML -o MD` to read a bindings file
and output a markdown file documenting the steps in the bindings file,
and the type of captures, and the documentation for the step.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
|
|
This makes it more clear what kind of files we're talking about. The
old name could've meant, say, the markdown files.
Sponsored-by: author
|
|
HTML generation uses write!, which can fail, so to_html must return a
Result.
Sponsored-by: author
|
|
To both improve debugability when writing scenarios, and also
to protect against future incompatibilities which might occur
if we add more classes which are appropriate for named code
blocks, we require that named blocks have one of `file` or `example`
as classes or else we warn.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Sponsored-by: author
|
|
We have long had a feature for docgen that checks the time stamps of
all input files and the output file and avoids running Pandoc to
produce the output file, if the output file won't change. This has
always been a little imperfect: sometimes the output file would change
due to other changes than what's in the input files. For example, when
Pandoc changes, or when Subplot code changes. This has led to
surprised users. We no longer user Pandoc at all. Drop the time stamp
checking functionality and have docgen always write the output file.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
We may add this back later, but for now, it's not wanted.
Sponsored-by: author
|
|
Change this:
format!("{}", foo)
into this:
format!("{foo}")
Support for this feature was added in Rust 1.58 (see
https://github.com/rust-lang/rust/releases/tag/1.58.0) and in 1.67
clippy suggests about this. Because the new style seems to be where
the Rust ecosystem is going, I think Subplot should follow to avoid
being needlessly different from most other projects.
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
This allows running docgen on a subplot that isn't in the current directory.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
This is a huge change all in one commit, sorry. However, as it changes
a fundamental part of the command line interface (namely, what
constitutes as the input file), there doesn't seem a way to break this
into a tidy series of small commits.
Most of the diff is in subplot.md, where every scenario that invokes
Subplot needs multiple changes, thus touching much of the file.
The overall change is that where we previously had document metadata
in embedded YAML in the Markdown file, we now have it in a separate
YAML file. The Markdown file is named in the YAML file.
We still parse the Markdown with Pandoc for everything, except
codegen. Switching from Pandoc to pulldown_cmark for parsing will be
another big change that I didn't want to include in this huge change
set.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
When we change Subplot to take a YAML file instead of a Markdown file
as input, it doesn't make sense to act as a Pandoc filter anymore:
Pandoc doesn't understand our YAML file.
In any case, I seem to have been the only user ever of that feature,
so it won't really bother anyone else. Even so, we should treat this
as a breaking change.
"subplot docgen" still works as before.
Sponsored-by: author
|
|
When errors have a source, i.e., an underlying error, it results in
better error messages to the user.
Also, refactor the way the source chain is printed, to code that is
clearer to me.
I will need this to for loading document metadata from an external
YAML file.
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
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
|
|
Add a --merciful option to subcommands for which this matters. Adjust
tests to invoke subplot with that option as necessary.
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
|
|
Also, sort the dependency list in Cargo.toml so it's tidy.
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>
|
|
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>
|
|
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
|
|
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
|
|
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>
|
|
Unfortunately there was a problem where the file writer guard
got dropped and so the subscriber (correctly) silently swallowed
the tracing instead of writing it out. This was caused by me
trying to DRY the code a bit. Undo some of that until we can come
up with a more elegant solution.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
otherwise set
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>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|