You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found https://rouge-ruby.github.io/docs/file.LexerDevelopment.html with instructions on how to make a Rouge Lexer, and contribute it to Rouge. I was able to use the instructions quite easily to make a custom Lexer. However, what I can't find is how to distribute the Lexer in a separate gem, and have Rouge work with that (thus, be able to find and load it). How would one go about that?
What I found is that Rouge loads lexers using a hardcoded relative path, namely rouge/lexers. I did not find any code that makes it look elsewhere.
Since you're probably going to ask why I want this: If I update the language I'm developing, and for instance add a new keyword, I want to be able to include the new syntax in my project's documentation. This means I need a new version of the lexer to highlight for instance the new keyword. But, if the lexer is part of Rouge itself, I need a new version of Rouge, before I can do a release of my project. Therefore, it would be good if I could include my own lexer in my own project, to not be dependent on new Rouge releases. This doesn't mean I shouldn't also contribute it to Rouge itself, but I'd like to be able to also have it as part of my own project.
The text was updated successfully, but these errors were encountered:
I found https://rouge-ruby.github.io/docs/file.LexerDevelopment.html with instructions on how to make a Rouge Lexer, and contribute it to Rouge. I was able to use the instructions quite easily to make a custom Lexer. However, what I can't find is how to distribute the Lexer in a separate gem, and have Rouge work with that (thus, be able to find and load it). How would one go about that?
What I found is that Rouge loads lexers using a hardcoded relative path, namely
rouge/lexers
. I did not find any code that makes it look elsewhere.Since you're probably going to ask why I want this: If I update the language I'm developing, and for instance add a new keyword, I want to be able to include the new syntax in my project's documentation. This means I need a new version of the lexer to highlight for instance the new keyword. But, if the lexer is part of Rouge itself, I need a new version of Rouge, before I can do a release of my project. Therefore, it would be good if I could include my own lexer in my own project, to not be dependent on new Rouge releases. This doesn't mean I shouldn't also contribute it to Rouge itself, but I'd like to be able to also have it as part of my own project.
The text was updated successfully, but these errors were encountered: