diff --git a/assets/images/icons.png b/assets/images/icons.png index 70f1bcbe..6dc96fad 100644 Binary files a/assets/images/icons.png and b/assets/images/icons.png differ diff --git a/assets/images/icons@2x.png b/assets/images/icons@2x.png index 24dd56c0..b6a7e356 100644 Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 3c67e1f1..41e888f1 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -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', diff --git a/assets/javascripts/templates/pages/news_tmpl.coffee b/assets/javascripts/templates/pages/news_tmpl.coffee index af8a6144..f2c74082 100644 --- a/assets/javascripts/templates/pages/news_tmpl.coffee +++ b/assets/javascripts/templates/pages/news_tmpl.coffee @@ -32,7 +32,10 @@ newsItem = (date, news) -> result app.news = [ - [ 1404518400000, # July 5, 2014 + [ 1406419200000, # July 27, 2014 + """ New Markdown documentation """, + ], [ + 1404518400000, # July 5, 2014 """ New Cordova documentation """, ], [ 1404172800000, # July 1, 2014 diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 4350bf6c..dfcb704f 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -45,6 +45,7 @@ 'pages/laravel', 'pages/less', 'pages/lodash', + 'pages/markdown', 'pages/maxcdn', 'pages/mdn', 'pages/moment', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index 1b9ffebb..775e1e47 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -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; } diff --git a/assets/stylesheets/pages/_markdown.scss b/assets/stylesheets/pages/_markdown.scss new file mode 100644 index 00000000..63c7e3d6 --- /dev/null +++ b/assets/stylesheets/pages/_markdown.scss @@ -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; } +} diff --git a/lib/docs/filters/markdown/clean_html.rb b/lib/docs/filters/markdown/clean_html.rb new file mode 100644 index 00000000..84fcb901 --- /dev/null +++ b/lib/docs/filters/markdown/clean_html.rb @@ -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 diff --git a/lib/docs/filters/markdown/entries.rb b/lib/docs/filters/markdown/entries.rb new file mode 100644 index 00000000..eb68ff27 --- /dev/null +++ b/lib/docs/filters/markdown/entries.rb @@ -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 diff --git a/lib/docs/scrapers/markdown.rb b/lib/docs/scrapers/markdown.rb new file mode 100644 index 00000000..6dc7b020 --- /dev/null +++ b/lib/docs/scrapers/markdown.rb @@ -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 + © 2004 John Gruber
+ Licensed under the BSD License. + HTML + end +end diff --git a/public/icons/docs/markdown/16.png b/public/icons/docs/markdown/16.png new file mode 100755 index 00000000..097460ad Binary files /dev/null and b/public/icons/docs/markdown/16.png differ diff --git a/public/icons/docs/markdown/16@2x.png b/public/icons/docs/markdown/16@2x.png new file mode 100755 index 00000000..9dcf39d5 Binary files /dev/null and b/public/icons/docs/markdown/16@2x.png differ diff --git a/public/icons/docs/markdown/SOURCE b/public/icons/docs/markdown/SOURCE new file mode 100644 index 00000000..389548ff --- /dev/null +++ b/public/icons/docs/markdown/SOURCE @@ -0,0 +1 @@ +https://github.com/dcurtis/markdown-mark