mirror of https://github.com/freeCodeCamp/devdocs
parent
6e4f56f6c2
commit
eea35dd09e
@ -0,0 +1,14 @@
|
||||
#= require views/pages/base
|
||||
|
||||
class app.views.VuePage extends app.views.BasePage
|
||||
afterRender: ->
|
||||
for el in @findAllByTag('pre')
|
||||
lang = if el.classList.contains('html') or el.textContent[0] is '<'
|
||||
'markup'
|
||||
else if el.classList.contains('css')
|
||||
'css'
|
||||
else
|
||||
'javascript'
|
||||
el.setAttribute('class', '')
|
||||
@highlightCode el, lang
|
||||
return
|
@ -0,0 +1,14 @@
|
||||
module Docs
|
||||
class Vue
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
# Remove code highlighting
|
||||
css('figure').each do |node|
|
||||
node.name = 'pre'
|
||||
node.content = node.at_css('td.code pre').css('.line').map(&:content).join("\n")
|
||||
end
|
||||
css('.content')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,18 @@
|
||||
module Docs
|
||||
class Vue
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def additional_entries
|
||||
type = nil
|
||||
|
||||
doc.children.each_with_object [] do |node, entries|
|
||||
if node.name == 'h1'
|
||||
type = node.content.strip
|
||||
elsif node.name == 'h3'
|
||||
name = node.content.strip
|
||||
entries << [name, node['id'], type]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,19 @@
|
||||
module Docs
|
||||
class Vue < UrlScraper
|
||||
self.name = 'Vue.js'
|
||||
self.slug = 'vue'
|
||||
self.type = 'vue'
|
||||
self.version = '0.12.5'
|
||||
self.base_url = 'http://vuejs.org/api/'
|
||||
|
||||
|
||||
html_filters.push 'vue/clean_html', 'vue/entries'
|
||||
options[:follow_links] = ->(filter) { filter.root_page? }
|
||||
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2014–2015 Evan You, Vue.js contributors<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1 @@
|
||||
http://vuejs.org/
|
Loading…
Reference in new issue