Skip to content

Commit

Permalink
Initial commit, not yet complete.
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-brooke committed Nov 10, 2014
1 parent 53885f6 commit d437f07
Show file tree
Hide file tree
Showing 33 changed files with 884 additions and 3 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: lein with-profile production trampoline ring server
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
38 changes: 38 additions & 0 deletions project.clj
Original file line number Diff line number Diff line change
@@ -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")
21 changes: 21 additions & 0 deletions resources/public/content/Introduction.md
Original file line number Diff line number Diff line change
@@ -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]].
13 changes: 13 additions & 0 deletions resources/public/content/_edit-left-bar.md
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions resources/public/content/_header.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions resources/public/content/_left-bar.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions resources/public/css/screen.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
html,
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
height: 100%;
padding-top: 40px;
}
154 changes: 154 additions & 0 deletions resources/public/css/standard.css
Original file line number Diff line number Diff line change
@@ -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;
}

Binary file added resources/public/favicon.ico
Binary file not shown.
Binary file added resources/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading

0 comments on commit d437f07

Please sign in to comment.