Unified · Split
| @@ -0,0 +1,14 @@ | |||
| 1 | #= require views/pages/base | ||
| 2 | |||
| 3 | class app.views.VuePage extends app.views.BasePage | ||
| 4 | afterRender: -> | ||
| 5 | for el in @findAllByTag('pre') | ||
| 6 | lang = if el.classList.contains('html') or el.textContent[0] is '<' | ||
| 7 | 'markup' | ||
| 8 | else if el.classList.contains('css') | ||
| 9 | 'css' | ||
| 10 | else | ||
| 11 | 'javascript' | ||
| 12 | el.setAttribute('class', '') | ||
| 13 | @highlightCode el, lang | ||
| 14 | return | ||
| @@ -25,7 +25,7 @@ · 24 unmodified lines | |||
| 25 | ._mocha, | 25 | ._mocha, |
| 26 | ._mongoose, | 26 | ._mongoose, |
| 27 | ._sinon, | 27 | ._sinon, |
| 28 | ._vue, | ||
| 28 | ._webpack { | 29 | ._webpack { |
| 29 | @extend %simple; | 30 | @extend %simple; |
| 30 | } | 31 | } |
| 31 | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | module Docs | ||
| 2 | class Vue | ||
| 3 | class CleanHtmlFilter < Filter | ||
| 4 | def call | ||
| 5 | # Remove code highlighting | ||
| 6 | css('figure').each do |node| | ||
| 7 | node.name = 'pre' | ||
| 8 | node.content = node.at_css('td.code pre').css('.line').map(&:content).join("\n") | ||
| 9 | end | ||
| 10 | css('.content') | ||
| 11 | end | ||
| 12 | end | ||
| 13 | end | ||
| 14 | end | ||
| @@ -0,0 +1,18 @@ | |||
| 1 | module Docs | ||
| 2 | class Vue | ||
| 3 | class EntriesFilter < Docs::EntriesFilter | ||
| 4 | def additional_entries | ||
| 5 | type = nil | ||
| 6 | |||
| 7 | doc.children.each_with_object [] do |node, entries| | ||
| 8 | if node.name == 'h1' | ||
| 9 | type = node.content.strip | ||
| 10 | elsif node.name == 'h3' | ||
| 11 | name = node.content.strip | ||
| 12 | entries << [name, node['id'], type] | ||
| 13 | end | ||
| 14 | end | ||
| 15 | end | ||
| 16 | end | ||
| 17 | end | ||
| 18 | end | ||
| @@ -0,0 +1,19 @@ | |||
| 1 | module Docs | ||
| 2 | class Vue < UrlScraper | ||
| 3 | self.name = 'Vue.js' | ||
| 4 | self.slug = 'vue' | ||
| 5 | self.type = 'vue' | ||
| 6 | self.version = '0.12.5' | ||
| 7 | self.base_url = 'http://vuejs.org/api/' | ||
| 8 | |||
| 9 | |||
| 10 | html_filters.push 'vue/clean_html', 'vue/entries' | ||
| 11 | options[:follow_links] = ->(filter) { filter.root_page? } | ||
| 12 | |||
| 13 | |||
| 14 | options[:attribution] = <<-HTML | ||
| 15 | © 2014–2015 Evan You, Vue.js contributors<br> | ||
| 16 | Licensed under the MIT License. | ||
| 17 | HTML | ||
| 18 | end | ||
| 19 | end | ||
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | |||
| 1 | http://vuejs.org/ | ||