Skip to content

Latest commit

 

History

History
250 lines (195 loc) · 4.53 KB

convert-markdown-to-asciidoc.adoc

File metadata and controls

250 lines (195 loc) · 4.53 KB

Convert a Markdown page to AsciiDoc

Sample files

Download

https://raw.github.com/mojombo/jekyll/master/site/docs/pages.md

Save As

docs/_creating-pages.md

Download

https://raw.github.com/mojombo/jekyll/master/site/docs/posts.md

Save As

docs/_writing-posts.md

Formatting

Markdown
**bold**

*italic*

`literal`

`_posts`
AsciiDoc
*bold*

_italic_

+literal+ (or `literal`)

[path]+_posts+

Document header

Markdown
---
layout: docs
title: Writing posts
prev_section: defining-frontmatter
next_section: creating-pages
permalink: /docs/writing-posts/
---
AsciiDoc
= Writing posts
:page-layout: base
:showtitle:
:prev_section: defining-frontmatter
:next_section: creating-pages

Section titles (optional)

Markdown
## The Posts Folder
AsciiDoc
== The Posts Folder

!

Common article elements such as call-out warnings…​were too complex for the WYSIWYG editor.
— Jeff Eaton

!

[E]ditors tried to duplicate the precise markup. [O]thers tried to duplicate the appearance with the WYSIWYG editor’s tools.
— Jeff Eaton

Admonitions

HTML embedded in Markdown
<div class="note">
  <h5>ProTip™: Show line numbers</h5>
  <p>
    You can make code snippets include line-numbers by adding the word
    <code>linenos</code> to the end of the opening highlight tag like
    this: <code>{% raw %}{% highlight ruby linenos %}{% endraw %}</code>
  </p>
</div>
AsciiDoc
[TIP, caption='ProTip(TM)']
.Show line numbers
You can make code snippets include line-numbers by adding the word
`linenos` to the end of the opening highlight tag like this:
`{% raw %}{% highlight ruby linenos %}{% endraw %}`
Markdown
[directory structure](../structure)
AsciiDoc
link:../structure[directory structure]
Markdown
[Markdown](http://daringfireball.net/projects/markdown/)
AsciiDoc
http://daringfireball.net/projects/markdown[Markdown]
Markdown
[get the PDF]({% raw %}{{ site.url }}{% endraw %}/assets/mydoc.pdf)
AsciiDoc
link:{ctx_path}/assets/mydoc.pdf[get the PDF]
Note
The location of ctx_path must be set in the Awestruct configuration.
Markdown
As explained on the [directory structure](../structure) page, the `_posts`
folder is where your blog posts will live. These files can be either
[Markdown](http://daringfireball.net/projects/markdown/) or
[Textile](http://textile.sitemonks.com/) formatted text files, and as long as
they have [YAML front-matter](../frontmatter), they will be converted from their
source format into an HTML page that is part of your static site.
AsciiDoc
As explained on the link:../structure[directory structure] page, the `_posts`
folder is where your blog posts will live. These files can be either
http://daringfireball.net/projects/markdown/[Markdown] or
http://textile.sitemonks.com/[Textile] formatted text files, and as long as
they have link:../frontmatter[YAML front-matter], they will be converted from
their source format into an HTML page that is part of your static site.

Images

Markdown
![Helpful screenshot]({% raw %}{{ site.url }}{% endraw %}/assets/screenshot.jpg)
AsciiDoc
image::screenshots.jpg[Helpful screenshot]
Note
The location of imagesdir must be set in the Awestruct configuration.

Smart quotes

Markdown
One of Jekyll’s best aspects is that it is “blog aware”.
AsciiDoc
One of Jekyll's best aspects is that it is ``blog aware''.

Source code

Markdown
{% highlight bash %}
YEAR-MONTH-DAY-title.MARKUP
{% endhighlight %}
AsciiDoc
[source,bash]
YEAR-MONTH-DAY-title.MARKUP

Source code with callouts

Markdown
{% highlight ruby %}
def show
  @widget = Widget(params[:id])
  respond_to {|format| format.html # show.html.erb
  }
end
{% endhighlight %}
AsciiDoc
[source,ruby]
def show
  @widget = Widget(params[:id])
  respond_to {|format| format.html ##<1>
  }
end

<1> show.html.erb