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
33 class Sanctuary
44 class CleanHtmlFilter < Filter
55 def call
6− # Remove header containing GitHub, Gitter, and Stack Overflow links.
7− doc.at("#css-header").unlink()
8−
96 # Remove redundant section links from table of contents.
107 doc.at("a[href='#section:api']").next_element.unlink()
118
12− # Swap headings and accompanying pilcrows to aid positioning via CSS.
13− doc.css(".pilcrow").each { |node| node.next_element.after(node) }
9+ # Remove pilcrows.
10+ doc.css(".pilcrow").remove()
1411
1512 # Insert Fink link in place of logo.
1613 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
1111 code: "https://github.com/sanctuary-js/sanctuary",
1212 }
1313
14− html_filters.push("sanctuary/entries")
15− html_filters.push("sanctuary/clean_html")
14+ html_filters.push "sanctuary/entries", "sanctuary/clean_html"
1615
16+ options[:container] = '#css-main'
1717 options[:title] = "Sanctuary"
1818 options[:attribution] = "Licensed under the MIT License."
1919

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