SourceDown
Transform your source code into easy to publish Markdown
Details
Installs
- Total 329
- Win 182
- Mac 98
- Linux 49
Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | Dec 7 | Dec 6 | Dec 5 | Dec 4 | Dec 3 | Dec 2 | Dec 1 | Nov 30 | Nov 29 | Nov 28 | Nov 27 | Nov 26 | Nov 25 | Nov 24 | Nov 23 | Nov 22 | Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
SourceDown plugin for Sublime Text
Convert your commented scripts into Markdown documents. Can be useful for blog/forum posts, tutorials, basic literate programming/scripting.
The comments get uncommented and the code gets fenced/indented. Your comments are copied verbatim so if they contain valid Markdown it will be rendered correctly. The package supports any language supported by Sublime Text (it uses scopes to detect comments).
Installation
- Install Sublime Text
- Install the plugin either:
- with **Package Control** (recommended): see <https://sublime.wbond.net/docs/usage>, or
- **manually**: by cloning this repository in your Sublime Text Package directory
Features
The source_down
command transforms the contents of the current view into a Markdown file containing code snippets as raw text and comments as main text.
For example
# # This is an example
#
# This `script` is *awesome*!
# Just run it with
#
# > python awesome.py
#
# And enjoy!
print("awesome") # TODO: add functionality
is turned into
# This is an example
This `script` is *awesome*!
Just run it with
> python awesome.py
And enjoy!
```python
print("awesome")
```
TODO: add functionality
Which in turn can be compiled to
This is an example
This
script
is awesome! Just run it with> python awesome.pyAnd enjoy!
print("awesome")TODO: add functionality
Options
fenced
(default: true
)
Use the fenced GFM syntax for code snippets. If the snippet contains backticks than the fence will be extended until it is not ambiguous where it ends (see Pandoc).
ignore_code
(default: false
)
This only processes the comments for producing the Markdown version.
convert_line_comments
(default: "lonely"
)
Line comments are the ones starting with a marker and ending with the end of the line. This setting can take the values:
"all"
: all line comments will be converted to Markdown text;"none"
: all line comments will be left as comments in the raw code block they belong to;"lonely"
: only the “standalone” line comments, i.e. the ones taking the full line, will be converted.
convert_block_comments
(default: true
)
This setting controls whether the block comments (the ones with start and end delimiters) are converted to Markdown text or left as comments in the raw code block they belong to.
keep_comments_beyond_level
(default: 2
)
Comments indented at a level greater than the one indicated will be kept as comments in a raw code block.
deindent_code
(default: false
)
If true, the raw code blocks generated from code snippets will be deindented.
deindent_comments
(default: true
)
If true, the Markdown text extracted from comments will be deindented.
guess_comments_indent_from_first_line
(default: true
)
If true, the indentation level will take in account where the first line of a block comment starts. For example
a = 0 /* The following line
will be deindented to level 0 */
gets converted to
```c
a = 0
```
The following line
will be deindented to level 0
extension
(default: "md"
)
This is the file extension associated to Markdown files.