Content:MirLua/Example: Difference between revisions

From Miranda NG
Jump to navigation Jump to search
(+todo about disabling line numeration in small examples)
(+note about replacing pipes with {{!}} in code)
Line 4: Line 4:
|line=line
|line=line
}}<includeonly>[[Category:MirLua examples|{{SUBPAGENAME}}]]</includeonly><noinclude>
}}<includeonly>[[Category:MirLua examples|{{SUBPAGENAME}}]]</includeonly><noinclude>
{{Documentation
|link box = off
|content =
{{Todo|Make a parameter to disable line numeration for examples of 1–3 lines (if possible).}}
{{Todo|Make a parameter to disable line numeration for examples of 1–3 lines (if possible).}}
== Usage ==
If the code to be highlighted contains pipes "<nowiki>|</nowiki>", they should be replaced with {{Tl|!}} to be displayed correctly:
<pre style="overflow: auto;">
{{Content:MirLua/Example|code=local hk = hotkeys.MakeHotkey(HOTKEYF_SHIFT {{!}} HOTKEYF_ALT, 'A')}}
</pre>
will produce
{{Content:MirLua/Example|code=local hk = hotkeys.MakeHotkey(HOTKEYF_SHIFT {{!}} HOTKEYF_ALT, 'A')}}
[[Category:Content pages]]
[[Category:Content pages]]
}}
</noinclude>
</noinclude>

Revision as of 19:08, 27 December 2015

Documentation
Todo: Make a parameter to disable line numeration for examples of 1–3 lines (if possible).

Usage

If the code to be highlighted contains pipes "|", they should be replaced with {{!}} to be displayed correctly:

{{Content:MirLua/Example|code=local hk = hotkeys.MakeHotkey(HOTKEYF_SHIFT {{!}} HOTKEYF_ALT, 'A')}}

will produce

local hk = hotkeys.MakeHotkey(HOTKEYF_SHIFT | HOTKEYF_ALT, 'A')