@cparra/apexdocs 2.2.5 → 2.5.0-beta.0
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/.github/workflows/close_stale.yml +3 -3
- package/README.md +75 -115
- package/docs/{Misc → API}/SampleClassWithoutModifier.md +0 -0
- package/docs/Main/GroupedClass.md +10 -0
- package/docs/{Sample-Classes → Main}/SampleClass.md +6 -2
- package/docs/README.md +5 -11
- package/docs/index.html +22 -21
- package/examples/force-app/main/default/classes/GroupedClass.cls +1 -1
- package/examples/force-app/main/default/classes/SampleClass.cls +1 -1
- package/lib/application/Apexdocs.d.ts +2 -1
- package/lib/application/Apexdocs.js +8 -5
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/cli/generate.js +9 -3
- package/lib/cli/generate.js.map +1 -1
- package/lib/model/apex-bundle.d.ts +2 -1
- package/lib/model/apex-bundle.js +2 -1
- package/lib/model/apex-bundle.js.map +1 -1
- package/lib/model/file.js +5 -2
- package/lib/model/file.js.map +1 -1
- package/lib/model/markdown-file.d.ts +2 -0
- package/lib/model/markdown-file.js +23 -0
- package/lib/model/markdown-file.js.map +1 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js +7 -3
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
- package/lib/model/markdown-home-file.d.ts +0 -1
- package/lib/model/markdown-home-file.js +0 -4
- package/lib/model/markdown-home-file.js.map +1 -1
- package/lib/model/markdown-type-file.d.ts +0 -1
- package/lib/model/markdown-type-file.js +0 -4
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/service/apex-file-reader.js +4 -4
- package/lib/service/apex-file-reader.js.map +1 -1
- package/lib/service/manifest-factory.d.ts +2 -1
- package/lib/service/manifest-factory.js.map +1 -1
- package/lib/service/parser.d.ts +2 -2
- package/lib/service/parser.js +3 -1
- package/lib/service/parser.js.map +1 -1
- package/lib/service/state.d.ts +9 -0
- package/lib/service/state.js +20 -0
- package/lib/service/state.js.map +1 -0
- package/lib/settings.d.ts +4 -1
- package/lib/settings.js +14 -2
- package/lib/settings.js.map +1 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +1 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js +30 -5
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +2 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +3 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js.map +1 -1
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +2 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +3 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +6 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +14 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -0
- package/lib/transpiler/processor-type-transpiler.d.ts +2 -0
- package/lib/transpiler/processor-type-transpiler.js.map +1 -1
- package/lib/transpiler/transpiler.js +2 -0
- package/lib/transpiler/transpiler.js.map +1 -1
- package/lib/util/error-logger.js +25 -24
- package/lib/util/error-logger.js.map +1 -1
- package/lib/util/logger.d.ts +4 -1
- package/lib/util/logger.js +28 -3
- package/lib/util/logger.js.map +1 -1
- package/package.json +6 -5
- package/src/application/Apexdocs.ts +16 -5
- package/src/cli/generate.ts +9 -3
- package/src/model/apex-bundle.ts +1 -1
- package/src/model/file.ts +6 -2
- package/src/model/markdown-file.ts +27 -0
- package/src/model/markdown-generation-util/method-declaration-util.ts +6 -1
- package/src/model/markdown-home-file.ts +0 -5
- package/src/model/markdown-type-file.ts +0 -5
- package/src/service/apex-file-reader.ts +4 -4
- package/src/service/manifest-factory.ts +5 -1
- package/src/service/parser.ts +5 -3
- package/src/service/state.ts +24 -0
- package/src/settings.ts +18 -3
- package/src/transpiler/markdown/class-file-generatorHelper.ts +32 -5
- package/src/transpiler/markdown/docsify/docsify-docs-processor.ts +5 -0
- package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +5 -0
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +12 -0
- package/src/transpiler/processor-type-transpiler.ts +4 -0
- package/src/transpiler/transpiler.ts +2 -0
- package/src/util/error-logger.ts +25 -24
- package/src/util/logger.ts +29 -3
- package/docs/Some-group/GroupedClass.md +0 -7
- package/docs/Utils/GroupedClass.md +0 -10
- package/examples/force-app/main/default/classes/SampleClassTest.cls +0 -11
|
@@ -10,10 +10,10 @@ jobs:
|
|
|
10
10
|
issues: write
|
|
11
11
|
pull-requests: write
|
|
12
12
|
steps:
|
|
13
|
-
- uses: actions/stale@
|
|
13
|
+
- uses: actions/stale@v5
|
|
14
14
|
with:
|
|
15
|
-
days-before-issue-stale:
|
|
16
|
-
days-before-issue-close:
|
|
15
|
+
days-before-issue-stale: 30
|
|
16
|
+
days-before-issue-close: 14
|
|
17
17
|
stale-issue-label: "stale"
|
|
18
18
|
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
|
|
19
19
|
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
|
package/README.md
CHANGED
|
@@ -68,9 +68,14 @@ public class MyClass {
|
|
|
68
68
|
}
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
* Apex docs blocks can now all be in a single line
|
|
72
|
+
* Support for grouping blocks of related code within a class
|
|
73
|
+
* Support for HTML tags
|
|
74
|
+
* And more!
|
|
75
|
+
|
|
71
76
|
### Demo
|
|
72
77
|
|
|
73
|
-
ApexDocs currently supports generating markdown files for Jekyll and Docsify sites.
|
|
78
|
+
ApexDocs currently supports generating markdown files for Jekyll and Docsify sites, as well as generating plain markdown files.
|
|
74
79
|
|
|
75
80
|
### In the wild
|
|
76
81
|
|
|
@@ -81,13 +86,13 @@ ApexDocs currently supports generating markdown files for Jekyll and Docsify sit
|
|
|
81
86
|
|
|
82
87
|
Demo
|
|
83
88
|
|
|
84
|
-
- [Docsify](https://cesarparra.github.io/apexdocs
|
|
89
|
+
- [Docsify](https://cesarparra.github.io/apexdocs/)
|
|
85
90
|
|
|
86
91
|
### [Jekyll](https://jekyllrb.com/)
|
|
87
92
|
|
|
88
93
|
Demo
|
|
89
94
|
|
|
90
|
-
- [Jekyll](https://cesarparra.github.io/apexdocs/)
|
|
95
|
+
- [Jekyll](https://cesarparra.github.io/apexdocs-docsify-example/)
|
|
91
96
|
|
|
92
97
|
## Installation
|
|
93
98
|
|
|
@@ -109,116 +114,34 @@ apexdocs-generate
|
|
|
109
114
|
|
|
110
115
|
The CLI supports the following parameters:
|
|
111
116
|
|
|
112
|
-
| Parameter
|
|
113
|
-
|
|
114
|
-
| --sourceDir
|
|
115
|
-
| --targetDir
|
|
116
|
-
| --recursive
|
|
117
|
-
| --scope
|
|
118
|
-
| --targetGenerator
|
|
119
|
-
| --indexOnly
|
|
120
|
-
| --
|
|
121
|
-
| --group | -o | (Only versions 1.X) Define whether the generated files should be grouped by the @group tag on the top level classes. | `true` | No |
|
|
122
|
-
|
|
123
|
-
#### Configuration File
|
|
124
|
-
|
|
125
|
-
You can optionally specify the path to a configuration JSON file through the `--configPath` parameter. This let's you
|
|
126
|
-
have some additional control over the content outputs.
|
|
127
|
-
|
|
128
|
-
The configuration file allows you to specify the following:
|
|
129
|
-
|
|
130
|
-
_Note_: Everything in the configuration file is optional. When something is not specified, the default will be used.
|
|
131
|
-
|
|
132
|
-
`root` (String)
|
|
133
|
-
|
|
134
|
-
Default: None
|
|
135
|
-
|
|
136
|
-
Allows you to specify the root directory for where the files are being generated. This can be helpful when embedding the
|
|
137
|
-
generated docs into an existing site so that the links are generated correctly.
|
|
138
|
-
|
|
139
|
-
`defaultGroupName`
|
|
140
|
-
|
|
141
|
-
Default: Miscellaneous
|
|
142
|
-
|
|
143
|
-
Defines the `@group` name to be used when a file does not specify it.
|
|
144
|
-
|
|
145
|
-
`sourceLanguage`
|
|
146
|
-
|
|
147
|
-
Default: None
|
|
148
|
-
|
|
149
|
-
Defines the name of the language that will be used when generating `@example` blocks. Use this when you are interested
|
|
150
|
-
in using syntax highlighting for your project.
|
|
151
|
-
|
|
152
|
-
Even though the source code material for which documentation is generated is always `Apex`, generally you will be able
|
|
153
|
-
to use a syntax highlighter that recognizes `java` source code, so set this value to `java` in those cases.
|
|
154
|
-
|
|
155
|
-
`home` (Object)
|
|
156
|
-
|
|
157
|
-
Gives you control over the home page.
|
|
158
|
-
|
|
159
|
-
`home.header` (String)
|
|
160
|
-
|
|
161
|
-
Default: None
|
|
162
|
-
|
|
163
|
-
Allows you to embed custom content into your home page by using the `header` property to point to the file which
|
|
164
|
-
contents will be added to the top of the generated home page.
|
|
165
|
-
|
|
166
|
-
Specify the path with the content that you want to embed.
|
|
167
|
-
|
|
168
|
-
`content` (Object)
|
|
169
|
-
|
|
170
|
-
Gives you control over the content pages.
|
|
171
|
-
|
|
172
|
-
`content.includeAuthor` (Boolean)
|
|
173
|
-
|
|
174
|
-
Default: false
|
|
175
|
-
|
|
176
|
-
Whether the `@author` tag should be used to add the file's author to the page.
|
|
177
|
-
|
|
178
|
-
`content.includeDate` (Boolean)
|
|
117
|
+
| Parameter | Alias | Description | Default | Required |
|
|
118
|
+
|--------------------|-------|------------------------------------------------------------------------------------------------------------------|-----------------|----------|
|
|
119
|
+
| --sourceDir | -s | The directory location which contains your apex .cls classes. | N/A | Yes |
|
|
120
|
+
| --targetDir | -t | The directory location where documentation will be generated to. | `docs` | No |
|
|
121
|
+
| --recursive | -r | Whether .cls classes will be searched for recursively in the directory provided. | `true` | No |
|
|
122
|
+
| --scope | -p | A list of scopes to document. Values should be separated by a space, e.g --scope public private | `global` | No |
|
|
123
|
+
| --targetGenerator | -g | Define the static file generator for which the documents will be created. Currently supports jekyll and docsify. | `jekyll` | No |
|
|
124
|
+
| --indexOnly | N/A | Defines whether only the index file should be generated. | `false` | No |
|
|
125
|
+
| --defaultGroupName | N/A | Defines the `@group` name to be used when a file does not specify it. | `Miscellaneous` | No |
|
|
179
126
|
|
|
180
|
-
Default: false
|
|
181
|
-
|
|
182
|
-
Whether the `@date` tag should be used to add the file's date to the page.
|
|
183
|
-
|
|
184
|
-
`content.startingHeadingLevel` (Number)
|
|
185
|
-
|
|
186
|
-
Default: 1
|
|
187
|
-
|
|
188
|
-
The starting H tag level for the document. Each title will use this as the starting point to docGenerator the
|
|
189
|
-
appropriate `<h#>` tag. For example, if set to 1, the class' file name at the top of the file will use an `<h1>` tag,
|
|
190
|
-
the `Properties` title will be `<h2>`, each property name will be an `<h3>`, etc.
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
{
|
|
194
|
-
"root": "root-directory",
|
|
195
|
-
"defaultGrouName": "api",
|
|
196
|
-
"sourceLanguage": "java",
|
|
197
|
-
"home": {
|
|
198
|
-
"header": "./examples/includes/header.md"
|
|
199
|
-
},
|
|
200
|
-
"content": {
|
|
201
|
-
"startingHeadingLevel": 1,
|
|
202
|
-
"includeAuthor": true,
|
|
203
|
-
"includeDate": true
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
```
|
|
207
127
|
|
|
208
128
|
### Importing to your project
|
|
209
129
|
|
|
210
|
-
If you are just interested in the Apex parsing capabilities, you can use the
|
|
130
|
+
If you are just interested in the Apex parsing capabilities, you can use the
|
|
131
|
+
standalone [Apex Reflection Library](https://www.npmjs.com/package/@cparra/apex-reflection)
|
|
211
132
|
which is what gets used by this library behind the scenes to generate the documentation files.
|
|
212
133
|
|
|
213
134
|
## Documentation Format
|
|
214
135
|
|
|
215
|
-
ApexDocs picks up blocks of comments throughout your `.cls` files. The block must begin with `/**` and
|
|
216
|
-
multiple lines, ending with `*/`.
|
|
136
|
+
ApexDocs picks up blocks of comments throughout your `.cls` files. The block must begin with `/**` and end with `*/`.
|
|
217
137
|
|
|
218
138
|
### Documenting Classes
|
|
219
139
|
|
|
220
140
|
The following tags are supported on the class level:
|
|
221
141
|
|
|
142
|
+
**Note** Any custom generated tag is also supported. Custom tags can be added with at symbol (`@`) followed by the name
|
|
143
|
+
of the tag. For example `@custom-tag`
|
|
144
|
+
|
|
222
145
|
| Tag | Description |
|
|
223
146
|
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------|
|
|
224
147
|
| `@description` | One or more lines describing the class. |
|
|
@@ -279,13 +202,14 @@ Methods and constructors support the same tags.
|
|
|
279
202
|
|
|
280
203
|
The following tags are supported on the method level:
|
|
281
204
|
|
|
282
|
-
| Tag
|
|
283
|
-
|
|
284
|
-
| `@description`
|
|
285
|
-
| `@param` _paramName_
|
|
286
|
-
| `@return`
|
|
287
|
-
| `@example`
|
|
288
|
-
| `@throws` _ExceptionName_
|
|
205
|
+
| Tag | Description |
|
|
206
|
+
|------------------------------|---------------------------------------------------|
|
|
207
|
+
| `@description` | One or more lines describing the method. |
|
|
208
|
+
| `@param` _paramName_ | Description of a single parameter. |
|
|
209
|
+
| `@return` | Description of the return value of the method. |
|
|
210
|
+
| `@example` | Example of how the code can be used or called. |
|
|
211
|
+
| `@throws` _ExceptionName_ | Description of an exception thrown by the method. |
|
|
212
|
+
| `@exception` _ExceptionName_ | Same as `@throws`. V2 only |
|
|
289
213
|
|
|
290
214
|
**Example**
|
|
291
215
|
|
|
@@ -298,6 +222,7 @@ The following tags are supported on the method level:
|
|
|
298
222
|
* Object result = SampleClass.call('exampleAction');
|
|
299
223
|
*/
|
|
300
224
|
public static Object call(String action) {
|
|
225
|
+
}
|
|
301
226
|
```
|
|
302
227
|
|
|
303
228
|
### Grouping Declarations Within A Class
|
|
@@ -307,6 +232,7 @@ groups of constants that should be grouped together because they share a common
|
|
|
307
232
|
of constants representing the possible values for different picklists.)
|
|
308
233
|
|
|
309
234
|
You can group things together within a class by using the following syntax:
|
|
235
|
+
|
|
310
236
|
```apex
|
|
311
237
|
// @start-group Group Name or Description
|
|
312
238
|
public static final String CONSTANT_FOO = 'Foo';
|
|
@@ -317,16 +243,19 @@ public static final String CONSTANT_BAR = 'Bar';
|
|
|
317
243
|
Groups of members are displayed together under their own subsection after its name or description.
|
|
318
244
|
|
|
319
245
|
Some notes about grouping:
|
|
246
|
+
|
|
320
247
|
* This is only supported on classes, NOT enums and interfaces
|
|
321
248
|
* Supports
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
* BUT only members of the same type are grouped together. For example,
|
|
327
|
-
if you have a group that contains properties and methods the properties will be grouped together under Properties ->
|
|
249
|
+
* Properties
|
|
250
|
+
* Fields (variables and constants)
|
|
251
|
+
* Constructors
|
|
252
|
+
* Methods
|
|
253
|
+
* BUT only members of the same type are grouped together. For example,
|
|
254
|
+
if you have a group that contains properties and methods the properties will be grouped together under Properties ->
|
|
255
|
+
Group Name, and the methods will be grouped together under Methods -> Group Name
|
|
328
256
|
* Does not support inner types (inner classes, interfaces, and enums)
|
|
329
|
-
* It is necessary to use `// @end-group` whenever a group has been started, otherwise a parsing error will be raised for
|
|
257
|
+
* It is necessary to use `// @end-group` whenever a group has been started, otherwise a parsing error will be raised for
|
|
258
|
+
that file.
|
|
330
259
|
|
|
331
260
|
### Inline linking
|
|
332
261
|
|
|
@@ -346,9 +275,40 @@ Apexdocs recognizes 2 different syntax when linking files:
|
|
|
346
275
|
* @param param1 An <<ExampleClass>> instance. Can also do {@link ExampleClass}
|
|
347
276
|
* @return The result of the operation.
|
|
348
277
|
*/
|
|
349
|
-
public static Object class(ExampleClass param1) {
|
|
278
|
+
public static Object class (ExampleClass param1) {
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
Email addresses can also be inlined linked by using the `{@email EMAIL_ADDRESS}` syntax.
|
|
284
|
+
|
|
285
|
+
### HTML support
|
|
286
|
+
|
|
287
|
+
For the most part all HTML is sanitized. But there are some tags are allowed to have for the possibility of better
|
|
288
|
+
styling long text.
|
|
289
|
+
|
|
290
|
+
- Allowed tags are: `br`, `p`, `ul`, and `li`
|
|
291
|
+
|
|
292
|
+
Example
|
|
293
|
+
|
|
294
|
+
```apex
|
|
295
|
+
/**
|
|
296
|
+
* @description <p>This is a paragraph</p>
|
|
297
|
+
* <p>And this is another paragraph</p>
|
|
298
|
+
* <ul>
|
|
299
|
+
* <li>This is a list item</li>
|
|
300
|
+
* <li>This is another list item</li>
|
|
301
|
+
* </ul>
|
|
302
|
+
*/
|
|
303
|
+
class MyClass {
|
|
304
|
+
}
|
|
350
305
|
```
|
|
351
306
|
|
|
352
307
|
## Typescript
|
|
353
308
|
|
|
354
309
|
ApexDocs provides all necessary type definitions.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## 1.X
|
|
314
|
+
Looking for documentation for version 1.X? Please refer to its [branch](https://github.com/cesarParra/apexdocs/tree/1.x)
|
|
File without changes
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
`STATUS: ACTIVE`
|
|
8
8
|
|
|
9
|
-
This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this ClassThatDoesNotExist does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
9
|
+
This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this [ClassThatDoesNotExist](ClassThatDoesNotExist) does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
**Group**
|
|
12
|
+
**Group** Main
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
**CustomAnnotation** A Custom annotation
|
|
@@ -29,6 +29,7 @@ This is a class description. This class relates to [SampleInterface](/Sample-Int
|
|
|
29
29
|
Constructs a SampleClass without any arguments. This relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
30
30
|
|
|
31
31
|
###### Throws
|
|
32
|
+
|
|
32
33
|
|Exception|Description|
|
|
33
34
|
|---|---|
|
|
34
35
|
|`ExcName`|some exception|
|
|
@@ -52,6 +53,7 @@ SampleClass sampleInstance = new SampleClass();
|
|
|
52
53
|
Constructs a SampleClass with an argument.
|
|
53
54
|
|
|
54
55
|
###### Parameters
|
|
56
|
+
|
|
55
57
|
|Param|Description|
|
|
56
58
|
|---|---|
|
|
57
59
|
|`argument1`|Argument1 definition|
|
|
@@ -92,6 +94,7 @@ This is a String property.
|
|
|
92
94
|
Executes commands based on the passed in argument.
|
|
93
95
|
|
|
94
96
|
#### Parameters
|
|
97
|
+
|
|
95
98
|
|Param|Description|
|
|
96
99
|
|---|---|
|
|
97
100
|
|`argument1`|Argument1 to debug|
|
|
@@ -118,6 +121,7 @@ System.debug(result);
|
|
|
118
121
|
Something here
|
|
119
122
|
|
|
120
123
|
#### Parameters
|
|
124
|
+
|
|
121
125
|
|Param|Description|
|
|
122
126
|
|---|---|
|
|
123
127
|
|
package/docs/README.md
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
# Classes
|
|
2
|
-
##
|
|
2
|
+
## Main
|
|
3
3
|
|
|
4
|
-
### [GroupedClass](/
|
|
4
|
+
### [GroupedClass](/Main/GroupedClass.md)
|
|
5
5
|
|
|
6
6
|
Uses a block style apex doc
|
|
7
|
-
## Sample Classes
|
|
8
7
|
|
|
9
|
-
### [SampleClass](/
|
|
8
|
+
### [SampleClass](/Main/SampleClass.md)
|
|
10
9
|
|
|
11
|
-
This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this ClassThatDoesNotExist does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
10
|
+
This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this [ClassThatDoesNotExist](ClassThatDoesNotExist) does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
12
11
|
## Miscellaneous
|
|
13
12
|
|
|
14
|
-
### [SampleClassWithoutModifier](/
|
|
13
|
+
### [SampleClassWithoutModifier](/API/SampleClassWithoutModifier.md)
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
## Sample Interfaces
|
|
@@ -19,8 +18,3 @@ This is a class description. This class relates to [SampleInterface](/Sample-Int
|
|
|
19
18
|
### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
20
19
|
|
|
21
20
|
This is an interface description.
|
|
22
|
-
## Stripe Integration
|
|
23
|
-
|
|
24
|
-
### [SampleTestClass](/Stripe-Integration/SampleTestClass.md)
|
|
25
|
-
|
|
26
|
-
|
package/docs/index.html
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<title>Document</title>
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
7
|
-
<meta name="description" content="Description">
|
|
8
|
-
<meta name="viewport" content="width=device-width,
|
|
9
|
-
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="app"></div>
|
|
13
|
-
<script>
|
|
14
|
-
window.$docsify = {
|
|
15
|
-
name: '',
|
|
16
|
-
repo: ''
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Document</title>
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
7
|
+
<meta name="description" content="Description">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
|
9
|
+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="app"></div>
|
|
13
|
+
<script>
|
|
14
|
+
window.$docsify = {
|
|
15
|
+
name: '',
|
|
16
|
+
repo: ''
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
<!-- Docsify v4 -->
|
|
20
|
+
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description This is a class description. This class relates to {@link SampleInterface}
|
|
3
3
|
* But this {@link ClassThatDoesNotExist} does not exist.
|
|
4
4
|
* You can also link using this syntax <<SampleInterface>>
|
|
5
|
-
* @group
|
|
5
|
+
* @group Main
|
|
6
6
|
* @CustomAnnotation A Custom annotation
|
|
7
7
|
* @author Cesar Parra
|
|
8
8
|
* @see SampleInterface
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReflectionResult } from '@cparra/apex-reflection';
|
|
2
|
+
import ApexBundle from '../model/apex-bundle';
|
|
2
3
|
/**
|
|
3
4
|
* Application entry-point to generate documentation out of Apex source files.
|
|
4
5
|
*/
|
|
@@ -7,5 +8,5 @@ export declare class Apexdocs {
|
|
|
7
8
|
* Generates documentation out of Apex source files.
|
|
8
9
|
*/
|
|
9
10
|
static generate(): void;
|
|
10
|
-
static _reflectionWithLogger: (
|
|
11
|
+
static _reflectionWithLogger: (apexBundle: ApexBundle) => ReflectionResult;
|
|
11
12
|
}
|
|
@@ -20,27 +20,30 @@ class Apexdocs {
|
|
|
20
20
|
* Generates documentation out of Apex source files.
|
|
21
21
|
*/
|
|
22
22
|
static generate() {
|
|
23
|
+
logger_1.Logger.log('Initializing...');
|
|
23
24
|
const fileBodies = apex_file_reader_1.ApexFileReader.processFiles(new file_system_1.DefaultFileSystem());
|
|
24
25
|
const manifest = manifest_factory_1.createManifest(new parser_1.RawBodyParser(fileBodies), this._reflectionWithLogger);
|
|
25
26
|
const filteredTypes = manifest.filteredByAccessModifierAndAnnotations(settings_1.Settings.getInstance().scope);
|
|
26
27
|
types_repository_1.TypesRepository.getInstance().populate(filteredTypes);
|
|
27
|
-
logger_1.Logger.
|
|
28
|
+
logger_1.Logger.clear();
|
|
29
|
+
logger_1.Logger.logSingle(`Filtered ${manifest.types.length - filteredTypes.length} file(s) based on scope: ${settings_1.Settings.getInstance().scope}`, false, 'green', false);
|
|
30
|
+
logger_1.Logger.logSingle(`Creating documentation for ${filteredTypes.length} file(s)`, false, 'green', false);
|
|
28
31
|
const processor = settings_1.Settings.getInstance().typeTranspiler;
|
|
29
32
|
transpiler_1.default.generate(filteredTypes, processor);
|
|
30
33
|
const generatedFiles = processor.fileBuilder().files();
|
|
31
34
|
file_writer_1.FileWriter.write(generatedFiles, (fileName) => {
|
|
32
|
-
logger_1.Logger.
|
|
35
|
+
logger_1.Logger.logSingle(`${fileName} processed.`, false, 'green', false);
|
|
33
36
|
});
|
|
34
37
|
// Error logging
|
|
35
38
|
error_logger_1.default.logErrors(filteredTypes);
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
exports.Apexdocs = Apexdocs;
|
|
39
|
-
Apexdocs._reflectionWithLogger = (
|
|
42
|
+
Apexdocs._reflectionWithLogger = (apexBundle) => {
|
|
40
43
|
var _a;
|
|
41
|
-
const result = apex_reflection_1.reflect(
|
|
44
|
+
const result = apex_reflection_1.reflect(apexBundle.rawTypeContent);
|
|
42
45
|
if (result.error) {
|
|
43
|
-
logger_1.Logger.
|
|
46
|
+
logger_1.Logger.error(`${apexBundle.filePath} - Parsing error ${(_a = result.error) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
44
47
|
}
|
|
45
48
|
return result;
|
|
46
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":";;;AAAA,kEAA6D;AAC7D,wDAA2D;AAC3D,6DAAuF;AACvF,2CAAwC;AACxC,kEAA6D;AAC7D,8CAAkD;AAClD,0CAAuC;AACvC,yDAAkD;AAClD,wDAAoD;AACpD,gEAA4D;AAC5D,uDAA+C;
|
|
1
|
+
{"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":";;;AAAA,kEAA6D;AAC7D,wDAA2D;AAC3D,6DAAuF;AACvF,2CAAwC;AACxC,kEAA6D;AAC7D,8CAAkD;AAClD,0CAAuC;AACvC,yDAAkD;AAClD,wDAAoD;AACpD,gEAA4D;AAC5D,uDAA+C;AAG/C;;GAEG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACH,MAAM,CAAC,QAAQ;QACb,eAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC9B,MAAM,UAAU,GAAG,iCAAc,CAAC,YAAY,CAAC,IAAI,+BAAiB,EAAE,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,iCAAc,CAAC,IAAI,sBAAa,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAE3F,MAAM,aAAa,GAAW,QAAQ,CAAC,sCAAsC,CAAC,mBAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5G,kCAAe,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACtD,eAAM,CAAC,KAAK,EAAE,CAAC;QAEf,eAAM,CAAC,SAAS,CACd,YAAY,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,4BACtD,mBAAQ,CAAC,WAAW,EAAE,CAAC,KACzB,EAAE,EACF,KAAK,EACL,OAAO,EACP,KAAK,CACN,CAAC;QACF,eAAM,CAAC,SAAS,CAAC,8BAA8B,aAAa,CAAC,MAAM,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACtG,MAAM,SAAS,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC;QACxD,oBAAU,CAAC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;QAC9C,MAAM,cAAc,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC;QACvD,wBAAU,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE;YACpD,eAAM,CAAC,SAAS,CAAC,GAAG,QAAQ,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,gBAAgB;QAChB,sBAAW,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC;;AA/BH,4BAwCC;AAPQ,8BAAqB,GAAG,CAAC,UAAsB,EAAoB,EAAE;;IAC1E,MAAM,MAAM,GAAG,yBAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IAClD,IAAI,MAAM,CAAC,KAAK,EAAE;QAChB,eAAM,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,QAAQ,oBAAoB,MAAA,MAAM,CAAC,KAAK,0CAAE,OAAO,EAAE,CAAC,CAAC;KACjF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/lib/cli/generate.js
CHANGED
|
@@ -34,13 +34,18 @@ const argv = yargs.options({
|
|
|
34
34
|
type: 'string',
|
|
35
35
|
alias: 'g',
|
|
36
36
|
default: 'jekyll',
|
|
37
|
-
choices: ['jekyll', 'docsify'],
|
|
38
|
-
describe: 'Define the static file generator for which the documents will be created. Currently supports jekyll, and
|
|
37
|
+
choices: ['jekyll', 'docsify', 'plain-markdown'],
|
|
38
|
+
describe: 'Define the static file generator for which the documents will be created. Currently supports jekyll, docsify, and plain markdown.',
|
|
39
39
|
},
|
|
40
40
|
indexOnly: {
|
|
41
41
|
type: 'boolean',
|
|
42
42
|
default: false,
|
|
43
|
-
describe: 'Defines whether only the index file should be
|
|
43
|
+
describe: 'Defines whether only the index file should be generated.',
|
|
44
|
+
},
|
|
45
|
+
defaultGroupName: {
|
|
46
|
+
type: 'string',
|
|
47
|
+
default: 'Miscellaneous',
|
|
48
|
+
describe: 'Defines the @group name to be used when a file does not specify it.',
|
|
44
49
|
},
|
|
45
50
|
}).argv;
|
|
46
51
|
settings_1.Settings.build({
|
|
@@ -50,6 +55,7 @@ settings_1.Settings.build({
|
|
|
50
55
|
outputDir: argv.targetDir,
|
|
51
56
|
targetGenerator: argv.targetGenerator,
|
|
52
57
|
indexOnly: argv.indexOnly,
|
|
58
|
+
defaultGroupName: argv.defaultGroupName,
|
|
53
59
|
});
|
|
54
60
|
Apexdocs_1.Apexdocs.generate();
|
|
55
61
|
//# sourceMappingURL=generate.js.map
|
package/lib/cli/generate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B,0CAAyD;AACzD,sDAAmD;AAEnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;IACzB,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,+DAA+D;KAC1E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,kEAAkE;KAC7E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,kFAAkF;KAC7F;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,QAAQ,EACN,sHAAsH;YACtH,0HAA0H;KAC7H;IACD,eAAe,EAAE;QACf,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B,0CAAyD;AACzD,sDAAmD;AAEnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;IACzB,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,+DAA+D;KAC1E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,kEAAkE;KAC7E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,kFAAkF;KAC7F;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,QAAQ,EACN,sHAAsH;YACtH,0HAA0H;KAC7H;IACD,eAAe,EAAE;QACf,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,gBAAgB,CAAC;QAChD,QAAQ,EACN,mIAAmI;KACtI;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,0DAA0D;KACrE;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,qEAAqE;KAChF;CACF,CAAC,CAAC,IAAI,CAAC;AAER,mBAAQ,CAAC,KAAK,CAAC;IACb,eAAe,EAAE,IAAI,CAAC,SAAS;IAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,eAAe,EAAE,IAAI,CAAC,eAAmC;IACzD,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;CACxC,CAAC,CAAC;AAEH,mBAAQ,CAAC,QAAQ,EAAE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export default class ApexBundle {
|
|
2
|
+
filePath: string;
|
|
2
3
|
rawTypeContent: string;
|
|
3
4
|
rawMetadataContent: string | null;
|
|
4
|
-
constructor(rawTypeContent: string, rawMetadataContent: string | null);
|
|
5
|
+
constructor(filePath: string, rawTypeContent: string, rawMetadataContent: string | null);
|
|
5
6
|
}
|
package/lib/model/apex-bundle.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class ApexBundle {
|
|
4
|
-
constructor(rawTypeContent, rawMetadataContent) {
|
|
4
|
+
constructor(filePath, rawTypeContent, rawMetadataContent) {
|
|
5
|
+
this.filePath = filePath;
|
|
5
6
|
this.rawTypeContent = rawTypeContent;
|
|
6
7
|
this.rawMetadataContent = rawMetadataContent;
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apex-bundle.js","sourceRoot":"","sources":["../../src/model/apex-bundle.ts"],"names":[],"mappings":";;AAAA,MAAqB,UAAU;IAC7B,YAAmB,cAAsB,EAAS,kBAAiC;
|
|
1
|
+
{"version":3,"file":"apex-bundle.js","sourceRoot":"","sources":["../../src/model/apex-bundle.ts"],"names":[],"mappings":";;AAAA,MAAqB,UAAU;IAC7B,YAAmB,QAAgB,EAAS,cAAsB,EAAS,kBAAiC;QAAzF,aAAQ,GAAR,QAAQ,CAAQ;QAAS,mBAAc,GAAd,cAAc,CAAQ;QAAS,uBAAkB,GAAlB,kBAAkB,CAAe;IAAG,CAAC;CACjH;AAFD,6BAEC"}
|
package/lib/model/file.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.File = void 0;
|
|
4
|
-
const
|
|
4
|
+
const xss = require("xss");
|
|
5
|
+
const xssFilter = new xss.FilterXSS({
|
|
6
|
+
whiteList: { br: [], p: [], ul: [], li: [] },
|
|
7
|
+
});
|
|
5
8
|
class File {
|
|
6
9
|
constructor(fileName, dir) {
|
|
7
10
|
this.fileName = fileName;
|
|
@@ -12,7 +15,7 @@ class File {
|
|
|
12
15
|
return this._contents;
|
|
13
16
|
}
|
|
14
17
|
addText(text, encodeHtml = true) {
|
|
15
|
-
const textToAdd = encodeHtml ?
|
|
18
|
+
const textToAdd = encodeHtml ? xssFilter.process(text) : text;
|
|
16
19
|
this._contents += textToAdd;
|
|
17
20
|
this.addBlankLine();
|
|
18
21
|
}
|
package/lib/model/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/model/file.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/model/file.ts"],"names":[],"mappings":";;;AAAA,2BAA4B;AAE5B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC;IAClC,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;CAC7C,CAAC,CAAC;AAEH,MAAsB,IAAI;IAGxB,YAAmB,QAAgB,EAAS,GAAW;QAApC,aAAQ,GAAR,QAAQ,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAFvD,cAAS,GAAG,EAAE,CAAC;IAE2C,CAAC;IAI3D,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,UAAU,GAAG,IAAI;QACrC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9D,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC;QAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,YAAY;QACV,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC;IACzB,CAAC;CACF;AApBD,oBAoBC"}
|
|
@@ -2,6 +2,7 @@ import { File } from './file';
|
|
|
2
2
|
export declare class MarkdownFile extends File {
|
|
3
3
|
fileExtension(): string;
|
|
4
4
|
addTitle(text: string, level?: number): void;
|
|
5
|
+
addText(text: string, encodeHtml?: boolean): void;
|
|
5
6
|
startCodeBlock(): void;
|
|
6
7
|
endCodeBlock(): void;
|
|
7
8
|
addHorizontalRule(): void;
|
|
@@ -9,4 +10,5 @@ export declare class MarkdownFile extends File {
|
|
|
9
10
|
addTableRow(...columns: string[]): void;
|
|
10
11
|
addListItem(text: string): void;
|
|
11
12
|
protected static replaceInlineLinks(text: string): string;
|
|
13
|
+
protected static replaceInlineEmails(text: string): string;
|
|
12
14
|
}
|
|
@@ -17,6 +17,11 @@ class MarkdownFile extends file_1.File {
|
|
|
17
17
|
this._contents += title;
|
|
18
18
|
this.addBlankLine();
|
|
19
19
|
}
|
|
20
|
+
addText(text, encodeHtml = true) {
|
|
21
|
+
text = MarkdownFile.replaceInlineLinks(text);
|
|
22
|
+
text = MarkdownFile.replaceInlineEmails(text);
|
|
23
|
+
super.addText(text, encodeHtml);
|
|
24
|
+
}
|
|
20
25
|
startCodeBlock() {
|
|
21
26
|
this._contents += '```';
|
|
22
27
|
const sourceLanguage = 'apex';
|
|
@@ -32,6 +37,7 @@ class MarkdownFile extends file_1.File {
|
|
|
32
37
|
this.addBlankLine();
|
|
33
38
|
}
|
|
34
39
|
initializeTable(...headers) {
|
|
40
|
+
this.addBlankLine();
|
|
35
41
|
this._contents += '|';
|
|
36
42
|
headers.forEach((header) => {
|
|
37
43
|
this._contents += header + '|';
|
|
@@ -76,6 +82,23 @@ class MarkdownFile extends file_1.File {
|
|
|
76
82
|
}
|
|
77
83
|
return text;
|
|
78
84
|
}
|
|
85
|
+
static replaceInlineEmails(text) {
|
|
86
|
+
// Parsing links using {@link ClassName} format
|
|
87
|
+
const linkFormatRegEx = '{@email (.*?)}';
|
|
88
|
+
const expression = new RegExp(linkFormatRegEx, 'gi');
|
|
89
|
+
let match;
|
|
90
|
+
const matches = [];
|
|
91
|
+
do {
|
|
92
|
+
match = expression.exec(text);
|
|
93
|
+
if (match) {
|
|
94
|
+
matches.push(match);
|
|
95
|
+
}
|
|
96
|
+
} while (match);
|
|
97
|
+
for (const currentMatch of matches) {
|
|
98
|
+
text = text.replace(currentMatch[0], `[${currentMatch[1]}](mailto:${currentMatch[1]})`);
|
|
99
|
+
}
|
|
100
|
+
return text;
|
|
101
|
+
}
|
|
79
102
|
}
|
|
80
103
|
exports.MarkdownFile = MarkdownFile;
|
|
81
104
|
//# sourceMappingURL=markdown-file.js.map
|