{{error}}
+diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..a4bcedb --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: lein with-profile production trampoline ring server diff --git a/README.md b/README.md index 2bc042c..14fbdc4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,29 @@ -smeagol -======= +# Welcome to Smeagol -Simple Wiki engine inspired by Gollum +Smeagol is a simple Git-backed Wiki inspired by [Gollum](https://github.com/gollum/gollum/wiki). + +## Prerequisites + +You will need [Leiningen][1] 2.0 or above installed. + +[1]: https://github.com/technomancy/leiningen + +## Running + +To start a web server for the application, run: + + lein ring server + +Alternatively, if you want to deploy to a servlet container, the simplest thing is to run: + + lein ring uberwar + +(a command which I'm sure Smeagol would entirely appreciate) and deploy the resulting war file. + +## TODO + +The editor is at present very primitive - right back from the beginnings of the Web. It would be nice to have a rich embedded editor like [Hallo](https://github.com/bergie/hallo) or [Aloha](http://aloha-editor.org/Content.Node/index.html) but I havenven't (yet) had time to integrate them! + +## License + +Copyright © 2014 Simon Brooke diff --git a/project.clj b/project.clj new file mode 100644 index 0000000..46b7c28 --- /dev/null +++ b/project.clj @@ -0,0 +1,38 @@ +(defproject smeagol "0.1.0-SNAPSHOT" + :description "A simple Git-backed Wiki inspired by Gollum" + :url "http://example.com/FIXME" + :dependencies [[org.clojure/clojure "1.6.0"] + [lib-noir "0.9.4"] + [ring-server "0.3.1"] + [selmer "0.7.2"] + [com.taoensso/timbre "3.3.1"] + [com.taoensso/tower "3.0.2"] + [markdown-clj "0.9.55" + :exclusions [com.keminglabs/cljx]] + [environ "1.0.0"] + [im.chit/cronj "1.4.2"] + [noir-exception "0.2.2"] + [prone "0.6.0"]] + + :repl-options {:init-ns smeagol.repl} + :jvm-opts ["-server"] + :plugins [[lein-ring "0.8.13"] + [lein-environ "1.0.0"] + [lein-ancient "0.5.5"]] + :ring {:handler smeagol.handler/app + :init smeagol.handler/init + :destroy smeagol.handler/destroy} + :profiles + {:uberjar {:omit-source true + :env {:production true} + :aot :all} + :production {:ring {:open-browser? false + :stacktraces? false + :auto-reload? false}} + :dev {:dependencies [[ring-mock "0.1.5"] + [ring/ring-devel "1.3.1"] + [pjstadig/humane-test-output "0.6.0"]] + :injections [(require 'pjstadig.humane-test-output) + (pjstadig.humane-test-output/activate!)] + :env {:dev true}}} + :min-lein-version "2.0.0") diff --git a/resources/public/content/Introduction.md b/resources/public/content/Introduction.md new file mode 100644 index 0000000..d08ede7 --- /dev/null +++ b/resources/public/content/Introduction.md @@ -0,0 +1,21 @@ +# Welcome to Smeagol! + +Smeagol is a simple Wiki engine inspired by [Gollum](https://github.com/gollum/gollum/wiki). Gollum is a Wiki engine written in Ruby, which uses a number of simple text formats including [Markdown](http://daringfireball.net/projects/markdown/), which uses [Git](http://git-scm.com/) to provide versioning and backup. I needed a new Wiki for a project and thought Gollum would be ideal - but unfortunately it doesn't provide user authentication, which I needed, and it was simpler for me to reimplement the bits I did need in Clojure than to modify Gollum. + +So at this stage Smeagol is a Wiki engine written in Clojure which uses Markdown as its text format, which does have user authentication, and which will soon use Git as its versioning and backup system. + +## Markup syntax + +Smeagol uses the Markdown format as provided by [markdown-clj](https://github.com/yogthos/markdown-clj), with the addition that anything enclosed in double square brackets, \[\[like this\]\], will be treated as a link into the wiki. + +## Security and authentication + +Not done yet. + +## Todo + +Git integration! + +## Editing the framing content + +You can edit the [[\_left-bar]], the [[\_edit-left-bar]], and the [[\_header]]. diff --git a/resources/public/content/_edit-left-bar.md b/resources/public/content/_edit-left-bar.md new file mode 100644 index 0000000..d491cbc --- /dev/null +++ b/resources/public/content/_edit-left-bar.md @@ -0,0 +1,13 @@ +####Formatting hints ++ \# Main heading ++ \#\# Second level heading ++ \#\#\# Third level heading ++ \[\[Link within this wiki\]\] ++ \[Link outside this wiki\] \(http://url.goes.here/\) ++ \!\[image alt text\]\(http://url.of.image\) ++ \+ (at start of line) ordinary bulleted lists ++ \1\. (at start of line) numbered lists ++ \**bold*\* ++ \__italic_\_ + +More documentation [here](http://daringfireball.net/projects/markdown/syntax) \ No newline at end of file diff --git a/resources/public/content/_header.md b/resources/public/content/_header.md new file mode 100644 index 0000000..b5d7dc2 --- /dev/null +++ b/resources/public/content/_header.md @@ -0,0 +1 @@ +This is the header. There isn't yet much in it. You could [edit](edit?content=_header) it to provide internal navigation or branding. diff --git a/resources/public/content/_left-bar.md b/resources/public/content/_left-bar.md new file mode 100644 index 0000000..5586090 --- /dev/null +++ b/resources/public/content/_left-bar.md @@ -0,0 +1 @@ +This is the left bar. There's nothing in it yet. You could [edit](edit?content=_left-bar) it to provide internal navigation or branding. diff --git a/resources/public/css/screen.css b/resources/public/css/screen.css new file mode 100644 index 0000000..d759510 --- /dev/null +++ b/resources/public/css/screen.css @@ -0,0 +1,6 @@ +html, +body { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + height: 100%; + padding-top: 40px; +} diff --git a/resources/public/css/standard.css b/resources/public/css/standard.css new file mode 100644 index 0000000..6fa4869 --- /dev/null +++ b/resources/public/css/standard.css @@ -0,0 +1,154 @@ +body { + margin: 0; + padding: 0; + font-family: sans-serif; +} + +/* ids generally in document order */ + +/* top-of-page navigation, not editable, provided by Smeagol */ +#nav{ + margin: 0; + padding: 0; + top: 0; + width: 100%; + _position: absolute; + _top: expression(document.documentElement.scrollTop); + z-index: 149; + background:rgba(40,40,40,0.8); +} + +/* only needed for fly-out menu effect on tablet and phone stylesheets */ +#nav-icon { + display: none; +} + +#nav ul li { + padding: 0; + margin: 0; + display: inline; +} + +#nav ul li a { + color: white; + text-decoration: none; + font-weight: bold; + padding: 0.1em 0.75em; + margin: 0; +} + +#nav ul li.active a { background: silver;} +li.nav-item a:hover { background: rgb( 240, 240, 240) } +li.nav-item a:active { background: gray; color: white; } + +/* Overall container div, holds all content of page. Yes, I know it shouldn't have fixed width */ +#main-container{ + clear: both; +/* width:100%; */ +} + + +/* header for all pages in the Wiki - editable, provided by users. Within main-container */ +#header { + width:100%; + background-color: gray; + color: white; +} + +/* left bar for all pages in the Wiki - editable, provided by users. Within main-container */ +#left-bar { + width: 17%; + height: 100%; + float: left; +} + +/* content of the current in the Wiki - editable, provided by users. Within main-container */ +#content { + border: thin solid silver; + width: 80%; + float: right; +} + + +/* footer of the page - not-editable, provided by Smeagol */ +#footer { + clear: both; + font-size: smaller; + padding: 0 2em; + text-align: center; + color:white; + background:rgba(196,196,196,0.95); + width: 100%; + margin: 0; + bottom:0; + position:fixed; + z-index:150; + _position:absolute; + _top:expression(eval(document.documentElement.scrollTop+ + (document.documentElement.clientHeight-this.offsetHeight))); +} + +.error { + background-color: red; + color: white; +} + +.widget { + background-color: silver; + border: thin solid white; + margin-top: 0; + margin-bottom: 0; +} + +.wiki { + margin: 0; +} + +div.error { + width: 100%; +} + +form { + border: thin solid silver; +} + +div.content, form, p, pre, ul, ol, dl, menu, h1, h2, h3, h4, h5 { + padding: 0.25em 10%; +} + +input { + background-color: white; +} + +input.submit { + background-color: green; +} + +input.required:after { + content: " \*"; + color: red; +} + +label { + width: 30em; + min-width: 20em; + border-right: thin solid gray; +} + +menu li { + display: inline; +} + +menu li::before { + content: "|| "; +} + +table.music-ruled tr:nth-child(odd) { + background-color: silver; +} + +th, td { + text-align: left; + padding: 0 0.25em; +} + diff --git a/resources/public/favicon.ico b/resources/public/favicon.ico new file mode 100644 index 0000000..ca89d76 Binary files /dev/null and b/resources/public/favicon.ico differ diff --git a/resources/public/favicon.png b/resources/public/favicon.png new file mode 100644 index 0000000..8736fa4 Binary files /dev/null and b/resources/public/favicon.png differ diff --git a/resources/public/fonts/glyphicons-halflings-regular.eot b/resources/public/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..78b119f Binary files /dev/null and b/resources/public/fonts/glyphicons-halflings-regular.eot differ diff --git a/resources/public/fonts/glyphicons-halflings-regular.svg b/resources/public/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..83f74b2 --- /dev/null +++ b/resources/public/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,229 @@ + + + diff --git a/resources/public/fonts/glyphicons-halflings-regular.ttf b/resources/public/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..ba41d0f Binary files /dev/null and b/resources/public/fonts/glyphicons-halflings-regular.ttf differ diff --git a/resources/public/fonts/glyphicons-halflings-regular.woff b/resources/public/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..60dd28d Binary files /dev/null and b/resources/public/fonts/glyphicons-halflings-regular.woff differ diff --git a/resources/public/img/clojure-icon.gif b/resources/public/img/clojure-icon.gif new file mode 100644 index 0000000..84eee16 Binary files /dev/null and b/resources/public/img/clojure-icon.gif differ diff --git a/resources/public/img/github-logo-transparent.png b/resources/public/img/github-logo-transparent.png new file mode 100644 index 0000000..6a37959 Binary files /dev/null and b/resources/public/img/github-logo-transparent.png differ diff --git a/resources/public/img/smeagol.png b/resources/public/img/smeagol.png new file mode 100644 index 0000000..09787cb Binary files /dev/null and b/resources/public/img/smeagol.png differ diff --git a/resources/public/img/threelines.png b/resources/public/img/threelines.png new file mode 100644 index 0000000..f26babb Binary files /dev/null and b/resources/public/img/threelines.png differ diff --git a/resources/public/md/docs.md b/resources/public/md/docs.md new file mode 100644 index 0000000..267f874 --- /dev/null +++ b/resources/public/md/docs.md @@ -0,0 +1,20 @@ + +### Managing Your Middleware + +Request middleware functions are located under the `smeagol.middleware` namespace. +A request logging helper called `log-request` has already been defined for you there. + +This namespace also defines two vectors for organizing the middleware called `development-middleware` and `production-middleware`. +Any middleware that you only wish to run in development mode, such as `log-request`, should be added to the first vector. + +### Here are some links to get started + +1. [HTML templating](http://www.luminusweb.net/docs/html_templating.md) +2. [Accessing the database](http://www.luminusweb.net/docs/database.md) +3. [Serving static resources](http://www.luminusweb.net/docs/static_resources.md) +4. [Setting response types](http://www.luminusweb.net/docs/responses.md) +5. [Defining routes](http://www.luminusweb.net/docs/routes.md) +6. [Adding middleware](http://www.luminusweb.net/docs/middleware.md) +7. [Sessions and cookies](http://www.luminusweb.net/docs/sessions_cookies.md) +8. [Security](http://www.luminusweb.net/docs/security.md) +9. [Deploying the application](http://www.luminusweb.net/docs/deployment.md) diff --git a/resources/templates/about.html b/resources/templates/about.html new file mode 100644 index 0000000..9295dec --- /dev/null +++ b/resources/templates/about.html @@ -0,0 +1,4 @@ +{% extends "templates/base.html" %} +{% block content %} +
this is the story of smeagol... work in progress
+{% endblock %} diff --git a/resources/templates/base.html b/resources/templates/base.html new file mode 100644 index 0000000..68c92dd --- /dev/null +++ b/resources/templates/base.html @@ -0,0 +1,48 @@ + + + +{{error}}
+