class Tilt::DynTtmTemplate

Public Class Methods

engine_initialized?() click to toggle source
# File lib/dyndoc/common/tilt.rb, line 114
def self.engine_initialized?
  defined? ::DynTtm
end

Public Instance Methods

prepare_output() click to toggle source
# File lib/dyndoc/common/tilt.rb, line 118
    def prepare_output
=begin
      ttm_preamble = <<-PREAMBLE
          \def\hyperlink#1#2{\special{html:<a href="\##1">}#2\special{html:</a>}}
            % Incorrect link name in \TeX\ because # can't be passed properly to a special.
          \def\hypertarget#1#2{\special{html:<a name="#1">}#2\special{html:</a>}}
          \long\def\ttmdump#1{#1} % Do nothing. The following are not done for TtM.
          \ttmdump{%
          \def\title#1{\bgroup\leftskip 0 pt plus1fill \rightskip 0 pt plus1fill
          \pretolerance=100000 \lefthyphenmin=20 \righthyphenmin=20
          \noindent #1 \par\egroup}% Centers a possibly multi-line title.
           \let\author=\title % Actually smaller font than title in \LaTeX.
           \input epsf     % PD package defines \epsfbox for figure inclusion
            % Macro for http reference inclusion, per hypertex.
           \def\href#1#2{\special{html:<a href="#1">}#2\special{html:</a>}}
           \def\urlend#1{#1\endgroup}
           \def\url{\begingroup \tt
            \catcode`\_=13 % Don't know why this works.
            \catcode`\~=11 \catcode`\#=11 \catcode`\^=11
            \catcode`\$=11 \catcode`\&=11 \catcode`\%=11
          \urlend}% \url for plain \TeX.
          PREAMBLE
=end
            CqlsDoc::Converter.ttm($curDyn.tmpl_doc.make_content(data),"-e2 -r -y1 -L").gsub(/<mtable[^>]*>/,"<mtable>").gsub("\\ngtr","<mtext>&ngtr;</mtext>").gsub("\\nless","<mtext>&nless;</mtext>").gsub("&#232;","<mtext>&egrave;</mtext>")
    end