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: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
|
|
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
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
This commit just moves files around and fixes references to moved modules.
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
|
|
We'll want to use the new Markdown type instead.
Sponsored-by: author
|
|
This will eventually be the only module in Subplot that uses
pandoc_ast or exposes types from that crate. When we replace
pandoc_ast with something pulldown_cmark, only this module will need
to change.
Sponsored-by: author
|
|
This was orphaned when we dropped the functionality to extract YAML
metadata embedded in the Markdown source. Because the function was
exported, tools didn't complain that it's unused.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Sponsored-by: author
|
|
This allows us to not use a generic byte vector, and slightly lessens
the chance of mistakes. Also, it strongly encodes what we need to know
about and do with SVG images.
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
|
|
Change places where warnings used to be written out so the warnings
are pushed into the list in Document instead.
Sponsored-by: author
|
|
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
|
|
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
In order to cope with multiple versions of Pandoc, we need to
support various pandoc_ast versions. This patch introduces
support for both 0.8 and 0.7, defaulting to the older 0.7. If
you use Subplot on a system with a much newer pandoc, then switch
to the 0.8 variant to cope.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
This redirects all file reading via the new resource module
which will be used to control where files come from.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
|
|
Also, fix anywhere that's affected by the change.
|
|
|
|
When reading a PDF printed on paper or on a reMarkable tablet, it's
not possible to see that there even is a link in a PDF. Make this more
visible by typesetting the link URL as a footnote.
This is not done on HTML output as web pages are read on browsers that
make links easy to see.
This is the first time the AST is transformed by docgen differently
based on the output format. The decision of what should be done is a
policy decision, best done at the topmost level: in the main function
of docgen.
The result of that decidion (turn links into footnotes or not) is
communicated from docgen main into the ast.rs module via a new Style
struct. This mechanism can later be extended for other typesetting
style decisions (e.g., what fonts to use).
|
|
This only moves things around, to avoid huge source code modules. It
doesn't rename functions, add unit tests, or similar.
* src/datafiles.rs: DataFile, DataFiles
* src/metata.rs: Metadata
* src/panhelper.rs: functions for querying Pandoc Attrs
* src/policy.rs: the get_basedir_from function; place for later policy
functions
* src/typeset.rs: functions to produce Pandoc AST nodes
* srv/visitor/*: various MutVisitor implementations for traversing
ASTs, and their helper functions
|
|
This will be used soon by a program to extract data files from
subplots, but I expect it to be more generally useful in the future.
|
|
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.
|
|
This lets sp-codegen.rs be only about the command line parsing etc.
|
|
All the language specific details are now in template.yaml, including
the command for how to run the generated test program.
|
|
On consideration, it's a clearer name. I've been trying to avoid
using "subplot" in the identifiers, in case we ever have to rename the
project again, but I think this is worth it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|