anatomy 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4a9681d1daeabe99dcaaa84e0b1384f0d796bd4
4
- data.tar.gz: 85e200d6995bb5c6d8d5da5b3b16af3bae74eb9b
3
+ metadata.gz: 985748eff63f9d8f7b6ba401b2e8585d918990d3
4
+ data.tar.gz: dc8a2871f8c07ad6246bfeab0a57f82211d4a4ab
5
5
  SHA512:
6
- metadata.gz: 9f3a2e81145e60f77d041dace615d78eb38bda944acb5c7eea2d5c5f736e52690884d5a51f63f40cc1dfa8fec7f9f8a2d12f67a008dfb2939ece45990478763a
7
- data.tar.gz: ee5dea35b6d56cffdae8269167abf727d0097ea19219192d863511f5501c5ac7cee9932dc614404d8eb4c4cc0203f3c00da329b2682de914354a025e60b70342
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
- [part]:
20
- part title = content
18
+ [ data MetaBlock new(
19
+ [part]:
20
+ part title = content
21
+
22
+ part tag = part set-tag(tag-name, .self, content)
21
23
 
22
- part tag = part set-tag(tag-name, .self, content)
24
+ extra-tag-names each [t]:
25
+ part set-tag(t))
23
26
 
24
- extra-tag-names each [t]:
25
- part set-tag(t))
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 ResolveElement new(
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 = ".", depth = 1)):
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, depth + 1)
370
+ render-part(sub, out)
375
371
 
376
372
  def(sync-asset-to(path, outdir)):
377
373
  if(File directory?(path))
@@ -1,3 +1,3 @@
1
1
  module Anatomy
2
- VERSION = "0.2.10"
2
+ VERSION = "0.2.11"
3
3
  end
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.10
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-21 00:00:00.000000000 Z
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