Using Discourse as a community-powered wiki

Erlend Sogge Heggen May 3, 2016

The following is a guest post by Sam Nazarko, CEO and founder of

Are you using Discourse in a novel way? If you’re interested in writing a guest post like this one, please get in touch.

In 2014, I started working on a new project, OSMC (Open Source Media Center). OSMC is a free and open source media player based on Linux that lets you play back media from your local network, attached storage and the Internet.



As the project started to accumulate users, we wanted to help the newcomers as much as possible and ensure that they could get the resources they wanted. The need for a Wiki became abundantly clear but I wasn’t sure that popular Wiki software was the best fit for us. For a while we worked on our own GitHub based Wiki system. GitHub had a markdown editor, but it still left a lot to work out for newcomers and the process wasn’t as smooth as we had expected.

After some thought, we realised that Discourse had everything we wanted. Users familiar with posting and the WYSIWYG editor would be able to edit or add to the Wiki without any additional learning curve, and they wouldn’t need to hold an additional account on an external Wiki site. Mark Theis (OSMC’s web developer) and I got to work. By the end of the day, we had a Wiki category in Discourse and some basic scripts that scraped this forum category every half hour and published the pages on our website as static HTML. We scrape Discourse via the Discourse REST API and build templates for our blog.



It’s working well. Edits are easily trackable, and Discourse’s permission system ensures we have fine control over edits on the website. The new implementation is also very fast, as we build the Wiki pages as static HTML and cache them. Discourse has already proven its ability to handle large numbers of posts, so unlike other Wiki software, I’m not concerned about performance problems as the Wiki scales.

There is certainly room for improvement with our Wiki. We scrape each post from the Wiki category and get the post content as JSON. This JSON contains pre-formatted HTML. In the future, it would be good to be able to access the post as Markdown and have more control over the styling of the content. Editing posts is simple enough, but adding new categories or new articles is still a little too complex for some users, and this is something we’d like to simplify in the future.

The Wiki needs a lot of work, but we’re glad to have implemented something stable and easy to use that will last for many years to come. We are now looking at using Discourse to power our new Newsletter system for the same ease of editing and great durability.

You can get the source code here: (updated)


Notable Replies

  1. this is pretty awesome! I might try this out on a new project, but just a heads up, the github links are dead. looks like the repo was refactored, so now the links are here:


    wiki.php - now a module

    is it possible to get Sam (or someone from OSMC) to put together a little how-to on using their Wiki code?

  2. Hi. Yeah I’ve been refactoring a bit :slight_smile:.

    All the server side code is now here:

    Wiki.js is just a very basic search feature you can see live on (at this point all the wiki data is being served server-side).

    It’s a bit of a convoluted/hack’ish setup, so it’s probably a bit tricky to follow without knowing the flow. I’ll make a guide soon :slight_smile:

  3. awesome - thanks @marktheis! as an aside - is the site css based off a framework, or completely custom? I noticed you guys use express/ghost/normalize.css - wasn’t sure if the rest was built from scratch or used something a la Susy or Bourbon as a starting point. either way, I love the design!

  4. css is completely custom. Frameworks are nice, but I always end up fighting the framework. And they’re usually too big for my taste.

    Yes apart from express, ghost, and a few js/css modules everything (server/client) is built from scratch.

    With a website that depends on a lot of external services (discourse for wiki and comments, woocommerce for shop, another server for diskimages) I think that node with express and handlebars templates works really well.

    Btw. I’m also currently building an email system that takes posts from discourse, and turns them into ready and processed emails via Foundation for Emails. To be consumed by phplist. Yes I really don’t like phplist’s html editor :smile:

  5. Been a bit busy lately, here’s the short version.

    The gist of it is to arrange it properly in discourse.
    We have a main table of contents (toc) post with links to each category toc that then have all the posts listed for that category.

    So for us it’s:

    Main toc post with links to all the category posts:

    > general
    > vero
    > pi
    And then in the general post e.q.
    > FAQ
    > how to
    > get started
    So via the discourse api you get the main toc. loop the category links, then you loop the post links and get the title and body.
    We then write the whole thing to a single json file for easy use.
    So when you go to
    It looks if "general" exists in the json file, and then after that it looks up the title of the post. If that also exists it renders the page with that content.
    Hope that helps :)
  6. Yep, this is something we might do, as discussed here:

Continue the discussion

6 more replies