podlite 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/lib/plugins/extrnal.js +7 -8
- package/package.json +8 -7
- package/src/plugins/extrnal.ts +8 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/tools.d.ts +0 -0
- package/lib/tools.js +0 -124
- package/src/tools.ts +0 -126
- package/t/fill-fixtures.ts +0 -40
- package/t/fixtures/00-main_1.txt +0 -25
- package/t/fixtures/00-main_broken_refs.txt +0 -106
- package/t/fixtures/00-main_images.txt +0 -33
- package/t/fixtures/00-main_link.txt +0 -21
- package/t/fixtures/00-main_links.txt +0 -79
- package/t/fixtures/01-node-api_1.txt +0 -2172
- package/t/fixtures/02-inlines_inline_code.txt +0 -78
- package/t/fixtures/02-inlines_thematic_break.txt +0 -9
- package/t/fixtures/03-blockquotes_blockquote.txt +0 -28
- package/t/fixtures/04-tables_table.txt +0 -77
- package/t/fixtures/05-strikethrough_strikethrough.txt +0 -12
- package/t/fixtures-md/00-main.t +0 -34
- package/t/fixtures-md/01-node-api.t +0 -234
- package/t/fixtures-md/02-inlines.t +0 -20
- package/t/fixtures-md/03-blockquotes.t +0 -6
- package/t/fixtures-md/04-tables.t +0 -6
- package/t/fixtures-md/05-strikethrough.t +0 -3
- package/t/md2ast.test.ts +0 -31
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
*This text will be italic*
|
|
3
|
-
_This will also be italic_
|
|
4
|
-
|
|
5
|
-
**This text will be bold**
|
|
6
|
-
__This will also be bold__
|
|
7
|
-
|
|
8
|
-
_You **can** combine them_
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
~~~~~~~
|
|
13
|
-
{
|
|
14
|
-
"type": "block",
|
|
15
|
-
"name": "pod",
|
|
16
|
-
"content": [
|
|
17
|
-
{
|
|
18
|
-
"type": "para",
|
|
19
|
-
"content": [
|
|
20
|
-
{
|
|
21
|
-
"type": "fcode",
|
|
22
|
-
"name": "I",
|
|
23
|
-
"content": [
|
|
24
|
-
"This text will be italic"
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
"\n",
|
|
28
|
-
{
|
|
29
|
-
"type": "fcode",
|
|
30
|
-
"name": "I",
|
|
31
|
-
"content": [
|
|
32
|
-
"This will also be italic"
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"type": "para",
|
|
39
|
-
"content": [
|
|
40
|
-
{
|
|
41
|
-
"type": "fcode",
|
|
42
|
-
"name": "B",
|
|
43
|
-
"content": [
|
|
44
|
-
"This text will be bold"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"\n",
|
|
48
|
-
{
|
|
49
|
-
"type": "fcode",
|
|
50
|
-
"name": "B",
|
|
51
|
-
"content": [
|
|
52
|
-
"This will also be bold"
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"type": "para",
|
|
59
|
-
"content": [
|
|
60
|
-
{
|
|
61
|
-
"type": "fcode",
|
|
62
|
-
"name": "I",
|
|
63
|
-
"content": [
|
|
64
|
-
"You ",
|
|
65
|
-
{
|
|
66
|
-
"type": "fcode",
|
|
67
|
-
"name": "B",
|
|
68
|
-
"content": [
|
|
69
|
-
"can"
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
|
-
" combine them"
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
As Kanye West said:
|
|
2
|
-
|
|
3
|
-
> We're living the future so
|
|
4
|
-
> the present is our past.
|
|
5
|
-
~~~~~~~
|
|
6
|
-
{
|
|
7
|
-
"type": "block",
|
|
8
|
-
"name": "pod",
|
|
9
|
-
"content": [
|
|
10
|
-
{
|
|
11
|
-
"type": "para",
|
|
12
|
-
"content": [
|
|
13
|
-
"As Kanye West said:"
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"type": "nested",
|
|
18
|
-
"content": [
|
|
19
|
-
{
|
|
20
|
-
"type": "para",
|
|
21
|
-
"content": [
|
|
22
|
-
"We're living the future so\nthe present is our past."
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
First Header | Second Header
|
|
2
|
-
------------ | -------------
|
|
3
|
-
Content from cell 1 | Content from cell 2
|
|
4
|
-
Content in the first column | Content in the second column
|
|
5
|
-
~~~~~~~
|
|
6
|
-
{
|
|
7
|
-
"type": "block",
|
|
8
|
-
"name": "pod",
|
|
9
|
-
"content": [
|
|
10
|
-
{
|
|
11
|
-
"name": "table",
|
|
12
|
-
"type": "block",
|
|
13
|
-
"content": [
|
|
14
|
-
{
|
|
15
|
-
"name": "table_row",
|
|
16
|
-
"type": "block",
|
|
17
|
-
"content": [
|
|
18
|
-
{
|
|
19
|
-
"name": "table_cell",
|
|
20
|
-
"type": "block",
|
|
21
|
-
"content": [
|
|
22
|
-
"First Header"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"name": "table_cell",
|
|
27
|
-
"type": "block",
|
|
28
|
-
"content": [
|
|
29
|
-
"Second Header"
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "table_row",
|
|
36
|
-
"type": "block",
|
|
37
|
-
"content": [
|
|
38
|
-
{
|
|
39
|
-
"name": "table_cell",
|
|
40
|
-
"type": "block",
|
|
41
|
-
"content": [
|
|
42
|
-
"Content from cell 1"
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"name": "table_cell",
|
|
47
|
-
"type": "block",
|
|
48
|
-
"content": [
|
|
49
|
-
"Content from cell 2"
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "table_row",
|
|
56
|
-
"type": "block",
|
|
57
|
-
"content": [
|
|
58
|
-
{
|
|
59
|
-
"name": "table_cell",
|
|
60
|
-
"type": "block",
|
|
61
|
-
"content": [
|
|
62
|
-
"Content in the first column"
|
|
63
|
-
]
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"name": "table_cell",
|
|
67
|
-
"type": "block",
|
|
68
|
-
"content": [
|
|
69
|
-
"Content in the second column"
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
}
|
package/t/fixtures-md/00-main.t
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
=begin code :id('links')
|
|
2
|
-
|
|
3
|
-
### Table of Contents
|
|
4
|
-
|
|
5
|
-
- [lint][1]
|
|
6
|
-
- [Parameters][2]
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[1]: #lint
|
|
10
|
-
|
|
11
|
-
[2]: #parameters
|
|
12
|
-
=end code
|
|
13
|
-
|
|
14
|
-
=begin code
|
|
15
|
-
## build
|
|
16
|
-
|
|
17
|
-
Generate JavaScript documentation as a list of parsed JSDoc
|
|
18
|
-
comments, given a root file as a path.
|
|
19
|
-
=end code
|
|
20
|
-
|
|
21
|
-
=begin code :id('broken_refs')
|
|
22
|
-
### Parameters
|
|
23
|
-
|
|
24
|
-
- `comments` **[Array][17]<[Object][19]>** parsed comments
|
|
25
|
-
- `args` **[Object][19]** Options that can customize the output
|
|
26
|
-
=end code
|
|
27
|
-
|
|
28
|
-
=begin code :id('link')
|
|
29
|
-
[#raku IRC channel](https://raku.org/community/irc)
|
|
30
|
-
=end code
|
|
31
|
-
|
|
32
|
-
=begin code :id('images')
|
|
33
|
-

|
|
34
|
-
=end code
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
=begin code
|
|
2
|
-
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
3
|
-
|
|
4
|
-
### Table of Contents
|
|
5
|
-
|
|
6
|
-
- [lint][1]
|
|
7
|
-
- [Parameters][2]
|
|
8
|
-
- [Examples][3]
|
|
9
|
-
- [build][4]
|
|
10
|
-
- [Parameters][5]
|
|
11
|
-
- [Examples][6]
|
|
12
|
-
- [formats][7]
|
|
13
|
-
- [formats.html][8]
|
|
14
|
-
- [Parameters][9]
|
|
15
|
-
- [Examples][10]
|
|
16
|
-
- [formats.markdown][11]
|
|
17
|
-
- [Parameters][12]
|
|
18
|
-
- [Examples][13]
|
|
19
|
-
- [formats.json][14]
|
|
20
|
-
- [Parameters][15]
|
|
21
|
-
- [Examples][16]
|
|
22
|
-
|
|
23
|
-
## lint
|
|
24
|
-
|
|
25
|
-
Lint files for non-standard or incorrect documentation
|
|
26
|
-
information, returning a potentially-empty string
|
|
27
|
-
of lint information intended for human-readable output.
|
|
28
|
-
|
|
29
|
-
### SParameterssss
|
|
30
|
-
|
|
31
|
-
- `indexes` **([Array][17]<[string][18]> | [string][18])** files to process
|
|
32
|
-
- `args` **[Object][19]** args
|
|
33
|
-
- `args.external` **[Array][17]<[string][18]>** a string regex / glob match pattern
|
|
34
|
-
that defines what external modules will be whitelisted and included in the
|
|
35
|
-
generated documentation.
|
|
36
|
-
- `args.shallow` **[boolean][20]** whether to avoid dependency parsing
|
|
37
|
-
even in JavaScript code. (optional, default `false`)
|
|
38
|
-
- `args.inferPrivate` **[string][18]?** a valid regular expression string
|
|
39
|
-
to infer whether a code element should be private, given its naming structure.
|
|
40
|
-
For instance, you can specify `inferPrivate: '^_'` to automatically treat
|
|
41
|
-
methods named like `_myMethod` as private.
|
|
42
|
-
- `args.extension` **([string][18] \| [Array][17]<[string][18]>)?** treat additional file extensions
|
|
43
|
-
as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
|
|
44
|
-
|
|
45
|
-
### Examples
|
|
46
|
-
|
|
47
|
-
```javascript
|
|
48
|
-
documentation.lint('file.js').then(lintOutput => {
|
|
49
|
-
if (lintOutput) {
|
|
50
|
-
console.log(lintOutput);
|
|
51
|
-
process.exit(1);
|
|
52
|
-
} else {
|
|
53
|
-
process.exit(0);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Returns **[Promise][21]** promise with lint results
|
|
59
|
-
|
|
60
|
-
## build
|
|
61
|
-
|
|
62
|
-
Generate JavaScript documentation as a list of parsed JSDoc
|
|
63
|
-
comments, given a root file as a path.
|
|
64
|
-
|
|
65
|
-
### Parameters
|
|
66
|
-
|
|
67
|
-
- `indexes` **([Array][17]<[string][18]> | [string][18])** files to process
|
|
68
|
-
- `args` **[Object][19]** args
|
|
69
|
-
- `args.external` **[Array][17]<[string][18]>** a string regex / glob match pattern
|
|
70
|
-
that defines what external modules will be whitelisted and included in the
|
|
71
|
-
generated documentation.
|
|
72
|
-
- `args.shallow` **[boolean][20]** whether to avoid dependency parsing
|
|
73
|
-
even in JavaScript code. (optional, default `false`)
|
|
74
|
-
- `args.order` **[Array][17]<([string][18] \| [Object][19])>** optional array that
|
|
75
|
-
defines sorting order of documentation (optional, default `[]`)
|
|
76
|
-
- `args.access` **[Array][17]<[string][18]>** an array of access levels
|
|
77
|
-
to output in documentation (optional, default `[]`)
|
|
78
|
-
- `args.hljs` **[Object][19]?** hljs optional args
|
|
79
|
-
- `args.hljs.highlightAuto` **[boolean][20]** hljs automatically detect language (optional, default `false`)
|
|
80
|
-
- `args.hljs.languages` **[Array][17]?** languages for hljs to choose from
|
|
81
|
-
- `args.inferPrivate` **[string][18]?** a valid regular expression string
|
|
82
|
-
to infer whether a code element should be private, given its naming structure.
|
|
83
|
-
For instance, you can specify `inferPrivate: '^_'` to automatically treat
|
|
84
|
-
methods named like `_myMethod` as private.
|
|
85
|
-
- `args.extension` **([string][18] \| [Array][17]<[string][18]>)?** treat additional file extensions
|
|
86
|
-
as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
|
|
87
|
-
|
|
88
|
-
### Examples
|
|
89
|
-
|
|
90
|
-
```javascript
|
|
91
|
-
var documentation = require('documentation');
|
|
92
|
-
|
|
93
|
-
documentation.build(['index.js'], {
|
|
94
|
-
// only output comments with an explicit @public tag
|
|
95
|
-
access: ['public']
|
|
96
|
-
}).then(res => {
|
|
97
|
-
// res is an array of parsed comments with inferred properties
|
|
98
|
-
// and more: everything you need to build documentation or
|
|
99
|
-
// any other kind of code data.
|
|
100
|
-
});
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Returns **[Promise][21]** results
|
|
104
|
-
|
|
105
|
-
## formats
|
|
106
|
-
|
|
107
|
-
Documentation's formats are modular methods that take comments
|
|
108
|
-
and config as input and return Promises with results,
|
|
109
|
-
like stringified JSON, markdown strings, or Vinyl objects for HTML
|
|
110
|
-
output.
|
|
111
|
-
|
|
112
|
-
## formats.html
|
|
113
|
-
|
|
114
|
-
Formats documentation as HTML.
|
|
115
|
-
|
|
116
|
-
### Parameters
|
|
117
|
-
|
|
118
|
-
- `comments` **[Array][17]<[Comment][22]>** parsed comments
|
|
119
|
-
- `config` **[Object][19]** Options that can customize the output
|
|
120
|
-
- `config.theme` **[string][18]** Name of a module used for an HTML theme. (optional, default `'default_theme'`)
|
|
121
|
-
|
|
122
|
-
### Examples
|
|
123
|
-
|
|
124
|
-
```javascript
|
|
125
|
-
var documentation = require('documentation');
|
|
126
|
-
var streamArray = require('stream-array');
|
|
127
|
-
var vfs = require('vinyl-fs');
|
|
128
|
-
|
|
129
|
-
documentation.build(['index.js'])
|
|
130
|
-
.then(documentation.formats.html)
|
|
131
|
-
.then(output => {
|
|
132
|
-
streamArray(output).pipe(vfs.dest('./output-directory'));
|
|
133
|
-
});
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
Returns **[Promise][21]<[Array][17]<[Object][19]>>** Promise with results
|
|
137
|
-
|
|
138
|
-
## formats.markdown
|
|
139
|
-
|
|
140
|
-
Formats documentation as
|
|
141
|
-
[Markdown][23].
|
|
142
|
-
|
|
143
|
-
### Parameters
|
|
144
|
-
|
|
145
|
-
- `comments` **[Array][17]<[Object][19]>** parsed comments
|
|
146
|
-
- `args` **[Object][19]** Options that can customize the output
|
|
147
|
-
|
|
148
|
-
### Examples
|
|
149
|
-
|
|
150
|
-
```javascript
|
|
151
|
-
var documentation = require('documentation');
|
|
152
|
-
var fs = require('fs');
|
|
153
|
-
|
|
154
|
-
documentation.build(['index.js'])
|
|
155
|
-
.then(documentation.formats.md)
|
|
156
|
-
.then(output => {
|
|
157
|
-
// output is a string of Markdown data
|
|
158
|
-
fs.writeFileSync('./output.md', output);
|
|
159
|
-
});
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Returns **[Promise][21]<[string][18]>** a promise of the eventual value
|
|
163
|
-
|
|
164
|
-
## formats.json
|
|
165
|
-
|
|
166
|
-
Formats documentation as a JSON string.
|
|
167
|
-
|
|
168
|
-
### Parameters
|
|
169
|
-
|
|
170
|
-
- `comments` **[Array][17]<[Comment][22]>** parsed comments
|
|
171
|
-
|
|
172
|
-
### Examples
|
|
173
|
-
|
|
174
|
-
```javascript
|
|
175
|
-
var documentation = require('documentation');
|
|
176
|
-
var fs = require('fs');
|
|
177
|
-
|
|
178
|
-
documentation.build(['index.js'])
|
|
179
|
-
.then(documentation.formats.json)
|
|
180
|
-
.then(output => {
|
|
181
|
-
// output is a string of JSON data
|
|
182
|
-
fs.writeFileSync('./output.json', output);
|
|
183
|
-
});
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Returns **[Promise][21]<[string][18]>**
|
|
187
|
-
|
|
188
|
-
[1]: #lint
|
|
189
|
-
|
|
190
|
-
[2]: #parameters
|
|
191
|
-
|
|
192
|
-
[3]: #examples
|
|
193
|
-
|
|
194
|
-
[4]: #build
|
|
195
|
-
|
|
196
|
-
[5]: #parameters-1
|
|
197
|
-
|
|
198
|
-
[6]: #examples-1
|
|
199
|
-
|
|
200
|
-
[7]: #formats
|
|
201
|
-
|
|
202
|
-
[8]: #formatshtml
|
|
203
|
-
|
|
204
|
-
[9]: #parameters-2
|
|
205
|
-
|
|
206
|
-
[10]: #examples-2
|
|
207
|
-
|
|
208
|
-
[11]: #formatsmarkdown
|
|
209
|
-
|
|
210
|
-
[12]: #parameters-3
|
|
211
|
-
|
|
212
|
-
[13]: #examples-3
|
|
213
|
-
|
|
214
|
-
[14]: #formatsjson
|
|
215
|
-
|
|
216
|
-
[15]: #parameters-4
|
|
217
|
-
|
|
218
|
-
[16]: #examples-4
|
|
219
|
-
|
|
220
|
-
[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
221
|
-
|
|
222
|
-
[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
223
|
-
|
|
224
|
-
[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
225
|
-
|
|
226
|
-
[20]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
227
|
-
|
|
228
|
-
[21]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
229
|
-
|
|
230
|
-
[22]: https://developer.mozilla.org/docs/Web/API/Comment/Comment
|
|
231
|
-
|
|
232
|
-
[23]: https://daringfireball.net/projects/markdown/
|
|
233
|
-
|
|
234
|
-
=end code
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
=comment thematic break
|
|
2
|
-
=begin code :id('thematic_break')
|
|
3
|
-
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
=end code
|
|
7
|
-
|
|
8
|
-
=begin code :id('inline_code')
|
|
9
|
-
|
|
10
|
-
*This text will be italic*
|
|
11
|
-
_This will also be italic_
|
|
12
|
-
|
|
13
|
-
**This text will be bold**
|
|
14
|
-
__This will also be bold__
|
|
15
|
-
|
|
16
|
-
_You **can** combine them_
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
=end code
|
package/t/md2ast.test.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
test('adds 1 + 2 to equal 3', () => {
|
|
2
|
-
expect(1+ 2).toBe(3);
|
|
3
|
-
});
|
|
4
|
-
|
|
5
|
-
// import clean_plugin from 'pod6/built/plugin-clean-location'
|
|
6
|
-
// import {cleanIds} from '../src/ids'
|
|
7
|
-
// import * as path from 'path'
|
|
8
|
-
// import * as fs from 'fs'
|
|
9
|
-
// const glob = require('glob')
|
|
10
|
-
// import { md2ast } from '../src/'
|
|
11
|
-
// const loadTests = (testsPath) => {
|
|
12
|
-
// const pathToTests = path.resolve(__dirname, testsPath)
|
|
13
|
-
// return glob.sync(pathToTests).map( f => {
|
|
14
|
-
// const testData = fs.readFileSync(f)
|
|
15
|
-
// const [ src, dst ] = `${testData}`.split('~~~~~~~\n')
|
|
16
|
-
// return { src, dst, file: f}
|
|
17
|
-
// })
|
|
18
|
-
// }
|
|
19
|
-
|
|
20
|
-
// const process = (src) => {
|
|
21
|
-
// return cleanIds({skipChain: 0, podMode: 1})(clean_plugin()(md2ast(src)))
|
|
22
|
-
|
|
23
|
-
// }
|
|
24
|
-
|
|
25
|
-
// describe("run parser tests", () => {
|
|
26
|
-
// loadTests('fixtures/*t').map( item => {
|
|
27
|
-
// test(item.file, ()=>expect(
|
|
28
|
-
// process(item.src)).toEqual( JSON.parse(item.dst))
|
|
29
|
-
// )
|
|
30
|
-
// })
|
|
31
|
-
// })
|