writeup-converter
writeup-converter copied to clipboard
Script for grabbing markdown files and Obsidian attachments from one folder and copying them to another.
For example, SESH Fundamental Skills Web 2 produced this text: `[many other](https://developer.mozilla.org/en-us/docs/web/http/methods)-http-methods-that-have-some-other-important-uses.-however,-the-most-important-ones-to-remember-are-**get**-(for-retrieving-information)-and-**post**-(for-sending-information).`
Website links come out as `![[None/Pasted Image...]]`
Jekyll seems to render link IDs this way by default, so do this replacement for any special characters not already handled
Might be worth checking target of link against the `filenames` array, or checking if a `[[x#y]]` link has a corresponding `# y` in the document Any that don't match this...
If same header appears more than once in a writeup (e.g. in scriptkiddie) the IDs beyond the first will have `-1`, `-2` etc appended to them. Take this into account...
E.g. for when regenerating a website export's `.md` file
If just a `http://` link is in the text with no brackets, wrap it in `[]()` - otherwise it won't be clickable
Store rules in a formatting file. Allow user to modify this or supply their own
Code quality could likely be improved - currently lots of loops over the same files List comprehensions are nice, but they limit what you can do - it might be...
E.g. turning all instances of `mac@kali $` into simply `$`