Permalink
Browse files

Initial checkin

  • Loading branch information...
0 parents commit aebc845f9cf84e8621ac6953c1937399263ad747 @hugoduncan committed Feb 26, 2009
Showing with 5,035 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +14 −0 README
  3. +44 −0 cl-blog-generator.asd
  4. +13 −0 content/drafts/first.post
  5. +4 −0 content/drafts/schemas.xml
  6. +13 −0 content/drafts/second.post
  7. +13 −0 content/published/my_first_blog_post.xhtml
  8. +1 −0 content/published/my_second_blog_post.xhtml
  9. +4 −0 content/push_site.sh
  10. +1 −0 content/site/post/.gitpreserve
  11. +61 −0 content/template/index.xhtml
  12. +61 −0 content/template/post.xhtml
  13. +2 −0 dtd/generate_rnc.sh
  14. +31 −0 dtd/post-1.mod
  15. +18 −0 dtd/post-elements-1.mod
  16. +14 −0 dtd/post-elements-1.mod.rnc
  17. +272 −0 dtd/post-model-1.mod
  18. +176 −0 dtd/post-model-1.mod.rnc
  19. +61 −0 dtd/post-qname-1.mod
  20. +27 −0 dtd/post-qname-1.mod.rnc
  21. +53 −0 dtd/xhtml-attribs-1.mod.rnc
  22. +46 −0 dtd/xhtml-base-1.mod.rnc
  23. +86 −0 dtd/xhtml-blkphras-1.mod.rnc
  24. +35 −0 dtd/xhtml-blkpres-1.mod.rnc
  25. +40 −0 dtd/xhtml-blkstruct-1.mod.rnc
  26. +84 −0 dtd/xhtml-csismap-1.mod.rnc
  27. +74 −0 dtd/xhtml-datatypes-1.mod.rnc
  28. +50 −0 dtd/xhtml-edit-1.mod.rnc
  29. +209 −0 dtd/xhtml-form-1.mod.rnc
  30. +45 −0 dtd/xhtml-framework-1.mod.rnc
  31. +48 −0 dtd/xhtml-hypertext-1.mod.rnc
  32. +45 −0 dtd/xhtml-image-1.mod.rnc
  33. +87 −0 dtd/xhtml-inlphras-1.mod.rnc
  34. +65 −0 dtd/xhtml-inlpres-1.mod.rnc
  35. +62 −0 dtd/xhtml-inlstruct-1.mod
  36. +62 −0 dtd/xhtml-inlstruct-1.mod.1
  37. +44 −0 dtd/xhtml-inlstruct-1.mod.rnc
  38. +55 −0 dtd/xhtml-link-1.mod.rnc
  39. +72 −0 dtd/xhtml-list-1.mod.rnc
  40. +43 −0 dtd/xhtml-meta-1.mod.rnc
  41. +54 −0 dtd/xhtml-object-1.mod.rnc
  42. +46 −0 dtd/xhtml-param-1.mod.rnc
  43. +195 −0 dtd/xhtml-post.dtd
  44. +63 −0 dtd/xhtml-post.rnc
  45. +29 −0 dtd/xhtml-pres-1.mod.rnc
  46. +165 −0 dtd/xhtml-qname-1.mod.rnc
  47. +141 −0 dtd/xhtml-ruby-1.mod.rnc
  48. +53 −0 dtd/xhtml-script-1.mod.rnc
  49. +27 −0 dtd/xhtml-ssismap-1.mod.rnc
  50. +89 −0 dtd/xhtml-struct-1.mod.rnc
  51. +45 −0 dtd/xhtml-style-1.mod.rnc
  52. +205 −0 dtd/xhtml-table-1.mod.rnc
  53. +39 −0 dtd/xhtml-target-1.mod.rnc
  54. +52 −0 dtd/xhtml-text-1.mod
  55. +31 −0 dtd/xhtml-text-1.mod.rnc
  56. +250 −0 dtd/xhtml11-model-1.mod
  57. +167 −0 dtd/xhtml11-model-1.mod.rnc
  58. +46 −0 dtd/xhtml11.dtd
  59. +317 −0 dtd/xhtml11.dtd.1
  60. +146 −0 dtd/xhtml11.rnc
  61. +146 −0 dtd/xhtml111.rnc
  62. +3 −0 src/database.lisp
  63. +58 −0 src/elisp/blog-gen.el
  64. +5 −0 src/elisp/load-blog-gen.el
  65. +5 −0 src/package.lisp
  66. +351 −0 src/post.lisp
  67. +133 −0 template.mod
  68. +7 −0 test/blog.lisp
  69. +6 −0 test/package.lisp
  70. +21 −0 test/post.lisp
@@ -0,0 +1,5 @@
+#*#
+.#*
+content/site/*.xhtml
+content/site/post/*.xhtml
+*.fasl
14 README
@@ -0,0 +1,14 @@
+Blog generator in CL
+
+A blog is not really dynamic content, and so should be served as static, which means we can use a generator.
+
+drafts - contains our input
+published - contains published drafts
+site - contains processed version of the published articles
+
+We use a database for the metadata.
+
+We expect to be editting content in emacs
+
+
+We use the blog in content as a way of documenting progress :-)
@@ -0,0 +1,44 @@
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (unless (find-package :cl-blog-generator-system)
+ (defpackage #:cl-blog-generator-system
+ (:documentation "ASDF System package for Tiamat systems.")
+ (:use :common-lisp :asdf))))
+
+(in-package #:cl-blog-generator-system)
+
+(defsystem #:cl-blog-generator
+ :name "cl-blog-generator"
+ :author "Hugo Duncan <hugo@hugoduncan.org>"
+ :version "0.1"
+ :maintainer "Hugo Duncan <hugo@hugoduncan.org>"
+ :licence "Open source"
+ :description "A generator for blog sites."
+ :depends-on (:cxml :cl-fad :elephant)
+ :components
+ ((:module "src"
+ :components
+ ((:file "package" )
+ (:file "post" :depends-on ("package"))))))
+
+(defsystem #:cl-blog-generator-test
+ :name "cl-blog-generator-test"
+ :author "Hugo Duncan <hugo@hugoduncan.org>"
+ :depends-on (#:cl-blog-generator #:stefil)
+ :components
+ ((:module "test"
+ :components
+ ((:file "package")
+ (:file "post" :depends-on ("package"))))))
+
+(defmethod asdf:perform ((op asdf:test-op) (system (eql (find-system '#:cl-blog-generator))))
+ (declare (ignore op system))
+ (asdf:operate 'load-op :cl-blog-generator-test)
+ (in-package #:cl-blog-generator-test)
+ (declaim (optimize (debug 3)))
+ (warn "(declaim (optimize (debug 3))) was issued to help later C-c C-c'ing")
+ (eval (read-from-string "(stefil:funcall-test-with-feedback-message 'cl-blog-generator-test::test)"))
+ (values))
+
+(defmethod operation-done-p ((op test-op) (system (eql (find-system '#:cl-blog-generator))))
+ (declare (ignore op system))
+ nil)
@@ -0,0 +1,13 @@
+<?xml version="1.1" encoding="UTF-8" ?>
+<html xmlns="http://hugoduncan.org/xmlns/post">
+<head>
+ <title>My First Blog Post</title>
+ <when year="2009" month="02" day="24"/>
+ <tag>blog</tag>
+ <tag>lisp</tag>
+</head>
+<body>
+<p>My first post. Mainly to have something to use in developing the code.</p>
+<p>Getting this to validate was a pain. I thought I could simply add a couple of elements to xhtml, but it took much longer than expected.</p>
+</body>
+</html>
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
+ <uri pattern="*.post" uri="../../dtd/xhtml-post.rnc"/>
+</locatingRules>
@@ -0,0 +1,13 @@
+<?xml version="1.1" encoding="UTF-8" ?>
+<html xmlns="http://hugoduncan.org/xmlns/post">
+<head>
+ <title>My Second Blog Post</title>
+ <tag>blog</tag>
+ <tag>lisp</tag>
+ <tag>testing</tag>
+</head>
+<body>
+<p>My second post. Mainly to have something to use in developing the code.</p>
+<p>Getting this to validate was a pain. I thought I could simply add a couple of elements to xhtml, but it took much longer than expected.</p>
+</body>
+</html>
@@ -0,0 +1,13 @@
+<?xml version="1.1" encoding="UTF-8" ?>
+<html xmlns="http://hugoduncan.org/xmlns/post">
+<head>
+ <title>My First Blog Post</title>
+ <when year="2009" month="02" day="24"/>
+ <tag>blog</tag>
+ <tag>lisp</tag>
+</head>
+<body>
+<p>My first post. Mainly to have something to use in developing the code.</p>
+<p>Getting this to validate was a pain. I thought I could simply add a couple of elements to xhtml, but it took much longer than expected.</p>
+</body>
+</html>
@@ -0,0 +1 @@
+<html xmlns="http://hugoduncan.org/xmlns/post">&#10;<head>&#10; <title>My Second Blog Post</title><when day="26" month="2" year="2009"></when>&#10; <tag>blog</tag>&#10; <tag>lisp</tag>&#10; <tag>testing</tag>&#10;</head>&#10;<body>&#10;<p>My second post. Mainly to have something to use in developing the code.</p>&#10;<p>Getting this to validate was a pain. I thought I could simply add a couple of elements to xhtml, but it took much longer than expected.</p>&#10;</body>&#10;</html>
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+cd ~/projects/blog/content/site
+rsync -avz -e ssh ~/projects/blog/content/site/ bluehost:\~/public_html/blog
@@ -0,0 +1 @@
+# dummy file to preserve the directory in git
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head profile="http://gmpg.org/xfn/11 http://www.w3.org/2006/03/hcard">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<link rel='stylesheet' type='text/css' media='screen' title='sans' href='/sans.css' />
+<link rel='alternate stylesheet' type='text/css' media='screen' title='serif' href='/serif.css' />
+<script type='text/javascript' src='/site.js'></script>
+<link rel="openid.server" href="http://www.myopenid.com/server" />
+<link rel="openid.delegate" href="http://hugoduncan.myopenid.com/" />
+<link rel="meta" type="application/rdf+xml" title="FOAF" href="foaf.rdf" />
+<meta name="keywords" content="boost,c++,cavitation,propeller,artificial intelligence,sematic web"/>
+<meta name="description" content="Home page for Hugo Duncan, with current projects"/>
+<title>Hugo Duncan</title>
+</head>
+<body>
+<div id='banner'><h1>Hugo Duncan</h1><div id='search'><form action="http://www.google.com/search"><div>Search <input size="15" name="as_q" /><input type="hidden" name="hl" value="en" /><input type="hidden" name="ie" value="UTF-8" /><input type="hidden" name="btnG" value="Google+Search" /><input type="hidden" name="as_qdr" value="all" /><input type="hidden" name="as_occt" value="any" /><input type="hidden" name="as_dt" value="i" /><input type="hidden" name="as_sitesearch" value="hugoduncan.org" /></div></form></div></div>
+<div id='centercontent'>
+<div id='posts'/>
+<hr />
+<div id='footer'><p><b id='updated'>Updated: 2008/02/20</b><br />
+<a href='/' onclick="setActiveStyleSheet('serif')" onkeypress="setActiveStyleSheet('serif')" accesskey='p'>Serif</a> / <a href='/' onclick="setActiveStyleSheet('sans')" onkeypress="setActiveStyleSheet('sans')" accesskey='p'>Sans-Serif</a><br />
+</p>
+</div>
+</div>
+
+<div id='rightcontent'>
+<div class='oo'><a id='to-home' href='/'><span id='home'>home</span></a></div>
+ <a rel="me" href="about.xhtml">author</a> &#xb7;
+ <a rel="me" href="http://www.yellowfin.com">Yellowfin</a>
+<div class="vcard">
+ <a class="fn url" href="http://hugoduncan.org/">Hugo Duncan</a>
+ <div><a class="email" href="mailto:tabcdef@hugoduncan.org">
+ <span class="type">pref</span><span>erred email</span>
+ </a></div>
+</div>
+<div id="fonts">
+<hr />
+<a href="/"
+ onclick="setActiveStyleSheet('serif')"
+ onkeypress = "setActiveStyleSheet('serif')"
+ accesskey="p" id="serif">Serif</a> &#xb7;
+<a href="/"
+ onclick="setActiveStyleSheet('sans')"
+ onkeypress = "setActiveStyleSheet('sans')"
+ accesskey="p" id="sans">Sans-Serif</a>
+<hr />
+</div>
+</div>
+
+
+<script type='text/javascript'>
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type='text/javascript'>
+var pageTracker = _gat._getTracker("UA-3688366-1");
+pageTracker._initData();
+pageTracker._trackPageview();
+</script>
+</body>
+</html>
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head profile="http://gmpg.org/xfn/11 http://www.w3.org/2006/03/hcard">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<link rel='stylesheet' type='text/css' media='screen' title='sans' href='/sans.css' />
+<link rel='alternate stylesheet' type='text/css' media='screen' title='serif' href='/serif.css' />
+<script type='text/javascript' src='/site.js'></script>
+<link rel="openid.server" href="http://www.myopenid.com/server" />
+<link rel="openid.delegate" href="http://hugoduncan.myopenid.com/" />
+<link rel="meta" type="application/rdf+xml" title="FOAF" href="foaf.rdf" />
+<meta name="keywords" content="boost,c++,cavitation,propeller,artificial intelligence,sematic web"/>
+<meta name="description" content="Home page for Hugo Duncan, with current projects"/>
+<title>Hugo Duncan : </title>
+</head>
+<body>
+<div id='banner'><h1>Hugo Duncan</h1><div id='search'><form action="http://www.google.com/search"><div>Search <input size="15" name="as_q" /><input type="hidden" name="hl" value="en" /><input type="hidden" name="ie" value="UTF-8" /><input type="hidden" name="btnG" value="Google+Search" /><input type="hidden" name="as_qdr" value="all" /><input type="hidden" name="as_occt" value="any" /><input type="hidden" name="as_dt" value="i" /><input type="hidden" name="as_sitesearch" value="hugoduncan.org" /></div></form></div></div>
+<div id='centercontent'>
+<div id='post'/>
+<hr />
+<div id='footer'><p><b id='updated'>Updated: 2008/02/20</b><br />
+<a href='/' onclick="setActiveStyleSheet('serif')" onkeypress="setActiveStyleSheet('serif')" accesskey='p'>Serif</a> / <a href='/' onclick="setActiveStyleSheet('sans')" onkeypress="setActiveStyleSheet('sans')" accesskey='p'>Sans-Serif</a><br />
+</p>
+</div>
+</div>
+
+<div id='rightcontent'>
+<div class='oo'><a id='to-home' href='/'><span id='home'>home</span></a></div>
+ <a rel="me" href="about.xhtml">author</a> &#xb7;
+ <a rel="me" href="http://www.yellowfin.com">Yellowfin</a>
+<div class="vcard">
+ <a class="fn url" href="http://hugoduncan.org/">Hugo Duncan</a>
+ <div><a class="email" href="mailto:tabcdef@hugoduncan.org">
+ <span class="type">pref</span><span>erred email</span>
+ </a></div>
+</div>
+<div id="fonts">
+<hr />
+<a href="/"
+ onclick="setActiveStyleSheet('serif')"
+ onkeypress = "setActiveStyleSheet('serif')"
+ accesskey="p" id="serif">Serif</a> &#xb7;
+<a href="/"
+ onclick="setActiveStyleSheet('sans')"
+ onkeypress = "setActiveStyleSheet('sans')"
+ accesskey="p" id="sans">Sans-Serif</a>
+<hr />
+</div>
+</div>
+
+
+<script type='text/javascript'>
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type='text/javascript'>
+var pageTracker = _gat._getTracker("UA-3688366-1");
+pageTracker._initData();
+pageTracker._trackPageview();
+</script>
+</body>
+</html>
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+java -jar ~/src/trang/trang-20081028/trang.jar -I dtd -O rnc xhtml-post.dtd xhtml-post.rnc
@@ -0,0 +1,31 @@
+
+
+<!-- Define the global namespace attributes -->
+<![%Post.prefixed;[
+<!ENTITY % Post.xmlns.attrib
+ "%NS.decl.attrib;"
+>
+]]>
+<!ENTITY % Post.xmlns.attrib
+ "%NS.decl.attrib;
+ xmlns %URI.datatype; #FIXED '%Post.xmlns;'"
+>
+
+<!-- Define a common set of attributes for all module elements -->
+<!ENTITY % Post.Common.attrib
+ "%Post.xmlns.attrib;
+ id ID #IMPLIED"
+>
+
+<!-- Define the elements and attributes of the module -->
+<!ELEMENT %Post.tag.qname; >
+<!ATTLIST %Post.tag.qname;
+ %Post.Common.attrib; >
+
+<!ELEMENT %Post.when.qname; >
+<!ATTLIST %Post.when.qname;
+ year CDATA #IMPLIED
+ month CDATA #IMPLIED
+ day CDATA #IMPLIED
+ %Post.Common.attrib;>
+
@@ -0,0 +1,18 @@
+<!-- Define the elements and attributes of the module -->
+<!ELEMENT %Post.when.qname; EMPTY >
+<!ATTLIST %Post.when.qname;
+ year CDATA #IMPLIED
+ month CDATA #IMPLIED
+ day CDATA #IMPLIED
+ %Post.Common.attrib;>
+
+<!ELEMENT %Post.tag.qname; (#PCDATA) >
+<!ATTLIST %Post.tag.qname;
+ %Post.Common.attrib; >
+
+<!-- Model for our module - how our dtd patches into xhtml -->
+
+<!ENTITY % HeadOpts.mix
+ "( %script.qname; | %style.qname; | %meta.qname;
+ | %link.qname; | %object.qname; | %Post.tag.qname; | %Post.when.qname; )*"
+>
@@ -0,0 +1,14 @@
+# Define the elements and attributes of the module
+
+default namespace = "http://hugoduncan.org/xmlns/post"
+
+when = element when { when.attlist, empty }
+when.attlist &=
+ attribute year { text }?,
+ attribute month { text }?,
+ attribute day { text }?,
+ Post.Common.attrib
+tag = element tag { tag.attlist, text }
+tag.attlist &= Post.Common.attrib
+# Model for our module - how our dtd patches into xhtml
+HeadOpts.mix = (script | style | meta | link | object | tag | when)*
Oops, something went wrong.

0 comments on commit aebc845

Please sign in to comment.