deplate 0.8.4 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. data/CHANGES.TXT +118 -0
  2. data/NEWS.TXT +6 -21
  3. data/VERSION.TXT +1 -1
  4. data/etc/deplate.ini +15 -2
  5. data/lib/action_view/helpers/deplate.rb +0 -0
  6. data/lib/deplate/abstract-class.rb +3 -2
  7. data/lib/deplate/bib.rb +3 -2
  8. data/lib/deplate/builtin.rb +3 -2
  9. data/lib/deplate/cache.rb +3 -2
  10. data/lib/deplate/commands.rb +3 -11
  11. data/lib/deplate/common.rb +7 -2
  12. data/lib/deplate/compat.rb +21 -0
  13. data/lib/deplate/compat/parsedate.rb +24 -0
  14. data/lib/deplate/converter.rb +3 -2
  15. data/lib/deplate/core.rb +135 -103
  16. data/lib/deplate/counters.rb +3 -2
  17. data/lib/deplate/css/article.css +2 -2
  18. data/lib/deplate/css/doc.css +3 -2
  19. data/lib/deplate/css/heading-navbar.css +2 -2
  20. data/lib/deplate/css/highlight.css +0 -0
  21. data/lib/deplate/css/layout-deplate-print.css +2 -2
  22. data/lib/deplate/css/layout-deplate.css +2 -2
  23. data/lib/deplate/css/presentation.css +2 -2
  24. data/lib/deplate/css/sans-serif.css +2 -2
  25. data/lib/deplate/css/screenplay.css +0 -0
  26. data/lib/deplate/css/serif-e.css +2 -2
  27. data/lib/deplate/css/serif-rel.css +3 -2
  28. data/lib/deplate/css/serif.css +2 -2
  29. data/lib/deplate/css/slides.css +3 -2
  30. data/lib/deplate/css/tabbar-top.css +2 -2
  31. data/lib/deplate/css/text-sans-serif.css +3 -2
  32. data/lib/deplate/css/text-serif.css +2 -2
  33. data/lib/deplate/css/website.css +0 -0
  34. data/lib/deplate/define.rb +3 -2
  35. data/lib/deplate/deplate-string.rb +3 -2
  36. data/lib/deplate/docbook.rb +4 -14
  37. data/lib/deplate/elements.rb +37 -4
  38. data/lib/deplate/encoding.rb +57 -0
  39. data/lib/deplate/etc.rb +7 -5
  40. data/lib/deplate/external.rb +5 -13
  41. data/lib/deplate/fmt/dbk-article-4.1.2.rb +3 -2
  42. data/lib/deplate/fmt/dbk-article.rb +3 -2
  43. data/lib/deplate/fmt/dbk-book.rb +3 -2
  44. data/lib/deplate/fmt/dbk-ref.rb +3 -2
  45. data/lib/deplate/fmt/dbk-slides.rb +3 -2
  46. data/lib/deplate/fmt/dbk-snippet.rb +3 -2
  47. data/lib/deplate/fmt/html-snippet.rb +3 -2
  48. data/lib/deplate/fmt/html.rb +40 -27
  49. data/lib/deplate/fmt/htmlsite.rb +3 -2
  50. data/lib/deplate/fmt/htmlslides.rb +3 -2
  51. data/lib/deplate/fmt/htmlwebsite.rb +3 -2
  52. data/lib/deplate/fmt/latex-dramatist.rb +2 -1
  53. data/lib/deplate/fmt/latex-snippet.rb +3 -2
  54. data/lib/deplate/fmt/latex.rb +88 -67
  55. data/lib/deplate/fmt/null.rb +3 -2
  56. data/lib/deplate/fmt/php.rb +3 -2
  57. data/lib/deplate/fmt/phpsite.rb +3 -2
  58. data/lib/deplate/fmt/plain.rb +4 -3
  59. data/lib/deplate/fmt/sweave.rb +104 -0
  60. data/lib/deplate/fmt/template.rb +3 -2
  61. data/lib/deplate/fmt/xhtml10t.rb +82 -2
  62. data/lib/deplate/fmt/xhtml11m.rb +3 -2
  63. data/lib/deplate/formatter-snippet.rb +3 -2
  64. data/lib/deplate/formatter.rb +203 -29
  65. data/lib/deplate/guesslanguage.rb +3 -2
  66. data/lib/deplate/input.rb +9 -8
  67. data/lib/deplate/input/deplate-headings.rb +3 -2
  68. data/lib/deplate/input/deplate-restricted.rb +3 -2
  69. data/lib/deplate/input/deplate.rb +3 -2
  70. data/lib/deplate/input/play.rb +3 -2
  71. data/lib/deplate/input/rdoc.rb +3 -2
  72. data/lib/deplate/input/template.rb +3 -2
  73. data/lib/deplate/lib/Makefile.config +8 -0
  74. data/lib/deplate/locale/de.latin1 +6 -0
  75. data/lib/deplate/macros.rb +4 -2
  76. data/lib/deplate/messages.rb +9 -5
  77. data/lib/deplate/metadata.rb +3 -2
  78. data/lib/deplate/metadata/marshal.rb +3 -2
  79. data/lib/deplate/metadata/xml.rb +3 -2
  80. data/lib/deplate/metadata/yaml.rb +3 -2
  81. data/lib/deplate/mod/anyword.rb +3 -2
  82. data/lib/deplate/mod/babelfish.rb +3 -2
  83. data/lib/deplate/mod/code-coderay.rb +3 -2
  84. data/lib/deplate/mod/code-gvim.rb +3 -2
  85. data/lib/deplate/mod/code-gvim71.rb +3 -2
  86. data/lib/deplate/mod/code-highlight.rb +3 -2
  87. data/lib/deplate/mod/colored-log.rb +3 -2
  88. data/lib/deplate/mod/encode.rb +33 -0
  89. data/lib/deplate/mod/endnotes.rb +3 -2
  90. data/lib/deplate/mod/entities-decode.rb +2 -1
  91. data/lib/deplate/mod/entities-encode.rb +2 -1
  92. data/lib/deplate/mod/guesslanguage.rb +3 -2
  93. data/lib/deplate/mod/html-asciimath.rb +3 -2
  94. data/lib/deplate/mod/html-deplate-button.rb +3 -2
  95. data/lib/deplate/mod/html-headings-navbar.rb +3 -2
  96. data/lib/deplate/mod/html-highstep.rb +3 -2
  97. data/lib/deplate/mod/html-jsmath.rb +3 -2
  98. data/lib/deplate/mod/html-mathml.rb +2 -1
  99. data/lib/deplate/mod/html-obfuscate-email.rb +3 -2
  100. data/lib/deplate/mod/html-sidebar.rb +3 -2
  101. data/lib/deplate/mod/htmlslides-navbar-fh.rb +3 -2
  102. data/lib/deplate/mod/iconv.rb +3 -2
  103. data/lib/deplate/mod/imgurl.rb +4 -3
  104. data/lib/deplate/mod/inlatex-compound.rb +3 -2
  105. data/lib/deplate/mod/koma.rb +3 -2
  106. data/lib/deplate/mod/lang-de.rb +3 -2
  107. data/lib/deplate/mod/lang-en.rb +3 -2
  108. data/lib/deplate/mod/lang-ru-koi8-r.rb +3 -2
  109. data/lib/deplate/mod/lang-ru.rb +3 -2
  110. data/lib/deplate/mod/lang-zh_CN-autospace.rb +3 -2
  111. data/lib/deplate/mod/lang-zh_CN.rb +3 -2
  112. data/lib/deplate/mod/latex-emph-table-head.rb +3 -2
  113. data/lib/deplate/mod/latex-styles.rb +3 -2
  114. data/lib/deplate/mod/latex-verbatim-small.rb +3 -2
  115. data/lib/deplate/mod/linkmap.rb +2 -1
  116. data/lib/deplate/mod/makefile.rb +39 -46
  117. data/lib/deplate/mod/mark-external-urls.rb +3 -2
  118. data/lib/deplate/mod/markup-1-warn.rb +3 -2
  119. data/lib/deplate/mod/markup-1.rb +3 -2
  120. data/lib/deplate/mod/navbar-png.rb +3 -2
  121. data/lib/deplate/mod/noindent.rb +3 -2
  122. data/lib/deplate/mod/numpara.rb +3 -2
  123. data/lib/deplate/mod/particle-math.rb +3 -2
  124. data/lib/deplate/mod/php-extra.rb +3 -2
  125. data/lib/deplate/mod/pstoedit.rb +3 -2
  126. data/lib/deplate/mod/recode.rb +3 -2
  127. data/lib/deplate/mod/smart-dash.rb +3 -2
  128. data/lib/deplate/mod/smiley.rb +3 -2
  129. data/lib/deplate/mod/soffice.rb +3 -2
  130. data/lib/deplate/mod/symbols-latin1.rb +8 -2
  131. data/lib/deplate/mod/symbols-od-utf-8.rb +3 -2
  132. data/lib/deplate/mod/symbols-plain.rb +3 -2
  133. data/lib/deplate/mod/symbols-sgml.rb +6 -5
  134. data/lib/deplate/mod/symbols-utf-8.rb +6 -5
  135. data/lib/deplate/mod/symbols-xml.rb +3 -2
  136. data/lib/deplate/mod/syntax-region-alt.rb +3 -2
  137. data/lib/deplate/mod/utf8.rb +3 -2
  138. data/lib/deplate/mod/validate-html.rb +3 -2
  139. data/lib/deplate/mod/xmlrpc.rb +3 -2
  140. data/lib/deplate/nukumi2.rb +3 -2
  141. data/lib/deplate/once-method.rb +3 -2
  142. data/lib/deplate/output.rb +3 -2
  143. data/lib/deplate/particles.rb +12 -6
  144. data/lib/{ps2ppm.rb → deplate/ps2ppm.rb} +11 -11
  145. data/lib/deplate/regions.rb +75 -52
  146. data/lib/deplate/skeletons.rb +3 -2
  147. data/lib/deplate/structured.rb +8 -24
  148. data/lib/deplate/template.rb +3 -2
  149. data/lib/deplate/themes/presentation.html/css/presentation.css +2 -2
  150. data/lib/deplate/themes/presentation.html/prelude.txt +1 -1
  151. data/lib/deplate/themes/presentation.html/resources/spacer.png +0 -0
  152. data/lib/deplate/themes/s5.xhtml/README.TXT +2 -0
  153. data/lib/deplate/themes/s5.xhtml/templates/s5.xhtml +42 -0
  154. data/lib/deplate/themes/s5.xhtml/theme.ini +11 -0
  155. data/lib/deplate/variables.rb +12 -2
  156. data/lib/deplate/wiki-markup.rb +3 -2
  157. data/lib/deplate/xml.rb +19 -21
  158. data/lib/deplate/zh_CN.rb +3 -2
  159. data/man/man1/deplate.1 +83 -128
  160. metadata +16 -4
@@ -1,6 +1,7 @@
1
+ # encoding: ASCII
1
2
  #!/usr/bin/env ruby
2
3
  # entities.rb
3
- # @Last Change: 2007-12-03.
4
+ # @Last Change: 2009-02-02.
4
5
  # Author:: Thomas Link (micathom AT gmail com)
5
6
  # License:: GPL (see http://www.gnu.org/licenses/gpl.txt)
6
7
  # Created:: 2007-11-28.
@@ -1,6 +1,7 @@
1
+ # encoding: ASCII
1
2
  #!/usr/bin/env ruby
2
3
  # entities.rb
3
- # @Last Change: 2007-12-04.
4
+ # @Last Change: 2009-02-02.
4
5
  # Author:: Thomas Link (micathom AT gmail com)
5
6
  # License:: GPL (see http://www.gnu.org/licenses/gpl.txt)
6
7
  # Created:: 2007-11-28.
@@ -1,9 +1,10 @@
1
+ # encoding: ASCII
1
2
  # guesslanguage.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
4
5
  # @Created: 2006-12-29.
5
- # @Last Change: 2008-07-16.
6
- # @Revision: 0.1.77
6
+ # @Last Change: 2009-02-02.
7
+ # @Revision: 0.1.79
7
8
 
8
9
  require 'deplate/guesslanguage'
9
10
 
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # html-asciimath.rb -- Support for asciimath.js
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 30-Dez-2004.
6
- # @Last Change: 23-Okt-2005.
7
- # @Revision: 0.43
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.45
8
9
 
9
10
  class Deplate::Formatter::HTML
10
11
  def formatter_initialize_html_asciimath
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # html-deplate-button.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 05-Sep-2004.
6
- # @Last Change: 23-Okt-2005.
7
- # @Revision: 0.23
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.25
8
9
 
9
10
  class Deplate::Formatter::HTML
10
11
  def prepare_html_deplate_button
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # html-headings-navbar.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 15-Nov-2004.
6
- # @Last Change: 14-Apr-2006.
7
- # @Revision: 0.45
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.47
8
9
 
9
10
  class Deplate::Formatter::HTML
10
11
  def formatter_initialize_headings_navbar
@@ -1,9 +1,10 @@
1
+ # encoding: ASCII
1
2
  # html-highstep.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
4
5
  # @Created: 2007-01-06.
5
- # @Last Change: 2007-01-12.
6
- # @Revision: 0.31
6
+ # @Last Change: 2009-02-02.
7
+ # @Revision: 0.33
7
8
  #
8
9
  # = Description
9
10
  # Provide the macro ''step'' to mark text for stepwise highlighting.
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # html-jsmath.rb -- Support for jsmath.js
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 30-Dez-2004.
6
- # @Last Change: 2008-04-14.
7
- # @Revision: 0.59
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.61
8
9
 
9
10
  class Deplate::Formatter::HTML
10
11
  def prepare_html_jsmath
@@ -1,4 +1,5 @@
1
- # @Last Change: 2008-04-14.
1
+ # encoding: ASCII
2
+ # @Last Change: 2009-02-02.
2
3
  # Author:: Thomas Link (micathom AT gmail com)
3
4
  # License:: GPL (see http://www.gnu.org/licenses/gpl.txt)
4
5
  # Created:: 2008-04-13.
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # html-obfuscate-email.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 13-Jul-2005.
6
- # @Last Change: 25-Apr-2006.
7
- # @Revision: 0.34
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.36
8
9
 
9
10
  class Deplate::Formatter::HTML
10
11
  alias :format_url_re_js_obfuscate_email :format_url
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # mod-html-sidebar.rb -- A popup-mini-toc for html output
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 19-Jul-2004.
6
- # @Last Change: 23-Okt-2005.
7
- # @Revision: 0.50
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.52
8
9
  #
9
10
  # Description:
10
11
  #
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # htmlslides-navbar-fh.rb
2
3
  # @Author: Thomas Link, Fritz Heinrichmeyer
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 17-M�r-2004.
6
- # @Last Change: 02-Apr-2006.
7
- # @Revision: 0.436
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.438
8
9
 
9
10
 
10
11
  class Deplate::Formatter::HTML_Site
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # iconv.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 11-Apr-2005.
6
- # @Last Change: 23-Okt-2005.
7
- # @Revision: 0.84
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.86
8
9
  #
9
10
  # = Description
10
11
  # Recode text on-the-fly using +iconv+. The source encoding is
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # imgurl.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 05-Mai-2005.
6
- # @Last Change: 30-Mrz-2006.
7
- # @Revision: 0.28
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.31
8
9
  #
9
10
  # = Description
10
11
  # Insert URLs to images as image
@@ -12,7 +13,7 @@
12
13
  require 'deplate/wiki-markup'
13
14
 
14
15
  # Insert URLs to images as image
15
- class Deplate::HyperLink::ImgUrl < Deplate::Input::Wiki::AbstractImgUrl
16
+ class Deplate::HyperLink::ImgUrl < Deplate::Input::Wiki::ImgUrl
16
17
  insert_particle_before(Deplate::HyperLink::Url)
17
18
  set_rx(/^((file|https?|mailto|ftps?|www):(\S+?)\.(png|jpg|jpeg|gif|bmp))/)
18
19
  end
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # inlatex-compound.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 07-Apr-2005.
6
- # @Last Change: 02-Jan-2006.
7
- # @Revision: 0.49
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.51
8
9
  #
9
10
  # = Description
10
11
  # This module changes the way deplate processes inline latex fragments.
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # mod-koma.rb -- Module: use Koma-Script and friends as LaTeX class
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 07-Mai-2004.
6
- # @Last Change: 2007-09-16.
7
- # @Revision: 0.110
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.112
8
9
  #
9
10
  # Description:
10
11
  #
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # mod-en.rb -- Standard messages
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 07-Mai-2004.
6
- # @Last Change: 23-Apr-2006.
7
- # @Revision: 0.80
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.82
8
9
 
9
10
  require 'deplate/messages'
10
11
 
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # mod-en.rb -- Standard messages
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 07-Mai-2004.
6
- # @Last Change: 23-Okt-2005.
7
- # @Revision: 0.44
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.46
8
9
 
9
10
  require 'deplate/messages'
10
11
 
@@ -1,11 +1,12 @@
1
+ # encoding: ASCII
1
2
  # ru_koi8-r.rb -- Standard messages
2
3
  # @Authors: Maxim Komar (komar from ukr.net), Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://komar.org.ua
4
5
  # @Website: http://deplate.sf.net/
5
6
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
6
7
  # @Created: 01-Sep-2004.
7
- # @Last Change: 23-Okt-2005.
8
- # @Revision: 0.61
8
+ # @Last Change: 2009-02-02.
9
+ # @Revision: 0.63
9
10
 
10
11
  require 'deplate/messages'
11
12
 
@@ -1,9 +1,10 @@
1
+ # encoding: ISO-8859-1
1
2
  # lang-ru.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
4
5
  # @Created: 2007-01-04.
5
- # @Last Change: 2007-01-04.
6
- # @Revision: 0.2
6
+ # @Last Change: 2008-12-04.
7
+ # @Revision: 0.3
7
8
 
8
9
  require 'deplate/mod/lang-ru-koi8-r'
9
10
 
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # zh-cn-autospace.rb
2
3
  # @Author: Thomas Link
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 01-Aug-2004.
6
- # @Last Change: 2006-12-31.
7
- # @Revision: 0.226
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.228
8
9
 
9
10
  require 'deplate/zh_CN'
10
11
 
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # zh-cn.rb
2
3
  # @Author: Thomas Link
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 01-Aug-2004.
6
- # @Last Change: 2007-01-04.
7
- # @Revision: 0.168
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.170
8
9
 
9
10
  require 'deplate/zh_CN'
10
11
 
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # latex-emph-table-head.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 26-Nov-2004.
6
- # @Last Change: 23-Okt-2005.
7
- # @Revision: 0.39
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.41
8
9
  #
9
10
  # Description:
10
11
  #
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # latex-emph-table-head.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 26-Nov-2004.
6
- # @Last Change: 2008-01-30.
7
- # @Revision: 0.363
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.365
8
9
  #
9
10
  # Description:
10
11
  #
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # latex-verbatim-small.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 20-Nov-2004.
6
- # @Last Change: 23-Okt-2005.
7
- # @Revision: 0.27
7
+ # @Last Change: 2009-02-02.
8
+ # @Revision: 0.29
8
9
  #
9
10
  # Description:
10
11
  #
@@ -1,5 +1,6 @@
1
+ # encoding: ASCII
1
2
  # linkmap.rb
2
- # @Last Change: 2007-09-30.
3
+ # @Last Change: 2009-02-02.
3
4
  # Author:: Jeff Barczewski (jeff barczewski at gmail com)
4
5
  # Minor modifications by Thomas Link.
5
6
  # License:: GPL (see http://www.gnu.org/licenses/gpl.txt)
@@ -1,10 +1,11 @@
1
+ # encoding: ASCII
1
2
  # makefile.rb
2
3
  # @Author: Thomas Link (micathom AT gmail com)
3
4
  # @Website: http://deplate.sf.net/
4
5
  # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
6
  # @Created: 28-Aug-2005.
6
- # @Last Change: 2008-04-13.
7
- # @Revision: 0.168
7
+ # @Last Change: 2009-02-05.
8
+ # @Revision: 0.209
8
9
  #
9
10
  # = Description
10
11
  # Create a standard makefile.
@@ -37,7 +38,7 @@ class Deplate::Core
37
38
 
38
39
  base, *files = @options.files
39
40
  base0 = File.basename(base, '.*')
40
- suffix = File.extname(base)
41
+ suffix = clean_makefile_name(File.extname(base))
41
42
 
42
43
  if @variables['genericViewer']
43
44
  genericViewer = @variables['genericViewer']
@@ -53,42 +54,6 @@ class Deplate::Core
53
54
  genericViewer = 'echo Not supported: genericViewer '
54
55
  end
55
56
 
56
- config = <<MAKEFILE
57
- BASE=#{base0}
58
- FILE=#{base}
59
- OTHER=#{files.join(' ') if files}
60
-
61
- DEPLATE=deplate
62
-
63
- OFLAGS=
64
- DFLAGS=#{options.join(' ')}
65
-
66
- HTML_DIR=html
67
- HTML_DFLAGS=-d ${HTML_DIR} -f html
68
-
69
- XHTML_DIR=html
70
- XHTML_DFLAGS=-d ${XHTML_DIR} -f xhtml10t
71
-
72
- WEBSITE_DIR=website
73
- WEBSITE_DFLAGS=-d ${WEBSITE_DIR} -f htmlsite
74
-
75
- PHP_DIR=php
76
- PHP_DFLAGS=-d ${PHP_DIR} -f phpsite
77
-
78
- TEX_DIR=tex
79
- TEX_DFLAGS=-d ${TEX_DIR} -f latex
80
-
81
- TEXT_DIR=plain
82
- TEXT_DFLAGS=-d ${TEXT_DIR} -f plain
83
-
84
- DBK_DIR=docbook
85
- DBK_DFLAGS=-d ${DBK_DIR} -f dbk-article
86
-
87
- REF_DIR=${DBK_DIR}
88
- REF_DFLAGS=-d ${REF_DIR} -f dbk-ref
89
-
90
- MAKEFILE
91
-
92
57
  makefile = <<MAKEFILE
93
58
  include Makefile.config
94
59
 
@@ -101,6 +66,7 @@ xhtml: ${BASE}.xhtml
101
66
  pdf:
102
67
  make DFLAGS="${DFLAGS} ${OFLAGS} --pdf" "${BASE}.pdf"
103
68
  php: ${BASE}.php
69
+ sweave: ${BASE}.Rnw
104
70
  tex: ${BASE}.tex
105
71
  text: ${BASE}.text
106
72
  man: ${BASE}.1
@@ -126,6 +92,11 @@ website:
126
92
  ${DEPLATE} ${DFLAGS} ${OFLAGS} ${XHTML_DFLAGS} $< ${OTHER}
127
93
  echo ${XHTML_DIR}/$@ > .last_output
128
94
 
95
+ %.Rnw: %#{suffix}
96
+ make prepare_sweave
97
+ ${DEPLATE} ${DFLAGS} ${OFLAGS} ${SWEAVE_DFLAGS} $< ${OTHER}
98
+ echo ${TEX_DIR}/$@ > .last_output
99
+
129
100
  %.text: %#{suffix}
130
101
  make prepare_text
131
102
  ${DEPLATE} ${DFLAGS} ${OFLAGS} ${TEXT_DFLAGS} $< ${OTHER}
@@ -160,6 +131,20 @@ website:
160
131
  latex ${LATEX_FLAGS} $<;
161
132
  echo ${TEX_DIR}/$@ > .last_output
162
133
 
134
+ # %.pdf: %.Rnw
135
+ sweavepdf:
136
+ make DFLAGS="${DFLAGS} --pdf" sweave
137
+ cd ${TEX_DIR}; \\
138
+ R CMD Sweave ${BASE}.Rnw; \\
139
+ $(call postprocess_sweave, ${BASE}.tex)
140
+ make prepare_pdf
141
+ cd ${TEX_DIR}; \\
142
+ pdflatex ${PDFLATEX_FLAGS} ${BASE}.tex; \\
143
+ bibtex ${BIBTEX_FLAGS} ${BASE}; \\
144
+ pdflatex ${PDFLATEX_FLAGS} ${BASE}.tex; \\
145
+ pdflatex ${PDFLATEX_FLAGS} ${BASE}.tex
146
+ echo ${TEX_DIR}/${BASE}.pdf > .last_output
147
+
163
148
  %.pdf: %.tex
164
149
  make prepare_pdf
165
150
  cd ${TEX_DIR}; \\
@@ -200,22 +185,30 @@ MAKEFILE
200
185
  cfg = File.open(fname) {|io| io.read}
201
186
  tmpl = Deplate::Template.new(:template => cfg)
202
187
  args = {
203
- 'base0' => base0,
204
- 'base' => base,
205
- 'files' => files ? files.join(' ') : nil,
206
- 'options' => options.join(' '),
188
+ 'base0' => clean_makefile_name(base0, 2),
189
+ 'base' => clean_makefile_name(base, 2),
190
+ 'files' => files ? clean_makefile_name(files.join(' '), 2) : nil,
191
+ 'options' => clean_makefile_name(options.join(' '), 2),
207
192
  }
193
+ config = nil
208
194
  Deplate::Define.let_variables(self, args) do
209
195
  config = tmpl.fill_in(self)
210
196
  end
197
+ File.open(Deplate::Core.file_join(@options.dir, 'Makefile.config'), 'w') do |io|
198
+ io.puts config
199
+ end
211
200
  else
212
201
  log(['File not found', 'Makefile.config'], :error)
213
202
  end
214
- File.open(Deplate::Core.file_join(@options.dir, 'Makefile.config'), 'w') do |io|
215
- io.puts config
216
- end
217
203
  end
218
204
  exit 0
219
205
  end
206
+
207
+
208
+ def clean_makefile_name(text, multiplier=1)
209
+ backslash = '\\\\' * multiplier
210
+ text.gsub(/[$]/, "#{backslash}\\0")
211
+ end
212
+
220
213
  end
221
214