aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/plaintext.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/plaintext.rb')
-rw-r--r--lib/sisu/v3dv/plaintext.rb36
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/sisu/v3dv/plaintext.rb b/lib/sisu/v3dv/plaintext.rb
index ba1cc48a..557c5f1b 100644
--- a/lib/sisu/v3dv/plaintext.rb
+++ b/lib/sisu/v3dv/plaintext.rb
@@ -200,12 +200,12 @@ WOK
@plaintext[:tail] <<<<WOK
#{@br}
plaintext (plain text):
- #{base_url}/#{@md.fn[:plain]}#{@br}
+ #{@md.file.output_path.txt.url}/#{@md.file.base_filename.txt}#{@br}
Other versions of this document: #{@br}
manifest:
- #{base_url}/#{@md.fn[:manifest]}#{@br}
+ #{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}#{@br}
at:
- #{@env.url.root}#{@br}
+ #{@md.file.output_path.base.url}#{@br}
#{sc}
* #{generator}
@@ -216,15 +216,15 @@ WOK
end
def plaintext_structure(dob='',p_num='') #% Used to extract the structure of a document
lv=n=n3=nil
- if dob.is=='heading'
+ if dob.is==:heading
lv=dob.ln
n=lv - 1
n3=lv + 2
end
util=nil
- wrapped=if dob.is =='para' \
- or dob.is=='heading'
- if dob.is=='para'
+ wrapped=if dob.is ==:para \
+ or dob.is==:heading
+ if dob.is==:para
if dob.hang \
and dob.hang =~/[0-9]/ \
and dob.indent != dob.hang
@@ -299,7 +299,7 @@ WOK
"#{Px[:strike_o]}\\1#{Px[:strike_c]}").
gsub(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,
"#{Px[:monospace_o]}\\1#{Px[:monospace_c]}")
- unless dob.is=='code'
+ unless dob.is==:code
dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}/,'\1').
gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1').
gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,'\1 [link: <\2>]').
@@ -323,12 +323,12 @@ WOK
gsub(/#{Mx[:gl_o]}#169#{Mx[:gl_c]}/,'©').
gsub(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\')
end
- dob.obj=if dob.of=='block' # watch
+ dob.obj=if dob.of==:block # watch
dob.obj.gsub(/#{Mx[:gl_o]}●#{Mx[:gl_c]}/,"* ").
gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,"\n")
else dob.obj.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,"\n\n")
end
- if dob.is=='code'
+ if dob.is==:code
dob.obj=dob.obj.gsub(/(^|[^}])_([<>])/m,'\1\2'). # _> _<
gsub(/(^|[^}])_([<>])/m,'\1\2') # _<_<
end
@@ -352,16 +352,16 @@ WOK
p_num=SiSU_PlaintextFormat::ParagraphNumber.new(dob.ocn).display
end
end
- if dob.is=='heading' \
- or dob.is=='para'
+ if dob.is==:heading \
+ or dob.is==:para
plaintext_structure(dob,p_num)
- elsif dob.is=='group' \
- or dob.is=='block' \
- or dob.is=='verse' \
- or dob.is=='code' \
- or dob.is=='table'
+ elsif dob.is==:group \
+ or dob.is==:block \
+ or dob.is==:verse \
+ or dob.is==:code \
+ or dob.is==:table
@plaintext[:body] << dob.obj + p_num << @br
- elsif dob.is=='break'
+ elsif dob.is==:break
sp=' '
ln='-'
@plaintext[:body] <<=if dob.obj==Mx[:br_page] \