Skip to content

Commit

Permalink
New readonly setting, updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
fredoliveira committed Nov 5, 2012
1 parent 40cb292 commit 34affe8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
## What is Commonplace?

I write quite a bit, usually in Markdown, but I usually keep all my markdown files scattered around my hard-drive. Commonplace is a simple wiki-like system to store and browse your markdown files. It works by reading `.md` files from a directory you configure (my advice would be to keep this directory backed up through [Dropbox](http://getdropbox.com)). The name draws inspiration from [commonplace books](http://en.wikipedia.org/wiki/Commonplace_book).
*TL;DR:* A server for your markdown files. Give it a directory, and Commonplace gives you a url, pretty pages, and quick editing.

*The longer version:* I write quite a bit, usually in Markdown, but I usually keep all my markdown files scattered around my hard-drive. Commonplace is a simple wiki-like system to store and browse your markdown files. It works by reading `.md` files from a directory you configure (my advice would be to keep this directory backed up through [Dropbox](http://getdropbox.com)). The name draws inspiration from [commonplace books](http://en.wikipedia.org/wiki/Commonplace_book).

Commonplace is not meant to be a markdown editor, even though it includes basic editing capabilities. There are a number of tools that do the markdown editing job extremely well - I happen to use [Byword](http://bywordapp.com) for Mac but you get to choose your own poison. If you edit the markdown files in an external editor, changes are reflected here after a refresh.

![Commonplace screenshot](http://madebyform.com/commonplace/img/screen.png)

### Installing Commonplace

Installing Commonplace is actually really easy - all you need is ruby (which if you're on a fairly recent mac, you already have). If you know your way around Apache, see the instructions below about Configuring apache. If you don't, here's what you do:
Installing Commonplace is actually really easy - all you need is ruby (which if you're on a fairly recent mac, you already have).

* Clone Commonplace to your local machine `git clone git://github.com/fredoliveira/commonplace.git`
* Install bundler, if you haven't got it yet `gem install bundler`
Expand Down
2 changes: 1 addition & 1 deletion config/commonplace.yml.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sitename: "Commonplace"
wikidir: "wiki"
locked: false
readonly: false
4 changes: 2 additions & 2 deletions lib/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CommonplaceServer < Sinatra::Base
config = YAML::load(File.open("config/commonplace.yml"))
set :sitename, config['sitename']
set :dir, config['wikidir']
set :locked, config['locked']
set :readonly, config['readonly']
#set :public_folder, "public"
set :views, "views"
end
Expand All @@ -22,7 +22,7 @@ class CommonplaceServer < Sinatra::Base
# every method that edits, saves redirects to root
# maybe this could be more elegant?
before '/p/*' do
redirect "/" if settings.locked
redirect "/" if settings.readonly
end

# show the homepage
Expand Down
2 changes: 1 addition & 1 deletion views/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<nav class="tools">
<a href="/" class="btn small <%= "disabled" if @name == "Home" %>">&lt; Home</a>
<a href="/list" class="btn small <%= "disabled" if @name == "Known pages" %>">Page list</a>
<% if @page && !@editing && !settings.locked %>
<% if @page && !@editing && !settings.readonly %>
<a href="/p/new" class="btn small">New page</a>
<a href="/p/<%= @page.permalink %>/edit" class="btn small primary">Edit this</a>
<% elsif @newpage %>
Expand Down
8 changes: 2 additions & 6 deletions wiki/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ Commonplace is not meant to be a markdown editor, even though it includes basic

### Now that you're running this,

If you're seeing this in your browser, it means you got Commonplace installed successfully (The latest instructions [are available here](https://github.com/fredoliveira/commonplace#readme)) and are generally to be considered a master and wizard of installing things. *Good.* What you need to do next is to edit this page to delete my words and to add your own magical works of wordsmithery (which isn't *even a word*, is it?). Then you will be on your way to fame, stardom and more fame<sup>1</sup>.
I hope Commonplace is as useful to you as it is to me. Let me know ([I'm on twitter](http://twitter.com/f) as [@f](http://twitter.com/f)) if you need help or if you have tips on improving it. If you have code chops, feel free to contribute by sending in your pull requests [on Github](https://github.com/fredoliveira/commonplace).

I hope Commonplace is as useful to you as it is to me. Let me know ([I'm on twitter](http://twitter.com/f) as the very short letter [@f](http://twitter.com/f)) if you need help or if you have tips on improving it. If you have code chops, feel free to contribute by sending in your pull requests [on Github](https://github.com/fredoliveira/commonplace).

If you want to contribute financially because you find this to be a neat tool (which makes me quite glad, I'll say), please consider donating 1 dollar per day to [Save the Children](http://www.savethechildren.org/) (or your favorite charity) instead. I'm fortunate enough to be able to do this for free, and there's people who'd make better use of your hard earned money. Thank you! Now start writing, silly reader! *I love you*, miss/sir/intelligent being who happens to understand english.

> <sup>[1]</sup> Sadly, using Commonplace does not guarantee fame. Don't email me about this - I know nothing of this fame you people want to hear of.
Commonplace is free, but consider donating 1 dollar per day to [Save the Children](http://www.savethechildren.org/) (or your favorite charity) if you like what you see.

0 comments on commit 34affe8

Please sign in to comment.