New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
F# support #286
F# support #286
Conversation
Did you give up on this, or was it completed elsewhere? Thanks. |
I forgot about this. I'll update it soon to at least have basic support |
Cloned and renamed the OCaml files for a start of the FSharp lexer
Hey @raymens, any update on this branch? If not I can see if someone else is willing to implement the F# lexer. |
One of the tests is failing and I haven't figured out why yet. But if someone can complete this work that's totally fine with me. |
This patch will fix the test because diff --git a/lib/rouge/lexers/glsl.rb b/lib/rouge/lexers/glsl.rb
index 792706a..bff3674 100644
--- a/lib/rouge/lexers/glsl.rb
+++ b/lib/rouge/lexers/glsl.rb
@@ -10,7 +10,7 @@ module Rouge
# Author: Sri Harsha Chilakapati
class Glsl < C
tag 'glsl'
- filenames '*.glsl', '*.frag', '*.vert', '*.geom', '*.fs', '*.vs', '*.gs', '*.shader'
+ filenames '*.glsl', '*.frag', '*.vert', '*.geom', '*.vs', '*.gs', '*.shader'
mimetypes 'x-shader/x-vertex', 'x-shader/x-fragment', 'x-shader/x-geometry'
title "GLSL" |
Agreed. |
Thanks @nickbabcock . This fixes the tests. Using rackup there seems to still be some errors around the |
Patch fixes the diff --git a/lib/rouge/lexers/fsharp.rb b/lib/rouge/lexers/fsharp.rb
index 928ff61..e8e6be0 100644
--- a/lib/rouge/lexers/fsharp.rb
+++ b/lib/rouge/lexers/fsharp.rb
@@ -50,6 +50,7 @@ module Rouge
rule /#{upper_id}(?=\s*[.])/, Name::Namespace, :dotted
rule upper_id, Name::Class
rule /[(][*](?![)])/, Comment, :comment
+ rule %r(//.*?\n), Comment::Single
rule id do |m|
match = m[0]
if self.class.keywords.include? match Not 100% sure it's optimal but it looks good to me 😄 |
I tried putting that in the |
Everything rendered beautifully on my end. @jneen, looks like this PR is ready for your review/blessing |
Thanks for your work, sorry about the delay. This looks great. |
What should I do to have fsharp syntax working on Jekyll page hosted on GitHub Pages? |
I'd also like to have F Sharp Syntax highlighting in Jekyll. Is there any progress on this? Looks like this has been awaiting review quite a while. |
Allowing rouge 2.0 (and thus F#) in jekyll is being tracked in a jekyll PR. You may feel free to try out that jekyll branch |
A start of adding F# support to Rouge. Related issue: #285.
Cloned and renamed the OCaml files for a start of the FSharp lexer, so a big thanks to the person that provided the OCaml bindings.
Now I'm trying to actually run this whole thing as I'm new to Ruby so I can check the output and make adjustments.