docfu 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/docfu.rb CHANGED
@@ -7,7 +7,7 @@ require 'mixlib/cli'
7
7
 
8
8
  # Document like a ninja
9
9
  module Docfu
10
- VERSION = '0.0.6'
10
+ VERSION = '0.0.7'
11
11
  end
12
12
 
13
13
  require 'docfu/outputs'
@@ -124,7 +124,7 @@ module Docfu
124
124
  end
125
125
  end
126
126
 
127
- def post_pandoc(string, config)
127
+ def post_pandoc(string, cfg)
128
128
  replace(string) do
129
129
  space = /\s/
130
130
 
@@ -134,15 +134,15 @@ module Docfu
134
134
  s(/SUBSUBSECTION: (.*)/, '\subsubsection{\1}')
135
135
 
136
136
  # Enable proper cross-reference
137
- s(/#{config['fig'].gsub(space, '\s')}\s*(\d+)\-\-(\d+)/, '\imgref{\1.\2}')
138
- s(/#{config['tab'].gsub(space, '\s')}\s*(\d+)\-\-(\d+)/, '\tabref{\1.\2}')
139
- s(/#{config['prechap'].gsub(space, '\s')}\s*(\d+)(\s*)#{config['postchap'].gsub(space, '\s')}/, '\chapref{\1}\2')
137
+ s(/#{cfg['fig'].gsub(space, '\s')}\s*(\d+)\-\-(\d+)/, '\imgref{\1.\2}')
138
+ s(/#{cfg['tab'].gsub(space, '\s')}\s*(\d+)\-\-(\d+)/, '\tabref{\1.\2}')
139
+ s(/#{cfg['prechap'].gsub(space, '\s')}\s*(\d+)(\s*)#{cfg['postchap'].gsub(space, '\s')}/, '\chapref{\1}\2')
140
140
 
141
141
  # Miscellaneous fixes
142
142
  s(/FIG: (.*)/, '\img{\1}')
143
143
  s('\begin{enumerate}[1.]', '\begin{enumerate}')
144
144
  s(/(\w)--(\w)/, '\1-\2')
145
- s(/``(.*?)''/, "#{config['dql']}\\1#{config['dqr']}")
145
+ s(/``(.*?)''/, "#{cfg['dql']}\\1#{cfg['dqr']}")
146
146
 
147
147
  # Typeset the maths in the book with TeX
148
148
  s('\verb!p = (n(n-1)/2) * (1/2^160))!', '$p = \frac{n(n-1)}{2} \times \frac{1}{2^{160}}$)')
@@ -20,13 +20,13 @@
20
20
 
21
21
  \definecolor{shadecolor}{gray}{0.90}
22
22
 
23
- \setromanfont[Mapping=tex-text,BoldFont=<%= config['bold'] %>]{<%= config['font'] %>}
24
- \setmonofont[Scale=.85]{<%= config['mono'] %>}
23
+ \setromanfont[Mapping=tex-text,BoldFont=<%= cfg['bold'] %>]{<%= cfg['font'] %>}
24
+ \setmonofont[Scale=.85]{<%= cfg['mono'] %>}
25
25
 
26
26
  \XeTeXlinebreaklocale{<%= lang %>}
27
- <%= config['langrule'] %>
27
+ <%= cfg['langrule'] %>
28
28
 
29
- \settowidth{\parindent}{<%= config['indent'] %>}
29
+ \settowidth{\parindent}{<%= cfg['indent'] %>}
30
30
 
31
31
  \title{<%= info['title'] %>}
32
32
  \author{<%= info['author'] %>}
@@ -40,7 +40,7 @@
40
40
  \makeatother
41
41
 
42
42
  \title{\textbf{\savedtitle}}
43
- \author{\textbf{\savedauthor}\thanks{<%= config['thanks'] %>}}
43
+ \author{\textbf{\savedauthor}\thanks{<%= cfg['thanks'] %>}}
44
44
  \def\w3cdtfymd{\the\year-\ifnum\month<10 0\fi\the\month-\ifnum\day<10 0\fi\the\day}
45
45
  \date{\w3cdtfymd}
46
46
  \renewcommand{\thefootnote}{\fnsymbol{footnote}}
@@ -101,20 +101,20 @@
101
101
  \newcounter{tab}[chapter]
102
102
  \renewcommand{\thetab}{\thechapter.\arabic{tab}}
103
103
 
104
- \newcommand{\prechap}{<%= config['prechap'] %>}
105
- \newcommand{\postchap}{<%= config['postchap'] %>}
106
- \newcommand{\presect}{<%= config['presect'] %>}
107
- \newcommand{\postsect}{<%= config['postsect'] %>}
104
+ \newcommand{\prechap}{<%= cfg['prechap'] %>}
105
+ \newcommand{\postchap}{<%= cfg['postchap'] %>}
106
+ \newcommand{\presect}{<%= cfg['presect'] %>}
107
+ \newcommand{\postsect}{<%= cfg['postsect'] %>}
108
108
  \renewcommand{\chaptermark}[1]{\markboth{\textbf{\prechap \thechapter \postchap}\hspace*{1ex}#1}{}}
109
109
  \renewcommand{\sectionmark}[1]{\markright{\textbf{\presect \thesection \postsect}\hspace*{1ex}#1}}
110
110
  \newcommand{\chap}[1]{\newpage\thispagestyle{empty}\chapter{#1}\label{chap:\thechapter}}
111
111
  \newcommand{\chapref}[1]{\hyperref[chap:#1]{\prechap #1\postchap}}
112
- \newcommand{\imgref}[1]{\hyperref[img:#1]{<%= config['fig'] %>#1}}
113
- \newcommand{\tabref}[1]{\hyperref[tab:#1]{<%= config['tab'] %>#1}}
112
+ \newcommand{\imgref}[1]{\hyperref[img:#1]{<%= cfg['fig'] %>#1}}
113
+ \newcommand{\tabref}[1]{\hyperref[tab:#1]{<%= cfg['tab'] %>#1}}
114
114
  \newcommand{\e}[1]{$ \times 10^{#1}$}
115
- \renewcommand{\contentsname}{<%= config['con'] %>}
116
- \renewcommand{\figurename}{<%= config['fig'] %>}
117
- \renewcommand{\tablename}{<%= config['tab'] %>}
115
+ \renewcommand{\contentsname}{<%= cfg['con'] %>}
116
+ \renewcommand{\figurename}{<%= cfg['fig'] %>}
117
+ \renewcommand{\tablename}{<%= cfg['tab'] %>}
118
118
 
119
119
  \makeatletter
120
120
  \def\@makechapterhead#1{%
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docfu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: