docs: build site with hakyll

This commit is contained in:
Simon Michael 2010-05-17 14:33:05 +00:00
parent c794616c91
commit 7dcb91a70f
13 changed files with 140 additions and 51 deletions

View File

@ -1,3 +1,6 @@
---
title: hledger Contributor List and Agreement
---
hledger Contributor List and Agreement
======================================

View File

@ -1,3 +1,6 @@
---
title: hledger manual
---
hledger manual
==============
@ -9,7 +12,7 @@ A tip: on hledger.org, these docs are also available with .pdf suffix.
User Guide
----------
::::::::::
Introduction
............
@ -161,7 +164,7 @@ For more details, see `File format compatibility <#file-format-compatibility>`_.
Reference
---------
:::::::::
Overview
........

View File

@ -20,8 +20,6 @@ COVCMD=test
BENCHEXES=hledger-0.7 hledger-0.8 ledger-3pre
# misc. tools
PANDOC=pandoc
RST2HTML=rst2html
RST2PDF=rst2pdf
#VIEWHTML=open
VIEWHTML=open -a 'Google Chrome'
@ -277,17 +275,27 @@ cleandocs:
rm -rf website/[A-Z]*.html website/api-doc/*
# rebuild all docs
docs: html pdf apidocs
docs: site apidocs
# build the hledger.org website
# Requires hakyll (cabal install hakyll)
site: website/hakyll
cd website; ./hakyll build
cd website/_site; ln -sf README.html index.html
website/hakyll: website/hakyll.hs
cd website; ghc --make hakyll.hs
viewsite: site
$(VIEWHTML) website/_site/index.html
# generate html versions of docs (and the hledger.org website)
# work around pandoc not handling full rst image directive
html:
for d in $(DOCFILES); do $(PANDOC) --toc -s -H website/header.html -A website/footer.html -r rst $$d >website/$$d.html; done
cd website && ln -sf ../SCREENSHOTS && $(RST2HTML) SCREENSHOTS >SCREENSHOTS.html && rm -f SCREENSHOTS
cd website; rm -f index.html; ln -s README.html index.html; rm -f profs; ln -s ../profs
# html:
# for d in $(DOCFILES); do $(PANDOC) --toc -s -H website/header.html -A website/footer.html -r rst $$d >website/$$d.html; done
# cd website && ln -sf ../SCREENSHOTS && $(RST2HTML) SCREENSHOTS >SCREENSHOTS.html && rm -f SCREENSHOTS
# cd website; rm -f index.html; ln -s README.html index.html; rm -f profs; ln -s ../profs
viewhtml: html
$(VIEWHTML) website/index.html
pdf: docspdf codepdf
@ -314,7 +322,7 @@ printall: pdf
$(PRINT) $(PDFS)
# push latest docs etc. and update the hledger.org site
site: push
pushdocs: push
ssh joyful.com 'make -C/repos/hledger docs'
# generate api docs

View File

@ -1,3 +1,6 @@
---
title: hledger news
---
hledger news
============

View File

@ -1,3 +1,6 @@
---
title: hledger
---
hledger
=======

View File

@ -1,3 +1,6 @@
---
title: hledger for techies
---
hledger for techies
===================

View File

@ -1,10 +1,13 @@
---
title: hledger screenshots
---
hledger screenshots
===================
.. ....................................................................
.. raw:: html
<br><br><a name=hledger-screen-1>
<a name=hledger-screen-1>
Basic command-line reports, like ledger:

View File

@ -1,4 +0,0 @@
<div id="footer">
<hr>
&copy; 2007-2010 <a href="http://joyful.com/">Simon Michael</a> and contributors
</div>

32
website/hakyll.hs Normal file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env runhaskell
import Control.Monad (forM_)
import Control.Monad.Trans (liftIO)
import System.Process
import Text.Hakyll (hakyll)
import Text.Hakyll.Render
import Text.Hakyll.CreateContext (createPage, createCustomPage, createListing)
import Text.Printf
main = hakyll "http://hledger.org" $ do
mapM_ renderParentDirPage
["README.rst"
,"README2.rst"
,"NEWS.rst"
,"SCREENSHOTS.rst"
,"MANUAL.rst"
,"CONTRIBUTORS.rst"
]
mapM_ static
["style.css"
,"sshot.png"
,"watchhours.png"
,"hledger-screen-1.png"
,"hledger-charts-2.png"
]
-- Render a page from the parent directory as if it was in the hakyll
-- root dir, setting up a symbolic link when needed.
renderParentDirPage p = do
liftIO $ system $ printf "[ -f %s ] || ln -s ../%s" p p
renderChain ["site.tmpl"] $ createPage p

View File

@ -1,10 +0,0 @@
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
<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">
try {
var pageTracker = _gat._getTracker("UA-3456280-3");
pageTracker._trackPageview();
} catch(err) {}</script>

View File

@ -1,11 +0,0 @@
<html>
<head><base target="main"></head>
<body>
<div id="search" style="whitespace:no-wrap;">
<form action="." method="get">
<input name="hoogle" id="hoogle" type="text" value="" size="25" maxlength="100" />
<input id="submit" type="submit" value="Hoogle" />
</div>
</form>
</body>
</html>

40
website/site.tmpl Normal file
View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>hledger.org - $title</title>
<link rel="stylesheet" type="text/css" href="$root/style.css" />
</head>
<body>
<div style="text-align:center;">
<!-- <a href="$root/"><img src="$root/logo.jpg" border="0" ALT="" /></a> -->
</div>
<div id="navigation">
<a href="$root/README.html">Intro</a>
<a href="$root/README2.html">Techie Intro</a>
<a href="$root/MANUAL.html">Manual</a>
<a href="$root/SCREENSHOTS.html">Screenshots</a>
<a href="$root/NEWS.html">News</a>
</div>
$body
<div id="footer">
<hr />
&copy; 2007-2010 <a href="http://joyful.com/">Simon Michael</a> and contributors
</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">
try {
var pageTracker = _gat._getTracker("UA-3456280-3");
pageTracker._trackPageview();
} catch(err) {}
</script>
</body>
</html>

View File

@ -6,6 +6,22 @@ body {
font-family: "helvetica","arial", "sans serif";
}
div#navigation {
/* text-align: center; */
/* border-bottom: 4px solid #226600; */
}
div#navigation a {
color: white;
font-weight:bold;
font-family:sans-serif;
/* font-size:small; */
text-decoration: none;
background-color: #226600;
padding: 3px 10px 3px 10px;
margin: 0 5px 0 0;
}
#footer {
padding-top: 1em;
/* font-size: 70%; */
@ -22,23 +38,23 @@ code {
margin: 0 auto;
width: 700px;
}
h1.title {
font-size: 3.8em;
h1 {
font-size: 3em;
/* color: #49637C; */
color: #226600;
/* color: #226600; */
margin-bottom: 3px;
text-align: left;
}
h1 {
margin-top:1em;
text-align: left;
}
h1 .small {
font-size: 0.4em;
}
h1 a {
text-decoration: none;
}
/* h1 { */
/* margin-top:1em; */
/* text-align: left; */
/* } */
/* h1 .small { */
/* font-size: 0.4em; */
/* } */
/* h1 a { */
/* text-decoration: none; */
/* } */
h2 {
font-size: 1.5em;
}