Open kkharji opened 3 years ago
Auto-scroll and auto-refresh might require an actual server. Thus, I'd need to implement a markdown preview server in lua
Preview files generated in tmp path should be auto-cleaned. Maybe keep track of generated files in preview module, then on exist iter over them if they start with tmp and unlink them.
It would be great if we can define a set of function that returns template configuration. Then use them by defining a template variable in yaml that get used to call those function.
For example, user defines
mdenv.preview.pdf.templates = {
company_X = function()
return {
path = "path/to/template",
vars = {} -- extra vars
extra_args = {} -- extra args to pass to the generator
}
end
}
Use fontmatter to pass extra args to the generator? maybe under a key?
Some variables I'd like to support
mdenv:
toc: true
listings: true
Generic
cfg.preview.pdf.template
function/tmp
Chores
Issues
HTML
Someday
*.md
, better yet, load them from a cfg value