anatomy 0.2.6 → 0.2.7

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: c7237a3a89826363048622c9a011c1fc00c43bb6
4
- data.tar.gz: 879ddd5bf27b68f1d49c6321a3d6fdf4c0d3c7a7
3
+ metadata.gz: 8bd164380607baf3afe9c067472e0031083fed64
4
+ data.tar.gz: 6d495bd0291c600e20615e2b07cfa91bc7e86da5
5
5
  SHA512:
6
- metadata.gz: 02499c99a5bc224de47e7888c709656268915d11fc9c57ac29c4a4d531cf8f2bed986c73765a4d5a59308140c579d8709a5e995bca3e6115a3de3eb94c065b9d
7
- data.tar.gz: c36259aff23f11d2c0968ba82dfb16bc8f7e40702c6c3d8d80f3aa4fac2304068fae8b13e25765a7a4d8b59515adfd31adef24254f21ae7fe761562fae71fb7f
6
+ metadata.gz: 968bba17c98053fc513f12ea285f654a1c5b0a6df10249986943e39b64936f9373bde69e10bd0db77e7a5c8b5ac59b59cf3752d42457a1260edee114bded5dbc
7
+ data.tar.gz: 49998d10fe5426aa5954d905159065ab45c04368648497d820b1b54892ab465b9b4b5747d3e8fda1d97403fffce637b2e4a563babc15260146ca2f78340a8a21
data/lib/anatomy/base.ay CHANGED
@@ -24,9 +24,15 @@ def(title(content, tag-name = data sanitize(content), *extra-tag-names)):
24
24
  extra-tag-names each [t]:
25
25
  part set-tag(t))
26
26
 
27
+ def(split-sections):
28
+ data MetaBlock new(
29
+ [part]:
30
+ part style properties << .split-sections)
31
+
27
32
  def(table-of-contents):
28
33
  data MetaBlock new(
29
34
  [part]:
35
+ part style properties << .split-sections
30
36
  part style properties << .toc)
31
37
 
32
38
  def(mobile-optimized):
data/lib/anatomy/data.ay CHANGED
@@ -82,6 +82,8 @@ def(Part set-tag(name, target = .self, display = nil)):
82
82
  def(Part set-local-tag(name, target = nil, display = nil)):
83
83
  @local-tags[name] = Tag new(self, name, target, display)
84
84
 
85
+ def(Part split-sections?): style properties include?(.split-sections)
86
+
85
87
  def(Part toc?): style properties include?(.toc)
86
88
 
87
89
  def(Part section-label):
@@ -201,7 +201,7 @@ def(filename(p)): p tag name + ".html"
201
201
 
202
202
  def(top(p)):
203
203
  condition:
204
- (p parent && p parent toc?):
204
+ (p parent && p parent split-sections?):
205
205
  p
206
206
 
207
207
  p parent:
@@ -353,12 +353,15 @@ def(render-part(part, out = ".", depth = 1)):
353
353
 
354
354
  over(part body)
355
355
 
356
- if(part toc?)
356
+ if(part split-sections?)
357
357
  then:
358
- <ol(.toc, #table-of-contents):
359
- part parts collect [sub]:
360
- render(sub, out)
361
- toc-leaf(part, sub)
358
+ part parts collect [sub]:
359
+ render(sub, out)
360
+
361
+ when(part toc?):
362
+ <ol(.toc, #table-of-contents):
363
+ part parts collect [sub]:
364
+ toc-leaf(part, sub)
362
365
  else:
363
366
  part parts collect [sub]:
364
367
  render-part(sub, out, depth + 1)
@@ -1,3 +1,3 @@
1
1
  module Anatomy
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
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.6
4
+ version: 0.2.7
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-16 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: atomy