Rosetta Code:Village Pump/Syntax highlighting: Difference between revisions

no edit summary
(REXX, NetRexx. and ooRexx support nested comments)
No edit summary
 
(12 intermediate revisions by 7 users not shown)
Line 302:
 
* On the [[Comments]] page we can see some languages that use nested comments, here is the list that I can see:
** [[Comments#AppleScript]]
** [[Comments#Haskell]]
** [[Comments#Lua]]
Line 963 ⟶ 964:
: GeSHi also has problems with comments in Bash, and with here documents in Ruby. Many of the current syntax-highlighting rules are not correct. --[[User:Kernigh|Kernigh]] 00:32, 28 January 2012 (UTC)
:: And since nobody reported the problems here or upstream its unlikely they will be fixed soon. --[[User:BenBE|BenBE]] 01:12, 28 January 2012 (UTC)
 
= GeShi appears have become 99% transparent =
I just noticed that many code specimen on RC no longer have their Syntax Highlighting apparent. At first I thought it may be just me, but I have the problem in both Firefox and Chrome. So I checked wikipedia and there the Highlighting still appears fine. eg [[wp:ALGOL_68C#The_ENVIRON_and_USING_clauses|ALGOL_68C]], Note the <font color="red">RED</font> where a non standard keyword is used.
By way of contrast <font color="red">ENVIRON</font> in the following is not <font color="red">RED</font> (currently) :
<lang algol68>BEGIN
INT dim = 3; # a constant #
INT a number := 120; # a variable #
ENVIRON EXAMPLE1;
MODE MATRIX = [dim, dim]REAL; # a type definition #
MATRIX m1;
a number := ENVIRON EXAMPLE2;
print((a number))
END</lang>
 
A good place to see the problem is in [[Hello_world]]. eg in [[Hello_world#Python]] & al. I (at least) cannot see any highlighting.
Then when one takes a closer look at the HTML source to the code specimen one finds:
<lang html><pre class="python highlighted_source"><span class="kw1">print</span> <span class="st0">"Goodbye, World!"</span></pre></lang>
 
So it looks like there is a missing style sheet for class="python highlighted_source" & others.
 
Here is the HTML for ALGOL_68:
<lang html><pre class="algol68 highlighted_source">main<span class="sy1">:</span> <span class="br0">(</span><br>
<span class="kw22">printf</span><span class="br0">(</span>$<span class="st0">"Goodbye, World!"</span>l$<span class="br0">)
</span><br><span class="br0">)</span><</pre></lang>
 
A missing style sheet for class="algol68 highlighted_source" maybe?
 
Work around is: think in monochrome! :-)
 
[[User:NevilleDNZ|NevilleDNZ]] 03:49, 20 March 2013 (UTC)
 
Update... today the highlighting is working fine in Algol68 and Python and probably everything else....
 
Problem resolved by some phantom somewhere :-)
 
I note that the wikipedia color schemes are different from rosettacode GeShi color schemes.... Not a big problem, but is there someone somewhere that has proposed a viable "standard" color scheme for syntax highlighting. GeShi itself hints at it, but gedit and vim hint totally different ideas.
 
[[User:NevilleDNZ|NevilleDNZ]] 07:03, 22 March 2013 (UTC)
 
= Highlighting for МК-61 =
I propose to install a syntax highlighting of MK-61/52: [http://pastebin.com/BNByHpac file]. [[User:Русский|Русский]] ([[User talk:Русский|talk]]) 16:02, 11 March 2014 (UTC)
: Or think the highlighting for it is not necessary and the code is clear so? [[User:Русский|Русский]] ([[User talk:Русский|talk]]) 16:09, 12 March 2014 (UTC)
: Do not present the technical opportunities to add new lighting? 19:18, 20 April 2014 (UTC)
:: I think you need to send a pull request if you want to add your language file to GeSHi. The repository is on [https://github.com/GeSHi/geshi-1.0 GitHub]. --[[User:AndiPersti|Andreas Perstinger]] ([[User talk:AndiPersti|talk]]) 06:53, 23 April 2014 (UTC)
::: So, I've finally managed to add a pull request for Phix, any idea how long that will take? [[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 01:00, 25 October 2015 (UTC)
* [https://github.com/GeSHi/geshi-1.0/blob/master/src/geshi/mk-61.php]
*: Is there still someone alive here? When is the update? 14:20, 13 May 2017 (UTC)
 
= AppleScript Comments =
AppleScript '#' comments do not get properly highlighted, nor do nested comments
 
=Tags: lang rsplus vs lang r=
I'm an R user and, like many of the R solutions on this site, when I want to contribute a solution in R, I do what seems to be the natural thing and start my solution with a '''lang r''' tag. This doesn't introduce any special formatting, but I didn't know to expect it to. Recently, I've noticed other R solutions on the site that start their code with '''lang rsplus''' tags and these appear to format the submitted code with nice colours that make R users smile. This raises a few questions that I'd like answered:
 
1) Is there any reason that any one of '''lang r''' or '''lang rsplus''' may be considered the correct option? If so, I'll gladly convert all of my solutions to the correct option.
 
2) Why does '''lang r''' appear to do nothing? Why does it not have the same functionality as '''lang rsplus'''? Is there a template that could be copied to give them the same functionality?
 
3) If the answer to #2 is anything to do with avoiding duplication of work, then is it possible to do a site-wide replacement of one tag for another (e.g. replace all '''lang r''' tags with '''lang rsplus''' tags)? Users would be much less likely to use an incorrect tag if they have never seen it before.
 
As an example of the difference between '''lang r''' and '''lang rsplus''' tags, have a look at the two solutions found at https://rosettacode.org/wiki/Left_factorials#R
--[[User:ReeceGoding|ReeceGoding]] ([[User talk:ReeceGoding|talk]]) 20:03, 18 June 2020 (UTC)
 
= Updating =
Does the site ever update syntax highlighting at all? [[User:Русский|Русский]] ([[User talk:Русский|talk]]) 10:37, 8 March 2021 (UTC)