Showing the changes to lib/docs (3 of 12 files). Show all
Unified · Split
| @@ -2,38 +2,21 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Jsdoc |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | − css('h2').each do |node| | |
| 6 | − next unless node.content.strip == 'Table of Contents' | |
| 7 | − toc_ul = node.next_element | |
| 8 | − toc_block = node.add_next_sibling('<nav class="_toc" role="directory"></nav>').first | |
| 9 | − | |
| 10 | − node.name = 'h3' | |
| 11 | − node['class'] = '_toc-title' | |
| 12 | − node.remove | |
| 13 | − toc_block.add_child(node) | |
| 14 | − | |
| 15 | − toc_ul.remove | |
| 16 | − toc_ul['class'] = '_toc-list' | |
| 17 | − toc_ul.css('ul').each do |child_list| | |
| 18 | − child_list.remove | |
| 19 | − end | |
| 20 | − toc_block.add_child(toc_ul) | |
| 21 | − end | |
| 5 | + at_css('h1').content = 'JSDoc' if root_page? | |
| 22 | 6 | |
| 23 | 7 | css('.prettyprint').each do |node| |
| 24 | − match = /lang-(\w+)/.match(node['class']) | |
| 25 | − next unless match | |
| 26 | − | |
| 27 | − lang = match[1] | |
| 8 | + node.content = node.content | |
| 9 | + node['data-language'] = node['class'][/lang-(\w+)/, 1] | |
| 28 | 10 | node.remove_attribute('class') |
| 29 | − node['data-language'] = lang | |
| 30 | 11 | end |
| 31 | 12 | |
| 32 | − css('figure').each do |node| | |
| 33 | − caption = node.at_css 'figcaption' | |
| 34 | − next unless caption | |
| 13 | + css('figcaption').each do |node| | |
| 14 | + node.name = 'div' | |
| 15 | + node['class'] = '_pre-heading' | |
| 16 | + end | |
| 35 | 17 | |
| 36 | − node.children.last.add_next_sibling(caption) | |
| 18 | + css('figure').each do |node| | |
| 19 | + node.before(node.children).remove | |
| 37 | 20 | end |
| 38 | 21 | |
| 39 | 22 | doc |
| @@ -2,8 +2,11 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Jsdoc |
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | 4 | def get_name |
| 5 | − at_css('h1').content | |
| 5 | + name = at_css('h1').content | |
| 6 | + name.prepend 'JSDoc: ' if !name.include?('@') && !name.include?('JSDoc') | |
| 7 | + name | |
| 6 | 8 | end |
| 9 | + | |
| 7 | 10 | def get_type |
| 8 | 11 | case slug |
| 9 | 12 | when /^about-/ |
| @@ -17,7 +20,7 @@ module Docs · 7 unmodified lines | ||
| 17 | 20 | when /^tags-/ |
| 18 | 21 | 'Tags' |
| 19 | 22 | else |
| 20 | − 'Other' # Only shown if a new category gets added in the upstream docs | |
| 23 | + 'Miscellaneous' # Only shown if a new category gets added in the upstream docs | |
| 21 | 24 | end |
| 22 | 25 | end |
| 23 | 26 | end |
| @@ -1,9 +1,10 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Jsdoc < UrlScraper |
| 3 | 3 | self.name = 'JSDoc' |
| 4 | − self.type = 'jsdoc' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.release = '3.5.5' |
| 6 | 6 | self.base_url = 'http://usejsdoc.org/' |
| 7 | + self.root_path = 'index.html' | |
| 7 | 8 | self.links = { |
| 8 | 9 | home: 'http://usejsdoc.org/', |
| 9 | 10 | code: 'https://github.com/jsdoc3/jsdoc' |
| @@ -17,14 +18,8 @@ module Docs · 7 unmodified lines | ||
| 17 | 18 | 'about-license-jsdoc3.html' |
| 18 | 19 | ] |
| 19 | 20 | options[:attribution] = <<-HTML |
| 20 | − © 2011–2017 | |
| 21 | − <a href="https://github.com/jsdoc3/jsdoc3.github.com/contributors"> | |
| 22 | − JSDoc 3 contributors | |
| 23 | − </a><br> | |
| 24 | − Licensed under | |
| 25 | − <a href="http://creativecommons.org/licenses/by-sa/3.0/"> | |
| 26 | − CC BY-SA 3.0 | |
| 27 | − </a> | |
| 21 | + © 2011–2017 the contributors to the JSDoc 3 documentation project<br> | |
| 22 | + Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0. | |
| 28 | 23 | HTML |
| 29 | 24 | end |
| 30 | 25 | end |