anatomy 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/anatomy/base.ay +2 -2
- data/lib/anatomy/processor.ay +9 -1
- data/lib/anatomy/renderers/html.ay +17 -12
- data/lib/anatomy/version.rb +1 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b1b191c8d7af232bda5851a16c767b38cd07df3
|
4
|
+
data.tar.gz: b9d1d3a88e065dfb0b6fd33f6b2be71c0b26968d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abb520c5072e23523b3ed92f8c4ab7d5ebd2291b3669810be2fd240dc8cf539c42016fb9c34dacc1f7815ce2a97918b44a422edf37fb2d012579b6bbcf52f6b2
|
7
|
+
data.tar.gz: 0421b480c9e6e726f945d80000be971c8f5e6ddcd16009c3a22848185f4d3bc4513e36508de4a262f15f78237307dab7e453a86d2aa7142e6d4bf6a24709c01e
|
data/lib/anatomy/base.ay
CHANGED
@@ -66,11 +66,11 @@ def(section(title, *tag-names, content)):
|
|
66
66
|
decode(title(title, *tag-names), content)
|
67
67
|
|
68
68
|
def(include-section(path)):
|
69
|
-
Atomy CodeLoader
|
69
|
+
Atomy CodeLoader load(path) doc
|
70
70
|
|
71
71
|
def(include-sections(path)):
|
72
72
|
Dir glob(path) collect [s]:
|
73
|
-
Atomy CodeLoader
|
73
|
+
Atomy CodeLoader load(s) doc
|
74
74
|
|
75
75
|
def(target-element(tag-name, display = nil)):
|
76
76
|
data CollectElement new(
|
data/lib/anatomy/processor.ay
CHANGED
@@ -12,11 +12,18 @@ resolve = require("anatomy/stages/resolve")
|
|
12
12
|
html = require("anatomy/renderers/html")
|
13
13
|
|
14
14
|
def(load(input)):
|
15
|
-
|
15
|
+
puts(i"#{input}: loading")
|
16
|
+
mod = Atomy CodeLoader load(input)
|
16
17
|
|
17
18
|
part = mod doc
|
19
|
+
|
20
|
+
puts(i"#{input}: traversing")
|
18
21
|
traversed = traverse over(part)
|
22
|
+
|
23
|
+
puts(i"#{input}: collecting")
|
19
24
|
collected = collect over(traversed)
|
25
|
+
|
26
|
+
puts(i"#{input}: resolving")
|
20
27
|
resolved = resolve over(collected)
|
21
28
|
|
22
29
|
resolved
|
@@ -30,4 +37,5 @@ def(process(input, renderer, output = ".")):
|
|
30
37
|
unless(Dir exists?(output)):
|
31
38
|
Dir mkdir(output)
|
32
39
|
|
40
|
+
puts(i"#{input}: rendering")
|
33
41
|
renderer render(part, output)
|
@@ -239,7 +239,12 @@ def(toc-leaf(current-part, part)):
|
|
239
239
|
part parts collect &.(Self toc-leaf(current-part, _))
|
240
240
|
|
241
241
|
|
242
|
-
def(render(part, out = ".")):
|
242
|
+
def(render(part, out = ".", done = Set new)):
|
243
|
+
when(done include?(part)):
|
244
|
+
return
|
245
|
+
|
246
|
+
done << part
|
247
|
+
|
243
248
|
tags-file = i"#{Dir tmpdir}/#{part top tag name}-tags.js"
|
244
249
|
|
245
250
|
unless(part parent):
|
@@ -252,7 +257,7 @@ def(render(part, out = ".")):
|
|
252
257
|
part js-additions << tags-file
|
253
258
|
|
254
259
|
-- call this early so the template can register its own assets/etc
|
255
|
-
template = render-part-template(part, out)
|
260
|
+
template = render-part-template(part, out, done)
|
256
261
|
|
257
262
|
class =
|
258
263
|
if(part style properties empty?)
|
@@ -296,15 +301,15 @@ def(render(part, out = ".")):
|
|
296
301
|
unless(part parent):
|
297
302
|
copy-all-assets(part, out)
|
298
303
|
|
299
|
-
def(render-part-template(part, out = ".")):
|
300
|
-
(part template || Self) template-for(part, out)
|
304
|
+
def(render-part-template(part, out = ".", done = Set new)):
|
305
|
+
(part template || Self) template-for(part, out, done)
|
301
306
|
|
302
307
|
def(all-part-assets(part)):
|
303
|
-
assets = part assets
|
308
|
+
assets = Set new(part assets)
|
304
309
|
|
305
|
-
assets += part css-additions
|
310
|
+
assets += part css-additions
|
306
311
|
|
307
|
-
assets += part js-additions
|
312
|
+
assets += part js-additions
|
308
313
|
|
309
314
|
part parts collect [sub]:
|
310
315
|
assets += all-part-assets(sub)
|
@@ -321,7 +326,7 @@ def(search-js-additions):
|
|
321
326
|
File expand-path("../js/search.js", __FILE__)
|
322
327
|
])
|
323
328
|
|
324
|
-
def(template-for(part, out)):
|
329
|
+
def(template-for(part, out, done)):
|
325
330
|
part css-additions << File expand-path("../css/anatomy.css", __FILE__)
|
326
331
|
part css-additions << File expand-path("../css/highlight.css", __FILE__)
|
327
332
|
|
@@ -330,7 +335,7 @@ def(template-for(part, out)):
|
|
330
335
|
<div(#page):
|
331
336
|
<div(#main):
|
332
337
|
<div(#content):
|
333
|
-
render-part(part, out)
|
338
|
+
render-part(part, out, done)
|
334
339
|
|
335
340
|
<div(.search):
|
336
341
|
<form(action = "javascript:void(0)"):
|
@@ -352,14 +357,14 @@ def(template-for(part, out)):
|
|
352
357
|
part top parts collect [p]:
|
353
358
|
toc-leaf(part, p)
|
354
359
|
|
355
|
-
def(render-part(part, out = ".")):
|
360
|
+
def(render-part(part, out = ".", done = Set new)):
|
356
361
|
<div(.section, id = i"section_#{part tag name}"):
|
357
362
|
over(part body)
|
358
363
|
|
359
364
|
if(part split-sections? && !(part inlined?))
|
360
365
|
then:
|
361
366
|
part parts collect [sub]:
|
362
|
-
render(sub, out)
|
367
|
+
render(sub, out, done)
|
363
368
|
|
364
369
|
when(part toc?):
|
365
370
|
<ol(.toc, #table-of-contents):
|
@@ -367,7 +372,7 @@ def(render-part(part, out = ".")):
|
|
367
372
|
toc-leaf(part, sub)
|
368
373
|
else:
|
369
374
|
part parts collect [sub]:
|
370
|
-
render-part(sub, out)
|
375
|
+
render-part(sub, out, done)
|
371
376
|
|
372
377
|
def(sync-asset-to(path, outdir)):
|
373
378
|
if(File directory?(path))
|
data/lib/anatomy/version.rb
CHANGED
metadata
CHANGED
@@ -1,38 +1,38 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anatomy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
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-08-
|
11
|
+
date: 2016-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: atomy
|
15
|
-
prerelease: false
|
16
|
-
type: :runtime
|
17
15
|
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
19
|
+
version: 0.7.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: puma
|
29
|
-
prerelease: false
|
30
|
-
type: :runtime
|
31
29
|
requirement: !ruby/object:Gem::Requirement
|
32
30
|
requirements:
|
33
31
|
- - "~>"
|
34
32
|
- !ruby/object:Gem::Version
|
35
33
|
version: '3.6'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
@@ -40,13 +40,13 @@ dependencies:
|
|
40
40
|
version: '3.6'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: broomhlda
|
43
|
-
prerelease: false
|
44
|
-
type: :runtime
|
45
43
|
requirement: !ruby/object:Gem::Requirement
|
46
44
|
requirements:
|
47
45
|
- - "~>"
|
48
46
|
- !ruby/object:Gem::Version
|
49
47
|
version: 0.2.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
@@ -54,13 +54,13 @@ dependencies:
|
|
54
54
|
version: 0.2.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: json_pure
|
57
|
-
prerelease: false
|
58
|
-
type: :runtime
|
59
57
|
requirement: !ruby/object:Gem::Requirement
|
60
58
|
requirements:
|
61
59
|
- - "~>"
|
62
60
|
- !ruby/object:Gem::Version
|
63
61
|
version: '1.8'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
@@ -68,13 +68,13 @@ dependencies:
|
|
68
68
|
version: '1.8'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
|
-
prerelease: false
|
72
|
-
type: :development
|
73
71
|
requirement: !ruby/object:Gem::Requirement
|
74
72
|
requirements:
|
75
73
|
- - "~>"
|
76
74
|
- !ruby/object:Gem::Version
|
77
75
|
version: '10.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project: anatomy
|
136
|
-
rubygems_version: 2.
|
136
|
+
rubygems_version: 2.5.1
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: Anatomy documentation system
|