nydp-html 0.0.10 → 0.0.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: efe785a4c0d281f715707c1e447ee9aff63378b7
4
- data.tar.gz: 457052e4687cf673789cbf8ff35b0c1be17a03d4
3
+ metadata.gz: af0f3578b42d4d0ceae6736a7682f63ea1618880
4
+ data.tar.gz: 55d79621b9c68dfca3b95ccc6ae20b5aba5d0fca
5
5
  SHA512:
6
- metadata.gz: 7bce3993bf2d5cfa2e63b02084843b7f5df1d456b3733133afbe96614c8f902413ee76d82c1a2441c3d30a4fe0f2801eb357886fbd7fbc84aeb97a0f0342607f
7
- data.tar.gz: 4835a0b63d77e3df682fdb70d90a1ec4b4d41cd9768b4044999c1deb122c886f50745778afac9e18cf31c0bed16f27b2143efe4fb8d45e7c78e36ce82843bfcd
6
+ metadata.gz: 06c2ffce91f11385f2599149b2a53089b3594bbe0396d3a7c1fafa2e34da0e2f9616c297d699466227d8dfe82a473b7ea50db3bd5526d6a30480f13a3ccc5176
7
+ data.tar.gz: 0fe492d9454d1e0f0ee6d831ddba5cdd9fcdda9b0ab9b0fbbe6c36e57a023a0cc34d54c9525005d26cbf41bcd634dc63bb4c7d4c5f36bb9bc1c67093077a44d5
@@ -25,7 +25,7 @@
25
25
  "list with ~(len thing) elements, first is a ~(helpful/type:car thing)"
26
26
  (with (mytype (helpful/type thing)
27
27
  mykeys (hash-keys thing))
28
- "~(pp thing) is a ~|mytype|~(helpful/keys thing)")))
28
+ "is a ~|mytype|~(helpful/keys thing)")))
29
29
 
30
30
  (def helpful/index ()
31
31
  ; return the names and types of all the things that are documented
@@ -42,13 +42,20 @@
42
42
  (map λi(apply dox-show-info i)
43
43
  infos)))))
44
44
 
45
+ (def helpful/show-examples (name examples)
46
+ (if examples
47
+ (%div.helpful-examples
48
+ (%h2 "Examples for "
49
+ (%span.example-name name))
50
+ (map λk(map λx(%pre.helpful-example
51
+ (dox-show-one-example name x))
52
+ k)
53
+ examples))))
54
+
45
55
  (def helpful/examples (name)
46
56
  ; finds examples that have been defined for the given 'name
47
- (let examples (dox-examples name)
48
- (if examples
49
- (joinstr "\n"
50
- (map (curry dox-show-examples name)
51
- examples)))))
57
+ (helpful/show-examples name
58
+ (dox-examples name)))
52
59
 
53
60
  (mac help (thing)
54
61
  ; returns helpful information about the thing
@@ -4,23 +4,37 @@
4
4
  (+ 2 foo))
5
5
 
6
6
  (examples-for test-example-f
7
- ("adds two"
7
+ ("adds two to 99"
8
8
  (test-example-f 99)
9
- 101))
9
+ 101)
10
+
11
+ ("adds two and two"
12
+ (test-example-f 2)
13
+ 4))
14
+
15
+ ;; do this again to try confuse helpful/examples
16
+ (examples-for test-example-f
17
+ ("adds two to 45"
18
+ (test-example-f 45)
19
+ 47)
20
+
21
+ ("adds two and seven"
22
+ (test-example-f 7)
23
+ 9))
10
24
 
11
25
  (examples-for help
12
26
  ("describes its argument when it's a number"
13
27
  help:22
14
- "<pre class='helpful'>22 : 22 is a number\n\n</pre>")
28
+ "<pre class='helpful'>22 : is a number\n\n</pre>")
15
29
 
16
30
  ("describes its argument when it's a string"
17
31
  (help "hello world")
18
- "<pre class='helpful'>\"hello world\" : \"hello world\" is a string\n\n</pre>")
32
+ "<pre class='helpful'>\"hello world\" : is a string\n\n</pre>")
19
33
 
20
34
  ("describes its argument when it's a hash"
21
35
  (let paris { a 1 b 2 c { x 9 y 8 z 7 } }
22
36
  (help paris))
23
- "<pre class='helpful'>paris : {a=>1, b=>2, c=>{x=>9, y=>8, z=>7}} is a hash<div class='keyhelp'><div class='key'>a</div>-&gt;<div class='keyvalue'>number</div></div><div class='keyhelp'><div class='key'>b</div>-&gt;<div class='keyvalue'>number</div></div><div class='keyhelp'><div class='key'>c</div>-&gt;<div class='keyvalue'>hash</div></div>
37
+ "<pre class='helpful'>paris : is a hash<div class='keyhelp'><div class='key'>a</div>-&gt;<div class='keyvalue'>number</div></div><div class='keyhelp'><div class='key'>b</div>-&gt;<div class='keyvalue'>number</div></div><div class='keyhelp'><div class='key'>c</div>-&gt;<div class='keyvalue'>hash</div></div>
24
38
 
25
39
  </pre>")
26
40
 
@@ -38,18 +52,40 @@ source
38
52
  (+ 2 foo))
39
53
 
40
54
 
55
+ <div class='helpful-examples'><h2>Examples for <span class='example-name'>test-example-f</span></h2><pre class='helpful-example'>test-example-f adds two to 45
56
+
57
+ example :
58
+
59
+ (test-example-f 45)
60
+
61
+ returns : 47
62
+
63
+ --------------------------------
64
+ </pre><pre class='helpful-example'>test-example-f adds two and seven
65
+
66
+ example :
67
+
68
+ (test-example-f 7)
69
+
70
+ returns : 9
41
71
 
42
- Examples for test-example-f
43
- ==================
72
+ --------------------------------
73
+ </pre><pre class='helpful-example'>test-example-f adds two to 99
44
74
 
45
- test-example-f adds two
75
+ example :
46
76
 
47
- running :
48
77
  (test-example-f 99)
49
78
 
50
- produces : 101
79
+ returns : 101
51
80
 
52
81
  --------------------------------
82
+ </pre><pre class='helpful-example'>test-example-f adds two and two
83
+
84
+ example :
53
85
 
86
+ (test-example-f 2)
54
87
 
55
- </pre>"))
88
+ returns : 4
89
+
90
+ --------------------------------
91
+ </pre></div></pre>"))
@@ -1,5 +1,5 @@
1
1
  module Nydp
2
2
  module Html
3
- VERSION = "0.0.10"
3
+ VERSION = "0.0.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nydp-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Conan Dalton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-14 00:00:00.000000000 Z
11
+ date: 2015-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler