|
1 | 1 | :doctitle: --auto-abstract command-line option |
2 | 2 |
|
3 | | -## [[overview]] Overview |
4 | | - |
5 | | -If you run pasdoc with --auto-abstract link:CommandLine[CommandLine] |
6 | | -option, pasdoc will automatically deduce the abstract description of |
7 | | -every item from the first sentence of it's description. This means that |
8 | | -you can write |
9 | | - |
10 | | -[source,pascal] |
11 | | ----- |
12 | | -type |
13 | | - { Short description of this class. |
14 | | - More elaborate description of this class. } |
15 | | - TMyClass = class |
16 | | ----- |
17 | | - |
18 | | -and it's equivalent to |
19 | | - |
20 | | -[source,pascal] |
21 | | ----- |
22 | | -type |
23 | | - { @abstract(Short description of this class.) |
24 | | - More elaborate description of this class. } |
25 | | - TMyClass = class |
26 | | ----- |
27 | | - |
28 | | -This means that you can avoid writing explicitly @abstract tags, which |
29 | | -means that your comments look less cluttered. Of course, this also means |
30 | | -that you have to carefully watch to make the first sentence of every |
31 | | -description to "stand on it's own". |
32 | | - |
33 | | -This is a standard feature of javadoc, and it's also available in |
34 | | -doxygen. |
35 | | - |
36 | | -The parsing logic is simple: the first sentence of the description ends |
37 | | -at the first period followed by any whitespace (including newline). Of |
38 | | -course this period must be in the "top-level" text, not inside parameter |
39 | | -of any @-tag. If there is no such period in the description, then the |
40 | | -_whole_ description is treated as one sentence, and the _whole_ |
41 | | -description is treated as an abstract description of the item. |
42 | | - |
43 | | -Of course if any description has an explicit @abstract section, then |
44 | | -this has priority over "the first sentence rule". Using explicit |
45 | | -@abstract tag may be useful if e.g. you need to make the abstract |
46 | | -description two-sentence long. |
47 | | - |
48 | | -## [[small-difference-between-explicit-abstract]] Small difference between explicit @abstract |
49 | | - |
50 | | -Note that there is actually a small difference between two examples |
51 | | -given above. It occurs when pasdoc writes full description of a given |
52 | | -item (full = abstract one + the rest). |
53 | | - |
54 | | -If you used explicit @abstract tag, then pasdoc will always separate the |
55 | | -abstract description with some space (e.g. paragraph marker, <p>, in |
56 | | -HTML) from the rest of the description. But if your abstract description |
57 | | -was deduced automatically, then pasdoc will not automatically insert |
58 | | -such paragraph. This way full description of an item looks more like it |
59 | | -was specified in source code. |
60 | | - |
61 | | -So if I would really want to make two exactly equivalent examples, I |
62 | | -should show this as the first example (note that I explicitly inserted |
63 | | -empty line between abstract description and the rest here): |
64 | | - |
65 | | -[source,pascal] |
66 | | ----- |
67 | | -type |
68 | | - { Short description of this class. |
69 | | -
|
70 | | - More elaborate description of this class. } |
71 | | - TMyClass = class |
72 | | - ... |
73 | | ----- |
74 | | - |
75 | | -## [[example-unit]] Example unit |
76 | | - |
77 | | -See https://github.com/pasdoc/pasdoc/blob/master/tests/testcases/ok_auto_abstract.pas[test unit of this feature]. |
| 3 | +The `--auto-abstract` docs moved to the link:Abstract[Abstract Description] page of the documentation. |
0 commit comments