Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
module Jekyll
# Convert org-mode files.
require 'org-ruby'
class OrgConverter < Converter
safe true
def setup
# No-op
end
def matches(ext)
ext =~ /org$/i
end
def output_ext(ext)
".html"
end
def convert(content)
setup
Orgmode::Parser.new(content).to_html
end
end
end
@stardiviner

This comment has been minimized.

Show comment
Hide comment
@stardiviner

stardiviner Apr 28, 2015

Can you tell me how to use this jekyll plugin?

Can you tell me how to use this jekyll plugin?

@aaronaddleman

This comment has been minimized.

Show comment
Hide comment
@aaronaddleman

aaronaddleman Apr 29, 2015

It looks like it takes a .org file and converts it to html?

It looks like it takes a .org file and converts it to html?

@stardiviner

This comment has been minimized.

Show comment
Hide comment
@stardiviner

stardiviner Apr 29, 2015

@aaronaddleman I only see it a class and methods definition. I don't know how jekyll automatically use this convert method.

I mean I just need to put org files into _posts without doing others things?

@aaronaddleman I only see it a class and methods definition. I don't know how jekyll automatically use this convert method.

I mean I just need to put org files into _posts without doing others things?

@braegel

This comment has been minimized.

Show comment
Hide comment
@braegel

braegel May 5, 2015

You can put the plugin here: ./_plugins/org_converter.rb

braegel commented May 5, 2015

You can put the plugin here: ./_plugins/org_converter.rb

@priyadarshan

This comment has been minimized.

Show comment
Hide comment
@priyadarshan

priyadarshan Jun 3, 2016

@stardiviner If you were asking how it works, I believe it leverages org-ruby.

@stardiviner If you were asking how it works, I believe it leverages org-ruby.

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