Description
My code converts any (markdown) file to html, docx, odt, pdf, and rtf files. It takes the input file name and removes anything past the “.” and renames the file using the new format of text.
Methods
I haven’t had any prior experience with Pandoc or scripting in general before this class, so most of my code is based on outside resources.
Converting a file to the different file types was pretty straight-forward since I used information from here and here.
Creating variables was more difficult. We went over how to create new variables in class, but I had multiple issues renaming my files. For instance, my file name was “dickinson.md,” but the only way I could figure out how to rename my file resulted in “dickinson.md.’new file format’” so I had to browse Google to learn how to only use characters before the ‘.’ symbol. I ended up using this link, but had confusion over how to refer to my original variable. I don’t quite understand why I refer to my variable without the ‘$’ symbol, but I’m just glad that my code works – at least I think it does.
Product
- Repository
- Script
- I left some questions commented in my code
- Source File
- INLS161 (4) ,
- pandoc (1) ,
- experience (4) ,
- text (1) ,
- conversion (2) ,
- markdown (2) ,
- html (2) ,
- docx (1) ,
- odt (1) ,
- pdf (1) ,
- rtf (1)