From a78a74764e0b2baad914272deac56d83609cad6c Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 1 Apr 2014 01:05:51 -0400 Subject: Move pre-commit files to scripts subdirectory --- scripts/pre-commit | 4 ++++ scripts/readme-to-md.el | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 scripts/pre-commit create mode 100644 scripts/readme-to-md.el (limited to 'scripts') diff --git a/scripts/pre-commit b/scripts/pre-commit new file mode 100755 index 0000000..56890a7 --- /dev/null +++ b/scripts/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +emacs --batch --load scripts/readme-to-md.el +git add README.md diff --git a/scripts/readme-to-md.el b/scripts/readme-to-md.el new file mode 100644 index 0000000..3303029 --- /dev/null +++ b/scripts/readme-to-md.el @@ -0,0 +1,13 @@ +(defvar org-location "~/src/emacs/org-mode/lisp") + +(when (and org-location (file-exists-p org-location)) + (add-to-list 'load-path org-location) + (require 'org)) +(require 'ox-md) + +(let ((readme-file "bog-readme.org") + exported-file + (final-file "README.md")) + (with-current-buffer (find-file-noselect readme-file) + (setq exported-file (org-md-export-to-markdown))) + (rename-file exported-file final-file t)) -- cgit v1.2.3