-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.json
141 lines (141 loc) · 27.2 KB
/
index.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
[
{
"uri": "https://standardese.github.io/010_start/",
"title": "Getting started",
"tags": [],
"description": "",
"content": " Chapter 1 GETTING STARTED "
},
{
"uri": "https://standardese.github.io/010_start/010/",
"title": "Basic Example",
"tags": [],
"description": "",
"content": "Consider the following C++ header file named swap.hpp:\n#include \u0026lt;type_traits\u0026gt; namespace std { /// \\effects Exchanges values stored in two locations. /// \\requires Type `T` shall be `MoveConstructible` and `MoveAssignable`. template \u0026lt;class T\u0026gt; void swap(T \u0026amp;a, T \u0026amp;b) noexcept(is_nothrow_move_constructible\u0026lt;T\u0026gt;::value \u0026amp;\u0026amp; is_nothrow_move_assignable\u0026lt;T\u0026gt;::value); } This will generate the following documentation:\n#Header file swap.hpp\n#include \u0026lt;type_traits\u0026gt; namespace std { template \u0026lt;typename T\u0026gt; void swap(T \u0026amp; a, T \u0026amp; b) noexcept(is_nothrow_move_constructible\u0026lt;T\u0026gt;::value \u0026amp;\u0026amp; is_nothrow_move_assignable\u0026lt;T\u0026gt;::value); } ##Function template swap\u0026lt;T\u0026gt;\ntemplate \u0026lt;typename T\u0026gt; void swap(T \u0026amp; a, T \u0026amp; b) noexcept(is_nothrow_move_constructible\u0026lt;T\u0026gt;::value \u0026amp;\u0026amp; is_nothrow_move_assignable\u0026lt;T\u0026gt;::value); Effects: Exchanges values stored in two locations.\nRequires: Type T shall be MoveConstructible and MoveAssignable.\nThe example makes it already clear: Standardese aims to provide a documentation in a similar way to the C++ standard - hence the name.\nThis means that it provides commands to introduce so called sections in the documentation. The current sections are all the C++ standard lists in [structure.specifications]/3 like \\effects, \\requires, \\returns and \\throws.\nRead more in the introductory blog post.\n"
},
{
"uri": "https://standardese.github.io/020_overview/commands/010/",
"title": "Command",
"tags": [],
"description": "",
"content": "A command is used to control the documentation generation in some way. A text that begins with a command doesn\u0026rsquo;t appear in the output documentation at all.\nThere are the following commands:\n verbatim - This command isn\u0026rsquo;t like the other commands. It can happen anywhere in a line — i.e. where CommonMark allows an inline entity like emphasis. The text following the command until an end command or the end of the line will be inserted as-is into the output.\n end - This command ends the currently active section, see below. This can be used to extend a section to multiple paragraphs.\n exclude {arg} - Manually excludes an entity or part of it from the documentation. If you don\u0026rsquo;t specify an argument, it won\u0026rsquo;t appear at all, not even in the synopsis. It is as if the entity never existed in the first place. If you specify return as argument, the return type of the function will be hidden in the synopsis. If you specify target as argument, the target of the namespace/type alias or underlying type of the enum will be hidden in the synopsis.\n unique_name {name} - Overrides the unique name of an entity (e.g. for linking):\n/// Some documentation. /// I can now link to `bar()` by writing [foo](). /// /// \\unique_name foo void bar(int a, int c); Note that if you override the unique name of a parent entity, this will also affect the unique names of child entities. If the unique name starts with \u0026lsquo;*\u0026rsquo; or \u0026lsquo;?\u0026rsquo;, it will be a relative unique name, i.e. the unique name of the parent entity will be prepended to it (with seperator \u0026lsquo;::\u0026rsquo; if needed).\n output_name {name} - Overrides the output name of a file. This will only change the base name, the doc_ prefix and extension are still handled separately. Useful if there are multiple files with the same base name in a project, e.g a .hpp and .h header.\n synopsis {string} - Overrides the synopsis in the output. You can pass any string that will be rendered instead of the actual synopsis. Use \\n to render a newline and use \\t to render a tab.\n synopsis_return {string} - Like synopsis, but only overrides the return type of the function.\n group \u0026lt;name\u0026gt; [heading] - Add the entity to a member group. A member group consists of multiple entities that are direct members of the same entity (i.e. class, file, namespace,\u0026hellip;) which will be grouped together in the output. For example:\n/// \\group foo A heading /// This is in the group `foo`. /// Because this is the first entity in the group, it will be the \u0026quot;master\u0026quot;. /// the group comment will be this comment, the group unique name will be this unique name, ... /// The optional heading (everything after the first whitespace) will be shown as heading in the output. void func(); /// \\group foo /// This entity will be added to the same group. /// As it is not the first occurence of the group, /// this comment here will be ignored. /// But you can still use commands to modify this entity. void func(int); /// This entity is not part of the group. void func(char); /// \\group foo /// But this one is (again, comment ignored). void func(short); This will write the synopsis of all group members together and use the documentation text of the first entity. The group name only needs to be unique for one given scope. Note: It will only show inline documentation for children, so don\u0026rsquo;t use it on containers.\n module {name} - Add the entity to a module. A module is just a way to group entities together, it will be inherited by all children. There is no need to define a module, but if you do, simply use the command in first place of a module and you can add documentation for it:\n/// This is an entity in the module 'bar'. /// \\module bar void foo(); /// \\module bar /// This is the documentation for the module 'bar', /// because the command was the first one. output_section {name} - Generates a little section comment in the synopsis above the entity. This is implictly used for member groups with the group name as output section name, if the option output.show_group_output_section is true (the default). If a member group name starts with \u0026lsquo;-\u0026rsquo;, it will never be used (the minus won\u0026rsquo;t be shown). Given the following input:\n/// Some int getter. /// \\output_section Getter functions int get_i(); /// Some float getter. float get_f(); /// Some int setter. /// \\output_section Setter functions void set_i(int val); /// Some float setter. void set_f(float f); It will generate a synopsis like this:\n//=== Getter functions ===// int get_i(); float get_f(); //=== Setter functions ===// void set_i(int val); void set_f(float f); entity {unique-name} - If put in the first place of a comment, names the entity to document, this allows \u0026ldquo;remote\u0026rdquo; comments:\nvoid foo(); /// \\entity foo /// This comment has no corresponding entity. /// But the command specifies the entity it will belong to. It also mixes with unique_name as you might expect.\n file - A shorthand for \\entity current-file-name.\n "
},
{
"uri": "https://standardese.github.io/020_overview/010/",
"title": "Syntax",
"tags": [],
"description": "",
"content": "standardese looks for documentation comments as shown in the following example:\n/// A regular C++ style documentation comment. /// Multiple C++ style comments are merged automatically. /// This line has *two* leading whitespaces because one is always skipped. //! A C++ style comment using an exclamation mark. /// It will also merge with other C++ style comments. //! But don't worry, also with the exclamation mark styles. /** A C style documentation commment. */ /** This is a different comment, they aren't merged. * But you can be fancy with the star at the beginning of the line. * It will ignore all whitespace, the star and the first following whitespace. */ /*! You can also use an exclamation mark. */ /// But neither will merge with any other comment. int x; //\u0026lt; An end-of-line comment. /// It will merge with C++ style comments. int y; //\u0026lt; But this is a different end-of-line comment. A comment corresponds to the entity on the line directly below or on the same line. You can document all entities that way except files (use file command), namespaces (use entity command), and inline entities such as parameters or base classes (use param/tparam/base command or entity command).\nInside the comment you can use arbitrary* Markdown* in the documentation comments and it will be rendered appropriately.\n The Markdown flavor used is CommonMark. standardese does not support inline HTML (for obvious reasons) or images. Inline HTML that isn\u0026rsquo;t a raw HTML block will be treated as literal text. This allows writing vector\u0026lt;T\u0026gt; without markup or escaping in the comment, for example.\n Note: CommonMark allows hard line breaks with a backslash at the end of the line. But the C preprocessor uses a backslash to combine multiple lines into one. For that reason you cannot use a backslash there, instead you can use a forward slash.\n"
},
{
"uri": "https://standardese.github.io/010_start/011/",
"title": "Installation",
"tags": [],
"description": "",
"content": " Very Easy: Pre-compiled Binaries TODO\nEasy: Docker The easiest way to build standardese is to download the docker image foonathan/standardese_dev and run it like so:\ndocker pull foonathan/standardese_dev docker run -v \u0026quot;/path/to/standardese/source:/root/standardese\u0026quot; -v \u0026quot;$(pwd):/root/output\u0026quot; foonathan/standardese_dev It will compile standardese as a fully statically linked binary and copy it to the current working directory. The binary is compatible with any Linux distribution.\nHarder: Building From Source The build system takes care of all dependencies automatically, except for two: Boost and libclang.\nIt needs to have Boost.ProgramOptions and Boost.Filesystem as statically linked binaries. If they\u0026rsquo;re installed, they should be found automatically.\nIt also needs libclang. If you are under a Linux system, it should find the llvm-config binary automatically and everything works, otherwise things are a bit harder. Read the cppast build instructions for more information, they also apply here.\nOnce they\u0026rsquo;re installed, compiling is a simple:\ncmake /path/to/standardese/source cmake --build . --target standardese_tool The result is the executable tool/standardese.\nTODO: cmake installation\n"
},
{
"uri": "https://standardese.github.io/020_overview/011/",
"title": "Linking",
"tags": [],
"description": "",
"content": "To link to an entity, use the syntax [link-text](\u0026lt;\u0026gt; \u0026quot;unique-name\u0026quot;) (a CommonMark link with empty URL and a title of unique-name). If you don\u0026rsquo;t want a special link-text, this can be shortened to [unique-name]() (a CommonMark link with empty URL and the name of an entity as text). You can also use an URL of the following form [link-text](standardese://unique-name/ \u0026quot;optional-title\u0026quot;) (a normal CommonMark link with the standardese:// protocol, the \u0026lsquo;/\u0026rsquo; at the end is important). In either case standardese will insert the correct URL by searching for the entity with the given unique-name.\nThe unique-name of an entity is the name with all scopes, i.e. foo::bar::baz.\n For templates (but not function templates) you need to append all parameters, i.e. foo\u0026lt;A, B, C\u0026gt;.\n For functions you need to append the signature (parameter types and cv and ref qualifier), i.e. func(), bar(int,char) or type::foo() const \u0026amp;\u0026amp;. If the signature is (), you can omit it.\n For (template) parameters it is of the form function-unique-name.parameter-name\n For base classes it is of the form derived-class::base-class\n The unique-name doesn\u0026rsquo;t care about whitespace, so bar(const char*), bar(const char *) and bar (constchar*) are all the same. Because it is sometimes long and ugly, you can override the unique name via the unique_name command (see below).\n For example you can override bar(long, list, of, parameters) to bar(). But keep in mind that it must be unique with regard to all overloads etc. Usually numbering would be a good choice, so bar() (1) or similar.\n You can also use a short unique-name if there aren\u0026rsquo;t multiple entities resolved to the same short name. The short name is the unique-name but without a signature or template parameters, i.e. for foo\u0026lt;T\u0026gt;::func\u0026lt;U\u0026gt;(int) const, the short name is foo::func.\n"
},
{
"uri": "https://standardese.github.io/020_overview/commands/011/",
"title": "Section",
"tags": [],
"description": "",
"content": "A section is the basic way of standardese documentation. It supports all the sections the C++ standard uses, as explained in the example. Those sections will create a paragraph in the output prefixed with a human readable name. There are two special sections, brief and details. They are not labeled in the output.\nUnlike for a command text following a section is included in the output. A section is active for the rest of the paragraph, a hard line break or until another special command is encountered. Any brief sections will be merged together automatically.\nIf you don\u0026rsquo;t specify a section for a paragraph, the first paragraph will be implictly brief, all others implictly details.\n/// \\brief This text is brief. /// /// This is implictly details. /// \\effects This is effects. /// This is still effects. /// \\returns This is returns./ /// Due to the hard break this is details again. /// /// \\notes This is notes. /// \\notes This is a different notes. If you have a section with the form \\\u0026lt;section\u0026gt; \u0026lt;arg\u0026gt; - \u0026lt;text\u0026gt;, it will generate a key value list in the output. Then you can also add other key-value pairs in each line. Use _ as argument for an empty key. Surround the argument in [\u0026lt;arg\u0026gt;] and it will create a link where \u0026lt;arg\u0026gt; is also the destination, i.e. like a regular entity link of the form [\u0026lt;arg\u0026gt;]().\nNote: Due to implementation reason you can\u0026rsquo;t use a real CommonMark link as key.\nThe value consists of CommonMark inline formatting until the reset of the section or a new key is encountered. For example:\n/// This is documentation text (implictly brief btw). /// \\returns 0 - Everything okay (first key-value pair). /// 1 - There was an input error (second key-value pair). /// This is *still* the second key-value pair. /// /// This is normal text as the paragraph ended. This will generate a list of possible return values in the output.\nThis is also how the see section is intended:\n/// Some documentation... /// \\see [this_type] - Put a description here (optional) /// [this_func()] - /// [std::vector\u0026lt;T\u0026gt;] - It will generate a \u0026ldquo;See also:\u0026rdquo; list in the output with links to the entities.\n"
},
{
"uri": "https://standardese.github.io/020_overview/",
"title": "Overview",
"tags": [],
"description": "",
"content": " Chapter 2 Overview "
},
{
"uri": "https://standardese.github.io/010_start/020/",
"title": "Command line",
"tags": [],
"description": "",
"content": "The tool uses Boost.ProgramOptions for the options parsing, --help gives a good overview.\nBasic usage is: standardese [options] inputs\nThe inputs can be both files or directories, in case of directory each file is documented, unless an input option is specified (see below). The tool will currently generate a corresponding Markdown file with the documentation for each file it gets as input. Files that are not source files (determined by the input.source_ext option), will be treated as template files (see below).\n Note: You only need and should give header files to standardese. The source files are unnecessary.\n The options listed under \u0026ldquo;Generic options:\u0026rdquo; must be given to the commandline. They include things like getting the version, enabling verbose output (please provide it for issues) or passing an additional configuration file.\nThe options listed under \u0026ldquo;Configuration\u0026rdquo; can be passed both to the commandline and to the config file. They are subdivided into various sections:\n The input.* options are related to the inputs given to the tool. They can be used to filter, both the files inside a directory and the entities in the source code.\n The compilation.* options are related to the compilation of the source. You can pass macro definitions and include directories as well as a commands_dir. This is a directory where a compile_commands.json file is located. standardese will pass all the flags of all files to libclang.\n This has technical reasons because you give header files whereas the compile commands use only source files.\n The comment.* options are related to the syntax of the documentation markup. You can set both the leading character and the name for each command, for example.\n The template.* options are related to the syntax of the template markup. You can set both the delimiters and the name for each command, for example.\n The output.* options are related to the output generation. It contains an option to set the human readable name of a section, for example.\n The configuration file you can pass with --config uses an INI style syntax, e.g:\n[compilation] include_dir=foo/ macro_definition=FOO [input] blacklist_namespace=detail extract_private=true "
},
{
"uri": "https://standardese.github.io/020_overview/020/",
"title": "External Links",
"tags": [],
"description": "",
"content": "You can also link to external documentations via the tool option --comment.external_doc prefix=url. All unique-names starting with prefix will be linked to the url. If the url contains two dollar signs $$, they will be replaced by the unique-name. By default the tool supports http://en.cppreference.com/w/ with a prefix of std:: by default.\n You can override to a different URL by specifying --comment.external_doc std::=new-url.\n "
},
{
"uri": "https://standardese.github.io/020_overview/commands/020/",
"title": "Inline",
"tags": [],
"description": "",
"content": "A inline is a special kind of command. They are param, tparam and base and used to document (template) parameters and base classes, because you cannot put a corresponding comment there. As such they are shorthands for the \\entity unique-name command. They are followed by the name of entity they refer to.\nThe inline and argument is stripped from the text. The rest of the line will be treated as brief documentation. Like a section, an inline ends when a new special command or hard line break is encountered or a paragraph ends. You can include sections in inlines, however.\nFor example:\n/// Normal documentation for the function. /// /// \\param foo Brief documentation for the parameter `foo`. /// It continues here with details. /// \\param bar /// \\exclude /// /// The `\\exclude` is part of the documentation for `bar`. void func(int foo, int bar); "
},
{
"uri": "https://standardese.github.io/020_overview/025/",
"title": "Name lookup",
"tags": [],
"description": "",
"content": "If you prefix a unique name with * or ?, this will do a name lookup, looking for the entity. This only works inside a comment associated with an entity, not in template files etc.\nIt does a similar search to the actual name lookup in C++: It starts at the associated entity and appends its scope to the partial unique name given, going to the next higher entity if no matching entity can be found, etc.\nFor example:\n```cpp /// a. struct a {};\nnamespace ns { /// ns::a. struct a {};\n/// [This will link to ::a, no lookup here](standardese://a/). /// [This will link to ns::a](standardese://*a/). void foo(); /// b template \u0026lt;typename T\u0026gt; struct b { /// c. void c(); /// [This will link to ns::b\u0026lt;T\u0026gt;::c()](standardese://*c/). void foo(); }; } `\n"
},
{
"uri": "https://standardese.github.io/010_start/030/",
"title": "CMake",
"tags": [],
"description": "",
"content": "To ease the compilation options, you can call standardese from CMake like so:\nfind_package(standardese REQUIRED) # find standardese after installation # generates a custom target that will run standardese to generate the documentation standardese_generate(my_target CONFIG path/to/config_file INCLUDE_DIRECTORY ${my_target_includedirs} INPUT ${headers}) It will use a custom target that runs standardese. You can specify the compilation options and inputs directly in CMake to allow shared variables. All other options must be given in a config file.\nIf you don\u0026rsquo;t have standardese installed, you can also include it directly:\nset(STANDARDESE_TOOL /path/to/standardese/binary) include(/path/to/standardese/standardese-config.cmake) # call standardese_generate() like normal See standardese-config.cmake for a documentation of standardese_generate().\n"
},
{
"uri": "https://standardese.github.io/020_overview/commands/",
"title": "Special commands",
"tags": [],
"description": "",
"content": " Chapter 2.1 Special Commands Standardese adds its own sets of special commands. A command is introduced by the command character (a backslash by default) at the beginning of each line in the comment.\nThere are three kinds of special commands: commands, sections and inlines.\n"
},
{
"uri": "https://standardese.github.io/020_overview/040/",
"title": "Template syntax",
"tags": [],
"description": "",
"content": " Note: Not implemented on develop at the moment.\n If you pass a file that is not a source file, it will be treated as template file and processed. This allows advanced control over the output or writing additional documentation files.\nstandardese will read the file and replace two things:\n URLs with the standardese:// protocol will be converted to the correct URL for the given entity. This allows referring to documentation entities from other files without manually having to deal with the URLs.\n Special commands inside two curly braces by default (\u0026lsquo;{{ … }}\u0026rsquo;).\n Note: standardese is dumb and does not do any other formatting with the template file otherwise. Most importantly, it will create lot of unnecessary empty lines, so does not really work with formats where newlines are important.\n The special commands allow querying standardese for information. It will look for delimiters and commands starting with standardese_. All other commands will be silently ignored.\n This allows mixing \u0026ldquo;normal\u0026rdquo; template syntax with standardese syntax. Process the file with standardese, then your template engine.\n There are the following commands available, entity always means the unique name of an entity here.\n standardese_doc \u0026lt;entity\u0026gt; \u0026lt;format\u0026gt;: Will be replaced with the documentation output for entity in the given format. For example {{ standardese_doc file.hpp html }} will be replaced with the same HTML standardese will generate for the header file file.hpp.\n standardese_doc_text \u0026lt;entity\u0026gt; \u0026lt;format\u0026gt;: Will be replaced with the comment of entity in the given format.\n standardese_doc_synopsis \u0026lt;entity\u0026gt; \u0026lt;format\u0026gt;: Will be replaced with the synopsis of entity in the given format.\n standardese_doc_anchor \u0026lt;unique_name\u0026gt; \u0026lt;format\u0026gt;: If unique_name refers to an existing entity, all links to that entity will link to the anchor in the template file generated in the given format. Otherwise it will create a new entity named unique_name you can link to throughout the documentation.\n standardese_name/index_name/unique_name \u0026lt;entity\u0026gt;: Will be replaced with the name/index name/unique name of the given entity (just a raw character sequence without formatting).\n standardese_module: Will be replaced by the module name of the given entity (just a raw character sequence without formatting).\n standardese_for \u0026lt;variable\u0026gt; \u0026lt;entity\u0026gt;: Will loop over each child of entity and copy the processed next block, the unique name of the current child is stored in the given variable. For example, this will print the names of all children of an entity:\n{{ standardese_for $child some_entity }} {{ standardese_name $child }} {{ standardese_end }} standardese_if/else_if/else \u0026lt;entity\u0026gt; \u0026lt;op\u0026gt; [args...]: Will ignore a block if a condition is not fulfilled. See below for a list of conditions. For example, this will do something different depending on the unique name of an entity:\n{{ standardese_if $entity name a }} Name is a! {{ standardese_else_if $entity name b }} Name is b! {{ standardese_else }} Name is something else. {{ standardese_end }} standardese_end: Ends the block that was started last.\n There are the following if operations available:\n \u0026lt;entity\u0026gt; name \u0026lt;name\u0026gt;: Checks if entity has the given unique name.\n \u0026lt;child\u0026gt; first_child \u0026lt;parent\u0026gt;: Checks if child is the first child of parent.\n \u0026lt;entity\u0026gt; has_children: Checks if entity has children.\n \u0026lt;entity\u0026gt; inline_entity: Checks if entity is an inline entity (parameter, base class, enum value,\u0026hellip;) and inline entities will be shown inline in the documentation output (output.inline_doc).\n \u0026lt;entity\u0026gt; member_group: Checks if entity refers to a member group.\n \u0026lt;entity\u0026gt; index: Check if entity refers to an index file\n You can also provide a default template that can be used to customize the output globally. Then there are two special variables available: $file, which refers to the current file, and $format, which refers to the set output format. The most basic template will just generate the output as standardese would do normally:\n{{ standardese_doc $file $format }} "
},
{
"uri": "https://standardese.github.io/999_other/",
"title": "Other Features",
"tags": [],
"description": "",
"content": " Chapter 2 OTHER FEATURES "
},
{
"uri": "https://standardese.github.io/thanks/",
"title": "Acknowledgements",
"tags": [],
"description": "",
"content": " Manu @Manu343726 Sánchez, as always\n Jason @jpleau Pleau, for much feedback and requests on Gitter\n Mark @DarkerStar Gibbs, for feature suggestions\n Tristan @tcbrindle Brindle, for (better) clang support\n Marek @mkurdej Kurdej, for (better) MSVC support\n Victor @vitaut Zverovich, for bugfixes\n John @johnmcfarlane McFarlane, for issue reporting\n Filipe @verri Verri, for maintaining the AUR package\n @topisani, for issue reporting and bugfixes\n Trim @bresilla Bresilla, for our logo\n And everyone else who shares and uses this project!\n"
},
{
"uri": "https://standardese.github.io/",
"title": "STANDARDESE",
"tags": [],
"description": "",
"content": "Standardese aims to be a nextgen Doxygen.\nIt consists of two parts: a library and a tool.\nThe library aims at becoming the documentation frontend that can be easily extended and customized. It parses C++ code with the help of libclang and provides access to it.\nThe tool drives the library to generate documentation for user-specified files. It supports a couple of output formats including Markdown and HTML as well as experimental Latex and Man pages.\n"
},
{
"uri": "https://standardese.github.io/categories/",
"title": "Categories",
"tags": [],
"description": "",
"content": ""
},
{
"uri": "https://standardese.github.io/tags/",
"title": "Tags",
"tags": [],
"description": "",
"content": ""
}]