Talk:Syntax highlighting
This article is rated C-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||||||||||||
|
Wiki Syntax highlighter
editDoes anyone know of a wiki syntax highlighter to help in writing the pages? —Preceding unsigned comment added by 144.92.96.22 (talk) 01:06, 20 June 2008 (UTC)
- See "WikiMedia Built-in Syntax highlighting" below. BTW, the standard practice is to add new topics at the bottom of the page. — Frecklefσσt | Talk 16:25, 20 June 2008 (UTC)
- Not sure that's quite what's wanted; the section you refer to is on highlighting computer code in wiki pages, not about highlighting wiki syntax (e.g. red for external links, from [ to ], blue for internal links from [[ to ]], grey for comments and templates...). This is separate and would also be useful. HLHJ (talk) 12:04, 8 July 2015 (UTC)
- If you mean highlighting wiki syntax while editing, there are several plugins that can be activated for that. One of them is already integrated; go to Preferences->Gadgets, and in the Editing section activate the Syntax highlighter. Diego (talk) 12:22, 8 July 2015 (UTC)
- Not sure that's quite what's wanted; the section you refer to is on highlighting computer code in wiki pages, not about highlighting wiki syntax (e.g. red for external links, from [ to ], blue for internal links from [[ to ]], grey for comments and templates...). This is separate and would also be useful. HLHJ (talk) 12:04, 8 July 2015 (UTC)
How can I implement Syntax highlighting in vb? or java? what is the funda of syntax highlighting?
Syntax highlighting is a function of the text editor, so to highlight syntax in a given language you simply get a text editor with support for that language. Or if you want to add support for a new language, you read the manual for the editor in question.
Isn't syntax coloring the more accurate term?
- No. Syntax highlighting in some programs uses font changes for different elements, too. "Syntax highlighting" gets lots more google hits than "syntax coloring" — Omegatron 20:40, 4 March 2006 (UTC)
- Not to mention that the whole purpose is to _highlight_ the various pieces of code, not to highlight them. "Syntax coloring" seems to be implying that it's an end in itself (pretty code), rather than a means to an end (better understanding of the code). --Shinyplasticbag 07:17, 19 March 2006 (UTC)
LimoWreck revert
editPlease explain why you reverted my edit. Otherwise leave it alone. --klaus
- because people tend to add their own pet editors to articles like this. Listing feature of <insert your favorite piece of software here> doesn't add anything to the principle that's explained in the article; contrary, it makes of the article a platform for spamming software links --LimoWreck 21:32, 23 July 2006 (UTC)
- Please remove the Vim reference as well. Otherwise, leave my change as-is. I have no relationship with PSPad whatsoever but it is one of the very few editors that can do what I mentioned in the blurb. --klaus
- The vim reference was removed as well ;-) --LimoWreck 12:17, 24 July 2006 (UTC)
- Not the last one. I don't want to be difficult here but if you're going to be reverting my changes then you also need to be fair. If it's so important to you that a reference to <whatever> not appear here then the Vim one should also be purged — but I'm not going to do it for you. --klaus
- The vim reference was removed as well ;-) --LimoWreck 12:17, 24 July 2006 (UTC)
- Please remove the Vim reference as well. Otherwise, leave my change as-is. I have no relationship with PSPad whatsoever but it is one of the very few editors that can do what I mentioned in the blurb. --klaus
The link to LEXX, goes to the series, not sure where what the correct link is here, so maybe one of you wikipedians can fix it.
Syntax Highlighting should highlight syntax and not only keywords
editMost of the editors do not really support Syntax Highlighting in my opinion, but instead only support keyword highlighting or lexical highlighting (or whatever you like to call it). Syntax highlighting should mean that the syntax is highlighted or in other words highlight that the text is syntactically valid or invalid. I.e: I could write a piece of Java code starting with public class
which is valid or write it as class public
which is invalid. With only keyword highlighting the last example would colour just fine because the editor recognizes the keywords class and public, with real Syntax highlighting the second example would be somehow marked as invalid. Semantic highlighting should even tell you that the meaning of the context is erroneous.
Text | keyword | syntax | semantic |
---|---|---|---|
Dogs jdsfosdf are | invalid | invalid | invalid |
Dogs humans are | valid | invalid | invalid |
Dogs are humans | valid | valid | invalid |
Dogs are animals | valid | valid | valid |
Writing a real Syntax highlighting text editor is a level complexer then writing a keyword highlighting text editor. Keyword recognition can be done on the fly whereas for syntax highlighting the text has to be parsed which is either a process running in a separate thread, is extremely fast and efficient or is able to break the parsing algorithm as soon as user input is received.
Here are some of the editors I know and how I would classify them (note that some of them can load plugins which could enable them to do real syntax highlighting):
Editor | Type |
---|---|
Notepad | None |
TextPad | Keyword |
Gedit | Keyword |
Eclipse | Syntax |
VIM | Keyword |
Borland JBuilder | Syntax |
Emacs | Keyword |
Eclipse (and maybe JBuilder) even has some basic semantically highlighting. It can tell you that an import is never used, that some local variables are never used and that some code might not be reachable. —Preceding unsigned comment added by 62.58.196.2 (talk) 10:27, 3 September 2008 (UTC)
WikiMedia Built-in Syntax highlighting
editHi, I've recently seen pages that use <source lang="...">code</source>
tags in place of <pre>code</pre>
tags. This is new and a neat feature, however, I don't see any documentation for it on Wikipedia. The header at the top presently reads "For syntax highlighting of source in Wikipedia and other wikis using MediaWiki, see Wikipedia:Text editor support", however, this statement is misleading, as the resulting page offers no feature. Is there a better page to link to for this? Also, as a hint, if you want to know what parameter to use for lang
, try using the tags above on the Wikipedia:Sandbox, and a bad lang
will dump an error that lists the supported keywords and languages. See GeSHi for more information for the code responsible for the syntax highlighting in MediaWiki.+mt 19:46, 6 July 2007 (UTC)
Revert: Link to online syntax highlighter
editHello,
I recently added a link to an online syntax highlighting utility (http://www.billauer.co.il/html_highlighting_nesting.html). Yes, it's in my own site, but that doesn't diminish the link's relevance. The topic is syntax highlighting, and the link takes you to a place where you can see it live. I suggest bringing the link back (revert by Heptite, on the grounds of advertising spam). Billauer (talk) 09:51, 12 October 2008 (UTC)
- Since there was no objection, I returned the link. Billauer (talk) 08:53, 13 October 2008 (UTC)
- I removed the entire external links section. There are tons of syntax highlighting utilities, and Wikipedia is not a directory. There's clearly no official link, so it's either everything (WP=/ directory), some (biased), or none. MrVibrating (talk) 09:18, 14 November 2008 (UTC)
Document Class Section?
editis document class an actual term? it seems made up. further, there is bad grammar. it seems like the only relevant part is the first paragraph and the list. im going to edit it, but if anyone can show me an example of 'document class' as an actual term, then revert.
Syntax Hylighting for Reports
editCan anybody add any info regarding having text font colors changed, so that you can include code all pretty in a open office etc? Chendy (talk) 14:55, 2 April 2010 (UTC)
Syntax highlighting for English/Natural language
editYou could highlight verb arguments: who, what, where, why, and how. To read, you'd scan for "red" verbs, then dart over to the "green" noun phrase (NP) describing the what for the red verb. —Preceding unsigned comment added by 69.171.160.228 (talk) 07:28, 1 April 2011 (UTC)
Syntax highlighting is common practice in primary schools
editThe article is completely oriented to programming and ignores the fact that using colored markers is a common standard technique in primary schools to teach writing, reading comprehension, exams, etc. and was so way before computer programming became common task. This means there is no way to find a pioneer or early use for the technique, the idea is incorporated in school systems for long. — Preceding unsigned comment added by 4.35.92.11 (talk) 00:01, 27 February 2017 (UTC)
Syntax highlighter on but is not selected in Preferences
editAnyone else experiencing this problem? I can't turn it off because it's not turned on. It's doing it on its own. Pyxis Solitary talk 09:26, 14 June 2018 (UTC)
Well, if this happens to anyone else, the fix is "Restore all default settings (in all sections)". I had not touched my Preferences in probably 3 years. Wikipedia bugs are a pain in the @#$! Pyxis Solitary 01:40, 15 June 2018 (UTC)