|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
;; Time-stamp: <2018-09-05 15:53:44 kmodi> |
|
|
|
|
;; Time-stamp: <2018-09-05 21:36:21 kmodi> |
|
|
|
|
|
|
|
|
|
;; Setup to export Org files to Hugo-compatible Markdown using |
|
|
|
|
;; `ox-hugo' in an "emacs -Q" environment. |
|
|
|
|
@ -8,10 +8,6 @@ |
|
|
|
|
(setq-default indent-tabs-mode nil) |
|
|
|
|
(setq-default make-backup-files nil) |
|
|
|
|
|
|
|
|
|
;; Force the locate to en_US for the tests. |
|
|
|
|
(set-locale-environment "en_US.UTF-8") |
|
|
|
|
(setenv "LANGUAGE" "en_US.UTF-8") |
|
|
|
|
|
|
|
|
|
;; Toggle debug on error, including `user-error'. |
|
|
|
|
(setq debug-ignored-errors (remq 'user-error debug-ignored-errors)) |
|
|
|
|
(toggle-debug-on-error) |
|
|
|
|
@ -200,19 +196,6 @@ Emacs installation. If Emacs is installed using |
|
|
|
|
|
|
|
|
|
(require 'ox-hugo-export-gh-doc) ;For `ox-hugo-export-gh-doc' |
|
|
|
|
|
|
|
|
|
;; Override the inbuilt `current-time' function so that the "lastmod" |
|
|
|
|
;; tests work. |
|
|
|
|
(defun ox-hugo-test/current-time-override (&rest args) |
|
|
|
|
"Hard-code the 'current time' so that the lastmod tests are reproducible. |
|
|
|
|
Fake current time: 2100/12/21 00:00:00 (arbitrary)." |
|
|
|
|
(encode-time 0 0 0 21 12 2100)) |
|
|
|
|
(advice-add 'current-time :override #'ox-hugo-test/current-time-override) |
|
|
|
|
;; (advice-remove 'current-time #'ox-hugo-test/current-time-override) |
|
|
|
|
|
|
|
|
|
;; Override the default `org-hugo-export-creator-string' so that this |
|
|
|
|
;; string is consistent in all ox-hugo tests. |
|
|
|
|
(setq org-hugo-export-creator-string "Emacs + Org mode + ox-hugo") |
|
|
|
|
|
|
|
|
|
;; Allow setting few vars in Local Variables in the test files. |
|
|
|
|
(put 'org-hugo-auto-set-lastmod 'safe-local-variable 'booleanp) |
|
|
|
|
(put 'org-hugo-suppress-lastmod-period 'safe-local-variable 'floatp) |
|
|
|
|
@ -246,16 +229,35 @@ Fake current time: 2100/12/21 00:00:00 (arbitrary)." |
|
|
|
|
(setq org-confirm-babel-evaluate #'ox-hugo-org-confirm-babel-evaluate-fn)) |
|
|
|
|
|
|
|
|
|
(with-eval-after-load 'ox |
|
|
|
|
(setq org-export-headline-levels 4) ;default is 3 |
|
|
|
|
(add-to-list 'org-export-exclude-tags "dont_export_during_make_test"))) |
|
|
|
|
|
|
|
|
|
;; Wed Sep 20 13:37:06 EDT 2017 - kmodi |
|
|
|
|
;; Below does not get applies when running emacs --batch.. need to |
|
|
|
|
;; figure out a solution. |
|
|
|
|
(custom-set-variables |
|
|
|
|
'(safe-local-variable-values |
|
|
|
|
(quote |
|
|
|
|
((org-hugo-footer . " |
|
|
|
|
(setq org-export-headline-levels 4))) ;default is 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
|
;;; Settings *only* for tests (applied during "make test") |
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
|
(when (string= "1" (getenv "TEST_ENABLED")) |
|
|
|
|
;; Set the time-zone to UTC. |
|
|
|
|
;; If TZ is unset, Emacs uses system wall clock time, which is a |
|
|
|
|
;; platform-dependent default time zone -- |
|
|
|
|
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Zone-Rules.html |
|
|
|
|
(setenv "TZ" "UTC") |
|
|
|
|
|
|
|
|
|
;; Force the locate to en_US for the tests. |
|
|
|
|
(set-locale-environment "en_US.UTF-8") |
|
|
|
|
(setenv "LANGUAGE" "en_US.UTF-8") |
|
|
|
|
|
|
|
|
|
;; Override the default `org-hugo-export-creator-string' so that this |
|
|
|
|
;; string is consistent in all ox-hugo tests. |
|
|
|
|
(setq org-hugo-export-creator-string "Emacs + Org mode + ox-hugo") |
|
|
|
|
|
|
|
|
|
;; Override the inbuilt `current-time' function so that the "lastmod" |
|
|
|
|
;; tests work. |
|
|
|
|
(defun ox-hugo-test/current-time-override (&rest args) |
|
|
|
|
"Hard-code the 'current time' so that the lastmod tests are reproducible. |
|
|
|
|
Fake current time: 2100/12/21 00:00:00 (arbitrary)." |
|
|
|
|
(encode-time 0 0 0 21 12 2100)) |
|
|
|
|
(advice-add 'current-time :override #'ox-hugo-test/current-time-override) |
|
|
|
|
;; (advice-remove 'current-time #'ox-hugo-test/current-time-override) |
|
|
|
|
|
|
|
|
|
[//]: # \"Exported with love from a post written in Org mode\" |
|
|
|
|
[//]: # \"- https://github.com/kaushalmodi/ox-hugo\""))))) |
|
|
|
|
(with-eval-after-load 'ox |
|
|
|
|
(add-to-list 'org-export-exclude-tags "dont_export_during_make_test"))) |
|
|
|
|
|