Skip to main content
edited tags
Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

How Dodo I Createwrite a Key Bindingfunction to Replace Specificreplace specific Markdown Texttext?

At work, I mostly use emacsEmacs 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.

Is there a way toHow can I write a lispLisp function where I can highlightthat highlights the original markdown and getgives me the output I want? Once again, not too familiar with lispLisp and still a beginner with emacsEmacs.

How Do I Create a Key Binding to Replace Specific Markdown Text?

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.

Is there a way to write a lisp function where I can highlight the original markdown and get the output I want? Once again, not too familiar with lisp and still a beginner with emacs.

How do I write a function to replace specific Markdown text?

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.

Source Link
dylanjm
  • 333
  • 2
  • 10

How Do I Create a Key Binding to Replace Specific Markdown Text?

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.

Is there a way to write a lisp function where I can highlight the original markdown and get the output I want? Once again, not too familiar with lisp and still a beginner with emacs.