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

pull/1474/head
Simon Legner 4 years ago
parent 6087613630
commit bf248f0dff

@ -246,9 +246,9 @@ module Docs
JSON.parse fetch(url, opts)
end
def get_npm_version(package, opts)
def get_npm_version(package, opts, tag='latest')
json = fetch_json("https://registry.npmjs.com/#{package}", opts)
json['dist-tags']['latest']
json['dist-tags'][tag]
end
def get_latest_github_release(owner, repo, opts)

@ -2,7 +2,7 @@ module Docs
class Vuex
class CleanHtmlFilter < Filter
def call
@doc = at_css('.content')
@doc = at_css('main')
# Remove video from root page
css('a[href="#"]').remove if root_page?
@ -10,6 +10,13 @@ module Docs
# Remove unneeded elements
css('.header-anchor').remove
# Remove data-v-* attributes
css('*').each do |node|
node.attributes.each_key do |attribute|
node.remove_attribute(attribute) if attribute.start_with? 'data-v-'
end
end
doc
end
end

@ -1,8 +1,6 @@
module Docs
class Vuex < UrlScraper
self.type = 'simple'
self.release = '3.1.1'
self.base_url = 'https://vuex.vuejs.org/'
self.links = {
home: 'https://vuex.vuejs.org',
code: 'https://github.com/vuejs/vuex'
@ -20,8 +18,18 @@ module Docs
Licensed under the MIT License.
HTML
version '4' do
self.release = '4.0.0-rc.2'
self.base_url = 'https://next.vuex.vuejs.org/'
end
version '3' do
self.release = '3.6.2'
self.base_url = 'https://vuex.vuejs.org/'
end
def get_latest_version(opts)
get_npm_version('vuex', opts)
get_npm_version('vuex', opts, 'next')
end
end
end

Loading…
Cancel
Save