Update to org-ruby 0.9.1, explicitly disable including files feature #254

Merged
merged 1 commit into from Apr 10, 2014

Conversation

Projects
None yet
7 participants
Contributor

wallyqs commented Feb 8, 2014

Update the org-ruby gem to recent version and explicitly disable the #+INCLUDE: directive making it more suitable for when running in Github environment. Recent version also adds lang attributes to code blocks so that syntax highlight is supported (fixes #253 and #250)

# Disable including files!
Orgmode::Parser.new(content, :allow_include_files => false).to_html

dakrone commented Feb 12, 2014

Really looking forward to this!

drewr commented Feb 12, 2014

🤘

Member

bkeepers commented Feb 12, 2014

Looks like there's a test failure: https://travis-ci.org/github/markup/jobs/18472549

test/markups/README.org.html
+<pre class="src" lang="ruby">
+module GitHub
+ module Markup
+ VERSION = 'test'
@ruediger

ruediger Feb 12, 2014

This line causes a test error https://travis-ci.org/github/markup/jobs/18472549

Change it to VERSION = &#39;test&#39;. &#39; is the same as '. Also no newline at the end of the file.

Contributor

wallyqs commented Feb 13, 2014

Sorry for the delay here. I found out that there is a
difference in the implementation of the CGI::escape_html function
in the 2.0.0 standard library which changed how a single quote is rendered in the output.

require 'cgi'
puts RUBY_VERSION

a = <<TEXT
'hello world'
TEXT

result = CGI::escapeHTML a

puts result

# 1.9.3
# 'hello world'

# 2.0.0
# &#39;hello world&#39;

https://github.com/bdewey/org-ruby/blob/master/lib/org-ruby/html_output_buffer.rb#L143

ruby/ruby@07132e0#diff-94952cbdbe387aefd1bb19c8a4684a33

ruby/ruby@bbb6b5e

To avoid surprises, I am thinking of merging this https://github.com/bdewey/org-ruby/compare/backport-cgi-escapehtml-function to make sure that the output is the same among versions and release it as 0.9.1.

Also after that thiking of moving the gem to wallyqs/org-ruby
to enable travis builds too..

Contributor

wallyqs commented Feb 13, 2014

Released today a new version of the gem 0.9.1 to workaround this issue. Build is green now! :)
Also, finally moved the repo to https://github.com/wallyqs/org-ruby where Travis build are activated.

dakrone commented Feb 26, 2014

@bkeepers Anything else that needs to happen for this to get in? (I don't want to be bothersome, I'm just really anxious for it ;))

If this gets pulled, it looks like we'll be able to close #253 as well. 😃 (Very excited for this as well—it means I won't have to track tangled code! Duplicate diffs are bothersome 😦 )

Contributor

wallyqs commented Feb 27, 2014

Also looking forward to this! Please let me know if there is a way I can help further.

Member

bkeepers commented Feb 27, 2014

Sorry for the delay. This is still on my list to do, but it got pushed down by a few other things. I'm hoping to get to it next week.

vermiculus added a commit to vermiculus/ssa-tool that referenced this pull request Mar 1, 2014

Remove duplicated code
In excited anticipation of github/markup#254.

*I'm so excited.*

You don't even *know*.

dakrone commented Apr 3, 2014

@bkeepers any update on this? anything we can do to help?

This was referenced Apr 3, 2014

Member

bkeepers commented Apr 8, 2014

I'm working on deploying this today, but realized there's an issue. I'm not seeing a way to disable syntax highlighting by org-ruby.

The way our pipeline works is we use GitHub::Markup to generate the HTML, heavily sanitize it, and then run it through html-pipeline's SyntaxHighlightFilter. It looks like org-ruby will performing the syntax highlighting itself if Pygments or Coderay is defined (which it is in our runtime environment), but it all gets striped out in the sanitization process.

I'd love a :skip_syntax_highlighting option that would just return the <pre lang="foo"> tag.

Contributor

wallyqs commented Apr 9, 2014

@bkeepers I will make a PR soon to add this functionality, thanks for the feedback.

Member

bkeepers commented Apr 9, 2014

Thanks, we've finished reviewing everything, so it should be pretty easy for us to get this deployed once syntax highlighting is working.

Contributor

wallyqs commented Apr 9, 2014

Made a release of the gem tagged as 0.9.1.gh to support skip_syntax_highlight. Hope this helps! Thanks @bkeepers for taking a look at this.
https://github.com/wallyqs/org-ruby/compare/version-0.9.1-gh

@bkeepers bkeepers merged commit 11d6665 into github:master Apr 10, 2014

myuhe commented Apr 11, 2014

awesome!! 👍

dakrone commented May 13, 2014

@bkeepers is there anything we need to do as org-mode users to activate this change? I've noticed that blocks like:

#+BEGIN_SRC clojure
(defn foo [a]
  (println "foo:" a))
#+END_SRC

Aren't having syntax highlighting activated for the code (in this case, clojure). Gist example: https://gist.github.com/dakrone/17de6685ddd163d5c9ac

Contributor

wallyqs commented May 13, 2014

@dakrone Looks like it is activated on the main site, but not for gists.
Here is an example of how syntax highlighting works for clojure: https://github.com/wallyqs/org-ruby/blob/master/spec/html_code_syntax_highlight_examples/advanced-code-pygments.org#3-it-should-be-possible-to-write-a-colon-at-the-beginning-of-an-example

Member

bkeepers commented May 13, 2014

Mea culpa. Thanks for bringing it up. We'll work on getting gist updated soon, and try get better at keeping Gist and GitHub in sync.

/cc @spicycode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment