Unified · Split
| @@ -2,16 +2,37 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Sequelize |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | + @doc = at_css('.content') | |
| 6 | + | |
| 5 | 7 | # Clean up the home page |
| 6 | − if root_page? | |
| 8 | + if root_page? || subpath == "index.html" | |
| 7 | 9 | # Remove logo |
| 8 | 10 | css('.manual-user-index > div > div.logo').remove |
| 9 | − # Convert title to proper H1 element | |
| 11 | + | |
| 12 | + # Convert title to proper h1 element | |
| 10 | 13 | at_css('.manual-user-index > div > div.sequelize').name = 'h1' |
| 14 | + | |
| 11 | 15 | # Remove badges (NPM, Travis, test coverage, etc.) |
| 12 | 16 | css('.manual-user-index > p:nth-child(4)').remove |
| 17 | + | |
| 13 | 18 | # Remove image cards pointing to entries of the manual |
| 14 | 19 | css('.manual-cards').remove |
| 20 | + | |
| 21 | + # Pull the header out of it's container | |
| 22 | + header = at_css('h1') | |
| 23 | + header.parent.parent.parent.add_previous_sibling header | |
| 24 | + else | |
| 25 | + # Pull the header out of it's container | |
| 26 | + header = at_css('h1') | |
| 27 | + header.parent.add_previous_sibling header | |
| 28 | + end | |
| 29 | + | |
| 30 | + # Remove header notice | |
| 31 | + css('.header-notice').remove | |
| 32 | + | |
| 33 | + # Change td in thead to th | |
| 34 | + css('table > thead > tr > td').each do |node| | |
| 35 | + node.name = 'th' | |
| 15 | 36 | end |
| 16 | 37 | |
| 17 | 38 | # Add syntax highlighting to code blocks |
| @@ -9,17 +9,24 @@ module Docs · 8 unmodified lines | ||
| 9 | 9 | # Assign the pages to main categories |
| 10 | 10 | def get_type |
| 11 | 11 | if path.start_with?('manual/') |
| 12 | − type = 'Manual' | |
| 13 | − elsif path.start_with?('file/lib/') | |
| 14 | − type = 'Source files' | |
| 12 | + 'Manual' | |
| 13 | + elsif path.include?('lib/data-types') | |
| 14 | + 'datatypes' | |
| 15 | + elsif path.include?('lib/errors/validation') | |
| 16 | + 'errors/validation' | |
| 17 | + elsif path.include?('lib/errors/database') | |
| 18 | + 'errors/database' | |
| 19 | + elsif path.include?('lib/errors/connection') | |
| 20 | + 'errors/connection' | |
| 21 | + elsif path.include?('lib/errors') | |
| 22 | + 'errors' | |
| 23 | + elsif path.include?('lib/associations') | |
| 24 | + 'associations' | |
| 25 | + elsif path.include?('master/variable') | |
| 26 | + 'variables' | |
| 15 | 27 | else |
| 16 | − # API Reference pages. The `path` for most of these starts with 'class/lib/', | |
| 17 | − # but there's also 'variable/index' (pseudo-classes), and 'identifiers' (the main index) | |
| 18 | − # so we use an unqualified `else` as a catch-all. | |
| 19 | − type = 'Reference' | |
| 28 | + 'classes' | |
| 20 | 29 | end |
| 21 | − | |
| 22 | − type | |
| 23 | 30 | end |
| 24 | 31 | end |
| 25 | 32 | end |
| @@ -3,18 +3,18 @@ module Docs · 2 unmodified lines | ||
| 3 | 3 | self.name = 'Sequelize' |
| 4 | 4 | self.slug = 'sequelize' |
| 5 | 5 | self.type = 'simple' |
| 6 | − self.release = '5.19.6' | |
| 6 | + self.release = '5.21.1' | |
| 7 | 7 | self.base_url = 'https://sequelize.org/master/' |
| 8 | 8 | self.links = { |
| 9 | 9 | home: 'https://sequelize.org/', |
| 10 | − code: 'https://github.com/sequelize/sequelize/' | |
| 10 | + code: 'https://github.com/sequelize/sequelize' | |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | # List of content filters (to be applied sequentially) |
| 14 | 14 | html_filters.push 'sequelize/entries', 'sequelize/clean_html' |
| 15 | 15 | |
| 16 | − # Wrapper element that holds the main content | |
| 17 | − options[:container] = '.content' | |
| 16 | + # Skip the source files, the license page and the "Who's using Sequelize" page | |
| 17 | + options[:skip_patterns] = [/\.js\.html/, /manual\/legal\.html/, /manual\/whos-using\.html/] | |
| 18 | 18 | |
| 19 | 19 | # License information that appears appears at the bottom of the entry page |
| 20 | 20 | options[:attribution] = <<-HTML |