diff --git a/assets/images/icons.png b/assets/images/icons.png index 98dc7672..b73d7475 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 bc6f67db..413354ab 100644 Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index ffeab822..e9f07bf9 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,7 +1,7 @@ [ [ "2015-07-05", - "New documentations: Drupal, Phaser and webpack" + "New documentations: Drupal, Vue.js, Phaser and webpack" ], [ "2015-05-24", "New Rust documentation" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 8f386e5e..3d60e309 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -360,6 +360,11 @@ credits = [ '2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors', 'MIT', 'https://raw.github.com/jashkenas/underscore/master/LICENSE' + ], [ + 'Vue.js', + '2013-2015 Evan You, Vue.js contributors', + 'MIT', + 'https://raw.githubusercontent.com/yyx990803/vue/master/LICENSE' ], [ 'Webpack', '2012-2015 Tobias Koppers', diff --git a/assets/javascripts/views/pages/javascript.coffee b/assets/javascripts/views/pages/javascript.coffee index 7e7eaeb0..2ba17bc8 100644 --- a/assets/javascripts/views/pages/javascript.coffee +++ b/assets/javascripts/views/pages/javascript.coffee @@ -34,4 +34,5 @@ app.views.JavascriptPage app.views.RequirejsPage = app.views.SocketioPage = +app.views.VuePage = app.views.JavascriptWithMarkupCheckPage diff --git a/assets/javascripts/views/pages/vue.coffee b/assets/javascripts/views/pages/vue.coffee deleted file mode 100644 index cde197db..00000000 --- a/assets/javascripts/views/pages/vue.coffee +++ /dev/null @@ -1,14 +0,0 @@ -#= 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 diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss index 827328fd..b2942d3a 100644 --- a/assets/stylesheets/application-dark.css.scss +++ b/assets/stylesheets/application-dark.css.scss @@ -68,5 +68,6 @@ 'pages/socketio', 'pages/sphinx', 'pages/underscore', + 'pages/vue', 'pages/yard', 'pages/yii'; diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 9a27ad70..18ffdc81 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -68,5 +68,6 @@ 'pages/socketio', 'pages/sphinx', 'pages/underscore', + 'pages/vue', 'pages/yard', 'pages/yii'; diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index d545a9a9..684e6349 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -104,3 +104,4 @@ ._icon-drupal:before { background-position: 0 -8rem; } ._icon-webpack:before { background-position: -1rem -8rem; @extend %darkIconFix !optional; } ._icon-phaser:before { background-position: -2rem -8rem; } +._icon-vue:before { background-position: -3rem -8rem; } diff --git a/assets/stylesheets/pages/_base.scss b/assets/stylesheets/pages/_base.scss index c5f61cd4..ef7d422d 100644 --- a/assets/stylesheets/pages/_base.scss +++ b/assets/stylesheets/pages/_base.scss @@ -25,7 +25,6 @@ ._mocha, ._mongoose, ._sinon, -._vue, ._webpack { @extend %simple; } diff --git a/assets/stylesheets/pages/_vue.scss b/assets/stylesheets/pages/_vue.scss new file mode 100644 index 00000000..a7440214 --- /dev/null +++ b/assets/stylesheets/pages/_vue.scss @@ -0,0 +1,5 @@ +._vue { + @extend %simple; + + p.tip { @extend %note; } +} diff --git a/lib/docs/filters/vue/clean_html.rb b/lib/docs/filters/vue/clean_html.rb index 357d62ce..87e5bfa7 100644 --- a/lib/docs/filters/vue/clean_html.rb +++ b/lib/docs/filters/vue/clean_html.rb @@ -2,12 +2,19 @@ module Docs class Vue class CleanHtmlFilter < Filter def call + @doc = at_css('.content') + + at_css('h1').content = 'Vue.js' if root_page? + + css('#demo').remove + # 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') + + doc end end end diff --git a/lib/docs/filters/vue/entries.rb b/lib/docs/filters/vue/entries.rb index e9bee8ad..5a54e1b8 100644 --- a/lib/docs/filters/vue/entries.rb +++ b/lib/docs/filters/vue/entries.rb @@ -1,16 +1,25 @@ module Docs class Vue class EntriesFilter < Docs::EntriesFilter + def get_name + at_css('h1').content + end + + def get_type + if slug.start_with?('guide') + 'Guide' + else + 'API' + end + end + def additional_entries - type = nil + return [] if slug.start_with?('guide') - 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 + css('h3').map do |node| + name = node.content.strip + name.sub! %r{\(.*\)}, '()' + [name, node['id'], "API: #{self.name}"] end end end diff --git a/lib/docs/scrapers/vue.rb b/lib/docs/scrapers/vue.rb index 8e73a5dd..87a34d8a 100644 --- a/lib/docs/scrapers/vue.rb +++ b/lib/docs/scrapers/vue.rb @@ -3,16 +3,21 @@ module Docs self.name = 'Vue.js' self.slug = 'vue' self.type = 'vue' - self.version = '0.12.5' - self.base_url = 'http://vuejs.org/api/' - + self.version = '0.12.6' + self.base_url = 'http://vuejs.org' + self.root_path = '/guide/index.html' + self.initial_paths = %w(/api/index.html) + self.links = { + home: 'http://vuejs.org/', + code: 'https://github.com/yyx990803/vue' + } html_filters.push 'vue/clean_html', 'vue/entries' - options[:follow_links] = ->(filter) { filter.root_page? } + options[:only_patterns] = [/\/guide\//, /\/api\//] options[:attribution] = <<-HTML - © 2014–2015 Evan You, Vue.js contributors
+ © 2013–2015 Evan You, Vue.js contributors
Licensed under the MIT License. HTML end diff --git a/public/icons/docs/vue/16.png b/public/icons/docs/vue/16.png index 82c41419..153c58cd 100644 Binary files a/public/icons/docs/vue/16.png and b/public/icons/docs/vue/16.png differ diff --git a/public/icons/docs/vue/16@2x.png b/public/icons/docs/vue/16@2x.png index 4307b9d3..7a277fae 100644 Binary files a/public/icons/docs/vue/16@2x.png and b/public/icons/docs/vue/16@2x.png differ