Skip to content

Commit 1e2e56d

Browse files
committed
Use typedoc for documentation
1 parent 2618f7c commit 1e2e56d

20 files changed

Lines changed: 2745 additions & 152 deletions

README.md

Lines changed: 4 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -42,95 +42,7 @@ javaProps
4242

4343
## Documentation
4444

45-
<!-- jsdoc2md start -->
46-
47-
- [javaProps](#javaProps)
48-
- [.parse(str)](#javaProps.parse) ⇒ <code>Object</code>
49-
- [.parseFile(path, [encoding])](#javaProps.parseFile) ⇒ <code>Promise.&lt;Object&gt;</code>
50-
- [.stringify(props)](#javaProps.stringify) ⇒ <code>String</code>
51-
52-
<a name="javaProps.parse"></a>
53-
54-
### javaProps.parse(str) ⇒ <code>Object</code>
55-
56-
Parses a .properties string, constructing a corresponding JavaScript object.
57-
58-
**Returns**: <code>Object</code> - The [Object](Object) corresponding to the given string
59-
60-
| Param | Type | Description |
61-
| ----- | ------------------- | ---------------------------------- |
62-
| str | <code>String</code> | The string to parse as .properties |
63-
64-
**Example**
65-
66-
```js
67-
const props = javaProps.parse('foo=Hello\nbar=World');
68-
console.log(props.foo + ' ' + props.bar);
69-
// "Hello World"
70-
```
71-
72-
<a name="javaProps.parseFile"></a>
73-
74-
### javaProps.parseFile(path, [encoding]) ⇒ <code>Promise.&lt;Object&gt;</code>
75-
76-
Parses a .properties file, constructing a corresponding JavaScript object.
77-
78-
**Returns**: <code>Promise.&lt;Object&gt;</code> - The [Object](Object) corresponding to the given string
79-
80-
| Param | Type | Default | Description |
81-
| ---------- | ------------------------------------------------------------------------------------- | ----------------- | --------------------------- |
82-
| path | <code>String</code> \| <code>Buffer</code> \| <code>URL</code> \| <code>number</code> | | Filename or file descriptor |
83-
| [encoding] | <code>String</code> | <code>utf8</code> | File encoding |
84-
85-
**Example**
86-
87-
```js
88-
javaProps
89-
.parseFile('./foobar.properties')
90-
.then((props) => {
91-
console.log(props.foo + ' ' + props.bar);
92-
// "Hello World"
93-
})
94-
.catch((err) => {
95-
console.error(err);
96-
});
97-
```
98-
99-
_- or with async/await -_
100-
101-
```js
102-
async function fct() {
103-
try {
104-
const props = await javaProps.parseFile('./foobar.properties');
105-
console.log(props.foo + ' ' + props.bar);
106-
// "Hello World"
107-
} catch (err) {
108-
console.error(err);
109-
}
110-
}
111-
```
112-
113-
<a name="javaProps.stringify"></a>
114-
115-
### javaProps.stringify(props) ⇒ <code>String</code>
116-
117-
Convert a JavaScript object to the corresponding .properties string.
118-
119-
**Returns**: <code>String</code> - The .properties string corresponding to the given JavaScript object
120-
121-
| Param | Type | Description |
122-
| ----- | ------------------- | -------------------------------- |
123-
| props | <code>Object</code> | The JavaScript object to convert |
124-
125-
**Example**
126-
127-
```js
128-
const str = javaProps.stringify({foo: 'Hello', bar: 'World'});
129-
console.log(str);
130-
// "foo: Hello\nbar: World\n"
131-
```
132-
133-
<!-- jsdoc2md end -->
45+
For detailed API Documentation, see: [https://nathan818fr.github.io/node-java-props/modules.html](https://nathan818fr.github.io/node-java-props/modules.html)
13446

13547
## Building
13648

@@ -140,11 +52,11 @@ This project uses TypeScript. To create javascript sources run:
14052
yarn run build
14153
```
14254

143-
To generate the documentation, edit `documentation.js` then run:
55+
To generate the documentation, use typedoc:
14456

14557
```sh
146-
# npm install -g jsdoc-to-markdown
147-
jsdoc2md --partial doc/scope.hbs --files doc/documentation.js --heading-depth 3 | xclip -selection c
58+
npm install -g typedoc
59+
typedoc
14860
```
14961

15062
and copy the result inside this README.

doc/documentation.js

Lines changed: 0 additions & 60 deletions
This file was deleted.

doc/scope.hbs

Whitespace-only changes.

docs/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

docs/assets/highlight.css

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
:root {
2+
--light-hl-0: #0000FF;
3+
--dark-hl-0: #569CD6;
4+
--light-hl-1: #000000;
5+
--dark-hl-1: #D4D4D4;
6+
--light-hl-2: #0070C1;
7+
--dark-hl-2: #4FC1FF;
8+
--light-hl-3: #001080;
9+
--dark-hl-3: #9CDCFE;
10+
--light-hl-4: #795E26;
11+
--dark-hl-4: #DCDCAA;
12+
--light-hl-5: #A31515;
13+
--dark-hl-5: #CE9178;
14+
--light-hl-6: #EE0000;
15+
--dark-hl-6: #D7BA7D;
16+
--light-hl-7: #008000;
17+
--dark-hl-7: #6A9955;
18+
--light-hl-8: #AF00DB;
19+
--dark-hl-8: #C586C0;
20+
--light-code-background: #FFFFFF;
21+
--dark-code-background: #1E1E1E;
22+
}
23+
24+
@media (prefers-color-scheme: light) { :root {
25+
--hl-0: var(--light-hl-0);
26+
--hl-1: var(--light-hl-1);
27+
--hl-2: var(--light-hl-2);
28+
--hl-3: var(--light-hl-3);
29+
--hl-4: var(--light-hl-4);
30+
--hl-5: var(--light-hl-5);
31+
--hl-6: var(--light-hl-6);
32+
--hl-7: var(--light-hl-7);
33+
--hl-8: var(--light-hl-8);
34+
--code-background: var(--light-code-background);
35+
} }
36+
37+
@media (prefers-color-scheme: dark) { :root {
38+
--hl-0: var(--dark-hl-0);
39+
--hl-1: var(--dark-hl-1);
40+
--hl-2: var(--dark-hl-2);
41+
--hl-3: var(--dark-hl-3);
42+
--hl-4: var(--dark-hl-4);
43+
--hl-5: var(--dark-hl-5);
44+
--hl-6: var(--dark-hl-6);
45+
--hl-7: var(--dark-hl-7);
46+
--hl-8: var(--dark-hl-8);
47+
--code-background: var(--dark-code-background);
48+
} }
49+
50+
body.light {
51+
--hl-0: var(--light-hl-0);
52+
--hl-1: var(--light-hl-1);
53+
--hl-2: var(--light-hl-2);
54+
--hl-3: var(--light-hl-3);
55+
--hl-4: var(--light-hl-4);
56+
--hl-5: var(--light-hl-5);
57+
--hl-6: var(--light-hl-6);
58+
--hl-7: var(--light-hl-7);
59+
--hl-8: var(--light-hl-8);
60+
--code-background: var(--light-code-background);
61+
}
62+
63+
body.dark {
64+
--hl-0: var(--dark-hl-0);
65+
--hl-1: var(--dark-hl-1);
66+
--hl-2: var(--dark-hl-2);
67+
--hl-3: var(--dark-hl-3);
68+
--hl-4: var(--dark-hl-4);
69+
--hl-5: var(--dark-hl-5);
70+
--hl-6: var(--dark-hl-6);
71+
--hl-7: var(--dark-hl-7);
72+
--hl-8: var(--dark-hl-8);
73+
--code-background: var(--dark-code-background);
74+
}
75+
76+
.hl-0 { color: var(--hl-0); }
77+
.hl-1 { color: var(--hl-1); }
78+
.hl-2 { color: var(--hl-2); }
79+
.hl-3 { color: var(--hl-3); }
80+
.hl-4 { color: var(--hl-4); }
81+
.hl-5 { color: var(--hl-5); }
82+
.hl-6 { color: var(--hl-6); }
83+
.hl-7 { color: var(--hl-7); }
84+
.hl-8 { color: var(--hl-8); }
85+
pre, code { background: var(--code-background); }

0 commit comments

Comments
 (0)