Add Markdown documentation

pull/114/head
Thibaut 11 years ago
parent c3eac44d79
commit 6bcfd08bb1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

@ -187,6 +187,11 @@ credits = [
'2009-2013 The Dojo Foundation',
'MIT',
'https://raw.github.com/lodash/lodash/master/LICENSE.txt'
], [
'Markdown',
'2004 John Gruber',
'BSD',
'http://daringfireball.net/projects/markdown/license'
], [
'MaxCDN',
'2014 MaxCDN',

@ -32,7 +32,10 @@ newsItem = (date, news) ->
result
app.news = [
[ 1404518400000, # July 5, 2014
[ 1406419200000, # July 27, 2014
""" New <a href="/markdown/">Markdown</a> documentation """,
], [
1404518400000, # July 5, 2014
""" New <a href="/cordova/">Cordova</a> documentation """,
], [
1404172800000, # July 1, 2014

@ -45,6 +45,7 @@
'pages/laravel',
'pages/less',
'pages/lodash',
'pages/markdown',
'pages/maxcdn',
'pages/mdn',
'pages/moment',

@ -62,3 +62,4 @@
._icon-chai:before { background-position: -3rem -9rem; }
._icon-sinon:before { background-position: -4rem -9rem; }
._icon-cordova:before { background-position: 0 -10rem; }
._icon-markdown:before { background-position: -1rem -10rem; }

@ -0,0 +1,7 @@
._markdown {
padding-left: 1rem;
h1, h2, h3, h1 + ul { margin-left: -1rem; }
h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
}

@ -0,0 +1,17 @@
module Docs
class Markdown
class CleanHtmlFilter < Filter
def call
at_css('h1').content = 'Markdown'
css('#ProjectSubmenu', 'hr').remove
css('pre > code').each do |node|
node.before(node.children).remove
end
doc
end
end
end
end

@ -0,0 +1,19 @@
module Docs
class Markdown
class EntriesFilter < Docs::EntriesFilter
def additional_entries
type = nil
doc.children.each_with_object [] do |node, entries|
if node.name == 'h2'
type = node.content.strip
elsif node.name == 'h3'
next if type == 'Overview'
name = node.content.strip
entries << [name, node['id'], type]
end
end
end
end
end
end

@ -0,0 +1,17 @@
module Docs
class Markdown < UrlScraper
self.name = 'Markdown'
self.type = 'markdown'
self.base_url = 'http://daringfireball.net/projects/markdown/syntax'
html_filters.push 'markdown/clean_html', 'markdown/entries'
options[:container] = '.article'
options[:skip_links] = true
options[:attribution] = <<-HTML
&copy; 2004 John Gruber<br>
Licensed under the BSD License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

@ -0,0 +1 @@
https://github.com/dcurtis/markdown-mark
Loading…
Cancel
Save