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.



1223
1224
1225
# File 'lib/sisu/html_format.rb', line 1223

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

Instance Method Details

#lev(tag, attrib) ⇒ Object



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

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

#lev0Object

docinfo



1243
1244
1245
# File 'lib/sisu/html_format.rb', line 1243

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

#lev1Object



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

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

#lev2Object



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

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

#lev3Object



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

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

#lev4Object



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

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

#lev5Object



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

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

#lev6Object



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

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

#lev7Object



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

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


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

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

#mini_concord_tailObject



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

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



1303
1304
1305
1306
# File 'lib/sisu/html_format.rb', line 1303

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

#mini_lev1Object



1275
1276
1277
1278
# File 'lib/sisu/html_format.rb', line 1275

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

#mini_lev2Object



1279
1280
1281
1282
# File 'lib/sisu/html_format.rb', line 1279

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

#mini_lev3Object



1283
1284
1285
1286
# File 'lib/sisu/html_format.rb', line 1283

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

#mini_lev4Object



1287
1288
1289
1290
# File 'lib/sisu/html_format.rb', line 1287

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

#mini_lev5Object



1291
1292
1293
1294
# File 'lib/sisu/html_format.rb', line 1291

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

#mini_lev6Object



1295
1296
1297
1298
# File 'lib/sisu/html_format.rb', line 1295

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

#mini_lev7Object



1299
1300
1301
1302
# File 'lib/sisu/html_format.rb', line 1299

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

#mini_tailObject



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

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

#strip_endnotes(txt) ⇒ Object



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

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