Permalink
Browse files

Rough code for initializing wikidata if it doesn't exist.

Note:  the markup help is screwed up because the HTML gets
stripped out. Redo with a grid table.

Also, we'll eventually need a wizard to create a config
directory.
  • Loading branch information...
1 parent 96a07bc commit 6d0c4b80881254a9386c0cc7a3c723403da4bff2 @jgm committed Mar 13, 2013
Showing with 637 additions and 19 deletions.
  1. +4 −1 Makefile
  2. +12 −0 data/FrontPage.page
  3. +125 −0 data/Help.page
  4. +32 −0 data/markup.HTML
  5. +63 −0 data/markup.LaTeX
  6. +198 −0 data/markup.Markdown
  7. +42 −0 data/markup.RST
  8. +85 −0 data/post-update
  9. +11 −1 gitit2.cabal
  10. +65 −17 src/gitit2.hs
View
5 Makefile
@@ -1,8 +1,11 @@
-.PHONY : all clean veryclean
+.PHONY : all clean veryclean install
all:
cabal-dev configure && cabal-dev build
+install:
+ cabal-dev install
+
prep:
cabal-dev install-deps
View
12 data/FrontPage.page
@@ -0,0 +1,12 @@
+# Welcome to Gitit!
+
+This is the front page of your new gitit wiki. You can edit this
+page by clicking on the "edit" tab at the top of the screen.
+For instructions on how to make a link to another wiki page, see [the
+Help page](Help#wiki-links). To create a new wiki page, just create a
+link to it and follow the link.
+
+Help is always available through the "Help" link in the sidebar.
+More details on installing and configurating gitit are available
+in the [Gitit User’s Guide]().
+
View
125 data/Help.page
@@ -0,0 +1,125 @@
+# Navigating
+
+The most natural way of navigating is by clicking wiki links that
+connect one page with another. The "Front page" link in the navigation
+bar will always take you to the Front Page of the wiki. The "All pages"
+link will take you to a list of all pages on the wiki (organized into
+folders if directories are used). Alternatively, you can search using
+the search box. Note that the search is set to look for whole words, so
+if you are looking for "gremlins", type that and not "gremlin".
+The "go" box will take you directly to the page you type.
+
+# Creating and modifying pages
+
+## Registering for an account
+
+In order to modify pages, you'll need to be logged in. To register
+for an account, just click the "register" button in the bar on top
+of the screen. You'll be asked to choose a username and a password,
+which you can use to log in in the future by clicking the "login"
+button. While you are logged in, these buttons are replaced by
+a "logout so-and-so" button, which you should click to log out
+when you are finished.
+
+Note that logins are persistent through session cookies, so if you
+don't log out, you'll still be logged in when you return to the
+wiki from the same browser in the future.
+
+## Editing a page
+
+To edit a page, just click the "edit" button at the bottom right corner
+of the page.
+
+You can click "Preview" at any time to see how your changes will look.
+Nothing is saved until you press "Save."
+
+Note that you must provide a description of your changes. This is to
+make it easier for others to see how a wiki page has been changed.
+
+## Page metadata
+
+Pages may optionally begin with a metadata block. Here is an example:
+
+ ---
+ format: latex+lhs
+ categories: haskell math
+ toc: no
+ title: Haskell and
+ Category Theory
+ ...
+
+ \section{Why Category Theory?}
+
+The metadata block consists of a list of key-value pairs, each on a
+separate line. If needed, the value can be continued on one or more
+additional line, which must begin with a space. (This is illustrated by
+the "title" example above.) The metadata block must begin with a line
+`---` and end with a line `...` optionally followed by one or more blank
+lines.
+
+Currently the following keys are supported:
+
+format
+: Overrides the default page type as specified in the configuration file.
+ Possible values are `markdown`, `rst`, `latex`, `html`, `markdown+lhs`,
+ `rst+lhs`, `latex+lhs`. (Capitalization is ignored, so you can also
+ use `LaTeX`, `HTML`, etc.) The `+lhs` variants indicate that the page
+ is to be interpreted as literate Haskell. If this field is missing,
+ the default page type will be used.
+
+categories
+: A space or comma separated list of categories to which the page belongs.
+
+toc
+: Overrides default setting for table-of-contents in the configuration file.
+ Values can be `yes`, `no`, `true`, or `false` (capitalization is ignored).
+
+title
+: By default the displayed page title is the page name. This metadata element
+ overrides that default.
+
+## Creating a new page
+
+To create a new page, just create a wiki link that links to it, and
+click the link. If the page does not exist, you will be editing it
+immediately.
+
+## Reverting to an earlier version
+
+If you click the "history" button at the bottom of the page, you will
+get a record of previous versions of the page. You can see the differences
+between two versions by dragging one onto the other; additions will be
+highlighted in yellow, and deletions will be crossed out with a horizontal
+line. Clicking on the description of changes will take you to the page
+as it existed after those changes. To revert the page to the revision
+you're currently looking at, just click the "revert" button at the bottom
+of the page, then "Save".
+
+## Deleting a page
+
+The "delete" button at the bottom of the page will delete a page. Note
+that deleted pages can be recovered, since a record of them will still be
+accessible via the "activity" button on the top of the page.
+
+# Uploading files
+
+To upload a file--a picture, a PDF, or some other resource--click the
+"upload" button in the navigation bar. You will be prompted to select
+the file to upload. As with edits, you will be asked to provide a
+description of the resource (or of the change, if you are overwriting
+an existing file).
+
+Often you may leave "Name on wiki" blank, since the existing name of the
+file will be used by default. If that isn't desired, supply a name.
+Note that uploaded files *must* include a file extension (e.g. `.pdf`).
+
+If you are providing a new version of a file that already exists on the
+wiki, check the box "Overwrite existing file." Otherwise, leave it
+unchecked.
+
+To link to an uploaded file, just use its name in a regular wiki link.
+For example, if you uploaded a picture `fido.jpg`, you can insert the
+picture into a (markdown-formatted) page as follows: `![fido](fido.jpg)`.
+If you uploaded a PDF `projection.pdf`, you can insert a link to it
+using: `[projection](projection.pdf)`.
+
View
32 data/markup.HTML
@@ -0,0 +1,32 @@
+# Markup
+
+The syntax for wiki pages is standard XHTML. All tags must be
+properly closed.
+
+## Wiki links
+
+Links to other wiki pages are formed this way:
+`<a href="">Page Name</a>`. (Gitit converts links with empty
+targets into wikilinks.)
+
+To link to a wiki page using something else as the link text:
+`<a href="Page+Name">something else</a>`.
+
+Note that page names may contain spaces and some special
+characters. They need not be CamelCase. CamelCase words are *not*
+automatically converted to wiki links.
+
+Wiki pages may be organized into directories. So, if you have
+several pages on wine, you may wish to organize them like so:
+
+ Wine/Pinot Noir
+ Wine/Burgundy
+ Wine/Cabernet Sauvignon
+
+Note that a wiki link `<a href="">Burgundy</a>` that occurs inside
+the `Wine` directory will link to `Wine/Burgundy`, and not to
+`Burgundy`. To link to a top-level page called `Burgundy`, you'd
+have to use `<a href="/Burgundy">Burgundy</a>`.
+
+To link to a directory listing for a subdirectory, use a trailing
+slash: `<a href="">Wine/</a>` will link to a listing of the `Wine` subdirectory.
View
63 data/markup.LaTeX
@@ -0,0 +1,63 @@
+# Markup
+
+This wiki's pages are written in (a subset of) [LaTeX].
+
+ [LaTeX]: http://www.latex-project.org/
+
+The following commands and environments are recognized:
+
+- `\emph{emphasis}`
+
+- `\textbf{bold}`
+
+- `verb!verbatim@@\#!`
+
+- `\textsubscr{2}`
+
+- `\sout{strikeout}`
+
+- `\textsuperscript{2}`
+
+- `$e = mc^2$`
+
+- `$$e = mc^2$$`
+
+- `\footnote{a footnote}`
+
+- `\section{section}`, `\subsection{subsection}`, etc.
+
+- `\begin{quote} . . . \end{quote}`
+
+- `\begin{verbatim} . . . \end{verbatim}`
+
+- `\begin{itemize} . . . \end{itemize}`
+
+- `\begin{enumerate} . . . \end{enumerate}`
+
+## Wiki links
+
+Links to other wiki pages are formed this way: `\href{}{Page Name}`.
+(Gitit converts markdown links with empty targets into wikilinks.)
+
+To link to a wiki page using something else as the link text:
+`\href{Page Name}{Something else}`.
+
+Note that page names may contain spaces and some special
+characters. They need not be CamelCase. CamelCase words are *not*
+automatically converted to wiki links.
+
+Wiki pages may be organized into directories. So, if you have
+several pages on wine, you may wish to organize them like so:
+
+ Wine/Pinot Noir
+ Wine/Burgundy
+ Wine/Cabernet Sauvignon
+
+Note that a wiki link `\href{}{Burgundy}` that occurs inside the `Wine`
+directory will link to `Wine/Burgundy`, and not to `Burgundy`. To
+link to a top-level page called `Burgundy`, you'd have to use
+`\href{/Burgundy}{Burgundy}`.
+
+To link to a directory listing for a subdirectory, use a trailing
+slash: `\href{}{Wine/}` will link to a listing of the `Wine` subdirectory.
+
View
198 data/markup.Markdown
@@ -0,0 +1,198 @@
+# Markdown
+
+This wiki's pages are written in [pandoc]'s extended form of [markdown].
+If you're not familiar with markdown, you should start by looking
+at the [markdown "basics" page] and the [markdown syntax description].
+Consult the [pandoc User's Guide] for information about pandoc's syntax
+for footnotes, tables, description lists, and other elements not present
+in standard markdown.
+
+[pandoc]: http://johnmacfarlane.net/pandoc
+[pandoc User's Guide]: http://johnmacfarlane.net/pandoc/README.html
+[markdown]: http://daringfireball.net/projects/markdown
+[markdown "basics" page]: http://daringfireball.net/projects/markdown/basics
+[markdown syntax description]: http://daringfireball.net/projects/markdown/syntax
+
+Markdown is pretty intuitive, since it is based on email conventions.
+Here are some examples to get you started:
+
+<table>
+<tr>
+<td>`*emphasized text*`</td>
+<td>*emphasized text*</td>
+</tr>
+<tr>
+<td>`**strong emphasis**`</td>
+<td>**strong emphasis**</td>
+</tr>
+<tr>
+<td>`` `literal text` ``</td>
+<td>`literal text`</td>
+</tr>
+<tr>
+<td>`\*escaped special characters\*`</td>
+<td>\*escaped special characters\*</td>
+</tr>
+<tr>
+<td>`[external link](http://google.com)`</td>
+<td>[external link](http://google.com)</td>
+</tr>
+<tr>
+<td>`![folder](/img/icons/folder.png)`</td>
+<td>![folder](/img/icons/folder.png)</td>
+</tr>
+<tr>
+<td>Wikilink: `[Front Page]()`</td>
+<td>Wikilink: [Front Page]()</td>
+</tr>
+<tr>
+<td>`H~2~O`</td>
+<td>H~2~O</td>
+</tr>
+<tr>
+<td>`10^100^`</td>
+<td>10^100^</td>
+</tr>
+<tr>
+<td>`~~strikeout~~`</td>
+<td>~~strikeout~~</td>
+</tr>
+<tr>
+<td>
+`$x = \frac{{ - b \pm \sqrt {b^2 - 4ac} }}{{2a}}$`
+</td>
+<td>
+$x = \frac{{ - b \pm \sqrt {b^2 - 4ac} }}{{2a}}$^[If this looks like
+code, it's because jsMath is
+not installed on your system. Contact your administrator to request it.]
+</td>
+</tr>
+<tr>
+<td>
+`A simple footnote.^[Or is it so simple?]`
+</td>
+<td>
+A simple footnote.^[Or is it so simple?]
+</td>
+</tr>
+<tr>
+<td>
+<pre>
+> an indented paragraph,
+> usually used for quotations
+</pre>
+</td>
+<td>
+
+> an indented paragraph,
+> usually used for quotations
+
+</td>
+<tr>
+<td>
+<pre>
+ #!/bin/sh -e
+ # code, indented four spaces
+ echo "Hello world"
+</pre>
+</td>
+<td>
+
+ #!/bin/sh -e
+ # code, indented four spaces
+ echo "Hello world"
+
+</td>
+</tr>
+<tr>
+<td>
+<pre>
+* a bulleted list
+* second item
+ - sublist
+ - and more
+* back to main list
+ 1. this item has an ordered
+ 2. sublist
+ a) you can also use letters
+ b) another item
+</pre>
+</td>
+<td>
+
+* a bulleted list
+* second item
+ - sublist
+ - and more
+* back to main list
+ 1. this item has an ordered
+ 2. sublist
+ a) you can also use letters
+ b) another item
+
+</td>
+</tr>
+<tr>
+<td>
+<pre>
+Fruit Quantity
+-------- -----------
+apples 30,200
+oranges 1,998
+pears 42
+
+Table: Our fruit inventory
+</pre>
+</td>
+<td>
+
+Fruit Quantity
+-------- -----------
+apples 30,200
+oranges 1,998
+pears 42
+
+Table: Our fruit inventory
+
+</td>
+</tr>
+</table>
+
+For headings, prefix a line with one or more `#` signs: one for a major heading,
+two for a subheading, three for a subsubheading. Be sure to leave space before
+and after the heading.
+
+ # Markdown
+
+ Text...
+
+ ## Some examples...
+
+ Text...
+
+## Wiki links
+
+Links to other wiki pages are formed this way: `[Page Name]()`.
+(Gitit converts markdown links with empty targets into wikilinks.)
+
+To link to a wiki page using something else as the link text:
+`[something else](Page Name)`.
+
+Note that page names may contain spaces and some special characters.
+They need not be CamelCase. CamelCase words are *not* automatically
+converted to wiki links.
+
+Wiki pages may be organized into directories. So, if you have
+several pages on wine, you may wish to organize them like so:
+
+ Wine/Pinot Noir
+ Wine/Burgundy
+ Wine/Cabernet Sauvignon
+
+Note that a wiki link `[Burgundy]()` that occurs inside the `Wine`
+directory will link to `Wine/Burgundy`, and not to `Burgundy`.
+To link to a top-level page called `Burgundy`, you'd have to use
+`[Burgundy](/Burgundy)`.
+
+To link to a directory listing for a subdirectory, use a trailing
+slash: `[Wine/]()` will link to a listing of the `Wine` subdirectory.
View
42 data/markup.RST
@@ -0,0 +1,42 @@
+# Markup
+
+This wiki's pages are written in [reStructuredText]. If you're
+not familiar with reStructuredText, you should start by looking at
+the [primer] and the [quick reference guide]. Note that not all
+reStructuredText constructs are currently supported. Use the
+preview button if you're in doubt.
+
+ [reStructuredText]: http://docutils.sourceforge.net/rst.html
+ [primer]: http://docutils.sourceforge.net/docs/user/rst/quickstart.html
+ [quick reference guide]: http://docutils.sourceforge.net/docs/user/rst/quickref.html
+
+## Wiki links
+
+Links to other wiki pages are formed this way: `` `Page Name <>`_ ``.
+(Gitit converts markdown links with empty targets into wikilinks.)
+
+To link to a wiki page using something else as the link text:
+either `` `something else <Page+Name>`_ `` or
+
+ `something else`_
+
+ .. _`something else`: Page Name
+
+Note that page names may contain spaces and some special
+characters. They need not be CamelCase. CamelCase words are *not*
+automatically converted to wiki links.
+
+Wiki pages may be organized into directories. So, if you have
+several pages on wine, you may wish to organize them like so:
+
+ Wine/Pinot Noir
+ Wine/Burgundy
+ Wine/Cabernet Sauvignon
+
+Note that a wiki link `` `Burgundy <>`_ `` that occurs inside the `Wine`
+directory will link to `Wine/Burgundy`, and not to `Burgundy`. To
+link to a top-level page called `Burgundy`, you'd have to use
+`` `Burgundy </Burgundy>`_ ``.
+
+To link to a directory listing for a subdirectory, use a trailing
+slash: `` `Wine/ <>`_ `` will link to a listing of the `Wine` subdirectory.
View
85 data/post-update
@@ -0,0 +1,85 @@
+#!/bin/sh
+#
+# This hook does two things:
+#
+# 1. update the "info" files that allow the list of references to be
+# queries over dumb transports such as http
+#
+# 2. if this repository looks like it is a non-bare repository, and
+# the checked-out branch is pushed to, then update the working copy.
+# This makes "push" function somewhat similarly to darcs and bzr.
+#
+# To enable this hook, make this file executable by "chmod +x post-update".
+
+git update-server-info
+
+is_bare=$(git config --get --bool core.bare)
+
+if [ -z "$is_bare" ]
+then
+ # for compatibility's sake, guess
+ git_dir_full=$(cd $GIT_DIR; pwd)
+ case $git_dir_full in */.git) is_bare=false;; *) is_bare=true;; esac
+fi
+
+update_wc() {
+ ref=$1
+ echo "Push to checked out branch $ref" >&2
+ if [ ! -f $GIT_DIR/logs/HEAD ]
+ then
+ echo "E:push to non-bare repository requires a HEAD reflog" >&2
+ exit 1
+ fi
+ if (cd $GIT_WORK_TREE; git diff-files -q --exit-code >/dev/null)
+ then
+ wc_dirty=0
+ else
+ echo "W:unstaged changes found in working copy" >&2
+ wc_dirty=1
+ desc="working copy"
+ fi
+ if git diff-index --cached HEAD@{1} >/dev/null
+ then
+ index_dirty=0
+ else
+ echo "W:uncommitted, staged changes found" >&2
+ index_dirty=1
+ if [ -n "$desc" ]
+ then
+ desc="$desc and index"
+ else
+ desc="index"
+ fi
+ fi
+ if [ "$wc_dirty" -ne 0 -o "$index_dirty" -ne 0 ]
+ then
+ new=$(git rev-parse HEAD)
+ echo "W:stashing dirty $desc - see git-stash(1)" >&2
+ ( trap 'echo trapped $$; git symbolic-ref HEAD "'"$ref"'"' 2 3 13 15 ERR EXIT
+ git update-ref --no-deref HEAD HEAD@{1}
+ cd $GIT_WORK_TREE
+ git stash save "dirty $desc before update to $new";
+ git symbolic-ref HEAD "$ref"
+ )
+ fi
+
+ # eye candy - show the WC updates :)
+ echo "Updating working copy" >&2
+ (cd $GIT_WORK_TREE
+ git diff-index -R --name-status HEAD >&2
+ git reset --hard HEAD)
+}
+
+if [ "$is_bare" = "false" ]
+then
+ active_branch=`git symbolic-ref HEAD`
+ export GIT_DIR=$(cd $GIT_DIR; pwd)
+ GIT_WORK_TREE=${GIT_WORK_TREE-..}
+ for ref
+ do
+ if [ "$ref" = "$active_branch" ]
+ then
+ update_wc $ref
+ fi
+ done
+fi
View
12 gitit2.cabal
@@ -13,7 +13,8 @@ stability: Experimental
cabal-version: >= 1.8
build-type: Simple
homepage: http://gitit.net
-data-files: messages/en.msg
+data-files: README.markdown
+ messages/en.msg
config/settings.yaml
config/favicon.ico
config/robots.txt
@@ -29,6 +30,13 @@ data-files: messages/en.msg
static/css/hk-pyg.css
static/css/print.css
static/css/screen.css
+ data/FrontPage.page
+ data/Help.page
+ data/markup.Markdown
+ data/markup.RST
+ data/markup.HTML
+ data/markup.LaTeX
+ data/post-update
flag executable
description: Build the gitit executable.
@@ -104,8 +112,10 @@ executable gitit2
, bytestring >= 0.9 && < 1.0
, warp >= 1.3 && < 1.4
, text >= 0.11 && < 0.12
+ , filepath >= 1.3 && < 1.4
, directory >= 1.1 && < 1.3
, network >= 2.3 && < 2.5
+ , pandoc >= 1.10 && < 1.12
, pandoc-types >= 1.10 && < 1.11
, syb >= 0.3 && < 0.5
, gitit2
View
82 src/gitit2.hs
@@ -8,7 +8,10 @@ import Network.Wai.Handler.Warp
import Data.FileStore
import Data.Yaml
import Control.Applicative
-import Control.Monad (when)
+import Text.Pandoc
+import qualified Text.Pandoc.UTF8 as UTF8
+import System.FilePath ((<.>), (</>))
+import Control.Monad (when, unless)
import System.Directory (removeDirectoryRecursive, doesDirectoryExist)
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as M
@@ -18,9 +21,10 @@ import Data.Text (Text)
import qualified Data.Text as T
import Prelude hiding (catch)
import Control.Exception (catch, SomeException)
+import qualified Data.Set as Set
+import Paths_gitit2 (getDataFileName)
-- TODO only for samplePlugin
import Data.Generics
-import Text.Pandoc.Definition
data Master = Master { getGitit :: Gitit, maxUploadSize :: Int }
mkYesod "Master" [parseRoutes|
@@ -175,11 +179,13 @@ main = do
Left e -> err 3 $ "Error reading configuration file.\n" ++ e
Right x -> parseMonad parseConfig x
let repopath = cfg_repository_path conf
+ repoexists <- doesDirectoryExist repopath
fs <- case T.toLower (cfg_repository_type conf) of
"git" -> return $ gitFileStore repopath
"darcs" -> return $ darcsFileStore repopath
"mercurial" -> return $ mercurialFileStore repopath
x -> err 13 $ "Unknown repository type: " ++ T.unpack x
+
st <- staticDevel $ cfg_static_dir conf
mimes <- case cfg_mime_types_file conf of
Nothing -> return mimeTypes
@@ -208,24 +214,66 @@ main = do
when exists $ removeDirectoryRecursive cachedir
let settings = defaultSettings{ settingsPort = cfg_port conf }
+ let gconfig = GititConfig{ mime_types = mimes
+ , default_format = format
+ , repository_path = cfg_repository_path conf
+ , page_extension = cfg_page_extension conf
+ , use_mathjax = cfg_use_mathjax conf
+ , feed_days = cfg_feed_days conf
+ , feed_minutes = cfg_feed_minutes conf
+ , pandoc_user_data = cfg_pandoc_user_data conf
+ , use_cache = cfg_use_cache conf
+ , cache_dir = cfg_cache_dir conf
+ , front_page = cfg_front_page conf
+ , help_page = cfg_help_page conf
+ , latex_engine = cfg_latex_engine conf
+ }
+
+ unless repoexists $ initializeRepo gconfig fs
+
let runner = runSettingsSocket settings sock
runner =<< toWaiApp
- (Master (Gitit{ config = GititConfig{
- mime_types = mimes
- , default_format = format
- , repository_path = cfg_repository_path conf
- , page_extension = cfg_page_extension conf
- , use_mathjax = cfg_use_mathjax conf
- , feed_days = cfg_feed_days conf
- , feed_minutes = cfg_feed_minutes conf
- , pandoc_user_data = cfg_pandoc_user_data conf
- , use_cache = cfg_use_cache conf
- , cache_dir = cfg_cache_dir conf
- , front_page = cfg_front_page conf
- , help_page = cfg_help_page conf
- , latex_engine = cfg_latex_engine conf
- }
+ (Master (Gitit{ config = gconfig
, filestore = fs
, getStatic = st
})
maxsize)
+
+initializeRepo :: GititConfig -> FileStore -> IO ()
+initializeRepo gconfig fs = do
+ putStrLn $ "Creating initial repository in " ++ repository_path gconfig
+ Data.FileStore.initialize fs
+ let toPandoc = readMarkdown def{ readerSmart = True, readerParseRaw = True }
+ -- note: we convert this (markdown) to the default page format
+ let converter f = do
+ contents <- getDataFileName f >>= UTF8.readFile
+ let defOpts lhs = def{
+ writerStandalone = False
+ , writerHTMLMathMethod = MathJax "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
+ , writerExtensions = if lhs
+ then Set.insert Ext_literate_haskell
+ $ writerExtensions def
+ else writerExtensions def
+ }
+ return $ (case default_format gconfig of
+ Markdown lhs -> writeMarkdown (defOpts lhs) . toPandoc
+ LaTeX lhs -> writeLaTeX (defOpts lhs) . toPandoc
+ HTML lhs -> writeHtmlString (defOpts lhs) . toPandoc
+ RST lhs -> writeRST (defOpts lhs) . toPandoc
+ Textile lhs -> writeTextile (defOpts lhs) . toPandoc) contents
+
+ let fmt = takeWhile (/=' ') $ show $ default_format gconfig
+ welcomecontents <- converter ("data" </> "FrontPage.page")
+ helpcontentsInitial <- converter ("data" </> "Help.page")
+ helpcontentsMarkup <- converter ("data" </> "markup" <.> fmt)
+ usersguidecontents <- converter "README.markdown"
+ -- include header in case user changes default format:
+ let header = "---\nformat: " ++ fmt ++ "\n...\n\n"
+ -- add front page, help page, and user's guide
+ let auth = Author "Gitit" ""
+ create fs (T.unpack (front_page gconfig) <.> "page") auth "Default front page"
+ $ header ++ welcomecontents
+ create fs (T.unpack (help_page gconfig) <.> "page") auth "Default help page"
+ $ header ++ helpcontentsInitial ++ "\n\n" ++ helpcontentsMarkup
+ create fs "Gitit User’s Guide.page" auth "User’s guide (README)"
+ $ header ++ usersguidecontents

0 comments on commit 6d0c4b8

Please sign in to comment.