aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-12-03 00:12:40 -0500
committerRalph Amissah <ralph@amissah.com>2013-12-03 00:12:40 -0500
commit32bc91491fedf30aa4594f9466836e4df9a43dd2 (patch)
tree98ad402f078ad7f3a0e5e999d2d36fc01187206a /lib
parentv5: some file renaming related to: shared files & epub, odf:odt, plaintext (diff)
v5: plaintext, rename & simplify
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v5/txt_plain.rb22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/sisu/v5/txt_plain.rb b/lib/sisu/v5/txt_plain.rb
index e6a8f46f..0cd50254 100644
--- a/lib/sisu/v5/txt_plain.rb
+++ b/lib/sisu/v5/txt_plain.rb
@@ -60,12 +60,10 @@
linefeed)
=end
-module SiSU_Plaintext
+module SiSU_Txt_Plain
require_relative 'ao' # ao.rb
require_relative 'sysenv' # sysenv.rb
include SiSU_Env
- require_relative 'txt_plaint_format' # plaintext_format.rb
- include SiSU_Plaintext_Format
require_relative 'shared_metadata' # shared_metadata.rb
require_relative 'txt_shared' # txt_shared.rb
include SiSU_Param
@@ -396,6 +394,16 @@ WOK
end
@@endnotes[:para]=[]
end
+ def ocn_display(dob)
+ if @env.plaintext_ocn?
+ if defined? dob.ocn \
+ and dob.ocn.is_a?(Fixnum)
+ (defined? dob.ocn) ? "\n#{Dx[:ocn_o]}#{dob.ocn}#{Dx[:ocn_c]}" : ''
+ else ''
+ end
+ else ''
+ end
+ end
def markup(data) # Used for major markup instructions
SiSU_Env::InfoEnv.new(@md.fns)
@data_mod,@endnotes,@level,@cont,@copen,@plaintext_contents_close=Array.new(6){[]}
@@ -466,13 +474,7 @@ WOK
gsub(/(?:^|[^_\\])#{Mx[:lnk_o]}(\S+?\.(?:png|jpg|gif)) .+?#{Mx[:lnk_c]}image/,' [ \1 ]').
gsub(/(?:^|[^_\\])\{\s*\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"\s*\}\S+/,'[image: "\1"]')
if dob.obj !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/
- p_num=''
- if @env.plaintext_ocn?
- if defined? dob.ocn \
- and dob.ocn.is_a?(Fixnum)
- p_num=SiSU_Plaintext_Format::ParagraphNumber.new(dob.ocn).display
- end
- end
+ p_num=ocn_display(dob)
if dob.is==:heading \
or dob.is==:para
plaintext_structure(dob,p_num)