summaryrefslogtreecommitdiff
path: root/src/metadata.rs
AgeCommit message (Collapse)AuthorFilesLines
2023-10-30feat: allow adding CSS URLs to HTML outputLars Wirzenius1-0/+14
This is in the meta data field "css_urls". Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
2023-10-30feat: allow .subplot to list CSS files to embed in HTML outputLars Wirzenius1-0/+19
This is in the meta data field "css_embed". Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
2023-07-02feat! drop support for bibliographies in document metadataLars Wirzenius1-26/+0
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
2023-05-19chore: drop unused error variantLars Wirzenius1-3/+0
Sponsored-by: author
2023-05-10feat! allow multiple markdown files for a subplotLars Wirzenius1-8/+8
Sponsored-by: author
2023-05-10refactor: move document metadata out of Markdown structLars Wirzenius1-0/+7
It's _document_ metadata, not metadata for a specific markdown file. It belongs in Document, not Markdown. Make it so. Sponsored-by: author
2023-04-08feat! drop Pandoc metadata from document metadata, set its dateLars Wirzenius1-11/+10
Sponsored-by: author
2023-01-28refactor: move YamlMetadata to src/metadata.rsLars Wirzenius1-2/+172
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
2023-01-22refactor: create Metadata from YamlMetadata without pandoc_astLars Wirzenius1-192/+38
We don't want to use pandoc_ast outside of the md module. Sponsored-by: author
2022-10-21fix: look up markdown file relative to basedir of subplotLars Wirzenius1-0/+7
This allows running docgen on a subplot that isn't in the current directory. Sponsored-by: author
2022-09-06feat! read document metadata from a YAML fileLars Wirzenius1-9/+17
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
2022-05-05refactor: drop the subplot::Result type aliasLars Wirzenius1-5/+12
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
2022-03-24feat! change logging to use log/env_logger instead of tracingLars Wirzenius1-17/+4
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
2021-12-11chore: tidy up minor issues found by clippyLars Wirzenius1-1/+1
Sponsored-by: author
2021-11-19subplot: Rework for impls not template/functionsDaniel Silverstone1-41/+33
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>
2021-11-19various: Rework document to support multiple implementationsDaniel Silverstone1-15/+46
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>
2021-09-13Merge branch 'multi-lang-docs' into 'main'Lars Wirzenius1-17/+10
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-07core: Adjust behaviour for bindings and function file findingDaniel Silverstone1-12/+6
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-07chore: Unwind global template nameDaniel Silverstone1-5/+4
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04tracing: Add a bunch of TRACE level tracingDaniel Silverstone1-5/+20
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-04chore: Fix unnecessary borrow lintsDaniel Silverstone1-4/+4
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-05-20chore: Fix a bunch of clippy lintsDaniel Silverstone1-14/+3
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-02-17refactor: get_title can't fail, so don't return a ResultLars Wirzenius1-4/+4
2021-01-10metadata: Acquire the template spec during doc load if possibleDaniel Silverstone1-5/+18
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-21metadata: Support quoted stringsDaniel Silverstone1-2/+13
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-11-21chore(src/visitor/structure.rs): push a char instead of push_strLars Wirzenius1-3/+3
Doesn't change the result, but it's cleaner to push a character instead of push_str a single-character string.
2020-08-08refactor: split stuff from src/ast.rs into smaller modulesLars Wirzenius1-0/+277
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