Skip to content

Commit 3b1a217

Browse files
authored
Merge pull request #1552 from Cimbali/jq
2 parents db90268 + 7269d54 commit 3b1a217

File tree

5 files changed

+45
-2
lines changed

5 files changed

+45
-2
lines changed

assets/stylesheets/application.css.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
'pages/haproxy',
6868
'pages/haskell',
6969
'pages/jekyll',
70+
'pages/jq',
7071
'pages/jquery',
7172
'pages/julia',
7273
'pages/knockout',

assets/stylesheets/pages/_jq.scss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
._jq {
2+
@extend %simple;
3+
4+
.manual-example table {
5+
border: none;
6+
7+
& td {
8+
@extend %pre;
9+
&.jqprogram { font-weight: bold; }
10+
border: none;
11+
}
12+
13+
& th {
14+
color: var(--textColor);
15+
background: var(--contentBackground);
16+
text-align: right;
17+
border: none;
18+
}
19+
20+
& tr:not(:first-child) th:not(:empty) {
21+
&, & + td {
22+
border-top: 1px solid var(--boxBorder);
23+
}
24+
}
25+
}
26+
}

lib/docs/filters/jq/clean_html.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@ module Docs
22
class Jq
33
class CleanHtmlFilter < Filter
44
def call
5-
at_css('div#manualcontent')
5+
content = at_css('div#manualcontent')
6+
7+
css('.manual-example').each do |node|
8+
container = node.parent
9+
example_header = doc.document.create_element('h4')
10+
example_header.content = container.at_css('a[data-toggle="collapse"]').content
11+
node.children.before(example_header)
12+
13+
node.remove_class('collapse')
14+
container.replace(node)
15+
end
16+
17+
content
618
end
719
end
820
end

lib/docs/filters/latex/clean_html.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ def call
1313

1414
css('h1, h2, h3, h4').each { |node| node.content = node.content.sub /^[0-9A-Z]+(\.[0-9]+)* /, '' }
1515

16+
css('div.example').each do |node|
17+
node.replace(node.children)
18+
end
19+
1620
css('pre').each do |node|
1721
node.delete 'class'
1822
node['data-language'] = 'latex'

lib/docs/scrapers/jq.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Docs
22
class Jq < UrlScraper
33
self.name = 'jq'
44
self.slug = 'jq'
5-
self.type = 'simple'
5+
self.type = 'jq'
66
self.release = '1.6'
77
self.links = {
88
home: 'https://stedolan.github.io/jq/'

0 commit comments

Comments
 (0)