Skip to content
This repository was archived by the owner on May 28, 2019. It is now read-only.

Coderay support #6

Open
aslakhellesoy opened this issue Dec 12, 2011 · 17 comments
Open

Coderay support #6

aslakhellesoy opened this issue Dec 12, 2011 · 17 comments

Comments

@aslakhellesoy
Copy link
Contributor

Grab this one: https://gist.github.com/1076987

@MMSequeira
Copy link

What's necessary to advance this?

@aslakhellesoy
Copy link
Contributor Author

Are you asking for advice on how to implement it?

@MMSequeira
Copy link

Yes!

@MMSequeira
Copy link

Should support for coderay be added here, or to the coderay project? Also, any idea how coderay deals with i18n?

@aslakhellesoy
Copy link
Contributor Author

  • Create a coderay directory
  • Create a gemspec and Gemfile in the coderay dir
  • Modify the Rakefile in the root directory so it generates a coderay scanner for each i18n language. Base the template on the gist.
  • Write some simple tests to verify that it works
  • Send me a pull request

How does that sound?

@aslakhellesoy
Copy link
Contributor Author

I think it makes more sense to add the coderay support in this project, especially since one parser is required per i18n language.

@MMSequeira
Copy link

What are the Gemfile and gemspec files for? Where do the tests go?

@aslakhellesoy
Copy link
Contributor Author

How familiar are you with Ruby? These are pretty basic things in Ruby.

@MMSequeira
Copy link

My problem is how the various pieces fit together. The idea is to create a gem with an extension to coderay?

@aslakhellesoy
Copy link
Contributor Author

Yes, I think that's the way to go. A gherkin-coderay gem that depends on the coderay gem.

@MMSequeira
Copy link

One would have to require the new gem, right? Can you see any way for the new gem to add Gherkin support to Coderay in a transparent way, so that installing the new gem would be enough?

@MMSequeira
Copy link

Perhaps CodeRay could be changed to use the new gem. By the way, do you think it is really necessary to have one parser per language? One might have a single parser and recognize the # language: iso directive.

@aslakhellesoy
Copy link
Contributor Author

What do you mean when you say CodeRay should be changed to use the new gem. Do you mean the CodeRay project should have a dependency on gherkin-coderay? Why?

It would be possible to make the CodeRay parser use the # language header to determine what tokens to look for. In that case, gherkin-coderay would have a runtime dependency on the gherkin gem (instead of a build-dependency on the gherkin gem, which is the approach taken by the other highlighters).

@MMSequeira
Copy link

How can one add support for Gherkin to, say, Redmine, without changing any of its code, just updating its gems?

As to the runtime dependency, that would be good, right?

@aslakhellesoy
Copy link
Contributor Author

That's a question for the RedMine maintainers. In theory it would be ok to let coderay depend on gherkin-coderay, but the drawback is that it makes CodeRay more cumbersome to install. Especially if gherkin-coderay carries with it a runtim dependency on gherkin.

All of this can be avoided if RedMine provides a mechanism for registering 3rd party CodeRay scanners.

@MMSequeira
Copy link

I talked with Kornelius Kalnbach, the developer of CodeRay, and he suggested that gherkin-coderay could be a CodeRay plugin (gem). I think it is a good idea.

@patwcummins
Copy link

Hi MMSequeira, have you found a solution for implementing gherkin syntax highlighting in Redmine?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants