Parcourir la Source

Add docs and further RSS tweaks.

Brit Butler il y a 13 ans
Parent
commit
b3455146ae
5 fichiers modifiés avec 111 ajouts et 7 suppressions
  1. 4 2
      README
  2. 99 0
      docs/coleslaw.html
  3. 4 3
      src/coleslaw.lisp
  4. 2 2
      src/feeds.lisp
  5. 2 0
      src/packages.lisp

+ 4 - 2
README

@@ -1,16 +1,18 @@
1 1
 Coleslaw aims to be flexible blog software suitable for replacing a single-user static site compiler such as Jekyll.
2 2
 
3
+Full docs coming soon...
4
+
3 5
 Features:
4 6
 * Git for storage
7
+* RSS feeds!
5 8
 * Plugins to...
6 9
 ** Import from wordpress
7 10
 ** Use Mathjax/LaTeX
8
-** Host on Amazon S3
9 11
 
10 12
 Forthcoming:
11 13
 * Markdown support
12 14
 * RST support
13
-* Atom or RSS feeds
15
+* Host on Amazon S3
14 16
 * Code highlighting
15 17
 
16 18
 References:

+ 99 - 0
docs/coleslaw.html

@@ -0,0 +1,99 @@
1
+
2
+<html lang="en">
3
+<head>
4
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+<title>API for COLESLAW</title>
6
+<style type="text/css" media="all">
7
+body {margin: 0 2em .5em 2em;font-family: Verdana,Arial,sans-serif;}
8
+.package {background: #efefef; 
9
+          padding: 1.5em 0 1em 0; 
10
+          text-align: center; 
11
+          font-size: x-large;}
12
+.definition {background: #efefef; padding: .3em 1em;}
13
+a.symbolname, a:visited.symbolname {font-weight: bold;}
14
+.initargs {font-size: small;}
15
+.slots {font-size: small;}
16
+div.label {border-bottom: 1px solid #efefef; margin-bottom: .5em}
17
+.symboldecl, .footer {margin: 0 2em 2em 2em;}
18
+.symbolname {font-weight: bold; color: gray;}
19
+.symboltype {font-style: italic;margin-left: 1.5em; font-size: smaller;}
20
+.documentation {color: gray; font-family: Fixed,monospace;margin: 0 0 1.5em 0.5em;}
21
+.packagedocumentation {color: gray; 
22
+                       font-family: Fixed,monospace;
23
+                       margin: 0 0 1.5em 0; 
24
+                       border: 1px solid #efefef; 
25
+                       padding-left: 1.5em;}
26
+.symbolcomments span {font-weight: bold;}
27
+.footer {font-size: x-small; text-align: right; margin-top: 2em; padding-top: 1em; border-top: 1px solid gray;}
28
+.undocumented {color: red; font-weight: bold;}
29
+a, a:visited {font-weight: bold; color: gray; text-decoration: none; font-weight: normal;}
30
+a:hover {border-bottom: 1px solid gray; }
31
+.label {font-weight: bold; font-style: italic;color: gray;}
32
+.labeltitle {font-weight: bold; font-style: italic;color: gray; border: 1px solid #efefef; padding: .25em;margin-bottom: .5em}
33
+.frame {marin-top: 1.5em}
34
+.expander {border: 2px solid #efefef; color: gray; 
35
+           font-weight: bold; 
36
+           font-family: Fixed,monospace; 
37
+           margin-right: .25em; padding: 0 .25em;cursor: pointer;}
38
+</style>
39
+<script type="text/javascript">
40
+function expand (expander, id) {
41
+var text = expander.innerHTML;
42
+if (text == '-')
43
+{
44
+  expander.innerHTML = '+';
45
+  document.getElementById(id).style.display = 'none';
46
+}
47
+else
48
+{
49
+  expander.innerHTML = '-';
50
+  document.getElementById(id).style.display = '';
51
+}
52
+}</script></head>
53
+<body>
54
+<div class="package">
55
+<div class="definition">API for package: 
56
+<a class="symbolname" name="coleslaw_package" href="#coleslaw_package">coleslaw</a></div></div>
57
+<div class="packagedocumentation">
58
+<pre>Homepage: <a href="http://github.com/redline6561/coleslaw">Github</a></pre></div>
59
+<div class="frame">
60
+<div class="labeltitle">
61
+<span class="expander" onclick="expand(this, 'functions');">-</span>Functions</div>
62
+<div id="functions">
63
+<div class="symboldecl">
64
+<div class="definition">
65
+<a class="symbolname" name="add-injection_func" href="#add-injection_func">add-injection</a>
66
+<span class="lambdalist">str location</span>
67
+<span class="symboltype">standard-generic-function</span></div>
68
+<div class="documentation">
69
+<pre>Add STR to the list of elements injected in LOCATION.</pre></div></div>
70
+<div class="symboldecl">
71
+<div class="definition">
72
+<a class="symbolname" name="deploy_func" href="#deploy_func">deploy</a>
73
+<span class="lambdalist">dir</span>
74
+<span class="symboltype">standard-generic-function</span></div>
75
+<div class="documentation">
76
+<pre>Deploy DIR, updating the .prev and .curr symlinks.</pre></div></div>
77
+<div class="symboldecl">
78
+<div class="definition">
79
+<a class="symbolname" name="main_func" href="#main_func">main</a>
80
+<span class="lambdalist"></span>
81
+<span class="symboltype">function</span></div>
82
+<div class="documentation">
83
+<pre>:undocumented</pre></div></div>
84
+<div class="symboldecl">
85
+<div class="definition">
86
+<a class="symbolname" name="render-content_func" href="#render-content_func">render-content</a>
87
+<span class="lambdalist">text format</span>
88
+<span class="symboltype">standard-generic-function</span></div>
89
+<div class="documentation">
90
+<pre>Compile TEXT from the given FORMAT to HTML for display.</pre></div></div>
91
+<div class="symboldecl">
92
+<div class="definition">
93
+<a class="symbolname" name="render-feed_func" href="#render-feed_func">render-feed</a>
94
+<span class="lambdalist"></span>
95
+<span class="symboltype">function</span></div>
96
+<div class="documentation">
97
+<pre>Render and write the feed for the site.</pre></div></div></div></div>
98
+<div class="footer">Generated by: 
99
+<a href="http://common-lisp.net/project/cl-api">CL-API</a></div></body></html>

+ 4 - 3
src/coleslaw.lisp

@@ -25,8 +25,9 @@ on files that match the given extension."
25 25
                      `,body))
26 26
              (list-directory ,path))))
27 27
 
28
-(defun render-page (path html)
29
-  "Populate the base template with the provided HTML and write it out to PATH."
28
+(defun render-page (path html &optional raw)
29
+  "Populate the base template with the provided HTML and write it out to PATH.
30
+If RAW is non-nil, write the content without wrapping it in the base template."
30 31
   (let ((filepath (merge-pathnames path (staging *config*))))
31 32
     (ensure-directories-exist filepath)
32 33
     (with-open-file (out filepath
@@ -43,7 +44,7 @@ on files that match the given extension."
43 44
                                                         (gethash :body *injections*))
44 45
                                     :license (license *config*)
45 46
                                     :credits (author *config*)))))
46
-        (write-line content out)))))
47
+        (write-line (if raw html content) out)))))
47 48
 
48 49
 (defun compile-blog ()
49 50
   "Compile the blog to a staging directory in /tmp."

+ 2 - 2
src/feeds.lisp

@@ -20,7 +20,7 @@
20 20
   (format nil "<![CDATA[ ~A ]]>" string))
21 21
 
22 22
 (defun render-feed ()
23
-  "Render and write the RSS feed for the site."
23
+  "Render and write the feed for the site."
24 24
   (let* ((posts (subseq (by-date (hash-table-values *posts*)) 0 10))
25 25
          (content (loop for post in posts
26 26
                      collect (list :title (post-title post)
@@ -34,4 +34,4 @@
34 34
                           :title (title *config*)
35 35
                           :siteroot (domain *config*)
36 36
                           :author (author *config*)
37
-                          :posts content))))
37
+                          :posts content)) t))

+ 2 - 0
src/packages.lisp

@@ -1,4 +1,5 @@
1 1
 (defpackage :coleslaw
2
+  (:documentation "Homepage: <a href=\"http://github.com/redline6561/coleslaw\">Github</a>")
2 3
   (:use :cl :closure-template)
3 4
   (:import-from :cl-fad #:delete-directory-and-files
4 5
                         #:list-directory)
@@ -10,4 +11,5 @@
10 11
   (:export #:main
11 12
            #:add-injection
12 13
            #:render-content
14
+           #:render-feed
13 15
            #:deploy))