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 +4 -4
- data/lib/lisp/html-020-help.nydp +13 -6
- data/lib/lisp/tests/help-examples.nydp +47 -11
- data/lib/nydp/html/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: af0f3578b42d4d0ceae6736a7682f63ea1618880
|
4
|
+
data.tar.gz: 55d79621b9c68dfca3b95ccc6ae20b5aba5d0fca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06c2ffce91f11385f2599149b2a53089b3594bbe0396d3a7c1fafa2e34da0e2f9616c297d699466227d8dfe82a473b7ea50db3bd5526d6a30480f13a3ccc5176
|
7
|
+
data.tar.gz: 0fe492d9454d1e0f0ee6d831ddba5cdd9fcdda9b0ab9b0fbbe6c36e57a023a0cc34d54c9525005d26cbf41bcd634dc63bb4c7d4c5f36bb9bc1c67093077a44d5
|
data/lib/lisp/html-020-help.nydp
CHANGED
@@ -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
|
-
"
|
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
|
-
(
|
48
|
-
|
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 :
|
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\" :
|
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 :
|
37
|
+
"<pre class='helpful'>paris : is a hash<div class='keyhelp'><div class='key'>a</div>-><div class='keyvalue'>number</div></div><div class='keyhelp'><div class='key'>b</div>-><div class='keyvalue'>number</div></div><div class='keyhelp'><div class='key'>c</div>-><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
|
-
|
43
|
-
|
72
|
+
--------------------------------
|
73
|
+
</pre><pre class='helpful-example'>test-example-f adds two to 99
|
44
74
|
|
45
|
-
|
75
|
+
example :
|
46
76
|
|
47
|
-
running :
|
48
77
|
(test-example-f 99)
|
49
78
|
|
50
|
-
|
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
|
-
|
88
|
+
returns : 4
|
89
|
+
|
90
|
+
--------------------------------
|
91
|
+
</pre></div></pre>"))
|
data/lib/nydp/html/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|