Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

* Renamed the gem to org-ruby
* Added +to_html+ for HTML output
* Now supports the following inline markup:
* Now supports the following inline markup:
* bold
* italic
* code
Expand Down
4 changes: 2 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This gem contains Ruby routines for parsing org-mode files.The most
significant thing this library does today is convert org-mode files to
HTML or textile. Currently, you cannot do much to customize the
conversion. The supplied textile conversion is optimized for
extracting "content" from the orgfile as opposed to "metadata."
extracting "content" from the orgfile as opposed to "metadata."

== FEATURES/PROBLEMS:

Expand All @@ -34,7 +34,7 @@ From Ruby code:

Orgmode::Parser.new(data)

...will construct a new +Parser+ object.
...will construct a new +Parser+ object.

== INSTALL:

Expand Down
2 changes: 1 addition & 1 deletion announcement.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This gem contains Ruby routines for parsing org-mode files.The most
significant thing this library does today is convert org-mode files to
HTML or textile. Currently, you cannot do much to customize the
conversion. The supplied textile conversion is optimized for
extracting "content" from the orgfile as opposed to "metadata."
extracting "content" from the orgfile as opposed to "metadata."

== CHANGES

Expand Down
2 changes: 1 addition & 1 deletion doc/fr_class_index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Expand Down
2 changes: 1 addition & 1 deletion doc/fr_file_index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Expand Down
2 changes: 1 addition & 1 deletion doc/fr_method_index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Expand Down
14 changes: 7 additions & 7 deletions lib/org-ruby/html_output_buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def push_mode(mode, opts={})
css_class = ""
css_class = " class=\"src\"" if [:src, :include_src].include? mode
css_class = " class=\"example\"" if (mode == :example || mode == :inline_example)
@logger.debug "#{mode}: <#{ModeTag[mode]}#{css_class}>\n"
@logger.debug "#{mode}: <#{ModeTag[mode]}#{css_class}>\n"
@output << "<#{ModeTag[mode]}#{css_class}>\n" unless mode == :table and skip_tables?
# Entering a new mode obliterates the title decoration
@title_decoration = ""
Expand Down Expand Up @@ -82,7 +82,7 @@ def flush!
unless buffer_mode_is_table? and skip_tables?
@logger.debug "FLUSH ==========> #{@buffer_mode}"
output_indentation
@output << "<#{HtmlBlockTag[@output_type]}#{@title_decoration}>"
@output << "<#{HtmlBlockTag[@output_type]}#{@title_decoration}>"
if (@buffered_lines[0].kind_of?(Headline)) then
headline = @buffered_lines[0]
raise "Cannot be more than one headline!" if @buffered_lines.length > 1
Expand All @@ -96,7 +96,7 @@ def flush!
output << "<span class=\"todo-keyword #{keyword}\">#{keyword} </span>"
end
end
@output << inline_formatting(@buffer)
@output << inline_formatting(@buffer)
@output << "</#{HtmlBlockTag[@output_type]}>\n"
@title_decoration = ""
else
Expand Down Expand Up @@ -148,23 +148,23 @@ def inline_formatting(str)
format_tables!(str)
str
end

def format_emphasis(str)
@re_help.rewrite_emphasis(str) do |marker, s|
"#{Tags[marker][:open]}#{s}#{Tags[marker][:close]}"
end
end

def format_links(str)
@re_help.rewrite_links(str) do |link, text|
if link =~ /(?:jpg|jpeg|gif|png)$/
"<img src=\"#{link}\" />"
else
text ||= link
link = link.sub(/^file:(.*)::(.*?)$/) do

# We don't support search links right now. Get rid of it.

"file:#{$1}"
end
link = link.sub(/^file:/i, "") # will default to HTTP
Expand Down
4 changes: 2 additions & 2 deletions lib/org-ruby/line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def table_separator?
check_assignment_or_regexp(:table_separator, /^\s*\|[-\|\+]*\s*$/)
end

# Checks if this line is a table header.
# Checks if this line is a table header.
def table_header?
@assigned_paragraph_type == :table_header
end
Expand Down Expand Up @@ -200,7 +200,7 @@ def self.to_textile(lines)
# What's tricky is lines can have assigned types, so you need to check
# the assigned type, if present, or see if the characteristic regexp
# for the paragraph type matches if not present.
#
#
# call-seq:
# check_assignment_or_regexp(assignment, regexp) => boolean
#
Expand Down
12 changes: 6 additions & 6 deletions lib/org-ruby/output_buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class OutputBuffer
# This is the overall output buffer
attr_reader :output

# This is the current type of output being accumulated.
# This is the current type of output being accumulated.
attr_accessor :output_type

# This stack is used to do proper outline numbering of headlines.
Expand Down Expand Up @@ -82,7 +82,7 @@ def prepare(line)
if not should_accumulate_output?(line) then
flush!
maintain_list_indent_stack(line)
@output_type = line.paragraph_type
@output_type = line.paragraph_type
end
push_mode(:inline_example) if line.inline_example? and current_mode != :inline_example
pop_mode(:inline_example) if current_mode == :inline_example && !line.inline_example?
Expand All @@ -92,7 +92,7 @@ def prepare(line)
@buffered_lines.push(line)
end

# Flushes everything currently in the accumulation buffer into the
# Flushes everything currently in the accumulation buffer into the
# output buffer. Derived classes must override this to actually move
# content into the output buffer with the appropriate markup. This
# method just does common bookkeeping cleanup.
Expand Down Expand Up @@ -140,7 +140,7 @@ def << (str)
@buffer << str
end

# Gets the current list indent level.
# Gets the current list indent level.
def list_indent_level
@list_indent_stack.length
end
Expand All @@ -165,7 +165,7 @@ def mode_is_code(mode)
def maintain_list_indent_stack(line)
if (line.plain_list?) then
while (not @list_indent_stack.empty? \
and (@list_indent_stack.last > line.indent))
and (@list_indent_stack.last > line.indent))
@list_indent_stack.pop
pop_mode
end
Expand Down Expand Up @@ -205,7 +205,7 @@ def should_accumulate_output?(line)

# Special case: Multiple blank lines get accumulated.
return true if line.paragraph_type == :blank and @output_type == :blank

# Currently only "paragraphs" get accumulated with previous output.
return false unless line.paragraph_type == :paragraph
if ((@output_type == :ordered_list) or
Expand Down
10 changes: 5 additions & 5 deletions lib/org-ruby/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def to_html(output_buffer_class=HtmlOutputBuffer)
export_options[:skip_tables] = true if not export_tables?
output = ""
output_buffer = output_buffer_class.new(output, export_options)

if @in_buffer_settings["TITLE"] then

# If we're given a new title, then just create a new line
Expand All @@ -174,7 +174,7 @@ def to_html(output_buffer_class=HtmlOutputBuffer)
Parser.translate([title], output_buffer, filename)
end
Parser.translate(@header_lines, output_buffer, filename) unless skip_header_lines?

# If we've output anything at all, remove the :decorate_title option.
export_options.delete(:decorate_title) if (output.length > 0)
@headlines.each do |headline|
Expand Down Expand Up @@ -217,10 +217,10 @@ def self.translate(lines, output_buffer, filename=nil)

when :metadata, :table_separator, :blank

output_buffer << line.line if output_buffer.preserve_whitespace?
output_buffer << line.line if output_buffer.preserve_whitespace?

when :comment

if line.begin_block?
output_buffer.push_mode(:blockquote) if line.block_type == "QUOTE"
output_buffer.push_mode(:src) if line.block_type == "SRC"
Expand All @@ -238,7 +238,7 @@ def self.translate(lines, output_buffer, filename=nil)
output_buffer << line.line.lstrip

when :unordered_list, :ordered_list

output_buffer << line.output_text << " "

when :inline_example
Expand Down
8 changes: 4 additions & 4 deletions lib/org-ruby/regexp_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Orgmode

# = Summary
#
#
# This class contains helper routines to deal with the Regexp "black
# magic" you need to properly parse org-mode files.
#
Expand Down Expand Up @@ -120,7 +120,7 @@ def rewrite_emphasis(str)
# output format.
#
# = Usage
#
#
# Give this a block that expect the link and optional friendly
# text. Return how that link should get formatted.
#
Expand Down Expand Up @@ -153,7 +153,7 @@ def rewrite_links(str) # :yields: link, text
end
end
end

# Rewrites all of the inline image tags.
def rewrite_images(str) # :yields: image_link
raise "Do not use rewrite_images, use rewrite_links instead!"
Expand All @@ -163,7 +163,7 @@ def rewrite_images(str) # :yields: image_link

def build_org_emphasis_regexp
@org_emphasis_regexp = Regexp.new("([#{@pre_emphasis}]|^)\n" +
"( [#{@markers}] )\n" +
"( [#{@markers}] )\n" +
"( [^#{@border_forbidden}] | " +
" [^#{@border_forbidden}]#{@body_regexp}[^#{@border_forbidden}] )\n" +
"\\2\n" +
Expand Down
12 changes: 6 additions & 6 deletions spec/data/freeform-example.org
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#+BEGIN_EXAMPLE
#+TITLE: Freeform
#+AUTHOR:
#+AUTHOR:
#+EMAIL: bdewey@gmail.com
#+DATE: 2009-12-20 Sun
#+DESCRIPTION:
#+KEYWORDS:
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE: en
#+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:
#+LINK_HOME:
#+LINK_UP:
#+LINK_HOME:
#+END_EXAMPLE
Freeform

Expand Down Expand Up @@ -71,7 +71,7 @@ the Freeform project.
CLOCK: [2009-11-28 Sat 22:44]--[2009-11-28 Sat 23:50] => 1:06

I'm now at the point where I *list* versions, but I can't show
them.
them.

- [X] I currently suspect that I broke my version recovery code
when I switched the order of the idea_changes. I need to
Expand Down
12 changes: 6 additions & 6 deletions spec/data/freeform.org
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#+TITLE: Freeform
#+AUTHOR:
#+AUTHOR:
#+EMAIL: bdewey@gmail.com
#+DATE: 2009-12-20 Sun
#+DESCRIPTION:
#+KEYWORDS:
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE: en
#+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:
#+LINK_HOME:
#+LINK_UP:
#+LINK_HOME:
Freeform

This is my todo list, research file, and log record from working on
Expand Down Expand Up @@ -69,7 +69,7 @@ the Freeform project.
CLOCK: [2009-11-28 Sat 22:44]--[2009-11-28 Sat 23:50] => 1:06

I'm now at the point where I *list* versions, but I can't show
them.
them.

- [X] I currently suspect that I broke my version recovery code
when I switched the order of the idea_changes. I need to
Expand Down
Loading