Skip to content

Commit

Permalink
make themes building deps optional, addresses #4
Browse files Browse the repository at this point in the history
  • Loading branch information
barraq committed Feb 3, 2015
1 parent 6ff9496 commit 9e5e1f9
Show file tree
Hide file tree
Showing 9 changed files with 533 additions and 19 deletions.
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
SRC_DIR = cv
BUILD_DIR = build
THEMES_DIR = themes
FONTS_DIR = fonts
SCAFFOLDS_DIR = scaffolds
IMAGES_DIR = $(SRC_DIR)/images
DIST_DIR = dist
HTMLTOPDF = wkpdf
THEME = classic
DATE = $(shell date +'%B %d, %Y')

ifeq "$(wildcard $(SRC_DIR) )" ""
Expand All @@ -15,6 +17,9 @@ endif

PARTS = $(patsubst $(SRC_DIR)/%.md, $(BUILD_DIR)/%.html, $(PARTS_SOURCES))

STYLESHEETS = $(wildcard stylesheets/themes/*/style.scss)
THEMES = $(patsubst stylesheets/%, %, $(STYLESHEETS:.scss=.css))

# before-body contains public or private parts
before-body = --variable=privatecv
ifeq ($(private-cv),true)
Expand All @@ -28,7 +33,7 @@ endif
# after-body contains all parts but public and private
after-body = $(filter-out $(BUILD_DIR)/public.html $(BUILD_DIR)/private.html, $(PARTS))

.PHONY: all directories media style parts html pdf clean
.PHONY: all directories media themes parts html pdf clean

# default target is build CV in html
all: html
Expand All @@ -50,22 +55,25 @@ else
endif

# Target for building stylesheets
style: stylesheets/*.scss
themes: $(THEMES)
mkdir -p $(DIST_DIR)/stylesheets/ && cp -r $(THEMES_DIR) $(DIST_DIR)

$(THEMES): $(STYLESHEETS)
compass compile \
--require susy \
--sass-dir stylesheets \
--sass-dir stylesheets/themes \
--javascripts-dir javascripts \
--css-dir $(DIST_DIR)/stylesheets \
--css-dir $(THEMES_DIR) \
--image-dir $(IMAGES_DIR) \
stylesheets/style.scss
$^

# Target for media
media: | directories
rsync -rupE $(FONTS_DIR) $(DIST_DIR)
rsync -rupE $(IMAGES_DIR) $(DIST_DIR)

# Target for building CV document in html
html: media style templates/cv.html parts $(SRC_DIR)/cv.md | directories
html: media themes templates/cv.html parts $(SRC_DIR)/cv.md | directories
pandoc --standalone \
--section-divs \
--smart \
Expand All @@ -75,7 +83,7 @@ html: media style templates/cv.html parts $(SRC_DIR)/cv.md | directories
$(before-body) \
$(after-body) \
--variable=date:'$(DATE)' \
--css stylesheets/style.css \
--css $(THEMES_DIR)/$(THEME)/style.css \
--output $(DIST_DIR)/cv.html $(SRC_DIR)/cv.md

# Target for building CV document in PDF
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ Live **pdf** preview [here](http://barraq.github.io/pandoc-moderncv/preview/cv.p
## Requirements

For building your CV in html you need:
- [Compass](http://compass-style.org/) (>= 1.0),
- [Susy](http://susy.oddbird.net/) (>= 2.1),
- [RSync](http://rsync.samba.org/),
- [Pandoc](http://johnmacfarlane.net/pandoc/) (>= 1.13)

For exporting your CV to pdf you need:
- wkpdf or wkhtmltopdf:
- wkpdf (MacOS X), http://plessl.github.io/wkpdf/
- wkhtmltopdf (Linux, Windows), http://wkhtmltopdf.org/
- exiftool, http://www.sno.phy.queensu.ca/~phil/exiftool/
- [wkpdf](http://plessl.github.io/wkpdf/) (MacOS X) or [wkhtmltopdf](http://wkhtmltopdf.org/) (Linux, Windows),
- [ExifTool](http://www.sno.phy.queensu.ca/~phil/exiftool/)

For building and customizing themes you need:
- [Compass](http://compass-style.org/) (>= 1.0),
- [Susy](http://susy.oddbird.net/) (>= 2.1)

## Installation

Install **Compass** and **Susy**:
Install **Compass** and **Susy** (only if you need to build themes):

$ gem install compass
$ gem install susy
Expand Down Expand Up @@ -193,6 +193,8 @@ Currently pandoc-moderncv supports a single theme: classic.

> Feel free to contribute and send me your custom theme!
To create a new THEME_NAME theme create a file `style.scss` under `stylesheets/themes/<THEME_NAME>/`.

### Colors, Fonts, Icons

All themes can be customized through variables defined in *stylesheets/_settings.scss*. Currently the variables are:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 7 additions & 5 deletions stylesheets/style.scss → stylesheets/themes/classic/style.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
@import "compass/reset";
@import "compass/typography/vertical_rhythm";
//@import "vendors/fontawesome/font-awesome";

@import "susy";
@import "settings";
@import "mixins";
@import "layouts";
@import "fonts";

@import "../../common/settings";
@import "../../common/mixins";
@import "../../common/layouts";

$fa-font-path: "../../fonts" !default;
@import "../../common/fonts";

@include establish-baseline;

Expand Down
Loading

0 comments on commit 9e5e1f9

Please sign in to comment.