summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2021-10-17fix: regex for extracting YAML from MarkdownLars Wirzenius1-9/+15
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
2021-10-13feat: add crate subplot-build for using Subplot from build.rsLars Wirzenius5-73/+101
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
2021-10-12fix(portability): avoid using str::split_onceLars Wirzenius1-1/+3
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
2021-10-08codegen: Refuse to codegen if there are zero scenariosDaniel Silverstone2-1/+11
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-18Merge branch 'fix-documentclass' into 'main'Daniel Silverstone1-0/+4
feat: allow the `documentclass` field in document metadata Closes #237 See merge request subplot/subplot!216
2021-09-18feat: allow the `documentclass` field in document metadataLars Wirzenius1-0/+4
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
2021-09-18pandoc: Add support for --citeprocDaniel Silverstone2-2/+25
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-18trace: Add scenario count traceDaniel Silverstone1-0/+6
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-18ast: codeblocks with single words are classes not IDsDaniel Silverstone1-3/+4
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-18ast: Codeblocks should not have extra trailing newlinesDaniel Silverstone1-0/+6
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-16feat! parse Markdown input with pull-cmark instead of PandocLars Wirzenius7-8/+537
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
2021-09-14debug: add tracing calls to help debugLars Wirzenius3-4/+37
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
2021-09-13Merge branch 'multi-lang-docs' into 'main'Lars Wirzenius9-253/+273
Implement polyglot bindings See merge request subplot/subplot!210
2021-09-09fix: handle most inline markup in metadata titlesLars Wirzenius1-0/+1
Actually, we only didn't handle `foo` code markup. Sponsored-by: author
2021-09-07chore: Rename generated file for resources to ease developmentDaniel Silverstone1-1/+1
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07core: Adjust behaviour for bindings and function file findingDaniel Silverstone2-32/+34
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>
2021-09-07subplot: Properly support polyglot bindingsDaniel Silverstone6-37/+79
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07bindings: Parse polyglot bindingsDaniel Silverstone1-12/+50
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07bindings: Remove redundant function/cleanupDaniel Silverstone1-27/+2
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07bindings: Initial move toward multi-lingual bindingsDaniel Silverstone2-138/+48
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07bindings: Refactor function+cleanup into a structDaniel Silverstone1-6/+59
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07chore: Unwind global template nameDaniel Silverstone6-27/+27
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-06fix: build resources into subplot binary even in Debian packageLars Wirzenius1-11/+1
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
2021-09-05resources: Hidden subcommand to list internal resourcesDaniel Silverstone2-0/+24
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-05tracing: Un-DRY the code a bit to cope with a guardDaniel Silverstone1-5/+4
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>
2021-09-04tracing: Make formatting better and documentDaniel Silverstone1-12/+36
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04subplot: Trace without ANSI to file, and always trace to console if not ↵Daniel Silverstone1-2/+2
otherwise set Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04bindings: Example chained error for parsing bindingsDaniel Silverstone2-1/+7
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04tracing: Add a bunch of TRACE level tracingDaniel Silverstone4-10/+61
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04chore: Enable tracingDaniel Silverstone1-2/+58
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04chore: Fix unnecessary borrow lintsDaniel Silverstone12-30/+26
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-08-30Merge branch 'no-parent-means-curdir' into 'main'Lars Wirzenius2-9/+10
policy: No parent directory means basedir is curdir See merge request subplot/subplot!203
2021-08-30policy: No parent directory means basedir is curdirDaniel Silverstone2-9/+10
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-07-20feat: when more than one bindings match a step, list all of themLars Wirzenius4-21/+58
Sponsored-by: author
2021-06-19plantuml: Pass dot path into plantumlDaniel Silverstone1-0/+2
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-06-19build: Support dot/plantuml.jar paths via build environment variablesDaniel Silverstone1-3/+14
This also adds Java binary path override Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-06-19cli: Add flexibility in dot and plantuml locationsDaniel Silverstone3-9/+57
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-06-18tests: Move bindings microbenchmark to an integration testDaniel Silverstone1-54/+0
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-06-11cli: Sort output of metadata commandDaniel Silverstone1-6/+12
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-06-06graphmarkup: Support JAVA_HOME for plantuml launchDaniel Silverstone1-4/+26
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-05-30bin: Remove obsolete single-call binariesDaniel Silverstone4-288/+0
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-05-22Merge branch 'clippy-chores' into 'main'Daniel Silverstone4-67/+39
chore: Fix a bunch of clippy lints See merge request subplot/subplot!168
2021-05-20chore: Fix a bunch of clippy lintsDaniel Silverstone4-67/+39
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-05-20bins: Switch to SUBPLOT_PLEASE=1 for separate binariesDaniel Silverstone4-8/+32
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-05-02chore: Fix up some clippy lintsDaniel Silverstone1-4/+1
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-05-02resources: Remove some unnecessary `pub`Daniel Silverstone1-2/+2
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-05-02resources: Use new path checking orderDaniel Silverstone4-6/+61
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-05-02Merge branch 'multi-ast' into 'main'Lars Wirzenius2-0/+9
pandoc_ast: Support multiple versions of pandoc_ast See merge request subplot/subplot!155
2021-05-02Merge branch 'split-binaries-warn' into 'main'Lars Wirzenius4-0/+12
bin: Emit warnings from old sp-* binaries Closes #189 See merge request subplot/subplot!161
2021-05-01bin: sp-filter -> subplot-filterDaniel Silverstone1-0/+0
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>