Age | Commit message (Collapse) | Author | Files | Lines |
|
This paves the way for a future change where src/html.rs is replaced
with the html-page crate.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
|
|
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
|
|
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
|
|
This is a start. We'll need to add more as we add more support for
styling the output.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
|
|
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
|
|
This is in the meta data field "css_urls".
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
|
|
This is in the meta data field "css_embed".
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
|
|
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
|
|
We don't use the bibliographies for anything so there's not point in
allowing users to specify it. If and when we add support for
bibliographies again, we may well want to do it in a different way.
Alas, we also have to disable reference.md because the release it
refers to uses bibliographies. We'll have to re-enable it again after
the next release.
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
|
|
The extra method doesn't provide anything useful to it's better inline.
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
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
It's _document_ metadata, not metadata for a specific markdown file.
It belongs in Document, not Markdown. Make it so.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
The same information is in the metadata, so use that instead.
Sponsored-by: author
|
|
Previously, we used the TryFrom<&Path> trait, but it's not clear that
converting a pathname into a Markdown value means reading it. An
associated function that reads a file is clearer.
Sponsored-by: author
|
|
Use RefCell's interior mutability to work around the fact that
pandoc_ast's MutVisitor requires a mutable reference to self.
Sponsored-by: author
|
|
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 means that if only the subplot is modified, docgen will rebuild
the output.
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
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
tidy up error handling a bit
See merge request subplot/subplot!275
|
|
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
|
|
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
|
|
In support of #256, this adds `example` as a permitted class and
ensures that we typeset it as though it were a file.
This includes linting it as though it were a file too.
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
|
|
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>
|
|
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
|
|
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>
|