Skip to content

Commit 11aa16a

Browse files
authored
Merge pull request #70 from IgniteUI/dTsvetkov/add-additional-options
Add additional context options
2 parents 31e9c98 + 532dec9 commit 11aa16a

File tree

3 files changed

+120
-41
lines changed

3 files changed

+120
-41
lines changed

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,68 @@ Here we would like to translate "Defined in" hardcoded string. </br>
251251
npx typedoc projects\igniteui-angular\src\ --localize jp --templateStrings ./extras/template/strings/shell-strings.json
252252
```
253253
You can see how our template strings file looks like here [./extras/template/strings/shell-strings.json](https://github.com/IgniteUI/igniteui-angular/blob/master/extras/template/strings/shell-strings.json).
254+
255+
#### Link and Debug
256+
In order to run the plugin locally, after it is build, it should be linked to the repo you want to use it.
257+
258+
1. Execute the following commands
259+
260+
```
261+
npm run build
262+
```
263+
264+
```
265+
npm pack
266+
```
267+
268+
```
269+
cp typedoc-plugin-localization-1.0.4.tgz ~
270+
```
271+
272+
2. Go to the theme repository where the plugin is included as peer dependency and add the reference to the packed file.
273+
Example:
274+
275+
```
276+
"peerDependecies": {
277+
"typedoc-plugin-localization": "file:../../../typedoc-plugin-localization-1.0.4.tgz",
278+
}
279+
```
280+
281+
3. Go to the repository which is using the theme and plugin.
282+
283+
```
284+
npm install ~/typedoc-plugin-localization-1.0.4.tgz
285+
```
286+
287+
4. Add launch.json configuration to enable debbuging
288+
289+
Example:
290+
```
291+
{
292+
"configurations": [
293+
{
294+
"name": "Typedoc plugin",
295+
"type": "node",
296+
"request": "launch",
297+
"program": "${workspaceFolder}/node_modules/typedoc/bin/typedoc",
298+
"args": [
299+
"${workspaceFolder}/projects/igniteui-angular/src/public_api.ts",
300+
"--generate-json",
301+
"${workspaceFolder}/dist",
302+
"--localize",
303+
"en",
304+
"--versioning",
305+
"--product",
306+
"ignite-ui-angular",
307+
"--tsconfig",
308+
"${workspaceFolder}/tsconfig.json"
309+
],
310+
"sourceMaps": true,
311+
"resolveSourceMapLocations": [
312+
"${workspaceFolder}/**",
313+
"!**/node_modules/**"
314+
]
315+
}
316+
]
317+
}
318+
```

utils/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export class Constants {
2525
static readonly INCLUDE_PARAMS_OPTION = 'params';
2626
static readonly LOCALIZE_OPTION = 'localize'
2727
static readonly TEMPLATE_STRINGS_OPTION = 'templateStrings';
28+
static readonly INCLUDE_VERSIONS_OPTION = 'versioning';
29+
static readonly PRODUCT_OPTION = 'product';
2830

2931
static readonly GLOBAL_FUNCS_FILE_NAME = 'globalFunctions';
3032
}

utils/options.ts

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,57 @@ import { Options, ParameterType } from 'typedoc'
22
import { Constants } from './constants';
33

44
export function pluginOptions(options: Pick<Options, "addDeclaration">) {
5-
6-
options.addDeclaration({
7-
name: Constants.CONVERT_OPTION,
8-
help: 'Specifies the directory where the json files have to be generated.'
9-
});
10-
11-
options.addDeclaration({
12-
name: Constants.RENDER_OPTION,
13-
help: 'Specify from where to get the loclized json data.'
14-
});
15-
16-
options.addDeclaration({
17-
name: Constants.INCLUDE_TAGS_OPTION,
18-
help: 'Specify whether to include tags per comment.',
19-
type: ParameterType.Boolean,
20-
defaultValue: false
21-
});
22-
23-
options.addDeclaration({
24-
name: Constants.INCLUDE_PARAMS_OPTION,
25-
help: 'Specify whether to include params per comment.',
26-
type: ParameterType.Boolean,
27-
defaultValue: false
28-
});
29-
30-
options.addDeclaration({
31-
name: Constants.INCLUDE_WARNS_OPTION,
32-
help: 'Specify whether to throw warnings of missed tags and parameters into the json\'s.',
33-
type: ParameterType.Boolean,
34-
defaultValue: false
35-
});
36-
37-
options.addDeclaration({
38-
name: Constants.LOCALIZE_OPTION,
39-
help: 'Specify your localization for instance (jp)'
40-
});
41-
42-
options.addDeclaration({
43-
name: Constants.TEMPLATE_STRINGS_OPTION,
44-
help: 'Path to the json file which contains your localized template strings'
45-
});
5+
6+
options.addDeclaration({
7+
name: Constants.CONVERT_OPTION,
8+
help: 'Specifies the directory where the json files have to be generated.'
9+
});
10+
11+
options.addDeclaration({
12+
name: Constants.RENDER_OPTION,
13+
help: 'Specify from where to get the loclized json data.'
14+
});
15+
16+
options.addDeclaration({
17+
name: Constants.INCLUDE_TAGS_OPTION,
18+
help: 'Specify whether to include tags per comment.',
19+
type: ParameterType.Boolean,
20+
defaultValue: false
21+
});
22+
23+
options.addDeclaration({
24+
name: Constants.INCLUDE_PARAMS_OPTION,
25+
help: 'Specify whether to include params per comment.',
26+
type: ParameterType.Boolean,
27+
defaultValue: false
28+
});
29+
30+
options.addDeclaration({
31+
name: Constants.INCLUDE_WARNS_OPTION,
32+
help: 'Specify whether to throw warnings of missed tags and parameters into the json\'s.',
33+
type: ParameterType.Boolean,
34+
defaultValue: false
35+
});
36+
37+
options.addDeclaration({
38+
name: Constants.LOCALIZE_OPTION,
39+
help: 'Specify your localization for instance (jp)'
40+
});
41+
42+
options.addDeclaration({
43+
name: Constants.TEMPLATE_STRINGS_OPTION,
44+
help: 'Path to the json file which contains your localized template strings'
45+
});
46+
47+
options.addDeclaration({
48+
name: Constants.INCLUDE_VERSIONS_OPTION,
49+
help: 'Specify whether to include versions dropdown into the header.',
50+
type: ParameterType.Boolean,
51+
defaultValue: false
52+
});
53+
54+
options.addDeclaration({
55+
name: Constants.PRODUCT_OPTION,
56+
help: 'Specify product name.'
57+
});
4658
}

0 commit comments

Comments
 (0)