diff --git a/Makefile b/Makefile index 933f960..9bf20f9 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ DTX = $(wildcard *.dtx) STY = $(patsubst %.dtx,%.sty,$(wildcard beamer*.dtx)) TEXMFHOME = $(shell kpsewhich -var-value=TEXMFHOME) INSTALL_DIR = $(TEXMFHOME)/tex/latex/mtheme +MANUAL_DIR = $(TEXMFHOME)/doc/latex/mtheme TEMP_DIR = .temptex DEMO_SRC = demo.tex @@ -17,31 +18,42 @@ DOCKER_IMAGE = latex-image DOCKER_CONTAINER = latex-container -.PHONY: clean install manual sty docker-run docker-rm +.PHONY: sty manual demo ctan clean install uninstall docker-run docker-build docker-rm +all: sty manual demo -all: sty demo contributors manual - -sty: $(DTX) $(INS) +$(STY): $(DTX) $(INS) @latex $(INS) -demo: $(STY) $(DEMO_SRC) +$(DEMO_PDF): $(STY) $(DEMO_SRC) $(TEXC) $(DEMO_SRC) @cp $(TEMP_DIR)/$(DEMO_PDF) . -$(CONTRIB_TEX):$(CONTRIB_SRC) - @python $(CONTRIB_SRC) - -manual: $(MANUAL_SRC) $(CONTRIB_TEX) +$(MANUAL_PDF): $(MANUAL_SRC) $(CONTRIB_TEX) @$(TEXC) $(MANUAL_SRC) @cp $(TEMP_DIR)/$(MANUAL_PDF) . +sty: $(STY) + +manual: $(MANUAL_PDF) + +demo: $(DEMO_PDF) + +ctan: + @echo Not yet implemented. + clean: @git clean -xfd -install: $(STY) +install: $(STY) $(MANUAL_PDF) @mkdir -p $(INSTALL_DIR) @cp $(STY) $(INSTALL_DIR) + @mkdir -p $(MANUAL_DIR) + @cp $(MANUAL_PDF) $(MANUAL_DIR) + +uninstall: + @rm -rf $(INSTALL_DIR) + @rm -rf $(MANUAL_DIR) docker-run: docker-build docker run --rm=true --name $(DOCKER_CONTAINER) -i -t -v `pwd`:/data $(DOCKER_IMAGE) /data/build.sh diff --git a/contributors.py b/contributors.py deleted file mode 100755 index 8f012b2..0000000 --- a/contributors.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -import sys -import requests -import json - -LOGIN = None -try: - with open("login.json", "r") as f: - login_data = json.load(f) - if (login_data['user'] and login_data['password']): - LOGIN = (login_data['user'], - login_data['password']) -except: - print("Couldn't open file 'login.json'.") - sys.exit() - - -def apiRequestLeft(): - resp = requests.get("https://api.github.com/rate_limit", - auth=LOGIN) - if(resp.ok): - data = json.loads(resp.content) - return data['rate']['remaining'] - else: - return 0 - -if not (apiRequestLeft): - print("No API requests left to load contributors list. ") - if(LOGIN is None): - print ("To get more API requests enter your login data into " + - "'login.json'") - sys.exit() - -resp = requests.get("https://api.github.com/repos/matze/mtheme/contributors", - auth=LOGIN) - -latex_string = "\\begin{itemize}\n" -if(resp.ok): - data = json.loads(resp.content) - extracted_data = ((c['login'], c['html_url'], c['url']) for c in data) - for user_name, html_url, url in extracted_data: - resp = requests.get(url, auth=LOGIN) - if(resp.ok): - user_data = json.loads(resp.content) - try: - name = user_data['name'] - except: - name = "" - else: - if not (apiRequestLeft): - name = "Couldn't load name. API request limit exceeded." - else: - "Couldn't load name." - latex_string += str(" \\item \\href{%s}{%s} %s\n" % (html_url, - user_name, - name)) -else: - latex_string += " \\item Couldn't load contributors.\n" -latex_string += "\\end{itemize}\n" - -try: - with open("contributors.tex", "w") as f: - f.write(latex_string) - print("Successfully written data to file.") - print(latex_string) -except IOError: - print("Error writing to file.") diff --git a/contributors.tex b/contributors.tex deleted file mode 100644 index d59ca63..0000000 --- a/contributors.tex +++ /dev/null @@ -1,17 +0,0 @@ -\begin{itemize} - \item \href{https://github.com/matze}{matze} Matthias Vogelgesang - \item \href{https://github.com/rchurchley}{rchurchley} Ross Churchley - \item \href{https://github.com/benjamin-weiss}{benjamin-weiss} Benjamin Weiss - \item \href{https://github.com/eddelbuettel}{eddelbuettel} Dirk Eddelbuettel - \item \href{https://github.com/ronnychevalier}{ronnychevalier} Ronny Chevalier - \item \href{https://github.com/jdahm}{jdahm} Johann Dahm - \item \href{https://github.com/Schwefelsaeure}{Schwefelsaeure} - \item \href{https://github.com/awalterschulze}{awalterschulze} Walter Schulze - \item \href{https://github.com/ehahn}{ehahn} Erik Hahn - \item \href{https://github.com/ChipmunkMath}{ChipmunkMath} - \item \href{https://github.com/timbers}{timbers} Finbarr Timbers - \item \href{https://github.com/kdungs}{kdungs} Kevin Dungs - \item \href{https://github.com/Leonidas-from-XIV}{Leonidas-from-XIV} Marek Kubica - \item \href{https://github.com/0ip}{0ip} Robin Buse - \item \href{https://github.com/cuzcomd}{cuzcomd} -\end{itemize} diff --git a/login.json b/login.json deleted file mode 100644 index 96415b9..0000000 --- a/login.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "user": "", - "password": "" -}