Skip to content

Commit 6cc0669

Browse files
committed
fix(*): update readme and get rid of --out option when gen json's
1 parent 05211b9 commit 6cc0669

File tree

2 files changed

+29
-19
lines changed

2 files changed

+29
-19
lines changed

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ A plugin for [Typedoc](http://typedoc.org)
77
When using [Typedoc](http://typedoc.org) for API docs generation you may want to generate documentation with different languages.
88

99
By using this plugin you will be able to:
10-
<br />
11-
-> Merge all code comments(classes, methods, properties, enumerations etc.) that needs localization in a couple of json files.
12-
<br />
13-
-> Translate them.
14-
<br />
15-
-> Use the updated files to build a documentation for an entire project in the desired language.
10+
1. Merge all code comments(classes, methods, properties, enumerations etc.) that needs localization in a couple of json files.
11+
2. Translate them.
12+
3. Use the updated files to build a documentation for an entire project in the desired language.
1613

1714
### Installing
1815

@@ -22,23 +19,35 @@ npm install typedoc-localization-plugin
2219

2320
### Using
2421

22+
> Please take in mind that you are running your local npm packages by `npx` right before the command execution.
23+
<br />
24+
> The alternative would be to install the plugin globally with `-g` at the end of the command.
25+
<br />
26+
> Then you won't need to use `npx`.
27+
28+
#### Path variable descriptions
29+
`<main-proj-file>` - This file has to contain the file structure of the project.
30+
<br />
31+
`<json-exports-dir>` - This file would contains all generated json files with retrieved comments.
32+
<br />
33+
`<out-typedoc-dir>` - The directory where the documentation have to be generated
34+
2535
#### Step 1
2636
In order to generate the json representation of each module of your application you will have to execute the command below:
2737
```
28-
typedoc `<main-file-with-all-exports>` --generate-json `<directory-to-export-json's>`
38+
typedoc `<main-proj-file>` --generate-json `<json-export-dir>`
2939
```
3040

3141
We can use [Ignite UI for Angular](https://github.com/IgniteUI/igniteui-angular) repository for Example:
3242

3343
```
3444
typedoc projects\igniteui-angular\src\public_api.ts --generate-json exports
3545
```
36-
37-
This command will create `exports` folder.
38-
<br />
39-
`projects\igniteui-angular\src\public_api.ts` This file contains the file structure of the project. It takes up to `two` levels.
40-
<br />
41-
For instance when you have a `/directory/inner-dir1/inner-dir2/file.ts` it will create the following structure `exports/directory/inner-dir1/` which will contains all files that are under it or files that are deeply nested.
46+
> This command will create `exports` folder.
47+
> <br />
48+
>`projects\igniteui-angular\src\public_api.ts` This file contains the file structure of the project. It takes up to `two` levels.
49+
> <br />
50+
> For instance when you have a `/directory/inner-dir1/inner-dir2/file.ts` it will create the following structure `exports/directory/inner-dir1/` which > will contains all files that are under it or files that are deeply nested.
4251
4352

4453
#### Step 2
@@ -105,11 +114,7 @@ What is the difference between `methods` and `functions` keys?
105114

106115
When you finish with the translations you will have to generate the documentation with the transleted files `(json's)`.
107116
<br />
108-
So the following command should be executed:
117+
So the following command have to be executed:
109118
```
110-
typedoc --generate-from-json `<json's-directory>` --out `<exported-doc-directory>`
119+
typedoc `<main-proj-file>` --generate-from-json `<json-exports-dir>` --out `<out-typedoc-dir>`
111120
```
112-
113-
`<json's-directory>` could be `exports` folder.
114-
<br />
115-
`<exported-doc-directory>` could be `dist\docs`

index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ module.exports = (PluginHost: Application) => {
3030
});
3131

3232
if (startConverter) {
33+
/**
34+
* We set the 'default' value of 'out' option because this option is checked before the converter has been started.
35+
* As we kill the process after the convertion of the json's we or not interested in the value of the option.
36+
*/
37+
app.options.setValue('out', 'defult');
3338
app.converter.addComponent('convert-component', ConvertComponent);
3439
}
3540

0 commit comments

Comments
 (0)