local util = require('util') local markdown = require("markdown") app.on('scan_experience', function(exp) --print_r(exp) end) app.on('scan_experience_file', function(exp) local me = app.plugin.markdown local patterns = util.split(app.opts.plugin_markdown_files," ") foreach( patterns, function(k,v) if exp.path:match(v) then print("✅ └─ plugin/markdown: detected " .. v) exp.parent.info = '
' .. markdown( util.readfile(exp.path) ) .. '
' end end) end) app.on('set', function(k,v) print("content was updated") end) -- this registers the plugin UI local plugin = { name = 'Markdown disabled', info = 'extract experience title and description from markdown file', opts = { { key='app.opts.plugin_markdown_files', title='Markdown files', info='Space-separated, lua patterns are allowed', default="README.md", values='' }, { key='app.opts.plugin_markdown_strategy', title='Markdown strategy', info='', default="headerparagraph", values={headerparagraph='title is first header + 1st paragraph is description',disabled='disabled'} }, } } return plugin