mirror of https://github.com/CrimsonTome/tldr.git
commit
b694dd10d5
|
@ -1,6 +1,9 @@
|
|||
.DS_Store
|
||||
.md~
|
||||
|
||||
# Local Ruby gems #
|
||||
.gem/
|
||||
|
||||
# JetBrains #
|
||||
.idea/
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
kramdown (1.7.0)
|
||||
mdl (0.2.1)
|
||||
kramdown (~> 1.5, >= 1.5.0)
|
||||
mixlib-cli (~> 1.5, >= 1.5.0)
|
||||
mixlib-config (~> 2.1, >= 2.1.0)
|
||||
mixlib-cli (1.5.0)
|
||||
mixlib-config (2.1.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
mdl
|
18
Makefile
18
Makefile
|
@ -1,8 +1,24 @@
|
|||
all: setup index
|
||||
|
||||
index:
|
||||
@TLDRHOME=`pwd` ./scripts/build_index.rb
|
||||
@echo "Index rebuilt."
|
||||
|
||||
setup:
|
||||
setup: hooks deps
|
||||
|
||||
hooks:
|
||||
@cp ./scripts/pre-commit .git/hooks
|
||||
@chmod +x .git/hooks/pre-commit
|
||||
@echo "Git pre-commit hook installed."
|
||||
|
||||
deps:
|
||||
@bundle
|
||||
@echo "OK"
|
||||
|
||||
lint:
|
||||
@GEM_PATH=.gem find pages -exec .gem/bin/mdl {} --style ./scripts/markdown-style.rb 1>&2 \;
|
||||
|
||||
lint-changed:
|
||||
@./scripts/lint-changed.sh
|
||||
|
||||
.PHONY: index setup hooks deps lint lint-changed
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
MD_FILES=`git diff --cached --name-only | tr " " "\n" | egrep ^.*\.md$`
|
||||
|
||||
# Execute Markdown lint if any markdown files have been changed and added to git
|
||||
[[ -z "$MD_FILES" ]] || GEM_PATH=.gem .gem/bin/mdl "$MD_FILES"
|
|
@ -0,0 +1,5 @@
|
|||
# This file contains the markdown rules markdownlint will check for
|
||||
all
|
||||
|
||||
exclude_rule 'MD013' # Lengthy lines (80+ chars)
|
||||
exclude_rule 'MD038' # Spaces inside code backticks
|
|
@ -2,3 +2,4 @@
|
|||
|
||||
make index
|
||||
git add ./pages/index.json
|
||||
make lint-changed
|
||||
|
|
Loading…
Reference in New Issue