History

sanctuary: simplify

Simon Legner committed 4 years ago

Commit d1edab71 parent 05362983 files · +4 −81Browse files

Showing the changes to lib/docs (2 of 3 files). Show all

Unified · Split

2 files
  1. lib/docs/filters/sanctuary/clean_html.rb +2 −5
  2. lib/docs/scrapers/sanctuary.rb +2 −2
lib/docs/filters/sanctuary/clean_html.rb+2−5
@@ -3,14 +3,11 @@ module Docs · 2 unmodified lines
3 class Sanctuary3 class Sanctuary
4 class CleanHtmlFilter < Filter4 class CleanHtmlFilter < Filter
5 def call5 def call
6 # Remove header containing GitHub, Gitter, and Stack Overflow links.
7 doc.at("#css-header").unlink()
8
9 # Remove redundant section links from table of contents.6 # Remove redundant section links from table of contents.
10 doc.at("a[href='#section:api']").next_element.unlink()7 doc.at("a[href='#section:api']").next_element.unlink()
11 8
12 # Swap headings and accompanying pilcrows to aid positioning via CSS.9 # Remove pilcrows.
13 doc.css(".pilcrow").each { |node| node.next_element.after(node) }10 doc.css(".pilcrow").remove()
14 11
15 # Insert Fink link in place of logo.12 # Insert Fink link in place of logo.
16 doc.at("[id='section:sponsors'] ~ ul > li > p").prepend_child(13 doc.at("[id='section:sponsors'] ~ ul > li > p").prepend_child(
lib/docs/scrapers/sanctuary.rb+2−2
@@ -11,9 +11,9 @@ module Docs · 10 unmodified lines
11 code: "https://github.com/sanctuary-js/sanctuary",11 code: "https://github.com/sanctuary-js/sanctuary",
12 }12 }
13 13
14 html_filters.push("sanctuary/entries")14 html_filters.push "sanctuary/entries", "sanctuary/clean_html"
15 html_filters.push("sanctuary/clean_html")
16 15
16 options[:container] = '#css-main'
17 options[:title] = "Sanctuary"17 options[:title] = "Sanctuary"
18 options[:attribution] = "Licensed under the MIT License."18 options[:attribution] = "Licensed under the MIT License."
19 19

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t