From 5963de4739f5d82c958aec1191a5e715b542d0c8 Mon Sep 17 00:00:00 2001 From: Christian Mueller Date: Mon, 11 Jun 2012 23:39:09 +0200 Subject: [PATCH] readme adjusted; color themes extended by link colors --- README.md | 30 ++++++++++++++--------------- src/NoteHub/storage.clj | 2 +- src/NoteHub/views/common.clj | 2 +- src/NoteHub/views/css_generator.clj | 23 +++++++++++++++------- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 3b50b44..6ed3240 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/NoteHub/storage.clj b/src/NoteHub/storage.clj index b81a416..4aa29d7 100644 --- a/src/NoteHub/storage.clj +++ b/src/NoteHub/storage.clj @@ -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 diff --git a/src/NoteHub/views/common.clj b/src/NoteHub/views/common.clj index d89621a..862ac73 100644 --- a/src/NoteHub/views/common.clj +++ b/src/NoteHub/views/common.clj @@ -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) diff --git a/src/NoteHub/views/css_generator.clj b/src/NoteHub/views/css_generator.clj index f9241ba..32ce669 100644 --- a/src/NoteHub/views/css_generator.clj +++ b/src/NoteHub/views/css_generator.clj @@ -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 @@ 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