Giter Club home page Giter Club logo

ox-jekyll-md's Introduction

Org Export Engine for Jekyll on Markdown

https://melpa.org/packages/ox-jekyll-md-badge.svg

This is a simple org export engine for Jekyll Markdown. It is built from the fabulous code provided by @yoshinari-nomura/org-octopress.

Unlike the original code (and indeed most org-jekyll exporters) this exporter is built on top of ox-md to generate markdown.

Major Changes & Features

More details on the development of this exporter can be found on my blog.

Date

The exporting of the #+DATE property (into the YAML front matter) is controlled by the date: option. Today’s date can be prepended to the filename with the option org-jekyll-use-todays-date.

Tables

Table export is now implemented (rather than falling through to HTML export). Valid kramdown tables are created, but they do not look pretty and cell widths are not even. Org-table alignments are not currently implemented.

ox-jekyll-md's People

Contributors

gonsie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ox-jekyll-md's Issues

options to set or prompt for directory to save export to

i keep my text files outside my blog, so i want to save my .md exports to a different location, and i don't always publish them in the same directory on my site.

i came up with this:

(defcustom org-export-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-project-directory-and-prompt' if you
want to choose a directory on saving."
  :group 'org-export-jekyll
  :type 'string)

(defcustom org-export-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."
  :group 'org-export-jekyll
  :type 'boolean)

(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
for a directory to save to."
  (interactive)
  (let* ((pub-dir (if org-export-jekyll-md-prompt-for-directory
                    (read-directory-name "Save to: "
                                         org-export-jekyll-md-project-directory
                                         nil
                                         t)
                    org-export-jekyll-md-project-directory))
         (outfile (concat pub-dir
                          (org-jekyll-md-filename-date)
                          (org-export-output-file-name ".md" subtreep))))
    (org-export-to-file 'jekyll outfile async subtreep visible-only)))

first option: set a different destination directory, second option: prompt each time for a directory to save in. either or both can be set.

Add this to Melpa

This was exactly the package I was looking for! Have you considered putting it on Melpa? That way I wouldn't have to maintain local copies 🐈

Quotation marks in title should be escaped

#+title: "test"
#+date: <2020-05-28 Thu>
#+language: en
#+select_tags: export
#+exclude_tags: noexport
#+creator: Emacs 28.0.50 (Org mode 9.3)
#+jekyll_layout: post
#+jekyll_categories:
#+jekyll_tags:

If I run C-c C-e j m to get a Jekyll Markdown file and then serve it, I get this error:

Error: YAML Exception reading /path/to/blog/_drafts/2020-05-28-test.md: (<unknown>): did not find expected key while parsing a block mapping at line 2 column 1

The resulting markdown looks like this:

---
title: ""test""
date: <span class="timestamp-wrapper"><span class="timestamp">&lt;2020-05-28 Thu&gt;</span></span>
layout: post
categories:
tags:
---

# Table of Contents

If the quotation marks are escaped, it works:

---
title: "\"test\""
date: <span class="timestamp-wrapper"><span class="timestamp">&lt;2020-05-28 Thu&gt;</span></span>
layout: post
categories:
tags:
---

# Table of Contents

So quotation marks in the title should be escaped when exporting.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.