Make docs templates the real markdown files

This commit is contained in:
Marcin Kulik 2015-03-31 13:07:22 +02:00
parent 689255edf1
commit f9da63be3b
13 changed files with 406 additions and 402 deletions

View File

@ -0,0 +1,90 @@
<% content_for(:title, 'Embedding') %>
# Embedding the player
The asciicasts can easily be embedded on any HTML page. If you want
to put the recording in your blog post, in your project's documentation or
in your conference talk slides you can do it by copy-pasting the embed
script.
You can find the embed script on the asciicast's page. It looks like this:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async></script>
The player shows up right at the place where the script is pasted. Let's look
at the following markup:
<p>This is some text.</p>
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async></script>
<p>This is some other text.</p>
The player will show up as a `div` element with a class "asciicast" between
the two paragraphs.
## Customizing the player
The embed script supports several customization options. An option can be
applied by adding it as a
<code>data-<em>option-name</em>="<em>option-value</em>"</code> attribute to
the script tag.
### speed
The `speed` option alters the playback speed. The default speed is 1 which
means it plays at the unaltered, original speed.
For example, to make the playback 2 times faster than original use the
following script:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async data-speed="2"></script>
### size
The `size` option alters the size of the terminal font. There are 3 available
sizes:
* small (default)
* medium
* big
For example, to make the font big use the following script:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async data-size="big"></script>
### theme
The `theme` option allows overriding a theme used for the terminal.
It defaults to a theme set by the asciicast author (or to "tango" if not set
by the author). There are 3 available themes:
* tango
* solarized-dark
* solarized-light
For example, to use Solarized Dark theme use the following script:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async data-theme="solarized-dark"></script>
### autoplay
The `autoplay` option allows for automatic playback start when the player
loads. Accepted values:
* 0 / false - do not start playback automatically (default)
* 1 / true - start playback automatically
For example, to make the asciicast auto play use the following script:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async data-autoplay="true"></script>
### loop
The `loop` option allows for looping the playback. This option is usually
combined with `autoplay` option. Accepted values:
* 0 / false - disable looping (default)
* 1 / true - enable looping
For example, to make the asciicast play infinitely use the following script:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async data-loop="true"></script>

View File

@ -1,92 +0,0 @@
- content_for(:title, 'Embedding')
markdown:
# Embedding the player
The asciicasts can easily be embedded on any HTML page. If you want
to put the recording in your blog post, in your project's documentation or
in your conference talk slides you can do it by copy-pasting the embed
script.
You can find the embed script on the asciicast's page. It looks like this:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async></script>
The player shows up right at the place where the script is pasted. Let's look
at the following markup:
<p>This is some text.</p>
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async></script>
<p>This is some other text.</p>
The player will show up as a `div` element with a class "asciicast" between
the two paragraphs.
## Customizing the player
The embed script supports several customization options. An option can be
applied by adding it as a
<code>data-<em>option-name</em>="<em>option-value</em>"</code> attribute to
the script tag.
### speed
The `speed` option alters the playback speed. The default speed is 1 which
means it plays at the unaltered, original speed.
For example, to make the playback 2 times faster than original use the
following script:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async data-speed="2"></script>
### size
The `size` option alters the size of the terminal font. There are 3 available
sizes:
* small (default)
* medium
* big
For example, to make the font big use the following script:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async data-size="big"></script>
### theme
The `theme` option allows overriding a theme used for the terminal.
It defaults to a theme set by the asciicast author (or to "tango" if not set
by the author). There are 3 available themes:
* tango
* solarized-dark
* solarized-light
For example, to use Solarized Dark theme use the following script:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async data-theme="solarized-dark"></script>
### autoplay
The `autoplay` option allows for automatic playback start when the player
loads. Accepted values:
* 0 / false - do not start playback automatically (default)
* 1 / true - start playback automatically
For example, to make the asciicast auto play use the following script:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async data-autoplay="true"></script>
### loop
The `loop` option allows for looping the playback. This option is usually
combined with `autoplay` option. Accepted values:
* 0 / false - disable looping (default)
* 1 / true - enable looping
For example, to make the asciicast play infinitely use the following script:
<script type="text/javascript" src="https://asciinema.org/a/14.js" id="asciicast-14" async data-loop="true"></script>

View File

@ -0,0 +1,39 @@
<% content_for(:title, 'FAQ') %>
# Frequently Asked Questions
## Can I embed the asciicast player on my blog?
Yes, see [embedding docs](<%= docs_path(:embedding) %>).
## How can I delete my asciicast?
In order to delete your asciicast you need to associate your local API token
(which was assigned to the recorded asciicast) with the asciinema.org
account. Just run `asciinema auth` in your terminal and open the printed URL
in your browser. Once you sign in you'll see a "Delete" link on your
asciicast's page.
## Can I have my own asciinema site instance?
Yes, you can set up your own asciinema site. The source code of the app that
runs asciinema.org is available
[here](https://github.com/asciinema/asciinema.org).
When you have the site up and running you can easily tell asciinema client to
use it by adding following setting to _~/.asciinema/config_ file:
[api]
url = http://asciinema.example.com
Alternatively, you can set `ASCIINEMA_API_URL` env variable:
ASCIINEMA_API_URL=http://asciinema.example.com asciinema rec
## Can I edit/post-process the recorded asciicast?
Yes, if you know how to deal with [ansi escape
sequences](https://en.wikipedia.org/wiki/ANSI_escape_code). Asciicasts are
self-contained JSON files which you can edit before uploading. Look at
`stdout` attribute in [asciicast format doc](https://github.com/asciinema/asciinema/blob/master/doc/asciicast-v1.md)
for inspiration.

View File

@ -1,41 +0,0 @@
- content_for(:title, 'FAQ')
markdown:
# Frequently Asked Questions
## Can I embed the asciicast player on my blog?
Yes, see [embedding docs](#{docs_path(:embedding)}).
## How can I delete my asciicast?
In order to delete your asciicast you need to associate your local API token
(which was assigned to the recorded asciicast) with the asciinema.org
account. Just run `asciinema auth` in your terminal and open the printed URL
in your browser. Once you sign in you'll see a "Delete" link on your
asciicast's page.
## Can I have my own asciinema site instance?
Yes, you can set up your own asciinema site. The source code of the app that
runs asciinema.org is available
[here](https://github.com/asciinema/asciinema.org).
When you have the site up and running you can easily tell asciinema client to
use it by adding following setting to _~/.asciinema/config_ file:
[api]
url = http://asciinema.example.com
Alternatively, you can set `ASCIINEMA_API_URL` env variable:
ASCIINEMA_API_URL=http://asciinema.example.com asciinema rec
## Can I edit/post-process the recorded asciicast?
Yes, if you know how to deal with [ansi escape
sequences](https://en.wikipedia.org/wiki/ANSI_escape_code). Asciicasts are
self-contained JSON files which you can edit before uploading. Look at
`stdout` attribute in [asciicast format doc](https://github.com/asciinema/asciinema/blob/master/doc/asciicast-v1.md)
for inspiration.

View File

@ -0,0 +1,33 @@
<% content_for(:title, 'Getting started') %>
# Getting started
## 1. Install the recorder
<%= render partial: 'docs/script_install_and_other' %>
## 2. Record
Go to your terminal and run the following command:
asciinema rec
New shell will be spawned and everything you do in it will get recorded.
When you're ready to finish simply exit the shell either by typing `exit` or
hitting <kbd>Ctrl-D</kdb>.
See [usage instructions](<%= docs_path(:usage) %>) to learn about all commands and options.
## 3. Create your profile (optional)
If you want your recordings to be assigned to your asciinema profile run the
following command:
asciinema auth
If you skip this step now, you can run the above command later and all
previously recorded asciicasts will automatically get assigned to your
profile.
NOTE: To be able to edit/delete your recordings you have to assign them to
your profile.

View File

@ -1,34 +0,0 @@
- content_for(:title, 'Getting started')
h1 Getting started
h2 1. Install the recorder
= render partial: 'docs/script_install_and_other'
markdown:
## 2. Record
Go to your terminal and run the following command:
asciinema rec
New shell will be spawned and everything you do in it will get recorded.
When you're ready to finish simply exit the shell either by typing `exit` or
hitting <kbd>Ctrl-D</kdb>.
See [usage instructions](#{docs_path(:usage)}) to learn about all commands and options.
## 3. Create your profile (optional)
If you want your recordings to be assigned to your asciinema profile run the
following command:
asciinema auth
If you skip this step now, you can run the above command later and all
previously recorded asciicasts will automatically get assigned to your
profile.
NOTE: To be able to edit/delete your recordings you have to assign them to
your profile.

View File

@ -0,0 +1,81 @@
<% content_for(:title, 'How it works') %>
# How it works
asciinema project is built of several complementary pieces:
* command-line based terminal session recorder, `asciinema`,
* website with an API at asciinema.org,
* javascript player
When you run `asciinema rec` in your terminal the recording starts, capturing
all output that is being printed to your terminal while you're issuing the
shell commands. When the recording finishes (by hitting <kbd>Ctrl-D</kbd> or
typing `exit`) then the captured output is uploaded to asciinema.org website
and prepared for playback on the web.
Here's a brief overview of how these parts work.
## Recording
You probably know `ssh`, `screen` or `script` command. Actually, asciinema
was inspired by `script` (and `scriptreplay`) commands. What you may not know
is they all use the same UNIX system capability: [a
pseudo-terminal](http://en.wikipedia.org/wiki/Pseudo_terminal).
> A pseudo terminal is a pair of pseudo-devices, one of which, the slave,
> emulates a real text terminal device, the other of which, the master,
> provides the means by which a terminal emulator process controls the slave.
Here's how terminal emulator interfaces with a user and a shell:
> The role of the terminal emulator process is to interact with the user; to
> feed text input to the master pseudo-device for use by the shell (which is
> connected to the slave pseudo-device) and to read text output from the
> master pseudo-device and show it to the user.
In other words, pseudo-terminals give programs the ability to act as a
middlemen between the user, the display and the shell. It allows for
transparent capture of user input (keyboard) and terminal output (display).
`screen` command utilizes it for capturing special keyboard shortcuts like
<kbd>Ctrl-A</kbd> and altering the output in order to display window
numbers/names and other messages.
asciinema recorder does its job by utilizing pseudo-terminal for capturing
all the output that goes to a terminal and saving it in memory (together with
timing information). The captured output includes all the text and invisible
escape/control sequences in a raw, unaltered form. When the recording session
finishes it uploads the output to asciinema.org. That's all about "recording"
part.
For the implementation details check out [recorder source
code](https://github.com/asciinema/asciinema).
## Playback
When asciinema.org accepts the upload of the captured output it saves it in a
file. Now, as the output is a raw, unaltered stream of text and control
sequences it can't be just played by incrementally printing text in proper
intervals. It requires interpretation of [ANSI escape code
sequences](http://en.wikipedia.org/wiki/ANSI_escape_code) in order to
correctly display color changes, cursor movement and printing text at proper
places on the screen.
Escape sequence interpretation was initially handled by asciinema's own VT100
terminal emulation layer written in Javascript but was later replaced with
[libtsm](http://www.freedesktop.org/wiki/Software/kmscon/libtsm/) based
interpreter. libtsm, "terminal-emulator state machine", is a wonderful, rock
solid library created by David Herrmann that is meant to be used by terminal
emulator authors and others in need of an escape sequence interpreter.
asciinema.org pre-processes the captured stream with libtsm based converter and
saves the result in a JSON file that contains simple representation of screen
changes for each animation frame (for each line that was changed on the
screen there is a string to be printed and color attributes for it). The
player loads the JSON data and simply renders each change at a right time.
The end result is a smooth animation with all text attributes (bold,
underline, inverse, ...) and 256 colors perfectly rendered.
For the implementation details check out [asciinema.org source
code](https://github.com/asciinema/asciinema.org).

View File

@ -1,83 +0,0 @@
- content_for(:title, 'How it works')
markdown:
# How it works
asciinema project is built of several complementary pieces:
* command-line based terminal session recorder, `asciinema`,
* website with an API at asciinema.org,
* javascript player
When you run `asciinema rec` in your terminal the recording starts, capturing
all output that is being printed to your terminal while you're issuing the
shell commands. When the recording finishes (by hitting <kbd>Ctrl-D</kbd> or
typing `exit`) then the captured output is uploaded to asciinema.org website
and prepared for playback on the web.
Here's a brief overview of how these parts work.
## Recording
You probably know `ssh`, `screen` or `script` command. Actually, asciinema
was inspired by `script` (and `scriptreplay`) commands. What you may not know
is they all use the same UNIX system capability: [a
pseudo-terminal](http://en.wikipedia.org/wiki/Pseudo_terminal).
> A pseudo terminal is a pair of pseudo-devices, one of which, the slave,
> emulates a real text terminal device, the other of which, the master,
> provides the means by which a terminal emulator process controls the slave.
Here's how terminal emulator interfaces with a user and a shell:
> The role of the terminal emulator process is to interact with the user; to
> feed text input to the master pseudo-device for use by the shell (which is
> connected to the slave pseudo-device) and to read text output from the
> master pseudo-device and show it to the user.
In other words, pseudo-terminals give programs the ability to act as a
middlemen between the user, the display and the shell. It allows for
transparent capture of user input (keyboard) and terminal output (display).
`screen` command utilizes it for capturing special keyboard shortcuts like
<kbd>Ctrl-A</kbd> and altering the output in order to display window
numbers/names and other messages.
asciinema recorder does its job by utilizing pseudo-terminal for capturing
all the output that goes to a terminal and saving it in memory (together with
timing information). The captured output includes all the text and invisible
escape/control sequences in a raw, unaltered form. When the recording session
finishes it uploads the output to asciinema.org. That's all about "recording"
part.
For the implementation details check out [recorder source
code](https://github.com/asciinema/asciinema).
## Playback
When asciinema.org accepts the upload of the captured output it saves it in a
file. Now, as the output is a raw, unaltered stream of text and control
sequences it can't be just played by incrementally printing text in proper
intervals. It requires interpretation of [ANSI escape code
sequences](http://en.wikipedia.org/wiki/ANSI_escape_code) in order to
correctly display color changes, cursor movement and printing text at proper
places on the screen.
Escape sequence interpretation was initially handled by asciinema's own VT100
terminal emulation layer written in Javascript but was later replaced with
[libtsm](http://www.freedesktop.org/wiki/Software/kmscon/libtsm/) based
interpreter. libtsm, "terminal-emulator state machine", is a wonderful, rock
solid library created by David Herrmann that is meant to be used by terminal
emulator authors and others in need of an escape sequence interpreter.
asciinema.org pre-processes the captured stream with libtsm based converter and
saves the result in a JSON file that contains simple representation of screen
changes for each animation frame (for each line that was changed on the
screen there is a string to be printed and color attributes for it). The
player loads the JSON data and simply renders each change at a right time.
The end result is a smooth animation with all text attributes (bold,
underline, inverse, ...) and 256 colors perfectly rendered.
For the implementation details check out [asciinema.org source
code](https://github.com/asciinema/asciinema.org).

View File

@ -0,0 +1,66 @@
<% content_for(:title, 'Installation') %>
# Installation
## The easy way
<%= render partial: 'docs/script_install' %>
## Manual download
You can
[download the latest binary](https://github.com/asciinema/asciinema/releases)
for your platform and place it in your `$PATH`.
## Using package manager
You can also use your favorite package manager to install asciinema recorder.
Note that it takes time for native packages to be updated so you may not get
the latest released version.
### Homebrew
On OS X asciinema is available in Homebrew:
brew update
brew install asciinema
### Arch Linux
Arch Linux users can install the
[AUR package](https://aur.archlinux.org/packages/asciinema/):
sudo yaourt -S asciinema
### Fedora
asciinema rpm package is included in the main Fedora 19 and 20 repository:
sudo yum install asciinema
### Gentoo Linux
Gentoo Linux users can install the
[portage package](http://packages.gentoo.org/package/app-misc/asciinema):
sudo emerge asciinema
### Ubuntu
To install Ubuntu package add
[zanchey ppa](https://launchpad.net/~zanchey/+archive/asciinema) to your
software sources list:
sudo apt-add-repository ppa:zanchey/asciinema
sudo apt-get update
sudo apt-get install asciinema
### No package for your operating system?
If you use other operating system and you know how to build a native package
for it then don't hesitate, build one and let us know.
## From source
For instructions on building asciinema from source please refer to the
[README file](https://github.com/asciinema/asciinema/blob/master/README.md).

View File

@ -1,67 +0,0 @@
- content_for(:title, 'Installation')
h1 Installation
h2 The easy way
= render partial: 'docs/script_install'
markdown:
## Manual download
You can
[download the latest binary](https://github.com/asciinema/asciinema/releases)
for your platform and place it in your `$PATH`.
## Using package manager
You can also use your favorite package manager to install asciinema recorder.
Note that it takes time for native packages to be updated so you may not get
the latest released version.
### Homebrew
On OS X asciinema is available in Homebrew:
brew update
brew install asciinema
### Arch Linux
Arch Linux users can install the
[AUR package](https://aur.archlinux.org/packages/asciinema/):
sudo yaourt -S asciinema
### Fedora
asciinema rpm package is included in the main Fedora 19 and 20 repository:
sudo yum install asciinema
### Gentoo Linux
Gentoo Linux users can install the
[portage package](http://packages.gentoo.org/package/app-misc/asciinema):
sudo emerge asciinema
### Ubuntu
To install Ubuntu package add
[zanchey ppa](https://launchpad.net/~zanchey/+archive/asciinema) to your
software sources list:
sudo apt-add-repository ppa:zanchey/asciinema
sudo apt-get update
sudo apt-get install asciinema
### No package for your operating system?
If you use other operating system and you know how to build a native package
for it then don't hesitate, build one and let us know.
## From source
For instructions on building asciinema from source please refer to the
[README file](https://github.com/asciinema/asciinema/blob/master/README.md).

View File

@ -0,0 +1,84 @@
<% content_for(:title, 'Usage') %>
# Usage
asciinema is composed of multiple commands, similar to `git`, `rails` or
`brew`.
When you run `asciinema` with no arguments help message is displayed showing
all available commands with their options.
## `rec [filename]`
__Record terminal session.__
This is the single most important command in asciinema, since it is how you
utilize this tool's main job.
By running `asciinema rec [filename]` you start a new recording session. The
command (process) that is recorded can be specified with `-c` option (see
below), and defaults to `$SHELL` which is what you want in most cases.
Recording finishes when you exit the shell (hit <kbd>Ctrl+D</kbd> or type
`exit`). If the recorded process is not a shell then recording finishes when
the process exits.
If the `filename` argument is given then the resulting recording (called
[asciicast](https://github.com/asciinema/asciinema/blob/master/doc/asciicast-v1.md))
is saved to a local file. It can later be replayed with `asciinema play
<filename>` and/or uploaded to asciinema.org with `asciinema upload
<filename>`. If the `filename` argument is omitted then (after asking for
confirmation) the resulting asciicast is uploaded to asciinema.org for further
playback in a web browser.
`ASCIINEMA_REC=1` is added to recorded process environment variables. This
can be used by your shell's config file (`.bashrc`, `.zshrc`) to alter the
prompt or play a sound when shell is being recorded.
Available options:
* `-c, --command=<command>` - Specify command to record, defaults to $SHELL
* `-t, --title=<title>` - Specify title of the asciicast
* `-w, --max-wait=<sec>` - Reduce recorded terminal inactivity to max <sec> seconds
* `-y, --yes` - Answer yes to all prompts (e.g. upload confirmation)
## `play <filename>`
__Replay recorded asciicast in a terminal.__
This command replays given asciicast (as recorded by `rec` command) directly in
your terminal.
NOTE: it is recommended to run it in a terminal of dimensions not smaller than
the one used for recording as there's no "transcoding" of control sequences for
new terminal size.
## `upload <filename>`
__Upload recorded asciicast to asciinema.org site.__
This command uploads given asciicast (as recorded by `rec` command) to
asciinema.org for further playback in a web browser.
`asciinema rec demo.json` + `asciinema play demo.json` + `asciinema upload
demo.json` is a nice combo for when you want to review an asciicast before
publishing it on asciinema.org.
## `auth`
__Assign local API token to asciinema.org account.__
On every machine you install asciinema recorder, you get a new, unique API
token. This command connects this local token with your asciinema.org account,
and links all asciicasts recorded on this machine with the account.
This command displays the URL you should open in your web browser. If you never
logged in to asciinema.org then your account will be created when opening the
URL.
NOTE: it is __necessary__ to do this if you want to __edit or delete__ your
recordings on asciinema.org.
You can synchronize your `~/.asciinema/config` file (which keeps the API
token) across the machines but that's not necessary. You can assign new
tokens to your account from as many machines as you want.

View File

@ -1,85 +0,0 @@
- content_for(:title, 'Usage')
markdown:
# Usage
asciinema is composed of multiple commands, similar to `git`, `rails` or
`brew`.
When you run `asciinema` with no arguments help message is displayed showing
all available commands with their options.
## `rec [filename]`
__Record terminal session.__
This is the single most important command in asciinema, since it is how you
utilize this tool's main job.
By running `asciinema rec [filename]` you start a new recording session. The
command (process) that is recorded can be specified with `-c` option (see
below), and defaults to `$SHELL` which is what you want in most cases.
Recording finishes when you exit the shell (hit <kbd>Ctrl+D</kbd> or type
`exit`). If the recorded process is not a shell then recording finishes when
the process exits.
If the `filename` argument is given then the resulting recording (called
[asciicast](doc/asciicast-v1.md)) is saved to a local file. It can later be
replayed with `asciinema play <filename>` and/or uploaded to asciinema.org with
`asciinema upload <filename>`. If the `filename` argument is omitted then
(after asking for confirmation) the resulting asciicast is uploaded to
asciinema.org for further playback in a web browser.
`ASCIINEMA_REC=1` is added to recorded process environment variables. This
can be used by your shell's config file (`.bashrc`, `.zshrc`) to alter the
prompt or play a sound when shell is being recorded.
Available options:
* `-c, --command=<command>` - Specify command to record, defaults to $SHELL
* `-t, --title=<title>` - Specify title of the asciicast
* `-w, --max-wait=<sec>` - Reduce recorded terminal inactivity to max <sec> seconds
* `-y, --yes` - Answer yes to all prompts (e.g. upload confirmation)
## `play <filename>`
__Replay recorded asciicast in a terminal.__
This command replays given asciicast (as recorded by `rec` command) directly in
your terminal.
NOTE: it is recommended to run it in a terminal of dimensions not smaller than
the one used for recording as there's no "transcoding" of control sequences for
new terminal size.
## `upload <filename>`
__Upload recorded asciicast to asciinema.org site.__
This command uploads given asciicast (as recorded by `rec` command) to
asciinema.org for further playback in a web browser.
`asciinema rec demo.json` + `asciinema play demo.json` + `asciinema upload
demo.json` is a nice combo for when you want to review an asciicast before
publishing it on asciinema.org.
## `auth`
__Assign local API token to asciinema.org account.__
On every machine you install asciinema recorder, you get a new, unique API
token. This command connects this local token with your asciinema.org account,
and links all asciicasts recorded on this machine with the account.
This command displays the URL you should open in your web browser. If you never
logged in to asciinema.org then your account will be created when opening the
URL.
NOTE: it is __necessary__ to do this if you want to __edit or delete__ your
recordings on asciinema.org.
You can synchronize your `~/.asciinema/config` file (which keeps the API
token) across the machines but that's not necessary. You can assign new
tokens to your account from as many machines as you want.

View File

@ -9,3 +9,16 @@ MKD_RENDERER = Redcarpet::Markdown.new(
:no_intra_emphasis => true, :no_intra_emphasis => true,
:autolink => true :autolink => true
) )
module MarkdownHandler
def self.erb
@erb ||= ActionView::Template.registered_template_handler(:erb)
end
def self.call(template)
compiled_source = erb.call(template)
"MKD_RENDERER.render(begin;#{compiled_source};end)"
end
end
ActionView::Template.register_template_handler :md, MarkdownHandler