plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Adding a Comment button for subsections in wiki pages

Open aspriya opened this issue 9 years ago • 0 comments

Feature

This is regarding the Long term project Wiki Discussion. A wiki page can broken down into subsections and can be edit per subsection basis. As the project describes, a wiki should be more interactive. Users having the ability to comment on section basis of is one step for acheiving that.

Relevant URLs

A detailed description of the project can be found in following links https://github.com/publiclab/plots2/issues/1438 https://publiclab.org/notes/Ashan/03-13-2017/wiki-discussion

Methodology

When a logged in user passed a query string paremeter raw=true for a wiki page, the rendering of that page is switched from server side RDiscount to client side publiclab/inline-markdown-editor. Doing so inline-markdown-editor brakes the wiki page into subsections on the basis of two new line characters (\n\n). Inline-markdown-editor library is coded so that it adds an edit button for every one of these broken subections. To add a comment button, in wiki.js we have to attach a new property called extraButtons for the object we are sending to the inline-markdown-editor module. Value of that property should also be a object which intern has a property to identify the button type (So this will be something like fa-comment). This 'fa-comment` property should be assigned with a setup function to setup the comment functionality. Creating that function is another task, So this feature is only to add a comment button for every commentable subsection.

aspriya avatar May 30 '17 18:05 aspriya