Closed sdondley closed 2 years ago
The short answer is "no", there certainly aren't any built in hooks to do this.
You can just embed raw html into your .md files and it will be placed verbatim into the HTML output. e.g. just place
<iframe width="560" height="315" src="https://www.youtube.com/watch?v=dQw4w9WgXcQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
into your .md
and it will pop out the other end intact.
I don't think I want to stray too far from what vimwiki
itself does. You'd also run into the problem of exactly what sort of embed to use (width, height etc). I guess you could pipe it on through to sed
or something like that if you want to convert further.
If you want to propose (and build & test) a hook system then I'd be open to the idea. Alternatively I guess you could just fork this gem and build in your own processors :)
I'll leave this open for a few days, or, feel free to close it if you decide not to build the hook system :)
Thanks for getting back.
I found a way to do this. Basically, it's this:
1) create your own html conversion script. make sure the script collects all the arguments passed to it
2) tell vimwiki to use the custom conversion script with the custom_wiki2html
setting
3) in the custom script, make a call to vimwiki_markdown and pass the arguments along to it
4) now have the script open the html file output by vimwiki_markdown in step 3
5) make modifications to the html code
6) save the code back to the same html file
Ah nice work :) yes, that'd work perfectly.
Thanks for this module.
Once the ruby script does its thing, I'd like to process the text some more. For example, I wish to convert hyperlinks to a youtube video to youtube's embed code. Is there some kind of hook or other method for doing this kind of thing?