-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mousebot
committed
May 12, 2022
1 parent
c4f7fcb
commit 7a1e0fb
Showing
1 changed file
with
17 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
;;; ox-jekyll-md.el --- Export Jekyll on Markdown articles using org-mode. -*- lexical-binding: t; -*- | ||
;;; ox-jekyll-md.el --- Export Jekyll on Markdown articles using org-mode -*- lexical-binding: t; -*- | ||
|
||
;; Copyright (C) 2018 Elsa Gonsiorowski | ||
|
||
;; Author: Elsa Gonsiorowski <[email protected]> | ||
;; Author: Yoshinari Nomura <[email protected]> | ||
;; Author: Justin Gordon <[email protected]> | ||
;; Keywords: org, jekyll | ||
;; Homepage: https://github.com/gonsie/ox-jekyll-md | ||
;; Package-Requires: ((emacs "26.1")) | ||
;; Keywords: org, jekyll, blog, convenience | ||
;; Version: 0.1 | ||
|
||
;; This is free software; you can redistribute it and/or modify it | ||
|
@@ -41,7 +43,7 @@ | |
|
||
;;; User Configurable Variables | ||
|
||
(defgroup org-export-jekyll-md nil | ||
(defgroup org-jekyll-md nil | ||
"Options for exporting Org mode files to jekyll MD." | ||
:tag "Org Jekyll MD" | ||
:group 'org-export | ||
|
@@ -104,15 +106,15 @@ makes: | |
:group 'org-export-jekyll | ||
:type 'boolean) | ||
|
||
(defcustom org-export-jekyll-md-project-directory default-directory | ||
(defcustom org-jekyll-md-project-directory default-directory | ||
"Directory to save exported articles to. | ||
\nDefaults to `default-directory' (i.e. current directory). See | ||
`org-export-jekyll-md-use-prompt-for-directory' if you | ||
want to choose a directory on saving." | ||
:group 'org-export-jekyll | ||
:type 'string) | ||
|
||
(defcustom org-export-jekyll-md-prompt-for-directory nil | ||
(defcustom org-jekyll-md-prompt-for-directory nil | ||
"Non-nil means prompt for a directory to save in. | ||
\nStart at `org-export-jekyll-md-project-directory'. Nil means | ||
use `org-export-jekyll-md-project-directory' with no prompt." | ||
|
@@ -191,9 +193,10 @@ Assume BACKEND is `jekyll'." | |
(defun org-jekyll-md-src-block (src-block contents info) | ||
"Optionally transcode SRC-BLOCK element into jekyll code template format. | ||
Use `highlight` / `endhighlight` if `org-jekyll-md-use-src-plugin` is t. Otherwise, | ||
perform `org-md-src-block`. CONTENTS holds the contents of the item. INFO is a | ||
plist used as a communication channel." | ||
Use `highlight` / `endhighlight` if | ||
`org-jekyll-md-use-src-plugin' is t. Otherwise, perform | ||
`org-md-src-block'. CONTENTS holds the contents of the item. INFO | ||
is a plist used as a communication channel." | ||
(if org-jekyll-md-use-src-plugin | ||
(let ((language (org-element-property :language src-block)) | ||
(value (org-remove-indentation | ||
|
@@ -232,8 +235,7 @@ holding export options." | |
(concat | ||
(org-jekyll-md--yaml-front-matter info) | ||
contents) | ||
contents | ||
)) | ||
contents)) | ||
|
||
(defun org-jekyll-md-inner-template (contents info) | ||
"Return body of document string after MD conversion. | ||
|
@@ -319,16 +321,16 @@ holding export options." | |
;;;###autoload | ||
(defun org-jekyll-md-export-to-md (&optional async subtreep visible-only) | ||
"Export current buffer to a Markdown file adding some YAML front matter. | ||
\nThe file is saved to `org-export-jekyll-md-project-directory'. | ||
If `org-export-jekyll-md-prompt-for-directory' is non-nil, prompt | ||
\nThe file is saved to `org-jekyll-md-project-directory'. | ||
If `org-export-md-prompt-for-directory' is non-nil, prompt | ||
for a directory to save to." | ||
(interactive) | ||
(let* ((pub-dir (if org-export-jekyll-md-prompt-for-directory | ||
(let* ((pub-dir (if org-jekyll-md-prompt-for-directory | ||
(read-directory-name "Save to: " | ||
org-export-jekyll-md-project-directory | ||
org-jekyll-md-project-directory | ||
nil | ||
t) | ||
org-export-jekyll-md-project-directory)) | ||
org-jekyll-md-project-directory)) | ||
(outfile (concat pub-dir | ||
(org-jekyll-md-filename-date) | ||
(org-export-output-file-name ".md" subtreep)))) | ||
|