I would like to find a CLI utility that replaces the inline links of a markdown file to reference-style links, a la this example.

On this website, I found a pandoc command that does something similar:

pandoc --from markdown --to markdown --reference-links --output outputfile.md inputfile.md

However, it's not a perfect solution. Running it on my jekyll blog posts deletes their YAML front matter block. The command also uses the link text for the reference, but I would prefer the number (like in the example).

Bonus if it can wrap the converted text afterwards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.