Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Hello old friend! #2

Open
wants to merge 2 commits into from

1 participant

Rizwan Reza
Rizwan Reza

I just took some time to fix the escaping of characters. Also fixed the author thing.

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 9 additions and 2 deletions.
  1. +8 −2 lib/rdoc/generator/paddle.rb
  2. +1 −0  lib/templates/content.opf.erb
10 lib/rdoc/generator/paddle.rb
View
@@ -19,6 +19,8 @@ class << self
def initialize options
@options = options
+ @title = options.title.split(';')[0]
+ @author = options.title.split(';')[1]
@class_dir = nil
@file_dir = nil
@odir = Pathname.new(options.op_dir).expand_path(Pathname.pwd)
@@ -49,7 +51,11 @@ def class_dir
end
def title
- @options.title
+ @title
+ end
+
+ def author
+ @author
end
def identifier
@@ -58,7 +64,7 @@ def identifier
private
def h string
- string.strip.gsub(/<pre>\s*<\/pre>/, '').gsub(/&/, '&amp;').gsub(/<</, '&lt;&lt;')
+ string.strip.gsub(/<pre>\s*<\/pre>/, '').gsub(/& /, '&amp; ').gsub(/<</, '&lt;&lt;')
end
def copy_images
1  lib/templates/content.opf.erb
View
@@ -7,6 +7,7 @@
xmlns:opf="http://www.idpf.org/2007/opf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dc:title><%= title %></dc:title>
+ <dc:creator opf:file-as="<%= author %>" opf:role="aut"><%= author %></dc:creator>
<dc:language xsi:type="dcterms:RFC3066">en</dc:language>
<dc:identifier id="dcidid" opf:scheme="URI">
<%= identifier %>
Something went wrong with that request. Please try again.