|
|
@@ -2,10 +2,6 @@
|
|
|
|
|
|
module Docs
|
|
|
class Koa < Github
|
|
|
- self.base_url = 'https://github.com/koajs/koa/blob/master/docs'
|
|
|
- self.release = '2.15.0'
|
|
|
-
|
|
|
- self.root_path = 'api/index.md'
|
|
|
self.initial_paths = %w[
|
|
|
error-handling
|
|
|
faq
|
|
|
@@ -30,16 +26,43 @@ module Docs
|
|
|
options[:trailing_slash] = false
|
|
|
options[:container] = '.markdown-body'
|
|
|
|
|
|
- options[:fix_urls] = ->(url) do
|
|
|
- url.sub! 'https://koajs.com/#error-handling', Koa.base_url + '/error-handling.md'
|
|
|
- url
|
|
|
- end
|
|
|
+
|
|
|
|
|
|
options[:attribution] = <<-HTML
|
|
|
© 2020 Koa contributors<br>
|
|
|
Licensed under the MIT License.
|
|
|
HTML
|
|
|
|
|
|
+ version do
|
|
|
+ self.base_url = 'https://github.com/koajs/koa/blob/v3.0.0/docs'
|
|
|
+ self.root_path = 'api/index.md'
|
|
|
+ self.release = '3.0.0'
|
|
|
+ options[:fix_urls] = ->(url) do
|
|
|
+ url.sub! 'https://koajs.com/#error-handling', self.base_url + '/error-handling.md'
|
|
|
+ url
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ version '2' do
|
|
|
+ self.base_url = 'https://github.com/koajs/koa/blob/v2.16.1/docs'
|
|
|
+ self.root_path = 'api/index.md'
|
|
|
+ self.release = '2.16.1'
|
|
|
+ options[:fix_urls] = ->(url) do
|
|
|
+ url.sub! 'https://koajs.com/#error-handling', self.base_url + '/error-handling.md'
|
|
|
+ url
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ version '1' do
|
|
|
+ self.base_url = 'https://github.com/koajs/koa/blob/1.7.1/docs'
|
|
|
+ self.root_path = 'api/index.md'
|
|
|
+ self.release = '1.7.1'
|
|
|
+ options[:fix_urls] = ->(url) do
|
|
|
+ url.sub! 'https://koajs.com/#error-handling', self.base_url + '/error-handling.md'
|
|
|
+ url
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
def get_latest_version(opts)
|
|
|
get_npm_version('koa', opts)
|
|
|
end
|