History

sanctuary: simplify

Simon Legner committed 4 years ago

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

Unified · Split

3 files
  1. assets/stylesheets/pages/_sanctuary.scss +0 −74
  2. lib/docs/filters/sanctuary/clean_html.rb +2 −5
  3. lib/docs/scrapers/sanctuary.rb +2 −2
assets/stylesheets/pages/_sanctuary.scss+0−74
@@ -1,80 +1,6 @@
11 ._sanctuary {
22 @extend %simple;
33
4− --base-font-size: 14px;
5−
6− --h2-padding-top: 0.5em;
7− --h2-line-height: 1.25rem;
8− --h2-padding-bottom: 0.5em;
9− --h2-border-bottom-width: 1px;
10− --h2-margin-bottom: 1em;
11−
12− --h3-padding-top: 1px;
13− --h3-line-height: 1.375rem;
14− --h3-padding-bottom: 2px;
15− --h3-border-bottom-width: 1px;
16− --h3-margin-bottom: 1em;
17−
18− --h4-padding-top: 0px;
19− --h4-line-height: calc(1.3 * var(--base-font-size));
20− --h4-padding-bottom: 0px;
21− --h4-margin-bottom: 1em;
22−
23− padding-left: 32px;
24−
25− .pilcrow {
26− position: absolute;
27− display: block;
28− width: 24px;
29− text-align: center;
30− text-decoration: none;
31− font-weight: var(--bolderFontWeight);
32−
33− html._theme-default & {
34− color: #eee;
35− &:hover { color: var(--linkColor); }
36− }
37− html._theme-dark & {
38− color: #555;
39− &:hover { color: var(--linkColor); }
40− }
41− }
42−
43− .pilcrow.h2 {
44− margin-left: -40px;
45− margin-top: calc(0px - (var(--h2-padding-top) +
46− var(--h2-line-height) +
47− var(--h2-padding-bottom) +
48− var(--h2-border-bottom-width) +
49− var(--h2-margin-bottom)));
50− padding: var(--h2-padding-top) 0 var(--h2-padding-bottom);
51− font-size: 1rem;
52− line-height: var(--h2-line-height);
53− }
54−
55− .pilcrow.h3 {
56− margin-left: -40px;
57− margin-top: calc(0px - (var(--h3-padding-top) +
58− var(--h3-line-height) +
59− var(--h3-padding-bottom) +
60− var(--h3-border-bottom-width) +
61− var(--h3-margin-bottom)));
62− padding: var(--h3-padding-top) 0 var(--h3-padding-bottom);
63− font-size: inherit;
64− line-height: var(--h3-line-height);
65− }
66−
67− .pilcrow.h4 {
68− margin-left: -24px;
69− margin-top: calc(0px - (var(--h4-padding-top) +
70− var(--h4-line-height) +
71− var(--h4-padding-bottom) +
72− var(--h4-margin-bottom)));
73− padding: var(--h4-padding-top) 0 var(--h4-padding-bottom);
74− font-size: inherit;
75− line-height: var(--h4-line-height);
76− }
77−
784 pre > code {
795 font-size: inherit;
806 }
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