Skip to content

Instantly share code, notes, and snippets.

@efraintorlo
Created January 12, 2016 19:29
Show Gist options
  • Select an option

  • Save efraintorlo/8ef790cb77ab7a706a67 to your computer and use it in GitHub Desktop.

Select an option

Save efraintorlo/8ef790cb77ab7a706a67 to your computer and use it in GitHub Desktop.
Mdpress Makefile
SHELL := /bin/bash
# Makefile for Reheating presentation in MDpress
#-----------------------------
# This is the file-name.md to
# be processed by mdpress
#-----------------------------
MDFILE = reheating_press
#-----------------------------
#-----------------------------
# Stylesheets defined
#-----------------------------
#STYLESHEET = deckjs
#STYLESHEET = default
#STYLESHEET = impress
#STYLESHEET = obtvse
#STYLESHEET = mytheme
STYLESHEET = reheating_theme
#-----------------------------
#-----------------------------
# Apps needed are different
# for Linux/Mac
#-----------------------------
ifeq ($(shell uname -s),Darwin)
OPEN = open
SED ?= gsed
else
OPEN = xdg-open
SED ?= sed
endif
#-----------------------------
default: begin show compile
local: fix_MathJax show_local
compile:
@echo
@echo "==================================================="
@echo -e "\033[31m Mdpress is running ..\033[0m"
@echo -e "\033[31m To stop press ctrl-c \033[0m"
@echo "==================================================="
@echo
mdpress --images=images --latex --stylesheet=$(STYLESHEET) -v -a $(MDFILE).md
begin:
@echo
@echo "==================================================="
@echo -e "\033[31m Beginning Mdpress ...\033[0m"
@echo "==================================================="
@echo
@mdpress --images=images --latex --stylesheet=$(STYLESHEET) $(MDFILE).md
show:
cd $(MDFILE)/ && $(OPEN) index.html
fix_MathJax:
@echo "==================================================="
@echo -e "\033[31m Changing to local MathJax ...\033[0m"
@echo "==================================================="
@cd $(MDFILE)/ && cp index.html index_local.html
@cd $(MDFILE)/ && $(SED) -i 's#http://cdn.mathjax.org/mathjax/latest/#../MathJax/#g' index_local.html
show_local:
@echo
cd $(MDFILE)/ && $(OPEN) index_local.html
@echo
clean:
rm -rf $(MDFILE)/*
help:
@echo "****************************************************"
@echo -e " \033[31m Mdpress \033[0m"
@echo " < Help Menu >"
@echo "****************************************************"
@echo "Please use 'make <target>' where target is one of:"
@echo
@echo -e "\033[31m default\033[0m to continuosly run mdpress using the theme: "
@echo -e " \033[32m"$(STYLESHEET) "\033[0m"
@echo -e "\033[31m local \033[0m to Fix the MathJax dependence into local copy"
@echo " this is useful to display eqs without internet"
@echo " use this to get the final version of the press"
@echo -e "\033[31m clean \033[0m clean the folder \033[32m./"$(MDFILE)"/*\033[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment