anatomy 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/anatomy/base.ay +17 -9
- data/lib/anatomy/data.ay +9 -0
- data/lib/anatomy/renderers/html.ay +2 -6
- data/lib/anatomy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 985748eff63f9d8f7b6ba401b2e8585d918990d3
|
|
4
|
+
data.tar.gz: dc8a2871f8c07ad6246bfeab0a57f82211d4a4ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d210c447f783c552643a5d1aafa4ddb1a74e304b67dff53e5ed4261a9dc56da806259ff0b08a1db3ce1741fec36dbd17934c58f7f66af23fc6eb0ea4dd74d3b
|
|
7
|
+
data.tar.gz: 35fc07889c20e823a2bbadfdc130c40a27619a8524ec05a305af98e90e5cff81a74df6b6a9722e58bc1eba8aef356e9131a2985cb5e4754df9146bb2aeb41928
|
data/lib/anatomy/base.ay
CHANGED
|
@@ -15,14 +15,23 @@ def(template(mod)):
|
|
|
15
15
|
part template = mod)
|
|
16
16
|
|
|
17
17
|
def(title(content, tag-name = data sanitize(content), *extra-tag-names)):
|
|
18
|
-
data MetaBlock new(
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
[ data MetaBlock new(
|
|
19
|
+
[part]:
|
|
20
|
+
part title = content
|
|
21
|
+
|
|
22
|
+
part tag = part set-tag(tag-name, .self, content)
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
extra-tag-names each [t]:
|
|
25
|
+
part set-tag(t))
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
data ResolveBlock new(
|
|
28
|
+
[part]:
|
|
29
|
+
data Block new(
|
|
30
|
+
[ data Target new(part tag name)
|
|
31
|
+
content
|
|
32
|
+
]
|
|
33
|
+
.header(part page-depth + 1)))
|
|
34
|
+
]
|
|
26
35
|
|
|
27
36
|
def(split-sections):
|
|
28
37
|
data MetaBlock new(
|
|
@@ -41,10 +50,9 @@ def(mobile-optimized):
|
|
|
41
50
|
part mobile-optimized? = true)
|
|
42
51
|
|
|
43
52
|
def(omit-children-from-table-of-contents):
|
|
44
|
-
data
|
|
53
|
+
data MetaBlock new(
|
|
45
54
|
[part]:
|
|
46
|
-
part omit-children-from-table-of-contents? = true
|
|
47
|
-
"")
|
|
55
|
+
part omit-children-from-table-of-contents? = true)
|
|
48
56
|
|
|
49
57
|
def(section(title, *tag-names, content)):
|
|
50
58
|
decode(title(title, *tag-names), content)
|
data/lib/anatomy/data.ay
CHANGED
|
@@ -89,6 +89,15 @@ def(Part split-sections?): style properties include?(.split-sections)
|
|
|
89
89
|
|
|
90
90
|
def(Part toc?): style properties include?(.toc)
|
|
91
91
|
|
|
92
|
+
def(Part page-depth):
|
|
93
|
+
if(@parent)
|
|
94
|
+
then:
|
|
95
|
+
if(@parent split-sections?)
|
|
96
|
+
then: 0
|
|
97
|
+
else: @parent page-depth + 1
|
|
98
|
+
else:
|
|
99
|
+
0
|
|
100
|
+
|
|
92
101
|
def(Part section-label):
|
|
93
102
|
if(@parent)
|
|
94
103
|
then:
|
|
@@ -352,12 +352,8 @@ def(template-for(part, out)):
|
|
|
352
352
|
part top parts collect [p]:
|
|
353
353
|
toc-leaf(part, p)
|
|
354
354
|
|
|
355
|
-
def(render-part(part, out = "."
|
|
355
|
+
def(render-part(part, out = ".")):
|
|
356
356
|
<div(.section, id = i"section_#{part tag name}"):
|
|
357
|
-
<"h#{depth}"(.section-header):
|
|
358
|
-
<a(name = part tag name) {}
|
|
359
|
-
over(part title)
|
|
360
|
-
|
|
361
357
|
over(part body)
|
|
362
358
|
|
|
363
359
|
if(part split-sections?)
|
|
@@ -371,7 +367,7 @@ def(render-part(part, out = ".", depth = 1)):
|
|
|
371
367
|
toc-leaf(part, sub)
|
|
372
368
|
else:
|
|
373
369
|
part parts collect [sub]:
|
|
374
|
-
render-part(sub, out
|
|
370
|
+
render-part(sub, out)
|
|
375
371
|
|
|
376
372
|
def(sync-asset-to(path, outdir)):
|
|
377
373
|
if(File directory?(path))
|
data/lib/anatomy/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: anatomy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Suraci
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-03-
|
|
11
|
+
date: 2016-03-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|