From e26a98b711de8f5d7c785ca5b1b1f47c6f1e6596 Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Wed, 22 Apr 2020 10:04:42 -0400 Subject: [PATCH] util.el can now add front-matter to org-exported-to-md --- org_fix_links.py | 1 + util.el | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/org_fix_links.py b/org_fix_links.py index 6527b1d..0e4705c 100755 --- a/org_fix_links.py +++ b/org_fix_links.py @@ -39,6 +39,7 @@ def fix_image_link(m): for n,line in enumerate(sys.stdin): for g1,_ in proper_link_re.findall(line): + #print("FOUND: {}".format(g1)) seen.add(g1) seen_line[g1] = n+1 for g1 in link_re.findall(line): diff --git a/util.el b/util.el index bc9e5b8..d8fc30b 100644 --- a/util.el +++ b/util.el @@ -55,11 +55,15 @@ (with-current-buffer (filter-buffer fname "tmp.org" tag) (write-file "./_tmp_filtered.org")))) +(setq extra-boilerplate + "toc = true\n") + (defun export-run () (find-file "./_tmp_filtered2.org") (princ "Exporting with ox-hugo...\n") (org-hugo-export-as-md) + (goto-line 3) + (insert extra-boilerplate) (write-file "./log.md")) ;; TODO: use command-line-args so that I can pass in the filename ;; instead of hard-code it -