# Wiki topic mini spec

**URL:** https://meta.discourse.org/t/wiki-topic-mini-spec/13966
**Category:** Feature
**Tags:** rfc, spec
**Created:** [March 21, 2014, 10:44am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966 "2014-03-21T10:44:57Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 21, 2014, 10:44am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/1 "2014-03-21T10:44:57Z")

</div>

We are interested in having a wiki style topic, but do not need this for version 1 of Discourse.

That said if the community would like to contribute a PR in this department we would be more than happy to review, and if good merge.

The spec for v0 of the feature.

1. Add a column to posts `wiki` not nullable bit, default 0.
2. Any post that has `wiki`=1 is editable by all logged on users.
3. Add admin post action (like like/flag etc), when clicked it brings up an admin menu
4. Admin menu allows you to wiki / unwiki a post
5. Every change in state is logged in post\_revisions with the name of the admin who changed it
6. Any posts that are wiki have a visual cue like PM or Group on the side to denote they are wiki
7. Accounts properly for existing states like hidden / deleted, I don’t want people editing deleted / hidden posts or posts they have no access to.

More context:

- long term admin menu will have more options like, hard delete post, change owner etc.
- longer term we may add a new permission for editing OP or posts in a category, which will allow better fidelity.

That is it, nothing else for v0.

cc @lightyear

---

<div class="post-metadata">

### Author: ![lightyear](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@lightyear](https://meta.discourse.org/u/lightyear)
#### Post date: [March 21, 2014, 12:46pm UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/2 "2014-03-21T12:46:41Z")

</div>

> [@sam](#):
>
> That said if the community would like to contribute a PR in this department we would be more than happy to review, and if good merge.

Yes, indeed. Looking into that.

> [@sam](#):
>
> 1. Add a column to posts wiki not nullable bit, default 0.
> 2. Any post that has wiki=1 is editable by all logged on users.

hee… that feels a little puzzling to me. I was thinking of implementing it as its own “archetype” because that’s what I thought it was for. Though this solution sounds much easier and very straight forward, you mind to explain what the “archetype” system is meant for if not cases like this?

I’m fine doing it either way and most definetly in a way that it gets merged faster, but if I do it, I might as well do it right from the beginning, so if archetypes are more appropriate, let me know ..

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 21, 2014, 1:13pm UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/3 "2014-03-21T13:13:53Z")

</div>

Sure, use archetype, turn it to an int while at it.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 21, 2014, 5:05pm UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/4 "2014-03-21T17:05:13Z")

</div>

Just make sure that there aren’t any regressions where the archetype of the post is being compared (because that happens all over the code). A wiki post should function just like a regular post in all other aspects.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 22, 2014, 2:28am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/5 "2014-03-22T02:28:17Z")

</div>

That is a strong argument in favor of this not being a topic archetype. I don’t think it should be. Archetypes are for entire topics that have unique behaviors, they are not intended for individual posts that have slightly different behavior as in this case.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 22, 2014, 2:31am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/6 "2014-03-22T02:31:06Z")

</div>

That is true, I thought it was on the topic table anyway, it should be an int not a string, but unrelated to this change cause iswiki is on post

---

<div class="post-metadata">

### Author: ![lightyear](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@lightyear](https://meta.discourse.org/u/lightyear)
#### Post date: [March 22, 2014, 9:42pm UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/7 "2014-03-22T21:42:54Z")

</div>

> [@codinghorror](#):
>
> Archetypes are for entire topics that have unique behaviors, they are not intended for individual posts that have slightly different behavior as in this case.

fair enough. care to explain what would be a different topic archetype example then? It hasn’t been defined somewhere, has it?

Because from how I’d see it, wiki would be about the first post in a topic in almost all cases, aren’t they? Or what case do you see when a collaborative post (that’s how I understand wikis in discourse at the moment) would be on other posts than the first one?

So assuming a wiki therefore is on mainly about the primary post, I’d argue that the other posts are a discussion about it, but you might also want to have this rendered differently with a higher emphasis on the wiki post itself – as this shall be subject of change, reflecting the latest conclusions of that conversation, shall it not? Coming from that perspective, looking at the current system, I’d argue that it falls on the level like the distinction between private message and normal topic. Which is defined by it’s archetype.

If it is just about allowing others to edit a post, I consider the [“share edit” plugin](https://meta.discourse.org/t/shared-edit-share-the-permission-to-edit-your-post-with-other-users/13631) a more than sufficient solution –&nbsp;and even for that one I don’t see why you’d do that for a non-primary post in a discussion…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 22, 2014, 9:46pm UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/8 "2014-03-22T21:46:36Z")

</div>

> [@lightyear](#):
>
> wiki would be about the first post in a topic in almost all cases, aren’t they?

No, I don’t think that’s true at all for Wiki. Any post could be wiki. Polls do work this way though, they have to be the first post otherwise it is insanity.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 22, 2014, 10:49pm UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/9 "2014-03-22T22:49:36Z")

</div>

> [@lightyear](#):
>
> If it is just about allowing others to edit a post, I consider the “share edit” plugin a more than sufficient solution –&nbsp;and even for that one I don’t see why you’d do that for a non-primary post in a discussion…

No, this is a **core feature** , and the spec walks through the reason this is strategic, it starts work towards the admin menu per post, which we need of many reasons.

Wiki can happen anywhere in a topic, you can start discussion then have the community work on a wiki mid topic.

Longer term plans of the spec deal with per-topic type permissions.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 22, 2014, 10:58pm UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/10 "2014-03-22T22:58:05Z")

</div>

> [@lightyear](#):
>
> fair enough. care to explain what would be a different topic archetype example then?

Our intention with archetype is at a higher level.

Buying/Selling archetype, Chat archetype, Q&A etc.

The concept it to give a special skin and function per archetype. Wiki may fit there, but its way out of scope as this would involve large architectural changes. I much prefer to start with something, small, concrete, simple rather that starting work on archetypes which is a massive amount of work.

---

<div class="post-metadata">

### Author: ![lightyear](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@lightyear](https://meta.discourse.org/u/lightyear)
#### Post date: [March 23, 2014, 8:31am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/11 "2014-03-23T08:31:22Z")

</div>

> [@codinghorror](#):
>
> No, I don’t think that’s true at all for Wiki. Any post could be wiki. Polls do work this way though, they have to be the first post otherwise it is insanity.

You’ve not actually given any use case. Sure – technically – all posts could be a wiki, but then again, so could they be polls. But you are making the good point, that they shouldn’t be.

> [@sam](#):
>
> Wiki can happen anywhere in a topic, you can start discussion then have the community work on a wiki mid topic.

Sure, technically, this is possible to implement. But same for polls, I’d consider this bad practice. Rather have a person “fork” the conversation and do a new “wiki-style” topic for it than start editing some post mid-way in the conversation as the “wiki” about it – it will be impossible to find for users…

> [@sam](#):
>
> No, this is a core feature, and the spec walks through the reason this is strategic, it starts work towards the admin menu per post, which we need of many reasons.

I really like that idea and I see good reason to implement this independent from the wiki. But in particular, when allowing the post to become “unwiki-ed” by admins later, I feel this will be confusing after (as a post then has been edited by multiple authors and a visual cue was showing that but from that point on the visual cue would be gone). I would make the current status of who can edit a post independent from the wiki-flag. Having the admin menu with proper permissions per posts sounds like a much better idea.

> [@sam](#):
>
> Our intention with archetype is at a higher level.
> 
> Buying/Selling archetype, Chat archetype, Q&A etc.
> 
> The concept it to give a special skin and function per archetype. Wiki may fit there, but its way out of scope as this would involve large architectural changes. I much prefer to start with something, small, concrete, simple rather that starting work on archetypes which is a massive amount of work.

Fair enough. Unfortunately what has been proposed as a “wiki” spec here wouldn’t be sufficient in the case of what we are working on (me, full-time from next week I might add) –&nbsp;as it is only about sharing edit permissions from what I can see. Instead what we do need for our installation is a “wiki” (or “article” as it is called here) which does have another layout and different behaviour and for sure, would be bound to the topic/first post. So, from all I’ve read and you’ve said, it should be implemented as its own archetype. I’m also not afraid of bigger amounts of work for that, that’s something I knew would be needed for it anyways. I’d just like to make it proper in the first place so we can merge this back into master and everyone can benefit from it.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 23, 2014, 10:49pm UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/12 "2014-03-23T22:49:12Z")

</div>

> [@lightyear](#):
>
> But same for polls, I’d consider this bad practice.

That is just like, your opinion man 🙂

I can see multiple use cases:

- Q&A archetype, Question remains normal, some answers are wiki.
- Topic summary post for long topics, such as [Underrated and overrated films (and other general filmy chat) - general topics - Boing Boing BBS](http://bbs.boingboing.net/t/underrated-and-overrated-films/19345) which would be totally fine as post #2
- Full Wiki topics, where post #1 is a table of contents and rest of posts are linked from there

Etc.

> [@lightyear](#):
>
> allowing the post to become “unwiki-ed” by admins later

Admins can do whatever they will, then can rewrite posts, impersonate users and wreak havoc with a forum if they wish. It is the nature of being an admin. Besides history is not going to be rewritten as part of un-wiki if ever needed so you can track it down. (Though admins will need nuke revision at some point)

> [@lightyear](#):
>
> Fair enough. Unfortunately what has been proposed as a “wiki” spec here wouldn’t be sufficient in the case of what we are working on (me, full-time from next week I might add)

There is a **VERY** important order of operations here. This is a strategic feature that we need first before building a huge battleship. This is a small, well specified, very useful feature that could be implemented in days. And **must** happen before we will even consider merging a wiki archetype into core. (which must be will specified regardless)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 3, 2014, 11:37pm UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/13 "2014-04-03T23:37:49Z")

</div>

@velesin the major use case for editor sync is wiki type posts, was wondering if you would like to take this spec on, then I can go ahead and make all the howtos wikis and we can start exercising your awesome feature a bit more.

---

<div class="post-metadata">

### Author: ![velesin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/velesin/32/107296_2.png) [@velesin](https://meta.discourse.org/u/velesin)
#### Post date: [April 7, 2014, 6:49am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/14 "2014-04-07T06:49:07Z")

</div>

I’m not sure if I understood correctly - do You mean if I’d like to implement the Wiki topic feature?

If @lightyear is not working on this, then sure, I’ll take it.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 7, 2014, 7:17am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/15 "2014-04-07T07:17:06Z")

</div>

Yes, please @lightyear is not interested in taking this on , just looking for an implementation of the initial post

---

<div class="post-metadata">

### Author: ![velesin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/velesin/32/107296_2.png) [@velesin](https://meta.discourse.org/u/velesin)
#### Post date: [April 7, 2014, 7:26am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/16 "2014-04-07T07:26:47Z")

</div>

OK, so I’m starting on this.

---

<div class="post-metadata">

### Author: ![lightyear](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@lightyear](https://meta.discourse.org/u/lightyear)
#### Post date: [April 7, 2014, 9:04am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/17 "2014-04-07T09:04:30Z")

</div>

> [@velesin](#):
>
> OK, so I’m starting on this.

Yup, go ahead. I currently have my hands full on other parts and can’t take care of this. But I’d love to help on the whole admin-menu-part. If you need any help, just shoot me a line.

---

<div class="post-metadata">

### Author: ![DavidGNavas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidgnavas/32/68313_2.png) [@DavidGNavas](https://meta.discourse.org/u/DavidGNavas)
#### Post date: [April 7, 2014, 10:28am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/18 "2014-04-07T10:28:05Z")

</div>

> [@velesin](#):
>
> OK, so I’m starting on this.

Hi! Just a few days ago I sent an email to Jeff about this topic. In my company there are two developers whom we are working with, that could dedicate time on this.

If @velesin wants to start on this and then we could contribute in some way, we would love to help to develope this feature 😄

---

<div class="post-metadata">

### Author: ![velesin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/velesin/32/107296_2.png) [@velesin](https://meta.discourse.org/u/velesin)
#### Post date: [April 8, 2014, 5:41am UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/19 "2014-04-08T05:41:00Z")

</div>

@lightyear @DavidGNavas

Thanks a lot guys!

For now this seems like too compact feature to comfortably split work among several people, so I’ll start myself right now - but if I get stuck or will need help on something I’ll surely let you know!

---

<div class="post-metadata">

### Author: ![velesin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/velesin/32/107296_2.png) [@velesin](https://meta.discourse.org/u/velesin)
#### Post date: [April 29, 2014, 6:31pm UTC](https://meta.discourse.org/t/wiki-topic-mini-spec/13966/20 "2014-04-29T18:31:03Z")

</div>

Took me years due to a ton of different stuff I had to do (had a couple of quite busy weeks) but finally the prototype is there… 🙂

> <https://github.com/discourse/discourse/pull/2303>
>
> See this topic for details: https://meta.discourse.org/t/wiki-topic-mini-spec/13…966
> 
> Functionality should work more or less as in requirements in above post.
> 
> Layout is my invention - it will most probably require some polishing.
> 
> There are also 2 new translations added: \`post.controls.admin\` and \`post.wiki\`. I don't know how the process of adding translations looks like (should they be added directly to all language files, to english file only or via external translation system) so for now I've added them only in the code (translation files need to be updated with these 2 new keys).

Please take a look. (check out the post menu - it has a new admin “wrench” icon now - as well as revision history popup)

[Next page](https://meta.discourse.org/t/wiki-topic-mini-spec/13966.md?page=2)
