|
| 1 | +# Doxygen Commands |
| 2 | + |
| 3 | +Include a limited set of Doxygen commands in parsed Markdown. |
| 4 | + |
| 5 | +Swift Markdown includes an option to parse a limited set of Doxygen commands, to facilitate |
| 6 | +transitioning from a different Markdown parser. To include these commands in the output, include |
| 7 | +the options ``ParseOptions/parseBlockDirectives`` and ``ParseOptions/parseMinimalDoxygen`` when |
| 8 | +parsing a ``Document``. In the resulting document, parsed Doxygen commands appear as regular |
| 9 | +``Markup`` types in the hierarchy. |
| 10 | + |
| 11 | +## Parsing Strategy |
| 12 | + |
| 13 | +Doxygen commands are written by using either a backslash (`\`) or an at-sign (`@`) character, |
| 14 | +followed by the name of the command. Any parameters are then parsed as whitespace-separated words, |
| 15 | +then a "description" argument is taken from the remainder of the line, as well as all lines |
| 16 | +immediately after the command, until the parser sees a blank line, another Doxygen command, or a |
| 17 | +block directive. The description is then parsed for regular Markdown formatting, which is then |
| 18 | +stored as the children of the command type. For example, with Doxygen parsing turned on, the |
| 19 | +following document will parse three separate commands and one block directive: |
| 20 | + |
| 21 | +```markdown |
| 22 | +\param thing The thing. |
| 23 | +This is the thing that is modified. |
| 24 | +\param otherThing The other thing. |
| 25 | + |
| 26 | +\returns A thing that has been modified. |
| 27 | +@Comment { |
| 28 | + This is not part of the `\returns` command. |
| 29 | +} |
| 30 | +``` |
| 31 | + |
| 32 | +Doxygen commands are not parsed within code blocks or block directive content. No indentation |
| 33 | +adjustment is performed on paragraph arguments that span multiple lines, unlike with block directive |
| 34 | +content. |
| 35 | + |
| 36 | +## Topics |
| 37 | + |
| 38 | +### Commands |
| 39 | + |
| 40 | +- ``DoxygenParam`` |
| 41 | +- ``DoxygenReturns`` |
| 42 | + |
| 43 | +<!-- Copyright (c) 2023 Apple Inc and the Swift Project authors. All Rights Reserved. --> |
0 commit comments