Template talk:Lua: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>NXTBoy
No edit summary
m Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">"
Tags: mobile web edit mobile edit
 
(18 intermediate revisions by 5 users not shown)
Line 3: Line 3:
Nice thing you did there. Sad how it's not supported on IE and webkit (Safari and Google Chrome), but they'll eventually be supported, anyways. <div style="border-top:1px dashed;padding-bottom:.5em;height:1em"><div style="font-size:75%;float:left">[[User:JulienDethurens|JulienDethurens]]</div><div style="font-size:75%;float:right">26 February 2012</div></div>
Nice thing you did there. Sad how it's not supported on IE and webkit (Safari and Google Chrome), but they'll eventually be supported, anyways. <div style="border-top:1px dashed;padding-bottom:.5em;height:1em"><div style="font-size:75%;float:left">[[User:JulienDethurens|JulienDethurens]]</div><div style="font-size:75%;float:right">26 February 2012</div></div>
:If we use this everywhere, it also makes transitions between syntax highlighters easier. {{User:NXTBoy/sig|date=23:05, 26 February 2012 (UTC)}}
:If we use this everywhere, it also makes transitions between syntax highlighters easier. {{User:NXTBoy/sig|date=23:05, 26 February 2012 (UTC)}}
== Unusual and Strange? ==
How is an indentation of 3 strange? It's what I use everywhere for Lua, it's between 2 and 4, which are often used, and it's what the studio uses by default anyways... <div style="border-top:1px dashed;padding-bottom:.5em;height:1em"><div style="font-size:75%;float:left">[[User:JulienDethurens|JulienDethurens]]</div><div style="font-size:75%;float:right">26 February 2012</div></div>
:I guess it just feels wrong to me. Pretty much all the code I see is indented by 4 spaces / a 4-space tab. I guess you can change it back to 3 if you really want. I don't think "it matches studio" is a valid excuse, since at present, the colors don't match anyway.{{User:NXTBoy/sig|date=08:43, 28 February 2012 (UTC)}}
== Problem with leading and trailing whitespace ==
There's a problem with hiding the code tag in a template like this - the parameters to <nowiki>{{#tag}}</nowiki> get trimmed, so we lose leading and trailing whitespace in code. Not normally an issue, but I can forsee corner cases. {{User:NXTBoy/sig|date=08:43, 28 February 2012 (UTC)}}
== Preferred Method of Syntax Highlighting? ==
I've been trying to begin contributing to the wiki again, but I've seen many different ways of attempting syntax highlighting.
Which one is best? <nowiki>{{lua}}, {{code}}, <syntaxhighlight lang="lua">, <pre>, etc</nowiki>
Have we come to a conclusion as to which to use? If so I can begin updating articles to use the preferred method. [[User:NecroBumpist|NecroBumpist]] 17:00, 14 April 2012 (EDT)
:Ideally, we want the <nowiki><syntaxhighlight></nowiki> tag, but we don't have the right extension installed. I'd at least hold off on updating anything until we get that resolved. --[[User:Anaminus|Anaminus]] 19:23, 14 April 2012 (EDT)
::Use {{tl|code}} or {{tl|lua}}. {{tag|code lua}} is fine too. However, you shouldn't use {{tag|pre}}. --[[User:JulienDethurens|JulienDethurens]] 16:15, 15 April 2012 (EDT)
::: {{tag|code lua}} is '''not''' fine. We can fix templates sidewide. Using the raw tag would result in a mess after an update. {{User:NXTBoy/sig|date=21:28, 15 April 2012 (UTC)}}
::::Speaking of fixing templates... Any chance of getting proper syntax highlighting of number literals? <br/> {{lua|=0x1234, 10e6}} {{User:NecroBumpist/Signature|date=21:38, 15 April 2012 (UTC)}}
::::But using the template doesn't properly escape wiki text. i.e. '''<nowiki>{{lua|={{Example}}}}</nowiki>''' Translates to: {{Code|=|{{Example}}|lang=lua|linenumbers=}} --[[User:Anaminus|Anaminus]] 17:46, 15 April 2012 (EDT)

Latest revision as of 05:22, 27 April 2023

Great!

Nice thing you did there. Sad how it's not supported on IE and webkit (Safari and Google Chrome), but they'll eventually be supported, anyways.

26 February 2012
If we use this everywhere, it also makes transitions between syntax highlighters easier.
23:05, 26 February 2012 (UTC)

Unusual and Strange?

How is an indentation of 3 strange? It's what I use everywhere for Lua, it's between 2 and 4, which are often used, and it's what the studio uses by default anyways...

26 February 2012
I guess it just feels wrong to me. Pretty much all the code I see is indented by 4 spaces / a 4-space tab. I guess you can change it back to 3 if you really want. I don't think "it matches studio" is a valid excuse, since at present, the colors don't match anyway.
08:43, 28 February 2012 (UTC)

Problem with leading and trailing whitespace

There's a problem with hiding the code tag in a template like this - the parameters to {{#tag}} get trimmed, so we lose leading and trailing whitespace in code. Not normally an issue, but I can forsee corner cases.

08:43, 28 February 2012 (UTC)

Preferred Method of Syntax Highlighting?

I've been trying to begin contributing to the wiki again, but I've seen many different ways of attempting syntax highlighting.

Which one is best? {{lua}}, {{code}}, <syntaxhighlight lang="lua">, <pre>, etc

Have we come to a conclusion as to which to use? If so I can begin updating articles to use the preferred method. NecroBumpist 17:00, 14 April 2012 (EDT)

Ideally, we want the <syntaxhighlight> tag, but we don't have the right extension installed. I'd at least hold off on updating anything until we get that resolved. --Anaminus 19:23, 14 April 2012 (EDT)
Use {{code}} or {{lua}}. <code lua> is fine too. However, you shouldn't use <pre>. --JulienDethurens 16:15, 15 April 2012 (EDT)
<code lua> is not fine. We can fix templates sidewide. Using the raw tag would result in a mess after an update.
21:28, 15 April 2012 (UTC)
Speaking of fixing templates... Any chance of getting proper syntax highlighting of number literals?
0x1234, 10e6
NecroBumpist (Writer) Discuss my contributions at my talk page.21:38, 15 April 2012 (UTC)
But using the template doesn't properly escape wiki text. i.e. {{lua|={{Example}}}} Translates to:
<div class="box shrink" style="background-color: #F5FAFF; border-color: #2F6EAC;"><div class="title" style="border-color: #2F6EAC; background-color: #CEE0F2; font-size: larger;">Example</div>{{{1}}}</div>
--Anaminus 17:46, 15 April 2012 (EDT)