Browse Source

readme adjusted; color themes extended by link colors

master
Christian Mueller 14 years ago
parent
commit
5963de4739
  1. 30
      README.md
  2. 2
      src/NoteHub/storage.clj
  3. 2
      src/NoteHub/views/common.clj
  4. 23
      src/NoteHub/views/css_generator.clj

30
README.md

@ -1,28 +1,28 @@ @@ -1,28 +1,28 @@
# NoteHub
# NoteHub Readme
NoteHub is a free and anonymous hosting for markdown pages. It can be used for publishing of markdown-formatted text. For instance, this service might be interesting to people, who want to publish something, but don't want to start a blog.
[NoteHub](http://notehub.org) is a free and hassle-free anonymous hosting for markdown pages. It can be used for publishing of markdown-formatted text.
## Writing
Once a user started to write, he gets a special draft URL like:
http://notehub.org/draft/4j32j4g23v23v4vnb234mn23jh6b76686
His changes will be auto-saved every minute, manualy or at a registered page exit. When the same link will be opened again and the page wasn't published yet, the author will be recognized using cookies, or he should enter three non-trivial words from the document, to unlock the draft. The security aspect here is non-critical, since every page will eventually be published on NoteHub anyway. So there is no reason to assume, that a draft contains critical information.
A new note can be entered and previewed at [notehub.org/new](http://notehub.org/new).
## Publishing
Once a page is published, it gets accessible under and URL like:
Once a page is published, it gets accessible through an URL of the format:
http://notehub.org/%YEAR/%MONTH/%DAY/%TITLE
Hence, every date represents a name space.
## Features
## Exporting & Statistics
By appending of `/stat` everyone can see a rudimentary statistics (currently, the number of note views only).
By appending of `/export` the original markdown content will be displayed in plain text format.
## Displaying
There are some experimental features, which allow to change via the note URL the design of the note page.
E.g., by appending of `&theme=dark` to the URL, the design colors will be inverted.
Currently it is also possible to change the header and the article text by appending of the Google Webfont names like this:
* Preview (could be used from Vim or any other MD-editor):
http://notehub.org/preview?t="..."
* View Control over url, e.g. `http://notehub.org/2012/03/23/My-Thoughts/background/dark` would display the note on a dark background.
* Short urls available by:
http://notehub.org/2012/03/23/foobar/...any-options.../shorturl -> http://notehub.org/asd3rf
* Every page downloadable without any dependencies except of fonts and images (can be improved ?)
notehub.org/.../title?header-font=Anton&text-font=Cagliostro

2
src/NoteHub/storage.clj

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
; Initialize the data base
(def db
(redis/init
(when dev-mode?
(when (dev-mode?)
{:url (get-setting :db-url)})))
; DB hierarchy levels

2
src/NoteHub/views/common.clj

@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
; generating the global CSS
[:style {:type "text/css"} (global-css params)]
; google analytics code should appear in prod mode only
(if-not dev-mode? (include-js "/js/google-analytics.js"))]
(if-not (dev-mode?) (include-js "/js/google-analytics.js"))]
[:body content
; we only need JS during a new note creation, so don't render it otherwise
(when (params :js)

23
src/NoteHub/views/css_generator.clj

@ -32,15 +32,21 @@ @@ -32,15 +32,21 @@
:margin-right "auto"))
; Resolves the theme name & tone parameter to a concrete color
(defn- color [theme tone]
(defn- color [& keys]
(get-in {:dark {:background :#333
:foreground :#ccc
:background-halftone :#444
:foreground-halftone :#bbb }
:foreground-halftone :#bbb
:link-color {:fresh :#6b8
:visited :#496
:hover :#7c9 }}
:default {:background :#fff
:foreground :#333
:background-halftone :#efefef
:foreground-halftone :#888 }} [theme tone]))
:foreground-halftone :#888
:link-color {:fresh :#097
:visited :#054
:hover :#0a8 }}} keys))
(defn global-css
"Generates the entire CSS rules of the app"
@ -52,16 +58,19 @@ @@ -52,16 +58,19 @@
background (color theme :background)
foreground (color theme :foreground)
background-halftone (color theme :background-halftone)
foreground-halftone (color theme :foreground-halftone)]
foreground-halftone (color theme :foreground-halftone)
link-fresh (color theme :link-color :fresh)
link-visited (color theme :link-color :visited)
link-hover (color theme :link-color :hover)]
(css
(rule "a"
:color :#097
:color link-fresh
:text-decoration :none
:border-bottom [:1px :dotted]
(rule "&:hover"
:color :#0a8)
:color link-hover)
(rule "&:visited"
:color :#054))
:color link-visited))
(rule ".landing-button"
:box-shadow [0 :2px :5px :#aaa]
:text-decoration :none

Loading…
Cancel
Save