I wanted to create a custom ALIAS #modified which includes #date and #authorand gives me the HTML output:
Modified:
17.05.2013 TEST
25.12.0033 jESUS Christos
this resulted in:
ALIASES += modified{1}{2}="\par Modified: #date\1 #author\2 \n"
to test it, I wrote the following comment in my c-File
* #modified 17.05.2013 TEST
* #modified 25.12.0033 jESUS Christos
but the corresponding HTML output wasn't quite what I expected:
17.05.2013 TEST 25.12.0033 jESUS Christos
So I'm missing the Modified: and linebreaks at the end of a #modified tag.
Any suggestion why and how it can be fixed?
Your syntax is a bit off the mark.
Put this in your Doxyfile.
ALIASES += mod="\b Modified:\n"
ALIASES += moditem{2}="\par #date\1 #author\2 \n"
and this in your code.
* #mod
* #moditem{ 17.05.2013, TEST }
* #moditem{ 25.12.0033, jESUS Christos }
You might also want to define an #endmod alias to "close" the above comment block, but it isn't necessary.
Related
I'm currently documenting a C code which is not from me.
Either than commenting the code, and then making blocks for Doxygen documentation, I prefer to put comments after each line of code (with ///) in order to implement directly everything in Doxygen.
So far it works very well but I'm not able to generate lists and paragraphs. It seams that list and paragraph are reinitialized each time I start a new comment on next line with ///
Is there something I am missing ?
[EDIT] : an exemple :
So this works perfectly fine, if I put it before my function :
/**
* 1. Title 1. \n
* Description 1. \n
* More description \n
* - Subtitle1. \n
* - Subtitle2. \n
* Description of subtitle2 \n
* 2. Title 2. \n
* Description 2.
*/
But this don't work at all, if I put it INSIDE my function :
Some code /// 1. Title 1. \n
other code /// Description 1. \n
x=x /// More description \n
y=x /// - Subtitle1. \n
code /// - Subtitle2. \n
code /// Description of subtitle2 \n
code /// 2. Title 2. \n
code /// Description 2.
It behaves like if each line was a new comment block.
Thank you,
I would like to define a snippet for comments like
//************
//* foo A1 *
//************
where I enter foo A1 and it would create a line with (6+ len(${1}) asterisks etc. - is that doable and if so, how?
While I am a big proponent of HyperSnips (see
[VSCODE]: Is there a way to insert N times the same characters,
VS Code: how to make a python snippet that after string or expression hitting tab will transform it and
VSCode Advanced Custom Snippets for how to use it),
it is instructive to see how to do this with just the built-in snippet functionality in vscode. Here is a snippet that does what you want:
"Custom Comment": {
"prefix": ["cc2"], // whatever trigger you want, then tab, write your info and tab again
"body": [
"//***${1/./*/g}***",
"//* $1 *",
"//***${1/./*/g}***"
]
},
That just adds 3 asterisks to the beginning and 3 to the end of your added comment, each character of which is replaced by an asterisk as well.
You can use the extension HyperSnips
snippet comment "Comment" A
``rv = '//' + '*'.repeat(t[0].length + 6)``
//* $1 *
``rv = '//' + '*'.repeat(t[0].length + 6)``
endsnippet
I am relatively new to markdown but when I type in the following:
# Here is a header
* here is some stuff about the header
* some more stuff
And this gives me something like:
when I put it into github.
Why is this happening?
Because you put 4 spaces in front of the asterisks. 4 leading spaces at the current indent level = code block. Remove the spaces (or put less then 4).
It's the same on stackoverflow
# Here is a header
* here is some stuff about the header
* some more stuff
produces
Here is a header
* here is some stuff about the header
* some more stuff
where as
# Here is a header
* here is some stuff about the header
* some more stuff
produces
Here is a header
here is some stuff about the header
some more stuff
as does
# Here is a header
* here is some stuff about the header
* some more stuff
--
Here is a header
here is some stuff about the header
some more stuff
I wish to create macro in Netbeans to put block comment over function. I have preference of code formatting over file save. So When I close file it saves code automatically and format it.
Issue is when I create function and comment it. It unformatted my whole block of code like this.
/**
*function abc(){
*var a, b = 50;
*}
*/
I wish to create comment like this. so it keep my coding properly formatted as well.
/*
|
| function abc(){
| var a, b = 50;
| }
|
*/
You can add your own macro by Following this instructions:
Edit->Start Macro Recording
Edit->Stop Macro Recirding
It Will pop-up one Box For Editor Macros->Add Your Choice of Macro Name
In code area add Your custom comment code in " your code "; Like,
Blockquote
"/*
|
| function abc(){
| var a, b = 50;
| }
|
*/"
Assign a Short Cut Key to your Custom Macro.
That's It
Though I couldn't find macro for the same. But I found alternative. Use Ctrl+Shift+R toggle, for multiple line action at same time & add pipeline sign. But it take extra effort for starting and ending comment.
If i want to implement following comment in shorts-cut, what should i do ?
I found shift+alt+j only comment before method body, i just want to comment in method.
thanks in advance
/**
** #modify by grandstream
** #oginal functions 将原先的代码注释 在这部分
** #desc 说明修改的原因
** start modify
*/
xxxxxxxxxx 新的代码
xxxxxxxxx
/**
** end modify
*/
You can define a template (Window>Preferences>Java>Editor>Templates). Insert your comments there, you can use ${line_selection} as a placeholder for the lines that are selected when you use the template.
Such templates are then "Surround with"-Templates, the shortcut for a list of them ist Shift + Alt + Z. So select your code xxxxx, press the Shift + Alt + Z and select your new template to insert the comments.