Coder Social home page Coder Social logo

Comments (13)

yurrriq avatar yurrriq commented on August 16, 2024

/cc @kytrinyx. GitHub has Idris highlighting support or worst case, Haskell highlighting would probably be better than nothing.

from idris.

kytrinyx avatar kytrinyx commented on August 16, 2024

Does http://github.com/jneen/rouge have idris support under a different name? If so we can map it to what we have in https://github.com/exercism/exercism.io/blob/master/lib/exercism/syntax_highlighter.rb#L6-L15

from idris.

yurrriq avatar yurrriq commented on August 16, 2024

Looks like it doesn't. Purportedly Pygments style sheets are compatible and iirc Pygments supports Idris. Could we adapt it for Exercism?

from idris.

kytrinyx avatar kytrinyx commented on August 16, 2024

If pygments supports it, how hard would it be to add it to rouge?

from idris.

NobbZ avatar NobbZ commented on August 16, 2024

I just looked into the pygmens repo, I wasn't able to find a lexer for idris, also it is NOT listed on the page of supported languages.

So there is no pygments support we could port.

So I forked rogue yesterday and played around a bit, it seems to be not that hard to implement new lexers. The DSL is pretty simple. A problem is though, that there is no formal description of Idris' syntax and the parser code of the compiler itself... Well it needs to get cleaned up a bit ;) So I can't extract the necessary information from there.

I'm slowly starting to adapt some snippets from the Haskell Lexer though. But since I do currently have only a very limited amount of spare time, it might take a while until I have something I could PR to rogue.

from idris.

yurrriq avatar yurrriq commented on August 16, 2024

Not sure if this would be of any use: https://github.com/david-christiansen/idris-code-highlighter

from idris.

yurrriq avatar yurrriq commented on August 16, 2024

If nothing else, you might be able to reverse engineer the output of idris --highlight (which doesn't need that repo).

from idris.

NobbZ avatar NobbZ commented on August 16, 2024

Davids Highlighter transforms the output of idris --highlight into HTML or LaTeX, so it relies on Idris beeing installed, and does not actually parse/scan idris sources, but a preformatted output. that is meant to be read by machines.

Also reverse engineering idris --highlight will be near to impossible because of semantic highlighting. Also it works on the AST which was generated by the parser, which is a little bit messy and not really straightforward.

from idris.

yurrriq avatar yurrriq commented on August 16, 2024

Quite right. There ought to be formal description somewhere..

from idris.

NobbZ avatar NobbZ commented on August 16, 2024

from idris.

yurrriq avatar yurrriq commented on August 16, 2024

I'd recommend IRC too.

from idris.

yurrriq avatar yurrriq commented on August 16, 2024

It looks like maybe GitHub uses this for GFM.

from idris.

NobbZ avatar NobbZ commented on August 16, 2024

from idris.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.