History

Update Vuex documentation (3.6.2 and 4.0.0-rc.2)

Simon Legner committed 5 years ago

Commit bf248f01 parent 60876133 files · +21 −6Browse files

Unified · Split

3 files
  1. lib/docs/core/doc.rb +2 −2
  2. lib/docs/filters/vuex/clean_html.rb +8 −1
  3. lib/docs/scrapers/vuex.rb +11 −3
lib/docs/core/doc.rb+2−2
@@ -246,9 +246,9 @@ module Docs · 245 unmodified lines
246 JSON.parse fetch(url, opts)246 JSON.parse fetch(url, opts)
247 end247 end
248 248
249 def get_npm_version(package, opts)249 def get_npm_version(package, opts, tag='latest')
250 json = fetch_json("https://registry.npmjs.com/#{package}", opts)250 json = fetch_json("https://registry.npmjs.com/#{package}", opts)
251 json['dist-tags']['latest']251 json['dist-tags'][tag]
252 end252 end
253 253
254 def get_latest_github_release(owner, repo, opts)254 def get_latest_github_release(owner, repo, opts)
lib/docs/filters/vuex/clean_html.rb+8−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Vuex2 class Vuex
3 class CleanHtmlFilter < Filter3 class CleanHtmlFilter < Filter
4 def call4 def call
5 @doc = at_css('.content')5 @doc = at_css('main')
6 6
7 # Remove video from root page7 # Remove video from root page
8 css('a[href="#"]').remove if root_page?8 css('a[href="#"]').remove if root_page?
@@ -10,6 +10,13 @@ module Docs · 1 unmodified line
10 # Remove unneeded elements10 # Remove unneeded elements
11 css('.header-anchor').remove11 css('.header-anchor').remove
12 12
13 # Remove data-v-* attributes
14 css('*').each do |node|
15 node.attributes.each_key do |attribute|
16 node.remove_attribute(attribute) if attribute.start_with? 'data-v-'
17 end
18 end
19
13 doc20 doc
14 end21 end
15 end22 end
lib/docs/scrapers/vuex.rb+11−3
@@ -1,8 +1,6 @@
1module Docs1module Docs
2 class Vuex < UrlScraper2 class Vuex < UrlScraper
3 self.type = 'simple'3 self.type = 'simple'
4 self.release = '3.1.1'
5 self.base_url = 'https://vuex.vuejs.org/'
6 self.links = {4 self.links = {
7 home: 'https://vuex.vuejs.org',5 home: 'https://vuex.vuejs.org',
8 code: 'https://github.com/vuejs/vuex'6 code: 'https://github.com/vuejs/vuex'
@@ -20,8 +18,18 @@ module Docs · 11 unmodified lines
20 Licensed under the MIT License.18 Licensed under the MIT License.
21 HTML19 HTML
22 20
21 version '4' do
22 self.release = '4.0.0-rc.2'
23 self.base_url = 'https://next.vuex.vuejs.org/'
24 end
25
26 version '3' do
27 self.release = '3.6.2'
28 self.base_url = 'https://vuex.vuejs.org/'
29 end
30
23 def get_latest_version(opts)31 def get_latest_version(opts)
24 get_npm_version('vuex', opts)32 get_npm_version('vuex', opts, 'next')
25 end33 end
26 end34 end
27end35end