Skip to content

Commit 49849a5

Browse files
committed
feat: __MRDOCS__ macro
1 parent 5bc071e commit 49849a5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/modules/ROOT/pages/usage.adoc

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ include::partial$workflow.adoc[]
1313

1414
In summary:
1515

16-
* Begin by specifying the <<config-file,configuration file>> and <<cli,command-line arguments>> to set up the options. The configuration options affect all processes.
17-
* The configuration options define a <<compilation-database, Compilation Database>>. All symbols are extracted with Clang to generate a unified corpus of symbols with their corresponding xref:page$commands.adoc[documentation].
16+
* Begin by specifying the <<config-file,configuration file>> and <<cli,command-line arguments>> to set up the options.
17+
The configuration options affect all processes.
18+
* The configuration options define a <<compilation-database, Compilation Database>>.
19+
All symbols are extracted with Clang to generate a unified corpus of symbols with their corresponding xref:page$commands.adoc[documentation].
1820
* Finally, This corpus is then fed to a xref:page$generators.adoc[Generator] that produces the desired documentation.
1921
2022
For more details on each component, refer to the corresponding sections of this guide.
@@ -210,7 +212,7 @@ However, this ill-formed pattern is problematic:
210212
* the developer has to effectively maintain two versions of the code
211213
* the original source code becomes more and more unreadable
212214

213-
Instead, when using MrDocs, the same function could be documented as:
215+
Instead, when using MrDocs, while the `\\__MRDOCS__` macro is still available for conditional compilation, the same function could be directly documented as:
214216

215217
[source,c++]
216218
----

src/lib/Lib/MrDocsCompilationDatabase.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ adjustCommandLine(
379379
{
380380
new_cmdline.emplace_back(fmt::format("-D{}", def));
381381
}
382+
new_cmdline.emplace_back("-D__MRDOCS__");
382383

383384
if (useSystemStdlib)
384385
{

0 commit comments

Comments
 (0)