Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Make it easier to edit the CSS file, and also add some styles for
upcoming scenario typesetting.
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
|
|
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>
|
|
Some day we will have syntax for continuing a step to the next line.
This change makes it easier to introduce that syntax, without a
breaking change.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
This doesn't compile yet.
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
YamlMetadata was in src/ast.rs, because originally it was only used to
parse metadata out of Markdown. Markdown parsing is now in its own
module, leaving ast.rs to only contain YamlMetadata. In this
situation, it seems tidy to have both kinds of metadata in the same
module, and to drop the now-empty ast.rs module.
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
|
|
feat: make errors have a source error
See merge request subplot/subplot!284
|
|
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
|
|
Sponsored-by: author
|
|
SubplotError::JsonError is a generic error, but we actually only parse
JSON when parsing the AST from Pandoc. Replace it with a ::AstJson
error to be more specific, and hopefully more helpful to the user.
Sponsored-by: author
|
|
SubplotError::RegexError was a struct variant in the enum. Replace it
with a more usual variant with the regex::Error as a source field, for
better error messaging.
Sponsored-by: author
|
|
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
|
|
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
|
|
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>
|
|
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
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Sponsored-by: author
|
|
Add one variant to the SubplotError enum and change src/codegen.rs to
return Result<_, SubplotError> instead of anyhow::Result<_>.
|
|
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>
|
|
|
|
Add sp-extract
Closes #41
See merge request larswirzenius/subplot!53
|
|
|
|
|
|
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>
|
|
Change: keep actual text of keyword from scenario
Closes #24
See merge request larswirzenius/subplot!38
|
|
The typesetting should preserve the actual keyword or alias in the
source. Previously, if source had this:
```
given foo
and bar
```
it got typeset as if were:
```
given foo
given bar
```
Also, change subplot.md to use alias when possible.
|
|
This moves the policy decision of what the base directory is to the
main functions of the various programs, instead of hiding it deep in
the call stack and making it implicitly the current working directory.
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|