How to comment out comment in Doxygen documentation - comments

I am using Doxygen's \page, \subpage and \section constructions to make overview documentation for my application. Somewhere in this I am using HTML to create a nicely formatted table.
However, I want to remove a part of the table in the output, without removing the comment itself. E.g.
/*!
\page MAINPAGE Main Page
<table>
<tr>
<td>Do This</td>
<td>100</td>
</tr>
<tr>
<td>Do That</td>
<td>200</td>
</tr>
<tr>
<td>Yet another one</td>
<td>300</td>
</tr>
</table>
I want to remove the line containing 'Do That' without removing the 'text' itself from the file.
If this were simple source code, I could simply comment this out using // or /* */.
I found out that I could use \if or \latexonly (we only generate html output) but both seem a workaround (looks like using if(false) in code to comment out a block).
Isn't there a clean way to comment out comment in Doxygen?

Did you try \cond \endcond tags? It's described here http://www.doxygen.nl/manual/commands.html#cmdcond
http://www.doxygen.nl/manual/commands.html#cmdendcond

Enclose the part to be excluded within #cond and #endcond blocks. Like so:
#cond DOXYGEN_EXCLUDE
<tr>
<td>Do That</td>
<td>200</td>
</tr>
#endcond
and ensure that you have not defined DOXYGEN_EXCLUDE in any place that doxygen can see. DOXYGEN_EXCLUDE is just what I use, it not a special keyword, you can choose any name you prefer.

Besides \cond...\endcond you can also use HTML comments, i.e <!-- this is a comment in a comment --> inside doxygen comments, as explained at the bottom of this page in the manual http://www.doxygen.org/manual/htmlcmds.html

Related

NReco pdf generator issue

I am getting the exact same error code as this question. I also read the answer to that post but not sure how it'll help in the context of this specific error.
NReco PDF generator works when I omit this line in this html file:
<tr>
<td valign="bottom"><div align="left" class="P ">- Other Receipts</div></td>
<td valign="bottom"><div align="center" class="P ">(36)</div></td>
<td valign="bottom"><div align="right" class="P ">83,00</div></td>
</tr>
If I do include that line I get the (exit code: -1073741819) exception. If I really want to include that line, then I must omit this line of code at the header of the same html file:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
For me this is beyond irrational behavior. I dont see how styling or the content that I add in the html file will cause it to crash.
Can anyone assist me with this?
NReco.PdfGenerator is a .NET wrapper for wkhtmltopdf, and this kind of exception indicates that 'wkhtmltopdf.exe' process is crushed for unknown reason.
This means that you need to check what in wkhtmltopdf causes a crush -- you may do that in the command line, actually. Typical reasons:
CSS border-radius rules in some specific cases may cause a crush
if page margins are defined explicitly and it is not enough space for header or footer content this also may cause wkhtmltopdf crush
Unfortunately only way to find a workaround are experiments, however in most cases workaround is possible.

WYSIWYG HTML editor that doesn't try and fix bad HTML

I need a WYSIWYG HTML editor that can edit PHP Blade and Handlebars* templates. I've tried TinyMCE, CKEditor and bootstrap wysihtml5 but they all "fix" my invalid HTML. Can anyone suggest an alternative?
I need to be able to toggle between WYSIWYG and Source mode without the following being altered.
<table>
<thead>
<tr>
<tr>Column 1</tr>
<tr>Column 2</tr>
</tr>
</thead>
<tbody>
#foreach ($data as $datum)
<tr>
<td>{{ $datum->col1 }}</td>
<td>{{ $datum->col2 }}</td>
</tr>
#endforeach
</tbody>
</table>
All the editors I have found remove the #foreach and sometimes break the table too. I don't care too much if the "visual" mode is broken but I need the HTML to remain untouched.
*I prefix Handlebars variables with $ so they're broadly compatible with blade templates.
You can use CKEditor for that, however you will have to define which parts of the code you DON'T want the editor to fix.
CKEditor have the protectedSource feature which you can use to define the parts of the source that the editor should not touch, even if they are not valid HTML.
I've created an example that will work with your #foreach loop and the variables in your example. You can take it and enhance it to fit your needs:
CKEDITOR.editorConfig = function( config ) {
....
....
config.protectedSource.push( /#foreach.*/g );
config.protectedSource.push( /#endforeach.*/g );
config.protectedSource.push( /{{.*}}/g );
}
Here is a working fiddle you can check: https://jsfiddle.net/0tw75xt3/
Note that I changed the
<tr>
<tr>Column 1</tr>
<tr>Column 2</tr>
</tr>
since it's not a valid HTML and I guessed it wasn't supposed to be <tr><tr>
If you want to support more complex templates you will need some more complex regular expressions inside the protectedSource, however this can really give you a good place to start.
There were some WYSIWYG editors for React, that I was able to find.
https://github.com/Pagedraw/pagedraw
https://github.com/c8r/lab
Demo of Pagedraw on YouTube.com, https://www.youtube.com/watch?v=NjH3koR1E6w
I read about the idea about WYSIWYG editing of components in https://medium.com/#vlascik/ember-in-the-middle-of-2019-the-good-the-bad-the-ugly-hopefully-d641cc73d6d1:
https://pinegrow.com
https://grapesjs.com/
Pinegrow explicitly disavows this in the documentation, https://pinegrow.com/docs/pages/pages.html#formats
I saw an attempt to get Handlebars working with GrapesJS, but it ended up inconclusively, https://github.com/artf/grapesjs/issues/1162

Dandelion Datatables + Thymleaf + dt:format

I've tried to implement the formatting attribute for Dandelion Datatables as specified here using Thymeleaf to no avail, like so:
<table dt:table="true" dt:serverside="true" dt:url="#{/somefnplace}">
<thead>
<tr>
<th dt:property="someCurrencyField" dt:format="{0, number, #.##}">
</tr>
</thead>
</table>
...but this does not do anything. Anyone got an idea on how this is supposed to work, or do I have to create render functions for every column because this feature is broken?
Unfortunately, the dt:format attribute is not compatible with AJAX sources. See the last column of the link you've mentioned.
In the upcoming version, it will simply be removed, because using DOM sources, expression utility objects meet all needs perfectly.
So yes, currently the only way is to use the dt:renderFunction attribute, which will refer to a rendering function, one for each column to need to display in a specific format.

Selenium WebDriver and xpath: a more complicated selection

So let's say my structure looks like this at some point:
..........
<td>
[...]
<input value="abcabc">
[...]
</td>
[...]
<td></td>
[...]
<td>
<input id="booboobooboo01">
<div></div> <=======I want to click this!
</td>
.........
I need to click that div, but I need to be sure it's on the same line as the td containing the input with value="abcabc". I also know that the div I need to click (which doesn't have id or any other relevant attribute I can use) is in a td at the same level as the first td, right after the input with id CONTAINING "boo" (dynamically generated, I only know the root part of the id). td's contain nothing relevant I can use.
This is what I tried as far as xpath goes:
//input[#value='abcabc']/../td/input[contains(#id,'boo')]/following-sibling::div
//input[#value='abcabc']/..//td/input[contains(#id,'boo')]/following-sibling::div
None of them worked, of course (element cannot be found).
I want to know if there's a way of selecting that div and how.
EDIT: //input[#value='abcabc']/../../td/input[contains(#id,'boo')]/following-sibling::div is the correct way. This was suggested by the person with the accepted answer. Also note that he offered a slightly different way of doing it. See his answer for details.
Try
//input[#value='abcabc']/ancestor::tr[1]/td/input[contains(#id,'boo')]/following-sibling::div[1]
Note that //input[#value='abcabc']/.. only goes up to the parent <td>, that's why your's did not work.
Another XPath that may work, is a bit more simple:
//input[#id='booboobooboo01']/../div[1]

Xpath query to find elements which contain a certain descendant

I'm using Html Agility Pack to run xpath queries on a web page. I want to find the rows in a table which contain a certain interesting element. In the example below, I want to fetch the second row.
<table name="important">
<tr>
<td>Stuff I'm NOT interested in</td>
</tr>
<tr>
<td>Stuff I'm interested in</td>
<td><interestingtag/></td>
<td>More stuff I'm interested in</td>
</tr>
<tr>
<td>Stuff I'm NOT interested in</td>
</tr>
<tr>
<td>Stuff I'm NOT interested in</td>
</tr>
</table>
I'm looking to do something like this:
//table[#name='important']/tr[has a descendant named interestingtag]
Except with valid xpath syntax. ;-)
I suppose I could just find the interesting element itself and then work my way up the parent chain from the node that's returned, but it seemed like there ought to be a way to do this in one step and I'm just being dense.
"has a descendant named interestintag" is spelled .//interestintag in XPath, so the expression you are looking for is:
//table[#name='important']/tr[.//interestingtag]
Actually, you need to look for a descendant, not a child:
//table[#name='important']/tr[descendant::interestingtag]
I know this isn't what the OP was asking, but if you wanted to find an element that had a descendant with a particular attribute, you could do something like this:
//table[#name='important']/tr[.//*[#attr='value']]
I know it is a late answer but why not going the other way around. Finding all <interestingtag/> tags and then select the parent <tr> tag.
//interestingtag/ancestor::tr

Resources