/uniorg-util

Converts your org-mode files into html + metadata.

Primary LanguageClojureGNU General Public License v3.0GPL-3.0

Uniorg Utility

https://img.shields.io/circleci/build/gh/wildwestrom/uniorg-util/main.svg

This program converts your Org Mode documents into HTML + metadata.
Outputs to both JSON and EDN formats.

It relies heavily on rasendubi’s very accurate Org Mode parser, uniorg.

Installation:

Install with npm.

npm install uniorg-util

Or install with yarn.

yarn add uniorg-util

Usage:

Outputs JSON by default.

npm run uniorg-util [OPTIONS]
yarn uniorg-util [OPTIONS]

By default it will process everything in the current directory.

Options:

-i, --input [DIR]      .      Directory to read from
-o, --output [DIR]     .      Directory to output to
-e, --edn                     Output files as EDN instead of JSON
-m, --manifest [NAME]  false  Create a list of all-files processed
-h, --help

If installed globally, just run:

uniorg-util [OPTIONS]

Example:

Input:

#+title: Here's a title
#+subtitle: And more headers
#+date: 2021-04-15
#+tags: it also has an id
#+author: Christian Westrom
#+id: test-1

* Here's some stuff
  :PROPERTIES:
  :id: Here's a drawer of stuff
  :END:
  * Here's more stuff

** DONE Make example
   CLOSED: [2021-06-20 Sun 23:10]

Output

Note: Formatted nicely just for show.
Outputs as one line.

{:content
 "<h1>Here's some stuff</h1>
<ul>
    <li>
        <p>Here's more stuff\n</p>
    </li>
</ul>
<h2>
    <span class=\"todo-keyword DONE\">DONE</span>
    Make example
</h2>",
 :meta {:title             "Here's a title",
        :subtitle          "And more headers",
        :date              "2021-04-15",
        :tags              "it also has an id",
        :author            "Christian Westrom",
        :id                "test-1",
        :original-filename "100-test"}}

TODO:

  • [X] Figure out why I can’t run the tool after installing.
  • [ ] Automate pushing releases.
  • [ ] Try adding a watch function.
    A function updates the data by watching a directory.

Development:

Install dependencies:

yarn install

Run a repl with tests:

yarn watch:test

Run a repl without tests:

yarn watch

Build the script:

yarn build

Run tests:

yarn test

License

This program converts your Org Mode documents into HTML + metadata.
Copyright © 2021 Christian Westrom

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

https://www.gnu.org/graphics/gplv3-or-later.png