<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/140094>140094</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-doc] Add a JSON backend to clang-doc to better leverage mustache templates
</td>
</tr>
<tr>
<th>Labels</th>
<td>
help wanted,
clang-doc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ilovepi
</td>
</tr>
</table>
<pre>
@petrhosek brought up this idea in #138061.
The general idea is to add a JSON backend to `clang-doc`, that can be used to verify all the various `Info*` extraction from the source code (e.g. do we extract the correct data from source files). The JSON backend could essentially become an internal backend that the existing backends (HTML, Markdown, etc.) use in conjunction with mustache templates. That should allow us to remove a significant amount of code from clang-doc, and greatly simplify the implementation.
This would also simplify testing, since the JSON testing would decouple formatting checks via templates from core functionality, and reduce the number of tests we need to maintain.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsk82SozYQx59GXLqGAgH-OHBwZsuVpLLJIfsCjdSAdoRESS17_fYpMcx6UzUny6g__r_-qzFGMzmiXnS_ie5LgYlnH3pj_Y1WUwxeP3rRVitxmH2kNxiCT9PMkFbg2UQwmhCMAyGbujlVh7oU1UVUl28zwUSOAto9JgJ7QK0B4c9___kbBlRv5HT-Kg6VsuimF-2VOFRCvgLwjAwKHQwEKdIWd6NgxgegtcAzwQ2D8Snm9D_c6IW8iEMF9IMDKjbewRj8skVGn4IiUF4TCHmicipBe7jTR_QWpXwIpBg0Mr7n7nmjsRSFPJeQsf6nXvlkNVCM5NigtQ8YSPmFAB0YxxQc2idqZsqd6IeJbNz0cROzqt-_ff0ro3_F8Kb93eUzsSqFPOcJ5Ckr774n9w53NzzDkiKjmgmYltUiU8wakSHOmzC01t8hbbMPtPgbAUK23IxGoWPAxSfH4Mf34WzUTy_kK6DTMAVCtg-IZlltdiAz5DMt5BiznJ-2mwj3vXX0v2TQBpwrRuMUbSW2Se43e5Ym5dNqCUYfFuTtRs2k3iLcDD4xd6U-EIz7RNAafnxIDqTT3sWlZaCQEXOrmF139P6gFjSO0biy0H2jz80ZC-rrY3tsZNd2VTH3qpF1e5YnGtTYDKdjfUCUnTzJs1ZNXXeF6WUlu6qru_pQV11V1vJUH0_HsW21PGmUoq1oQWNLa29L6cNUmBgT9XVbVee2sDiQjdv-STmTXeGOjkkLKYV8FVL-4obMKxr6XOhlSFMUbWVN5PgszYbttszPrO4LXD7dup8h-c9AzBTA0o0CTvTJwypSsP3MvEbRXIS8CnmdDM9pKJVfhLxmDfvPyxr8d1Is5HVjjUJed9xbL_8LAAD__6cZhAY">