mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
reactivex: process review comments
This commit is contained in:
parent
f2a38dbf2c
commit
dcbe81cd99
3 changed files with 81 additions and 3 deletions
|
@ -8,4 +8,44 @@
|
||||||
figure {
|
figure {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dfn {
|
||||||
|
cursor: text;
|
||||||
|
font-style: italic;
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tree {
|
||||||
|
dt, dd {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
dt {
|
||||||
|
float: left;
|
||||||
|
clear: left;
|
||||||
|
|
||||||
|
margin-top: 0;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: "…";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dd:not(.sub) {
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
margin: 0 0 0 5px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl#outer > dt {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 5px;
|
||||||
|
|
||||||
|
& + dd {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,36 @@ module Docs
|
||||||
# Remove breadcrumbs
|
# Remove breadcrumbs
|
||||||
css('.breadcrumb').remove
|
css('.breadcrumb').remove
|
||||||
|
|
||||||
|
# Titleize title on Backpressure Operators page
|
||||||
|
if subpath == 'documentation/operators/backpressure.html'
|
||||||
|
title = at_css('h1')
|
||||||
|
title.content = title.content.titleize
|
||||||
|
end
|
||||||
|
|
||||||
|
# Lower all h1 headers except the first one
|
||||||
|
css('* + h1').each do |node|
|
||||||
|
node.name = 'h2'
|
||||||
|
end
|
||||||
|
|
||||||
|
# Pull code blocks in links out of their <strong> parent (if possible)
|
||||||
|
css('a > strong > code').each do |node|
|
||||||
|
# Skip if the parent had multiple code nodes and node.parent.replace already ran for one
|
||||||
|
next unless node.parent.name == 'strong'
|
||||||
|
|
||||||
|
node.parent.replace node.parent.children
|
||||||
|
end
|
||||||
|
|
||||||
|
# Pull header out of trees
|
||||||
|
tree = at_css('#tree')
|
||||||
|
unless tree.nil?
|
||||||
|
title = tree.at_css('h1')
|
||||||
|
title.name = 'h2'
|
||||||
|
tree.before(title)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Beautify operator descriptions
|
||||||
|
at_css('h3').name = 'blockquote' if subpath.include?('operators/')
|
||||||
|
|
||||||
# Replace interactive demo's with links to them
|
# Replace interactive demo's with links to them
|
||||||
css('rx-marbles').each do |node|
|
css('rx-marbles').each do |node|
|
||||||
node.name = 'a'
|
node.name = 'a'
|
||||||
|
@ -37,8 +67,9 @@ module Docs
|
||||||
|
|
||||||
# Make language specific implementation titles prettier
|
# Make language specific implementation titles prettier
|
||||||
css('.panel-title').each do |node|
|
css('.panel-title').each do |node|
|
||||||
# Remove the link, keep the text
|
# Remove the link, keep the children
|
||||||
node.content = node.content
|
link = node.at_css('a')
|
||||||
|
link.replace(link.children) unless link.nil?
|
||||||
|
|
||||||
# Transform it into a header for better styling
|
# Transform it into a header for better styling
|
||||||
node.name = 'h3'
|
node.name = 'h3'
|
||||||
|
|
|
@ -2,13 +2,20 @@ module Docs
|
||||||
class Reactivex
|
class Reactivex
|
||||||
class EntriesFilter < Docs::EntriesFilter
|
class EntriesFilter < Docs::EntriesFilter
|
||||||
def get_name
|
def get_name
|
||||||
at_css('h1').content
|
title = at_css('h1').content
|
||||||
|
title = title.titleize if is_backpressure_operators?
|
||||||
|
title
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_type
|
def get_type
|
||||||
|
return 'Manual' if is_backpressure_operators?
|
||||||
links = css('.breadcrumb > li:nth-child(2) > a')
|
links = css('.breadcrumb > li:nth-child(2) > a')
|
||||||
links.size > 0 ? links.first.content : 'Manual'
|
links.size > 0 ? links.first.content : 'Manual'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_backpressure_operators?
|
||||||
|
subpath == 'documentation/operators/backpressure.html'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue