Class: SiSU_HTML_Format::FormatToc

Inherits:
FormatTextObject show all
Defined in:
lib/sisu/html_format.rb

Instance Attribute Summary

Attributes inherited from FormatTextObject

#banner, #format, #headname, #link, #linkname, #md, #ocn, #p_num, #paranum, #t_o, #table, #txt, #url

Instance Method Summary collapse

Methods inherited from FormatTextObject

#alt, #block, #bold, #bold_heading, #bold_para, #bullet, #center, #center_bold, #code, #dl, #endnote_body, #endnote_body_indent, #group, #gsub_body, #heading_body, #heading_body0, #heading_body1, #heading_body2, #heading_body3, #heading_body4, #heading_body5, #heading_body6, #heading_body7, #heading_normal, #nametags_scroll, #nametags_seg, #no_paranum, #para, #para_form_css, #seg_heading4, #seg_heading5, #seg_heading6, #seg_heading_sub, #table_css_end, #title_heading, #title_heading0, #title_heading1, #title_heading2, #title_heading3, #title_heading4, #toc_head_copy_at, #verse

Methods included from SiSU_Parts_HTML

#_url_path_image_base, #band1, #band2, #banner_band, #black, #blue_ink, #blue_tinge, #css, #grey, #grey_medium, #grey_pale, #home_button_only, #ico, #instrument_cover_band_scr, #instrument_cover_band_seg, #num, #num_css, #numless, #paragraph_font_small, #paragraph_font_tiny, #png_home, #png_home_button, #set_color, #set_face, #set_fonts, #set_size_endnote, #set_small, #set_tiny, #table1, #table2, #table_txt, #table_txt_r, #the_banner, #the_color, #the_font, #the_line_break, #the_margin, #the_nav, #the_png, #the_table_cellpad_box, #the_table_close, #the_url_decoration, #the_width, #txt_0, #txt_1, #txt_2, #txt_3, #txt_close, #txt_concordance, #txt_doc_link, #txt_homepage, #txt_manifest, #txt_open, #txt_toc_link, #white, #xml_close, #xml_open, #yellow_light

Methods included from SiSU_Parts_Generic

#footer_signature, #home, #home_txt, #i_choice, #i_home_button, #i_ico, #i_new, #rl_root, #root_http, #sisu, #sisu_txt, #sisudoc, #site, #the_icon, #the_text, #the_url, #txt_home, #txt_hp, #txt_hp_alias, #txt_signature, #urify, #url_close, #url_open

Constructor Details

#initialize(md, txt) ⇒ FormatToc

Returns a new instance of FormatToc.



1225
1226
1227
# File 'lib/sisu/html_format.rb', line 1225

def initialize(md,txt)
  super(md,txt)
end

Instance Method Details

#lev(tag, attrib) ⇒ Object



1236
1237
1238
1239
1240
1241
1242
1243
1244
# File 'lib/sisu/html_format.rb', line 1236

def lev(tag,attrib)
  if @txt
    %{<#{tag} class="#{attrib}">
#{@txt}
  </#{tag}>
}
  else ''
  end
end

#lev0Object

docinfo



1245
1246
1247
# File 'lib/sisu/html_format.rb', line 1245

def lev0 #docinfo
  lev('h1','toc')
end

#lev1Object



1248
1249
1250
# File 'lib/sisu/html_format.rb', line 1248

def lev1
  lev('h1','toc')
end

#lev2Object



1251
1252
1253
# File 'lib/sisu/html_format.rb', line 1251

def lev2
  lev('h2','toc')
end

#lev3Object



1254
1255
1256
# File 'lib/sisu/html_format.rb', line 1254

def lev3
  lev('h3','toc')
end

#lev4Object



1257
1258
1259
# File 'lib/sisu/html_format.rb', line 1257

def lev4
  lev('h4','toc')
end

#lev5Object



1260
1261
1262
# File 'lib/sisu/html_format.rb', line 1260

def lev5
  lev('h5','toc')
end

#lev6Object



1263
1264
1265
# File 'lib/sisu/html_format.rb', line 1263

def lev6
  lev('h6','toc')
end

#lev7Object



1266
1267
1268
# File 'lib/sisu/html_format.rb', line 1266

def lev7
  lev('h7','toc')
end


1228
1229
1230
1231
1232
1233
1234
1235
# File 'lib/sisu/html_format.rb', line 1228

def links_guide
  %{  <li class="doc">
<a href="#{@lnk_url}" target="_top">
  #{@lnk_txt}
</a>
  </li>
}
end

#mini_concord_tailObject



1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
# File 'lib/sisu/html_format.rb', line 1315

def mini_concord_tail
  %{
  <h4 class="minitoc">
<a href="concordance.html">Concordance (wordlist)</a>
  </h4>
  <h4 class="minitoc">
<a href="sisu_manifest.html">Manifest (alternative outputs)</a>
  </h4>
}
end

#mini_lev0Object

docinfo



1305
1306
1307
1308
# File 'lib/sisu/html_format.rb', line 1305

def mini_lev0
  @txt=strip_endnotes(@txt)
  lev('h1','minitoc')
end

#mini_lev1Object



1277
1278
1279
1280
# File 'lib/sisu/html_format.rb', line 1277

def mini_lev1
  @txt=strip_endnotes(@txt)
  lev('h1','minitoc')
end

#mini_lev2Object



1281
1282
1283
1284
# File 'lib/sisu/html_format.rb', line 1281

def mini_lev2
  @txt=strip_endnotes(@txt)
  lev('h2','minitoc')
end

#mini_lev3Object



1285
1286
1287
1288
# File 'lib/sisu/html_format.rb', line 1285

def mini_lev3
  @txt=strip_endnotes(@txt)
  lev('h3','minitoc')
end

#mini_lev4Object



1289
1290
1291
1292
# File 'lib/sisu/html_format.rb', line 1289

def mini_lev4
  @txt=strip_endnotes(@txt)
  lev('h4','minitoc')
end

#mini_lev5Object



1293
1294
1295
1296
# File 'lib/sisu/html_format.rb', line 1293

def mini_lev5
  @txt=strip_endnotes(@txt)
  lev('h5','minitoc')
end

#mini_lev6Object



1297
1298
1299
1300
# File 'lib/sisu/html_format.rb', line 1297

def mini_lev6
  @txt=strip_endnotes(@txt)
  lev('h6','minitoc')
end

#mini_lev7Object



1301
1302
1303
1304
# File 'lib/sisu/html_format.rb', line 1301

def mini_lev7
  @txt=strip_endnotes(@txt)
  lev('h7','minitoc')
end

#mini_tailObject



1308
1309
1310
1311
1312
1313
1314
# File 'lib/sisu/html_format.rb', line 1308

def mini_tail
  %{
  <h4 class="minitoc">
<a href="sisu_manifest.html">Manifest (alternative outputs)</a>
  </h4>
}
end

#strip_endnotes(txt) ⇒ Object



1269
1270
1271
1272
# File 'lib/sisu/html_format.rb', line 1269

def strip_endnotes(txt)
  txt=txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ')
  txt
end