Update Sequelize documentation (6.23.2)

pull/1826/head
Simon Legner 2 years ago
parent 666d655c70
commit 73af877589

@ -2,26 +2,9 @@ module Docs
class Sequelize class Sequelize
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
@doc = at_css('.content') @doc = at_css('article', '.content')
# Clean up the home page if at_css('header > h1')
if root_page? || subpath == "index.html"
# Remove logo
css('.manual-user-index > div > div.logo').remove
# Convert title to proper h1 element
at_css('.manual-user-index > div > div.sequelize').name = 'h1'
# Remove badges (NPM, Travis, test coverage, etc.)
css('.manual-user-index > p:nth-child(4)').remove
# Remove image cards pointing to entries of the manual
css('.manual-cards').remove
# Pull the header out of its container
header = at_css('h1')
header.parent.parent.parent.add_previous_sibling header
else
# Pull the header out of its container # Pull the header out of its container
header = at_css('h1') header = at_css('h1')
header.parent.add_previous_sibling header header.parent.add_previous_sibling header
@ -36,18 +19,13 @@ module Docs
end end
# Add syntax highlighting to code blocks # Add syntax highlighting to code blocks
css('pre > code[class^="lang-"]').each do |node| css('pre[class^="prism-code language-"]').each do |node|
pre = node.parent node['data-language'] = node['class'][/language-(\w+)/, 1] if node['class'] and node['class'][/language-(\w+)/]
# Convert the existing language definitions to Prism-compatible attributes node.content = node.css('.token-line').map(&:content).join("\n")
pre['data-language'] = 'javascript' if node['class'] == 'lang-js' || node['class'] == 'lang-javascript'
pre['data-language'] = 'json' if node['class'] == 'lang-json'
pre['data-language'] = 'shell' if node['class'] == 'lang-sh' || node['class'] == 'lang-bash'
pre['data-language'] = 'sql' if node['class'] == 'lang-sql'
pre['data-language'] = 'typescript' if node['class'] == 'lang-ts'
end end
# Return the cleaned-up document # Return the cleaned-up document
doc at_css('.markdown') || doc
end end
end end
end end

@ -8,19 +8,19 @@ module Docs
# Assign the pages to main categories # Assign the pages to main categories
def get_type def get_type
if path.start_with?('manual/') if base_url.path.include?('/docs/')
'Manual' 'Manual'
elsif path.include?('lib/data-types') elsif path.include?('src/data-types')
'datatypes' 'datatypes'
elsif path.include?('lib/errors/validation') elsif path.include?('src/errors/validation')
'errors/validation' 'errors/validation'
elsif path.include?('lib/errors/database') elsif path.include?('src/errors/database')
'errors/database' 'errors/database'
elsif path.include?('lib/errors/connection') elsif path.include?('src/errors/connection')
'errors/connection' 'errors/connection'
elsif path.include?('lib/errors') elsif path.include?('src/errors')
'errors' 'errors'
elsif path.include?('lib/associations') elsif path.include?('src/associations')
'associations' 'associations'
elsif path.include?('master/variable') elsif path.include?('master/variable')
'variables' 'variables'
@ -28,6 +28,11 @@ module Docs
'classes' 'classes'
end end
end end
def include_default_entry?
at_css('.card > h2:contains("📄️")').nil?
end
end end
end end
end end

@ -1,5 +1,7 @@
module Docs module Docs
class Sequelize < UrlScraper class Sequelize < UrlScraper
include MultipleBaseUrls
self.name = 'Sequelize' self.name = 'Sequelize'
self.slug = 'sequelize' self.slug = 'sequelize'
self.type = 'simple' self.type = 'simple'
@ -20,9 +22,20 @@ module Docs
Licensed under the MIT License. Licensed under the MIT License.
HTML HTML
def initial_urls
[
"https://sequelize.org/docs/v6/",
"https://sequelize.org/api/v6/identifiers.html",
]
end
version '6' do version '6' do
self.release = '6.5.0' self.release = '6.23.2'
self.base_url = "https://sequelize.org/master/" self.base_url = "https://sequelize.org/docs/v6/"
self.base_urls = [
"https://sequelize.org/docs/v6/",
"https://sequelize.org/api/v6/",
]
end end
version '5' do version '5' do

Loading…
Cancel
Save