Unified · Split
| @@ -0,0 +1,12 @@ | |||
| 1 | # frozen_string_literal: true | ||
| 2 | |||
| 3 | module Docs | ||
| 4 | class Qunit | ||
| 5 | class CleanHtmlFilter < Filter | ||
| 6 | def call | ||
| 7 | css('.sidebar').remove | ||
| 8 | doc | ||
| 9 | end | ||
| 10 | end | ||
| 11 | end | ||
| 12 | end | ||
| @@ -0,0 +1,23 @@ | |||
| 1 | # frozen_string_literal: true | ||
| 2 | |||
| 3 | module Docs | ||
| 4 | class Qunit | ||
| 5 | class EntriesFilter < Docs::EntriesFilter | ||
| 6 | TYPE_MAPPING = { | ||
| 7 | 'QUnit' => '1. Main methods', | ||
| 8 | 'assert' => '2. Assertions', | ||
| 9 | 'callbacks' => '3. Callback events', | ||
| 10 | 'config' => '4. Configuration', | ||
| 11 | 'extension' => '5. Extension interface' | ||
| 12 | } | ||
| 13 | def get_name | ||
| 14 | at_css('h1').content | ||
| 15 | end | ||
| 16 | |||
| 17 | def get_type | ||
| 18 | main, *rest = *slug.split('/') | ||
| 19 | TYPE_MAPPING[main] | ||
| 20 | end | ||
| 21 | end | ||
| 22 | end | ||
| 23 | end | ||
| @@ -0,0 +1,32 @@ | |||
| 1 | # frozen_string_literal: true | ||
| 2 | |||
| 3 | module Docs | ||
| 4 | class Qunit < UrlScraper | ||
| 5 | self.name = 'QUnit' | ||
| 6 | self.type = 'qunit' | ||
| 7 | self.release = '2.19.3' | ||
| 8 | self.base_url = 'https://api.qunitjs.com/' | ||
| 9 | self.root_path = '/' | ||
| 10 | self.links = { | ||
| 11 | home: 'https://qunitjs.com/', | ||
| 12 | code: 'https://github.com/qunitjs/qunit' | ||
| 13 | } | ||
| 14 | |||
| 15 | html_filters.push 'qunit/entries', 'qunit/clean_html' | ||
| 16 | |||
| 17 | options[:trailing_slash] = false | ||
| 18 | |||
| 19 | options[:container] = '.main' | ||
| 20 | options[:skip_patterns] = [ | ||
| 21 | /deprecated/, | ||
| 22 | /^QUnit$/, | ||
| 23 | /^assert$/, | ||
| 24 | /^callbacks$/, | ||
| 25 | /^async$/, | ||
| 26 | /^config$/, | ||
| 27 | /^extension$/, | ||
| 28 | ] | ||
| 29 | |||
| 30 | options[:attribution] = 'Copyright OpenJS Foundation and contributors.' | ||
| 31 | end | ||
| 32 | end | ||
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | |||
| 1 | https://raw.githubusercontent.com/qunitjs/qunitjs.com/main/img/logo.svg | ||