This package provides a simplified Markdown text-to-HTML conversion tool.
jmm get github.com/jminusminus/markdown
import github.com.jminusminus.markdown.Markdown;
A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines.
Headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. For example:
# This is an H1
## This is an H2
###### This is an H6
Unordered lists use asterisks, pluses, and hyphens interchangeably as list markers:
* Red
* Green
* Blue
is equivalent to:
+ Red
+ Green
+ Blue
and:
- Red
- Green
- Blue
To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces. For example, given this input:
This is a normal paragraph:
This is a code block.
For pre-formatted code blocks specifing a langauge use three back tick quotes (```) on a line by them selfs.
```
function foo() {
return "bar";
}
```
Optional you can provide a language hint.
```javascript
function foo() {
return "bar";
}
```
To create an inline link, use a set of regular parentheses immediately after the link texts closing square bracket. Inside the parentheses, put the URL where you want the link to point. For example:
This is [an example](http://example.com/) inline link.
Markdown treats underscores () as indicators of emphasis. Text wrapped with one () will be wrapped with an HTML <em> tag; double (_)'s will be wrapped with an HTML <strong> tag. E.g., this input:
_single underscores_
__double underscores__
To indicate a span of code, wrap it with back tick quotes (`). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example:
Use the `printf()` function.
Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: inline and reference.
Inline image syntax looks like this:
![Alt text](/path/to/img.jpg)
Images can also be placed as link text.
Line feed.
Returns HTML from the given Markdown string.
Returns a Markdown instance with the given string parsed.
Returns HTML from the given Markdown.