Skip to content

Commit

Permalink
add logo
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh authored and cypher committed Sep 3, 2010
1 parent cd10a05 commit fb36095
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions assets/book.css
Expand Up @@ -56,6 +56,11 @@ body p

body hr
{ display: none; }

body img[src="logo.png"]
{ position: relative;
left: -1em;
margin-bottom: -2em; }

/* TOC */
.maruku_toc ul { font-weight: bold; padding: 0em; }
Expand Down
2 changes: 2 additions & 0 deletions book/TOC.markdown
@@ -1,6 +1,8 @@
CSS: ./book.css
Title: Sinatra Book

![logo](logo.png)

Table of Contents
=================

Expand Down
Empty file removed images/.gitignore
Empty file.
Binary file added images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions sinatra-book.thor
Expand Up @@ -6,6 +6,7 @@ require 'maruku'
require 'fileutils'

class Book < Thor
include FileUtils

SUPPORTED_FORMATS = %w{html latex pdf}
OUTPUT_DIR = File.join(File.dirname(__FILE__), "output")
Expand All @@ -17,8 +18,10 @@ class Book < Thor
def build(format = 'html')
doc = Maruku.new(complete_markdown)

FileUtils.mkdir_p(OUTPUT_DIR)
FileUtils.cp( File.join(File.dirname(__FILE__), 'assets', 'book.css'), File.join(File.dirname(__FILE__), 'output'))
mkdir_p OUTPUT_DIR
Dir.glob File.expand_path('../{assets,images}/*', __FILE__) do |file|
cp file, OUTPUT_DIR
end


if SUPPORTED_FORMATS.include?( format )
Expand All @@ -32,7 +35,7 @@ class Book < Thor

desc "clean", "Delete the output directory, along with all contents"
def clean
FileUtils.rm_rf(OUTPUT_DIR, {:verbose => true})
rm_rf OUTPUT_DIR, :verbose => true
end

private
Expand Down

0 comments on commit fb36095

Please sign in to comment.