Giter Site home page Giter Site logo

pages's Introduction

A CouchApp Wiki

I was tired of all the complicated wikis that required some kind of application server that I didn't want to even think about, so I wrote a CouchApp wiki. This one uses Markdown.

Installing

Follow the instructions below ("Deploying...") to get this code into your CouchDB. This section concerns how to make it so Pages is accessible at the URL-style you prefer.

The Easy Way (Ugly URLs)

The easy way is just to run couchapp push as detailed below, and go to the URL it hints you. That should be something like:

http://localhost:5984/pages/_design/pages/_rewrite/page/index

Now you can create your first wiki page. Later on, you can easily follow the next set of instructions to get nicer looking URLs. The nice ones will replace /pages/_design/pages/_rewrite/page/index with just /page/index.

Pretty URLs

To deploy this you need to point a DNS name at your Couch (or use /etc/hosts), and then configure your CouchDB to have a vhost like:

[vhosts]
mydnsname.com = /pages/_design/pages/_rewrite

You can also add this configuration option with curl:

curl -X PUT http://localhost:5984/_config/vhosts/mydnsname.com -d '"/pages/_design/pages/_rewrite"'

This app requires that it be deployed to a database called pages. I'd like to make that more dynamic, but I haven't quite gotten around to it yet (maybe I never will, that's where you come in.)

Once you have it deployed, visit http://mydnsname.com:5984 and it will take it from there.

Generated by CouchApp

CouchApps are web applications which can be served directly from CouchDB. This gives them the nice property of replicating just like any other data stored in CouchDB. They are also simple to write as they can use the built-in jQuery libraries and plugins that ship with CouchDB.

More info about CouchApps here.

Deploying this app

Assuming you just cloned this app from git, and you have changed into the app directory in your terminal, you want to push it to your CouchDB with the CouchApp command line tool, like this:

couchapp push http://name:password@hostname:5984/pages

If you don't have a password on your CouchDB (admin party) you can do it like this (but it's a bad, idea, set a password):

couchapp push http://hostname:5984/pages

If you get sick of typing the URL, you should setup a .couchapprc file in the root of your directory. Remember not to check this into version control as it will have passwords in it.

The .couchapprc file should have contents like this:

{
  "env" : {
    "public" : {
      "db" : "http://name:[email protected]/pages"
    },
    "default" : {
      "db" : "http://name:pass@localhost:5984/pages"
    }
  }
}

Now that you have the .couchapprc file set up, you can push your app to the CouchDB as simply as:

couchapp push

This pushes to the default as specified. To push to the public you'd run:

couchapp push public

Of course you can continue to add more deployment targets as you see fit, and give them whatever names you like.

License

Licensed under the Apache 2.0 License

pages's People

Contributors

jchris avatar jhs avatar janl avatar victorbstan avatar vmx avatar poswald avatar

Stargazers

Fabien Bourgeois avatar John Kent avatar Sam Rogers avatar Gregory Miller avatar Tony Wärn avatar Henri Bouvier avatar Andrew Stewart avatar Igor Kuznetsov avatar ProMoFu avatar Mike avatar Chris Stefano avatar  avatar Nicolas Forgerit avatar jon ⚝ avatar Alexander Gugel avatar Alexander Shorin avatar  avatar Jesse Wattenbarger avatar Lee avatar [] avatar Chance Jiang avatar Henky Prayoga avatar Pepijn Verlaan avatar Rodrigo Valeri avatar Patrick Shields avatar  avatar Charles Alston avatar Manish Jhawar avatar Igor Vuk avatar Jody 3t avatar Karsten Küpper avatar Jose Hilario Almeida avatar George Lewis avatar Adrien Haxaire avatar Arwid Bancevicius avatar Felix Hummel avatar Paul Capestany avatar Jeremy Taylor avatar Felix Fischer avatar  avatar Earl Celis avatar  avatar Jan Forst avatar Klaus Mueller avatar Marcell Mars avatar Silver Knight avatar Joshua Stauter avatar  avatar Justin Shoffstall avatar Marcus P S avatar Tobias Bradtke avatar Simon Leblanc avatar Stuart Runyan avatar Val Packett avatar Ben Peachey avatar Ido Ran avatar  avatar Rob Sawyer avatar Omar avatar Brian Dunnette avatar Sean Summers avatar Seth Vincent avatar Jarrod Roberson avatar  avatar Joseph Chiocchi avatar ohdarling88 avatar Rob Brazier avatar  avatar Wact B. Prot avatar Veena Basavaraj avatar Martin Klepsch avatar Bradley Holt avatar Christian Schmizz avatar Mark Fiers avatar Kamyar Navidan avatar  avatar Fabian Linzberger avatar Daniel Truemper avatar Bram Neijt avatar Richard Metzler avatar Chance Jiang avatar Kristina Schneider avatar  avatar Masatoshi Ishida avatar BigBlueHat avatar Gurpartap Singh avatar Max avatar Chris Hamant avatar Andy Wang avatar Julian Stahnke avatar Phillip Smith avatar Hiroyuki Nakamura avatar Luciano Ramalho avatar Randall Leeds avatar Mateusz Łapsa-Malawski avatar Christoph Olszowka avatar somename123 avatar Sergey Avseyev avatar Maksim Pechnikov avatar Geoff Buesing avatar

Watchers

James Cloos avatar  avatar Brian Mong avatar ProMoFu avatar

pages's Issues

Comment object has no "by" field

I encountered a comment at the bottom of a page, but the commenter was not displayed. I discovered that the comment document has no "by" field which the mustache template needs. (Also missing is gravatar_url.)

Is a good fix to add this to the validator? Not confident with the Pages code, I wanted to ask first.

(Also of course there is presumably some client code with some kind of bug.)

No way to revert, since clicking edit on an old version edits the latest version

I tried reverting a page to the first version by following these steps:

  1. To view the old version, I clicked History and clicked the version number 1. This put #/version/1 in my url and showed me the old version.
  2. Because I needed to copy markdown in order to paste it into the new version, I clicked Edit to bring up the textarea. This put #/edit in my url and showed me the latest version, rather than the version I was on.

This is probably a quick fix and I may fix it myself. If I'm going to fix it myself this will serve as a reminder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.