mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Update Jasmine documentation (4.0.0)
This commit is contained in:
parent
0072328e33
commit
8507118e2c
5 changed files with 25 additions and 29 deletions
|
@ -66,6 +66,7 @@
|
|||
'pages/gtk',
|
||||
'pages/haproxy',
|
||||
'pages/haskell',
|
||||
'pages/jasmine',
|
||||
'pages/jekyll',
|
||||
'pages/jq',
|
||||
'pages/jquery',
|
||||
|
|
4
assets/stylesheets/pages/_jasmine.scss
Normal file
4
assets/stylesheets/pages/_jasmine.scss
Normal file
|
@ -0,0 +1,4 @@
|
|||
._jasmine {
|
||||
.subsection-title, h2 { @extend %block-heading; }
|
||||
h4 { @extend %block-label, %label-blue; }
|
||||
}
|
|
@ -2,21 +2,19 @@ module Docs
|
|||
class Jasmine
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
@doc = at_css('.docs')
|
||||
@doc = at_css('.docs') unless root_page?
|
||||
|
||||
at_css('h1').content = 'Jasmine' if root_page?
|
||||
# css('header', 'article', 'section:not([class])', 'div.description').each do |node|
|
||||
# node.before(node.children).remove
|
||||
# end
|
||||
|
||||
css('header', 'article', 'section:not([class])', 'div.description').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
# css('h3.subsection-title').each do |node|
|
||||
# node.name = 'h2'
|
||||
# end
|
||||
|
||||
css('h3.subsection-title').each do |node|
|
||||
node.name = 'h2'
|
||||
end
|
||||
|
||||
css('h4.name').each do |node|
|
||||
node.name = 'h3'
|
||||
end
|
||||
# css('h4.name').each do |node|
|
||||
# node.name = 'h3'
|
||||
# end
|
||||
|
||||
css('pre').each do |node|
|
||||
node.content = node.content
|
||||
|
|
|
@ -2,24 +2,17 @@ module Docs
|
|||
class Jasmine
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
name = at_css('h1').content.strip
|
||||
name.remove! %r{\A\w+:\s}
|
||||
name
|
||||
end
|
||||
|
||||
def get_type
|
||||
at_css('h1').content.strip
|
||||
end
|
||||
|
||||
def get_type
|
||||
name
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
css('h3[id]').each_with_object [] do |node, entries|
|
||||
name = node.content.strip
|
||||
next if name.start_with?('new ')
|
||||
static = name.sub! '(static) ', ''
|
||||
name.sub! %r{\(.*\)}, '()'
|
||||
name.remove! %r{\s.*}
|
||||
name.prepend "#{self.name}#{static ? '.' : '#'}" unless slug == 'global'
|
||||
entries << [name, node['id']]
|
||||
css('h4[id]').each_with_object [] do |node, entries|
|
||||
name = node['id']
|
||||
entries << [name.sub(/\./, ''), name]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
module Docs
|
||||
class Jasmine < UrlScraper
|
||||
self.type = 'simple'
|
||||
self.release = '3.7.1'
|
||||
self.base_url = 'https://jasmine.github.io/api/3.7/'
|
||||
self.type = 'jasmine'
|
||||
self.release = '4.0.0'
|
||||
self.base_url = 'https://jasmine.github.io/api/4.0/'
|
||||
self.root_path = 'index.html'
|
||||
self.links = {
|
||||
home: 'https://jasmine.github.io/',
|
||||
|
|
Loading…
Reference in a new issue