organa.artworks
4 | Experimental feature for showing artworks.
5 |
spit-out-artworks-pages!
(spit-out-artworks-pages! css)
--------------------------------------------------------------------------------
/docs/organa.config.html:
--------------------------------------------------------------------------------
1 |
3 | organa.config
4 | Generate a map of configuration values.
5 |
6 | This should eventually be more configurable.
7 |
--------------------------------------------------------------------------------
/docs/organa.core.html:
--------------------------------------------------------------------------------
1 |
3 | organa.dates
article-date-format
Date format used when rendering blog posts
4 |
current-year
(current-year)
Current year (at the time the program is being run).
5 |
date->year
(date->year d)
Find year for a clj-time
time (Joda DateTime
).
6 |
date-for-file-by-os
(date-for-file-by-os path)
date-for-org-file
(date-for-org-file site-source-dir basename)
Find Joda DateTime
for an Org post in HTML format, first looking in the Org Mode header, and if not present there, using the filesystem time.
10 |
--------------------------------------------------------------------------------
/docs/organa.egg.html:
--------------------------------------------------------------------------------
1 |
3 | organa.files
files-in-directory
(files-in-directory pathstr & {:keys [as], :or {as :file}})
4 | Get list of (non-hidden) files in directory. Examples:
5 |
6 | (files-in-directory "/tmp")
7 | (files-in-directory "/tmp" :as :str)
8 | (files-in-directory "/tmp" :as :file)
9 |
splitext
(splitext f)
10 | Split non-extension portion of file name from extension.
11 |
12 | (splitext "a") ;;=> '("a" nil)
13 | (splitext "a.b") ;;=> '("a" "b")
14 | (splitext "a.b.c") ;;=> '("a.b" "c")
15 |
--------------------------------------------------------------------------------
/docs/organa.fs.html:
--------------------------------------------------------------------------------
1 |
3 | organa.fs
4 | Functions for interacting with files, paths, and directories in the
5 | file system.
6 |
basename
(basename f)
7 | Get file (not directory) portion of name of `f`, where `f` is a
8 | `File` or path string.
9 |
dirfile
(dirfile f)
10 | Find the directory File that contains File `f`, which must exist.
11 |
files-in-directory
(files-in-directory pathstr & {:keys [as], :or {as :file}})
12 | Get list of (non-hidden) files in directory. Examples:
13 |
14 | (files-in-directory "/tmp")
15 | (files-in-directory "/tmp" :as :str)
16 | (files-in-directory "/tmp" :as :file)
17 |
path
(path & args)
18 | Create a file or directory path (string) out of `args`.
19 |
20 | (path "/a" "b" "c.txt")
21 | ;;=>
22 | "a/b/c.txt"
23 |
splitext
(splitext f)
24 | Split non-extension portion of file name from extension.
25 |
26 | (splitext "a") ;;=> '("a" nil)
27 | (splitext "a.b") ;;=> '("a" "b")
28 | (splitext "a.b.c") ;;=> '("a.b" "c")
29 |
with-tmp-dir
macro
(with-tmp-dir dir-file & body)
30 | Create temporary file, bind to `dir-file`, and execute `body` in
31 | that context, removing the directory afterwards.
32 |
--------------------------------------------------------------------------------
/docs/organa.gallery.html:
--------------------------------------------------------------------------------
1 |
3 | organa.gallery
4 | Functions for implementing galleries of images.
5 |
gallery-images
(gallery-images galpath)
inline-gallery
(inline-gallery gallery-name)
6 | This is invoked directly from one of the org files on the blog!
7 | FIXME: sketchy!
8 |
--------------------------------------------------------------------------------
/docs/organa.html.html:
--------------------------------------------------------------------------------
1 |
3 | organa.html
4 | Implementations of the parts of HTML needed by
5 | this blog engine.
6 |
a
(a content)
(a attrs content)
div
(div content)
(div attrs content)
em
(em content)
(em attrs content)
h1
(h1 content)
(h1 attrs content)
h2
(h2 content)
(h2 attrs content)
img
(img content)
(img attrs content)
li
(li content)
(li attrs content)
link
(link content)
(link attrs content)
p
(p content)
(p attrs content)
parse-org-html
(parse-org-html html-text)
(parse-org-html source-dir basename)
pre
(pre content)
(pre attrs content)
script
(script content)
(script attrs content)
span
(span content)
(span attrs content)
strong
(strong content)
(strong attrs content)
style
(style content)
(style attrs content)
table
(table content)
(table attrs content)
tbody
(tbody content)
(tbody attrs content)
td
(td content)
(td attrs content)
th
(th content)
(th attrs content)
thead
(thead content)
(thead attrs content)
tr
(tr content)
(tr attrs content)
ul
(ul content)
(ul attrs content)
--------------------------------------------------------------------------------
/docs/organa.image.html:
--------------------------------------------------------------------------------
1 |
3 | organa.image
create-thumbnail!
(create-thumbnail! maxh orig-path thumb-path)
(create-thumbnail! orig-path thumb-path)
image-file-pattern
4 | image-file-pattern
5 | ;;=>
6 | #"\.PNG|\.JPG|\.JPEG|\.GIF|\.png|\.jpg|\.jpeg|\.gif"
7 |
--------------------------------------------------------------------------------
/docs/organa.io.html:
--------------------------------------------------------------------------------
1 |
3 | organa.mirror
epoch-secs->local-date-time
(epoch-secs->local-date-time n)
parse-file
(parse-file txt)
post->enl
(post->enl {:keys [url]})
preview-file
(preview-file fname)
read-temp-posts-file
(read-temp-posts-file)
relevant-data
(relevant-data m)
--------------------------------------------------------------------------------
/docs/organa.pages.html:
--------------------------------------------------------------------------------
1 |
3 | organa.parse
clean-empty-string-values
(clean-empty-string-values m)
empty-org-table-entry?
(empty-org-table-entry? s)
title-for-org-file
(title-for-org-file parsed-html)
--------------------------------------------------------------------------------
/docs/organa.rss.html:
--------------------------------------------------------------------------------
1 |
3 | Date: 2008-02-18
24 | ")
25 | (testing "creation date is correct"
26 | (is (.startsWith (str (d/date-for-org-file d "post"))
27 | "2008-02-18"))))))))
28 |
--------------------------------------------------------------------------------
/test/organa/fs_test.clj:
--------------------------------------------------------------------------------
1 | (ns organa.fs-test
2 | (:require [clojure.java.shell :as shell]
3 | [clojure.test :refer [are deftest testing is]]
4 | [clojure.java.io :as io]
5 | [organa.fs :as fs]
6 | [clojure.string :as string])
7 | (:import [java.io File]))
8 |
9 | (deftest with-tmp-dir-test
10 | (testing "It creates a file object"
11 | (is (instance? java.io.File
12 | (fs/with-tmp-dir d
13 | d))))
14 | (testing "It contains `organa` in the path"
15 | (is (string/includes? (fs/with-tmp-dir d
16 | (:out (shell/sh "pwd" :dir d)))
17 | "organa")))
18 | (testing "It cleans up after itself"
19 | (let [path (fs/with-tmp-dir d
20 | (string/trim (:out (shell/sh "pwd" :dir d))))]
21 | (is (not
22 | (.exists (io/file path)))))))
23 |
24 | (deftest path-test
25 | (are [args result]
26 | (testing (str args " => " (pr-str result))
27 | (is (= result (apply fs/path args))))
28 |
29 | [] ""
30 | nil ""
31 | ["a"] "a"
32 | ["a" "b"] "a/b"))
33 |
34 | (deftest directory-test
35 | (testing "file / directory operations"
36 | (fs/with-tmp-dir d
37 | (testing "in a temporary directory"
38 | (let [test-file (fs/path d "f.txt")
39 | _ (spit test-file "some text")
40 | parent (fs/dirfile (io/file test-file))]
41 | (testing (str "the parent found by `dirfile` "
42 | "has a single child, the test file we made")
43 | (is (= [(io/file test-file)]
44 | (into [] (.listFiles ^File parent))))
45 | (testing "using `files-in-directory`, result is same"
46 | (is (= [(io/file test-file)]
47 | (fs/files-in-directory (str parent)
48 | :as :file)))))
49 | (testing "`basename` returns original file name"
50 | (is (= "f.txt"
51 | (fs/basename test-file))))
52 | (testing "`splitext` returns `basename` and extension"
53 | (is (= ["f" "txt"]
54 | (fs/splitext test-file)))))))))
55 |
--------------------------------------------------------------------------------
/tests.edn:
--------------------------------------------------------------------------------
1 | {:kaocha/reporter [kaocha.report/doc]
2 | :kaocha/tests [{:kaocha.testable/type :kaocha.type/clojure.test
3 | :kaocha.testable/id :unit
4 | :kaocha/ns-patterns ["-test$"]
5 | :kaocha/source-paths ["src"]
6 | :kaocha/test-paths ["test"]}]}
7 |
--------------------------------------------------------------------------------