cc – Template
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Add partial multiline support) |
Lou Montana (talk | contribs) m (Fix demo) |
||
Line 16: | Line 16: | ||
}}</includeonly><noinclude>__NOTOC__ | }}</includeonly><noinclude>__NOTOC__ | ||
Displays a code comment. | Displays a code comment. | ||
== Usage == | |||
{| style="float: right; min-width: 50em; max-width: 50%" | {| style="float: right; min-width: 50em; max-width: 50%" | ||
| colspan="4" | | | colspan="4" | | ||
{{Important| | {{Important| | ||
* There is an issue with multiline comments in space-triggered code blocks (see below). Use <tt><code></tt> tags instead for multiline comments. | |||
* There is also an issue where leaving a blank line would break the code block (even in <tt><code></tt> tags - use <tt><br></tt> twice instead)}} | |||
|- | |- | ||
| style="vertical-align: top" | | | style="vertical-align: top" | | ||
Line 30: | Line 34: | ||
test1 | test1 | ||
test2 | test2 | ||
test3}} | test3}} | ||
| style="vertical-align: top" | | | style="vertical-align: top" | | ||
Line 41: | Line 46: | ||
test1 | test1 | ||
test2 | test2 | ||
test3}}</code> | test3}}</code> | ||
|} | |} | ||
{{<nowiki/>cc|'''''message'''''}} | {{<nowiki/>cc|'''''message'''''}} | ||
* message: comment to display | * message: comment to display | ||
Line 57: | Line 62: | ||
| <nowiki>{{cc|this code is wonderful}}</nowiki> | | <nowiki>{{cc|this code is wonderful}}</nowiki> | ||
| {{cc|this code is wonderful}} | | {{cc|this code is wonderful}} | ||
|- | |- | ||
| | | | ||
Line 84: | Line 79: | ||
this | this | ||
code | code | ||
is | is | ||
wonderful}}</code></pre> | wonderful | ||
}}</code></pre> | |||
| <span style="color: #00F; font-style: italic; white-space: pre">/* | | <span style="color: #00F; font-style: italic; white-space: pre">/* | ||
this | this | ||
code | code | ||
is | is | ||
wonderful | wonderful |
Revision as of 00:53, 30 November 2020
Displays a code comment.
Usage
spaced /*
test1 test2 test3 */ |
spaced + line return /*
test1 test2 test3 */ |
code tag
|
code tag + line return
|
{{cc|message}}
- message: comment to display
Code | Result |
---|---|
{{cc}} | // -no comment defined- |
{{cc|this code is wonderful}} | // this code is wonderful |
<code>{{cc|this code is wonderful}}</code> |
/*
this code is wonderful */ |
<code>{{cc| this code is wonderful }}</code> |
/*
this code is wonderful */ |
Source
<span style="color: #00F; font-style: italic"><nowiki>//</nowiki> {{Trim|{{{1|-no comment defined-}}}}}</span>