Class: Tilt::DynTtmTemplate
- Inherits:
-
DynDocTemplate
- Object
- Template
- DynDocTemplate
- Tilt::DynTtmTemplate
- Defined in:
- lib/dyndoc/common/tilt.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from DynDocTemplate
#evaluate, init, #initialize_engine, #prepare
Class Method Details
.engine_initialized? ⇒ Boolean
87 88 89 |
# File 'lib/dyndoc/common/tilt.rb', line 87 def self.engine_initialized? defined? ::DynTtm end |
Instance Method Details
#prepare_output ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/dyndoc/common/tilt.rb', line 91 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>≯</mtext>").gsub("\\nless","<mtext>≮</mtext>").gsub("è","<mtext>è</mtext>") end |