Whoops. Misc typo and thinko fixes. Bump version to 0.5. We're useful now!

This commit is contained in:
Brit Butler 2012-08-22 15:12:36 -04:00
parent 377f1143ec
commit 023004269a
6 changed files with 33 additions and 10 deletions

View file

@ -1,7 +1,7 @@
(defsystem #:coleslaw (defsystem #:coleslaw
:name "coleslaw-core" :name "coleslaw-core"
:description "Flexible Lisp Blogware" :description "Flexible Lisp Blogware"
:version "0.4" :version "0.5"
:license "BSD" :license "BSD"
:author "Brit Butler <redline6561@gmail.com>" :author "Brit Butler <redline6561@gmail.com>"
:pathname "src/" :pathname "src/"

View file

@ -1,7 +1,7 @@
(:author "Brit Butler" (:author "Brit Butler"
:domain "http://blog.redlinernotes.com" :domain "http://blog.redlinernotes.com"
:license "CC-BY-SA" :license "CC-BY-SA"
:plugins nil :plugins (markdown mathjax)
:repo "/home/redline/projects/coleslaw/ignore/input/" :repo "/home/redline/projects/coleslaw/ignore/input/"
:sitenav "" :sitenav ""
:title "Improved Means for Achieving Deteriorated Ends" :title "Improved Means for Achieving Deteriorated Ends"

View file

@ -1,4 +1,4 @@
(eval-when (:compile-toplevel) (eval-when (:compile-toplevel :load-toplevel)
(ql:quickload '(3bmd 3bmd-ext-code-blocks))) (ql:quickload '(3bmd 3bmd-ext-code-blocks)))
(defpackage :coleslaw-md (defpackage :coleslaw-md
@ -7,6 +7,6 @@
(in-package :coleslaw-md) (in-package :coleslaw-md)
(defmethod render-content (text (format (eql :md))) (defmethod render-content (text (format (eql :md)))
(let ((3mbd-code-blocks:*code-blocks* t)) (let ((3bmd-code-blocks:*code-blocks* t))
(with-output-to-string (str) (with-output-to-string (str)
(3bmd:parse-string-and-print-to-stream text str)))) (3bmd:parse-string-and-print-to-stream text str))))

View file

@ -10,8 +10,4 @@
src=\"http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML\"> src=\"http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">
</script>") </script>")
(defmethod enable () (coleslaw:add-injection *mathjax-header* :head)
(coleslaw::add-injection *mathjax-header* :head))
(defmethod disable ()
(coleslaw::remove-injection *mathjax-header* :head))

View file

@ -18,4 +18,5 @@
(defun load-config (&optional (dir (user-homedir-pathname))) (defun load-config (&optional (dir (user-homedir-pathname)))
"Load the coleslaw configuration from DIR/.coleslawrc. DIR is ~ by default." "Load the coleslaw configuration from DIR/.coleslawrc. DIR is ~ by default."
(with-open-file (in (merge-pathnames ".coleslawrc" dir)) (with-open-file (in (merge-pathnames ".coleslawrc" dir))
(setf *config* (apply #'make-instance 'blog (read in))))) (setf *config* (apply #'make-instance 'blog (read in))))
(load-plugins (plugins *config*)))

26
src/util.lisp Normal file
View file

@ -0,0 +1,26 @@
(in-package :coleslaw)
(defun app-path (path &rest args)
"Take a relative PATH and return the corresponding pathname beneath coleslaw.
If ARGS is provided, use (apply 'format nil PATH ARGS) as the value of PATH."
(merge-pathnames (apply 'format nil path args) coleslaw-conf:*basedir*))
(defun to-pathname (file &optional (parent coleslaw-conf:*basedir*))
"Convert an iolib file-path back to a pathname."
(merge-pathnames (file-path-namestring file) parent))
(defun read-symlink (path)
"A trivial wrapper over iolib.os that returns the pathname in the symlink PATH."
(to-pathname (iolib.os:read-symlink path)))
(defmacro do-files ((var path &optional extension) &body body)
"For each file under PATH, run BODY. If EXTENSION is provided, only run BODY
on files that match the given extension."
(alexandria:with-gensyms (ext)
`(mapcar (lambda (,var)
,@(if extension
`((let ((,ext (pathname-type ,var)))
(when (and ,ext (string= ,ext ,extension))
,@body)))
`,body))
(list-directory ,path))))