adambard/learnxinyminutes-site

Some pages are not generating because a problem with middleman-syntax/extension.rb

Closed this issue · 3 comments

samcv commented

Update: Pull request has been made which uses newer middleman and rogue which solves the problem so editing the file below isn't needed.


This line (Line 40) in ~/.gem/ruby/2.3.0/gems/middleman-syntax-1.2.1/lib/middleman-syntax/extension.rb

lexer = Rouge::Lexer.find_fancy(language, code) || Rouge::Lexers::Text

Needs to change to be this:
lexer = Rouge::Lexer.find_fancy(language, code) || Rouge::Lexers::PlainText


Doing that the pages generate properly. Some of them are showing up right now but that may not mean they're actually generating properly.

Here is a list. The ones with Missing by them don't show up on the website. The ones without it don't build on my computer, so they may just be using previously built versions:

build/docs/objective-c/index.html
build/docs/ru-ru/objective-c-ru/index.html
build/docs/id-id/pyqt-id/index.html Missing
build/docs/id-id/coffeescript-id/index.html Missing
build/docs/pyqt/index.html Missing
build/docs/rst/index.html Missing
build/docs/sk-sk/elixir/index.html Missing
build/docs/tr-tr/objective-c-tr/index.html
build/docs/kotlin/index.html
build/docs/vi-vn/objective-c-vi/index.html
build/docs/fa-ir/css-fa/index.html Missing
build/docs/fr-fr/objective-c-fr/index.html

I don't really know ruby, I tried to fix it through changing the site's config.rb but just encountered the same issues (or tried updating some of the gems to later version than in the gemfile). Patching that line in middleman-syntax works and all of the generate. The site is locked to older versions of a lot of things, and updating middleman made the clementine extension not work since it's now an old extension method and isn't supported anymore on the latest middleman. @adambard your thoughts?

Moved here from adambard/learnxinyminutes-docs#2513

samcv commented

Just made a pull request ( #38 ) Which fixes all of the pages I mentioned above. 👍

This doesn't require manually editing that middleman file (Also editing that file only fixed 75% of the pages anyway).

samcv commented

Alternatively we could use Pygments which has many more languages supported. This could be nice.
http://pygments.org/languages/
I have the site working using Pygments instead of Rouge on my branch here: https://github.com/samcv/learnxinyminutes-site/tree/pygments-highlighting

All pages generate with this as well, with full syntax highlighting. Plus we would gain 2x+ the number of supported languages. Thoughts? I would personally love getting a bunch of extra languages added. If you like this I can go ahead and check every page and make sure every page works as expected. Thanks!