Sublime Forum

Source Code to Markdown conversion: SourceDown

#1

Recently added to Package Control: SourceDown, a ST plugin to convert any source code into readable, easy to publish Markdown.
sublime.wbond.net/packages/SourceDown

It takes your comments and transforms them into normal text, while wrapping code into fenced/indented raw code blocks.
If you write your comments in Markdown the extracted document will contain all the markup you used in them.
Can serve as a poor’s man form of literate programming or for keeping your programming tutorials in a runnable/testable format and publish them when ready.

For example

[code]# # This is an example

This script is awesome!

Just run it with

> python awesome.py

And enjoy!

print(“awesome”) #> TODO: add functionality[/code]

gets converted into

[code]# This is an example

This script is awesome!
Just run it with

> python awesome.py

And enjoy!

print("awesome") 

TODO: add functionality[/code]

0 Likes