I plan to submit this upstreams once we're reasonably confident that
it's correct. I'll also submit it to the GitHub team to enable syntax
highlighting on Dart projects. The bloggers of you who use Jekyll (or
anything else utilizing Pygments for highlighting) should also find
this useful to get your samples in beautiful Technicolor.
/Olov
I have implemented Dart support for Pygments. It should be fairly
correct but any review would be much appreciated. Source code is
available at <https://gist.github.com/1320163>. Check out
<http://blog.lassus.se/2011/10/dart-syntax-highlighting.html> for a
highlighting example and installation instructions.
I plan to submit this upstreams once we're reasonably confident that
it's correct. I'll also submit it to the GitHub team to enable syntax
highlighting on Dart projects. The bloggers of you who use Jekyll (or
anything else utilizing Pygments for highlighting) should also find
this useful to get your samples in beautiful Technicolor.
That should work already (let me know if you find a case for which it doesn't).
> 2. Highlighted interpolation expressions inside string literals '$like
> ${this + "one"}';
I'd like that too. Did I mention that I accept patches? ;)
/Olov
Done. String interpolation highlighting isn't bullet proof but works
well in practice. I created a color scheme too. Check out
<http://blog.lassus.se/2011/11/dart-syntax-highlighting-update.html>
for a demonstration and installation/usage instructions.
Please let me know of any issues.
I'll check if the github guys want to add it.
/Olov
I've pinged the Github guys.
/Olov
Thanks to Ilya Grigorik for submitting the configuration change. The
highlighter lives in the upstream Pygments repository now and is
included in releases since 1.5 (released Mar 10, 2012). I will try to
keep it correct and updated. Patches and bug reports are welcome,
either to me or the Pygments project.
I've found a few bugs already after clicking around on peoples repos,
such as StringBuffer being incorrectly highlighted and that multi-line
comments are falsely detected. Will fix unless someone beats me to it.
/Olov
> I've found a few bugs already after clicking around on peoples repos,
> such as StringBuffer being incorrectly highlighted and that multi-line
> comments are falsely detected. Will fix unless someone beats me to it.
Alright, those are fixed now in
https://bitbucket.org/olov/pygments-main/changesets
I would /love/ to get some help testing that before submitting
upstreams again. It's very easy, just hg clone
https://bitbucket.org/olov/pygments-main; cd pygments-main;
./pygmentize <filename.dart>.
/Olov