Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
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
|
|
Thank you Milo Moisson.
Sponsored-by: author
|
|
Sponsored-by: author
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Tera now returns an error if Tera::new is given a glob that references
a directory that doesn't exist. We don't want to use the glob at all,
so Tera::default is a better way to create a Tera.
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
|
|
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>
|
|
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 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>
|
|
In readiness for the lib/ import, rearrange from a structure of
share/templates/$lang/... to be share/$lang/template/...
This will permit share/$lang/lib/ to exist later.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
In a general sense, we will want to have more than just template
files as resources. This shifts from the concept that the only
thing resource-wise that subplot has is templates, to a more general
shared resources concept without a default path beyond CWD.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
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>
|
|
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>
|
|
A template's YAML file can now list any additional files, called
helpers. An empty list is OK, as is not having the 'helper' key in the
YAML file. The helpers are loaded as Tera templates so they can be
included in the main template.
This will allow us to split out un-templated code out of the main
template. The helpers can then be linted and unit tested separately.
This commit only adds the mechanism, and fixes up the YAML files.
Later commits will actually split the main Python template into
helpers, and add unit tests.
refactor: use .join
|
|
The Python and Bash templates now insert the name of the source files
from where the function codes come from.
|
|
|
|
Where previously the document metadata could specify a single bindings
file, and a single functions file, it can now specify one or more. If
a single value is given, that's the filename. Otherwise, it can be a
YAML list of filenames.
Drop the functions_filename template variable, which was effectively
unused, and for which there is no recorded use case at this time.
|
|
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.
|
|
|