mirror of https://github.com/freeCodeCamp/devdocs
parent
c3eac44d79
commit
6bcfd08bb1
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
@ -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
|
||||||
|
© 2004 John Gruber<br>
|
||||||
|
Licensed under the BSD License.
|
||||||
|
HTML
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 247 B |
After Width: | Height: | Size: 245 B |
@ -0,0 +1 @@
|
|||||||
|
https://github.com/dcurtis/markdown-mark
|
Loading…
Reference in new issue