-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding makefile for auto-generating PDF (#106)
* Adding makefile for auto-generating PDF * Updating adoc
- Loading branch information
Showing
11 changed files
with
1,013 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
|
||
.bazelrc.user | ||
user.bazelrc | ||
.readme.adoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
=Ruby Rules® for Bazel | ||
:subtitle: Version %VERSION% | ||
:doctype: book | ||
:source-highlighter: rouge | ||
:rouge-style: base16.monokai | ||
:toclevels: 5 | ||
:toc: | ||
:sectnums: 9 | ||
:icons: font | ||
:license: apache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.4.1 | ||
0.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# vim: tabstop=8 | ||
# vim: shiftwidth=8 | ||
# vim: noexpandtab | ||
|
||
# grep '^[a-z\-]*:' Makefile | cut -d: -f 1 | tr '\n' ' ' | ||
.PHONY: help update-changelog update-readme update | ||
|
||
red := \033[0;31m | ||
bold := \033[1;45m | ||
yellow := \033[0;33m | ||
blue := \033[0;34m | ||
green := \033[0;35m | ||
clear := \033[0m | ||
|
||
RUBY_VERSION := $(shell cat .ruby-version) | ||
RULES_VERSION := $(shell cat .rules_version) | ||
OS := $(shell uname -s | tr '[:upper:]' '[:lower:]') | ||
|
||
# see: https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile/18137056#18137056 | ||
SCREEN_WIDTH := 100 | ||
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) | ||
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))) | ||
PATH := $(shell echo "$(HOME)/.rbenv/shims:$(PATH)") | ||
|
||
help: ## Prints help message auto-generated from the comments. | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
update: update-changelog update-readme ## Runs all of the updates, add locally modiofied files to git. | ||
|
||
update-changelog: ## Auto-generate the doc/CHANGELOG (requires GITHUB_TOKEN env var set) | ||
@printf "\n$(bold) 👉 $(red)$(clear) $(green)Regenerating CHANGELOG....$(clear)\n" | ||
@bash -c "$(BASHMATIC_HOME)/bin/regen-changelog" | ||
|
||
update-readme: ## Generate the PDF version of the README | ||
@printf "\n$(bold) 👉 $(red)$(clear) $(green)Converting README.md into the ASCIIDOC...$(clear)\n" | ||
@bash -c "command -v kramdoc || gem install kramdoc; kramdoc README.md" | ||
@rm -fv README.pdf | ||
@printf "\n$(bold) 👉 $(red)$(clear) $(green)Converting ASCIIDOC into the PDF...$(clear)\n" | ||
@mv README.adoc .readme.adoc | ||
@cat .readme .readme.adoc | sed -E "s/source,bazel/source,python/g; s/%VERSION%/$(RULES_VERSION)/g" > README.adoc | ||
@$(BASHMATIC_HOME)/bin/adoc2pdf README.adoc | ||
@git add README.pdf | ||
@open README.pdf | ||
|
||
|
Oops, something went wrong.