Created
July 16, 2020 21:50
-
-
Save BonfaceKilz/db98fc723ffb3af297e79dd4b2daa8d2 to your computer and use it in GitHub Desktop.
Sample MAKEFILE to convert org files to md using emacs
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
#!/usr/bin/make -f | |
SHELL := emacs | |
.SHELLFLAGS := --quick --batch --eval | |
orgs := $(wildcard *.org) | |
objs := $(orgs:.org=.md) $(orgs:.org=.texi) | |
.PHONY: all | |
all: $(objs) | |
.ONESHELL: | |
%.md %.texi: %.org | |
(with-temp-buffer | |
(require 'ox-md) | |
(require 'ox-texinfo) | |
(when (insert-file-contents "$<") | |
(org-mode) | |
(org-export-to-file 'md "$*.md") | |
(org-export-to-file 'texinfo "$*.texi"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment