jgm / jgm/pandoc

Support for more variable types in yaml default files

Open
#7,253 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
46.3k
Forks
4k
Avg merge
19h 39m
Merged PRs (30d)
9

Description

With default files (via `--defaults` switch) only a limited set of environment variables is available for use in path related fields. A really common use case where one would convert `markdown` file to `docx` file with only extension being different in the filename (apart from path) is therefore not supported.

Supporting more variable types, similarly to how this is implemented for `Lua` filters via `CommonState`, would improve user experience since even fewer switches and logic for achieving desired behavior would be needed. By supporting access to the name of the first input file without extension, passed via command line, the following would be possible:

`pandoc --defaults=my_defaults.yaml my_document.md`

After executing only the command above file `my_document.docx` could be created in `TEMP` subfolder of the folder where `my_document.md` is located.

Contributor guide

Open the contributing guide

Research direction

Start by tracing handling for the `--defaults` switch and compare it with how variable access is implemented for Lua filters through `CommonState`. Check how the first command-line input file is represented and what additional variable types would be needed. Done means the shown command can derive `my_document.docx` in the `TEMP` subfolder without extra switches or logic.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, yaml
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.