Intellij IDEA is already very good at syntax highlighting .vm Velocity files or independent .html files. But very often one uses template engines to create something in HTML format. Is there any way to enable this mixed mode syntax highlighting, like the one we have for JSP technology?
Did you specify the language for your templates?
Related
I running a mediawiki and want to use syntax highlighting. I am using the extension https://www.mediawiki.org/wiki/Extension:SyntaxHighlight for that.
That works pretty fine.
Alas I want to highlight a language that is not part of this extension. So I wrote an python egg to extend pygments so it can parse my language (using entry points). This works fine.
Now I am struggling to get both to work together. How do I tell the GeShi Extension of MediaWiki to use my pygments extension? What do I have to do, so that using <syntaxhighlight lang="myLanguage"> will result in using my language lexer and style?
The solution was quite simple. One has to edit the file SyntaxHighlight_GeSHi.lexers.php and add the lexer.
It's important to use only lowercase for the lexer name, otherwise the extension will not find the lexer.
I'm just getting into preprocessors, and I'm beginning with haml. I've got the basics down, and have yet to put this to any practical use. I'm not great with the command line, but at the very least, I've managed to convert my index.haml file to a readable html file.
My question is twofold.
1) Do I need to individually convert EACH file within my site directory i.e index.haml | service.haml | contact.haml etc or am I able to bulk convert the entire directory?
2) My second question relates to CMS's such as Wordpress. Am I able to use preprocessors with platforms such as this? If so, how would that work?
Apologies if these questions sound basic and/or stupid, but gotta start somewhere!
Thanks, Scott
1) NO, you don't need to convert each file to HAML. your server serves back HTML back to the client. If it's just plain HTML, it just serves without pre-processing through HAML engine. If it's haml, it pre-processes to generate HTML which will be finally served to the client.
2) CMS's such as WordPress support plain HTML by default, maybe some plugins might allow you to use HAML. you can always use conversion tools like htmltohaml to convert HAML templates to HTML if you want skip plugins.
I have succeeded to compile demo web application using OCaml and Ocsigen server but it's tricky to edit *.eliom, *.eliomi, *.ml and *.mli files because there is no syntax for OCaml. Erlang seems to be best option but it has some issues comparately to OCaml syntax. Can I add new syntax definition myself or I should ask developers about it?
How do I define a custom syntax with highlighting in Monodevelop (v3.0.6) for log files or JSON files. I only could find Syntax_Mode_Definition but it only shows very short snippets which are hard to understand.
Could somebody just show/link a short examlpe how such a file should look like and where it should be put?
You can find most of the built-in syntax highlighting definitions here.
To add one, you would have to write an addin that registers the definition and registers the mimetype.
What syntax highlighting is used on GitHub (for HTML, CSS, JavaScript, C#) when viewing source code-file and is it available for the public to use?
It works on the page and it works when embedding on a page (from a Gist), like this:
<script src="https://gist.github.com/1009439.js"></script>
But can I just include their JavaScript-library and let it highlight my code?
Github uses pygments to highlight syntax. Pygments is running on the server, instead of a pure Javascript client solution. If you're looking for a Javascript solution check out this review of the various options.
According to this help page, GitHub currently highlights syntax with the open-source Linguist library for Ruby. Linguist highlights each language using the tmLanguage files linked in vendor/grammars.
Since Linguist is written in Ruby, it can only be used on the server. If you want a client-side JavaScript library that you can just include on a page, you will have to find a different library.
According to this: http://www.infoq.com/news/2008/03/github-git-repository-hosting
they are using Python Pygments
Chris Wanstrath shared some
information about the inner workings
of GitHub with InfoQ:
GitHub is mostly implemented in Rails.
The post-commit integration mini-apps
we're working on are all written in
Merb, we use the Python Pygments for
syntax highlighting, and we use Ara T.
Howard's Bj plus some Ruby scripts for
our queueing system. And, of course,
we use the Ruby Grit library to
interface with Git.
I believe they use their albino gem. It is a Ruby wrapper for the pygments syntax highlighter.
Here is an article of a comparison I read recently on javascript based syntax highlighters (if that is what you need): http://softwaremaniacs.org/blog/2011/05/22/highlighters-comparison/
As others have said previously, GitHub uses Pygments. You can achieve the same effect by using it together with pygments-style-github.