At work, I mostly use Emacs for all my programming and text editing but I wouldn't really say I'm a pro. I'm more like beginner or intermediate so I'm not sure if this is really even a question.
I have been tasked with migrating our documentation from LaTeX to Markdown (Our own flavor of Markdown) and after converting to vanilla markdown with pandoc, I have found myself repeating the following pattern a lot.
Say I need to include an image in the .md
file from the figures/
directory. My markdown will look something like this
![Fission gas release experimental comparison of IFA-535 rod 809 during
the ramp test.](rod809_fgr){width="4in"}
And I need to convert it to this
!media figures/rod809_fgr.png
id=rod809_fgr
caption=Fission gas release experimental comparison of IFA-535 rod 809 during the ramp test.
style=width:50%
Notice how the file name in the parenths (rod809_fgr)
became figures/rod809_fgr.png
and id=rod809_fgr
and the description was put into the caption. Also the text was indented a specific way.
How can I write a Lisp function that highlights the original markdown and gives me the output I want? Once again, not too familiar with Lisp and still a beginner with Emacs.