writemonkey / wm3

165 stars 5 forks source link

Suggestion for those using WM with Pandoc #380

Closed tomasrei closed 4 years ago

tomasrei commented 4 years ago

For workflow reasons I created a small script to remove the first line in my .md document. This way I can name my documents with the "name:"-function in WM, and at the same time quickly convert my .md to .pdf without removing it. Maybe it's useful for someone? This is obviously formatted for my personal use, so change the code as you please. This is for academic work and includes a bibliography file, a separate .yaml-file and also sets the language to Swedish and UTF-8.

All you have to do is copy-paste this in a text file and save as *.ps1 and run it in Powershell.

CD C:\Users\username\Desktop\ppp2020 # Filepath of .md, .yaml and .bib

Get-Content cap.md -Encoding UTF8 | Select-Object -Skip 2 | Set-Content cap_temp.md -Encoding UTF8 # Removes the first line (name:) from markdown document

pandoc  cap_temp.md default.yaml  -o cap.pdf --bibliography library.bib -V lang=sv # converts .md to .pdf 

Remove-Item 'C:\Users\username\Desktop\ppp2020\cap_temp.md' # This removes the tempfile

Hope this is ok? I don't use github very much...

writemonkey commented 4 years ago

Hi, I am working on pandoc support for wm, that will include support for YAML blocks + title & keywords aliases for name & tags. If you have any other suggestions about pandoc and workflow in wm, plese let me know. i.

tomasrei commented 4 years ago

Sounds great! It's working really well for me at least. I just got started with markdown and pandoc - so maybe somethig will come up in the near future.