summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/pre-commit4
-rw-r--r--scripts/readme-to-md.el13
2 files changed, 17 insertions, 0 deletions
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))