diff --git a/.gitignore b/.gitignore index 06adcba..5f206c0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ my_book.tex tmp/ site/ svgsite/ +include/.sass-cache diff --git a/Rakefile b/Rakefile index 7ec4b4c..df62815 100644 --- a/Rakefile +++ b/Rakefile @@ -78,6 +78,31 @@ task :html do attr_accessor :filelist + def initialize + + eval File.new('config_html.rb','r').read + + @prefilters=[] + @prefilters<<=MarkdownMacros.new + @prefilters<<=MarkdownPostMacros.new + + @postfilters=[] + html_template=HTMLTemplate.new + html_template.template=@general_template + html_template.title=@title + html_template.subtitle=@subtitle + html_template.author=@author + html_template.html_headers=@html_headers + html_template.homeURL="index.html" + @postfilters<<=Links.new + @postfilters<<=html_template + @postfilters<<=MathJax.new + + @filelist=Dir.glob("content/**/*.md").sort.map do |fic| + [ fic, fic.sub(/^content\//,"site/").sub(/.md$/,".html") ] + end + end + # take a string from kramdown # returns LaTeX after filter def compile_text(tmp) @@ -86,7 +111,8 @@ task :html do end # compile to latex - tmp=Kramdown::Document.new(tmp, :latex_headers => %w(chapter section subsection paragraph subparagraph subsubparagraph)).to_html + # puts tmp + tmp=Kramdown::Document.new(tmp).to_html # post filters @postfilters.each{ |f| tmp=f.run(tmp) } @@ -127,31 +153,6 @@ task :html do fic.close end - def initialize - - eval File.new('config_html.rb','r').read - - @prefilters=[] - @prefilters<<=MarkdownMacros.new - @prefilters<<=MarkdownPostMacros.new - - @postfilters=[] - html_template=HTMLTemplate.new - html_template.template=@general_template - html_template.title=@title - html_template.subtitle=@subtitle - html_template.author=@author - html_template.html_headers=@html_headers - html_template.homeURL="index.html" - @postfilters<<=Links.new - @postfilters<<=html_template - @postfilters<<=MathJax.new - - @filelist=Dir.glob("content/**/*.md").sort.map do |fic| - [ fic, fic.sub(/^content\//,"site/").sub(/.md$/,".html") ] - end - end - def run i=-1 @filelist.each do |doublon| diff --git a/filters/markdown_postmacros.rb b/filters/markdown_postmacros.rb index 8461b0e..fd1d940 100644 --- a/filters/markdown_postmacros.rb +++ b/filters/markdown_postmacros.rb @@ -29,7 +29,7 @@ class MarkdownPostMacros def run (content) content.gsub(/^POSTMACRO\((\w[a-zA-Z0-9_]*)\) = LATEX: ((.|\n)*?) HTML: ((.|\n)*?) ENDMACRO/m) do |m| - puts %{ mkd macro %#{$1}\t [:latex] => #{$2} [:html] => #{$4}} + # puts %{ mkd macro %#{$1}\t [:latex] => #{$2} [:html] => #{$4}} @macro[$1.intern]='{::nomarkdown type="latex"}'+$2+'{:/nomarkdown}{::nomarkdown type="html"}'+$4+'{:/nomarkdown}' "" end.gsub(/((\\)?)%(\w[a-zA-Z0-9_]*)/) do |m| diff --git a/include/main.css b/include/main.css index 6a93419..8835577 100644 --- a/include/main.css +++ b/include/main.css @@ -56,7 +56,7 @@ pre { pre, code { font-family: monaco, monospace; - font-size: 0.7em; } + font-size: 0.8em; } p code { font-family: monospace; diff --git a/include/main_s.css b/include/main_s.css index 3c437ea..2a39273 100644 --- a/include/main_s.css +++ b/include/main_s.css @@ -128,7 +128,7 @@ pre pre, code font: family: monaco, monospace - size: .7em + size: .8em p code font: diff --git a/krambook.pdf b/krambook.pdf index 957971b..ce59a93 100644 Binary files a/krambook.pdf and b/krambook.pdf differ