Skip to content
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

Rouge #1266

Closed
ghost opened this issue Apr 17, 2019 · 6 comments
Closed

Rouge #1266

ghost opened this issue Apr 17, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Apr 17, 2019

github.com utilizes Rouge for syntax highlighting. This is good, but it even
uses Rouge with markups that lack Rouge support. For example if you make a file
readme.org:

#+BEGIN_SRC ruby
puts 'hello world'
#+END_SRC

github.com will correctly render the file with highlighting. What is confusing
is that the Org-Ruby Gem currently only supports Coderay or Pygments.rb:

https://github.com/wallyqs/org-ruby#current-status

So how is github.com using Org-Ruby with Rouge?

@wallyqs
Copy link
Contributor

wallyqs commented Apr 17, 2019

iirc the trick was that there are some special css tags that when added to the generated html output, then github will pick them up and apply the syntax highlighting pass on them.

@ghost
Copy link
Author

ghost commented Apr 17, 2019

@wallyqs is it possible for an individual to do this with a local installation?

@wallyqs
Copy link
Contributor

wallyqs commented Apr 17, 2019

I'm not sure tbh how it is done these days...

@kivikakk
Copy link
Contributor

GitHub uses Rouge for syntax highlighting in GitHub Pages, but we use our own highlighter on github.com. In either case, we post-process the HTML output from this gem -- see https://github.com/github/markup/blob/master/README.md and note item 3.

@wallyqs You recall correctly! We search for pre tags with a lang attribute, which determines the language to highlight as.

@ghost
Copy link
Author

ghost commented Apr 17, 2019

@kivikakk where is repo for "our own highlighter"? is it this?

https://github.com/jch/html-pipeline

@kivikakk
Copy link
Contributor

@cup No -- our highlighter, PrettyLights, is closed source. This is regrettable because it's a nice piece of software, but unfortunately licensing issues that are completely out of our hands prevent us from open-sourcing it. (We've tried to address this with our upstream a number of times to no avail.)

@ghost ghost mentioned this issue Sep 12, 2019
@github github locked and limited conversation to collaborators Sep 12, 2019
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

2 participants