Add documentations for vue.js

pull/229/merge
kikyous 10 years ago committed by Thibaut
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

@ -25,7 +25,7 @@
._mocha,
._mongoose,
._sinon,
._vue,
._webpack {
@extend %simple;
}

@ -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
&copy; 2014&ndash;2015 Evan You, Vue.js contributors<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -0,0 +1 @@
http://vuejs.org/
Loading…
Cancel
Save