Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 1 commit into from

7 participants

@wallyqs

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

Really looking forward to this!

@bkeepers
Owner

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

test/markups/README.org.html
@@ -11,13 +11,28 @@
conversion. The supplied textile conversion is optimized for
extracting &#8220;content&#8221; from the orgfile as opposed to &#8220;metadata.&#8221;</p>
<h1><span class="heading-number heading-number-1">2</span> History</h1>
-<h2><span class="heading-number heading-number-2">2.1</span> 2009-12-30: Version 0.5.1</h2>
+<h2><span class="heading-number heading-number-2">2.1</span> 2014-02-08: Version 0.9.0</h2>
+<ul>
+ <li>Let&#8217;s make sure <code>#+INCLUDE:</code> is not supported</li>
+</ul>
+<ul>
+ <li>And confirm that syntax highlight is supported</li>
+</ul>
+<pre class="src" lang="ruby">
+module GitHub
+ module Markup
+ VERSION = 'test'

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.

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

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..

@wallyqs

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

@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 ;))

@vermiculus

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

@wallyqs

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

@bkeepers
Owner

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 vermiculus referenced this pull request from a commit in vermiculus/ssa-tool
@vermiculus vermiculus Remove duplicated code
In excited anticipation of github/markup#254.

*I'm so excited.*

You don't even *know*.
1ae3f24
@dakrone

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

This was referenced
@bkeepers
Owner

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.

@wallyqs

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

@bkeepers
Owner

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

@wallyqs

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
@myuhe

awesome!! :+1:

@dakrone

@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

@bkeepers
Owner

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
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 0 deletions.
Something went wrong with that request. Please try again.