kkharji / mdenv.nvim

WIP markdown editing environment
3 stars 0 forks source link

Preview Feature #1

Open kkharji opened 3 years ago

kkharji commented 3 years ago

Generic


Chores

Issues


HTML


Someday


kkharji commented 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

kkharji commented 3 years ago

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.

kkharji commented 3 years ago

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
}
kkharji commented 3 years ago

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