Skip to content

About

Wiki Plugin to create and maintain documentation for Kanboard projects.

Topics

Resources

Stars

45 stars

Watchers

4 watching

Forks

Repository files navigation

Wiki Plugin for Kanboard

GitHub Latest Release (by date) kanboard-plugin-Wysiwyg-MD-Editor

GitHub All Releases GitHub Repository File Count GitHub Repository Size GitHub Code Size

kanboard-plugin-Wysiwyg-MD-Editor GitHub Discussions GitHub Commits Since Last Release GitHub Commit Monthly Activity

Kanboard


The main purpose of the Wiki Plugin is to provide an easy way to add and maintain documentation for KB projects:

  • Create and manage a branched structure of Wiki pages per project.
  • Support for backup of previous versions of Wiki pages as editions.
  • Search Wiki pages by title and content across all user accessible projects.
  • Wiki pages provide rich text content through the GitHub Flavored Markdown, which is implemented by the parsedown lib.

Table of Contents

[↓ Bottom] [↑ Top]

Author

[↓ Bottom] [↑ Top]

Installation & Compatibility

Installation
Compatibility
  • Requires Kanboard ≥1.0.37
  • Other Plugins & Action Plugins
    • No known issues
  • Core Files & Templates
    • 2 Template overrides
    • 3 Database tables serving Wiki plugin purposes + 1 entry into KB settings
Translations
  • Available translations for some common languages: CZ, DK, DE, ES, FI, FR, HU, IT, JP, NO, NL, PL, BR, PT, RU, SE, TH, TR, UA, CN
  • Translation for en_US is the default if there is no translation pack for the user selected language in KB.

[↓ Bottom] [↑ Top]

Features and Usage (with Screenshots)

The Wiki Plugin has three functional views which are explained hereby.

Details on accessing and operating them are provided within each expandable section.

[↓ Bottom] [↑ Top]

🔳 Wiki Content

Wiki Content Link

To see the Wiki Content for a project simply press the Wiki button [1] in the project header. Alternatively, use a keyboard shortcut v w while in some of the project views (Overview, Board, List, Calendar).

Wiki Content Link

[↓ Bottom] [↑ Top]

Wiki Tree View

The Wiki tree represents the hierarchy of the pages organized in nested branches, starting form an empty (root) node.

The interface provides navigation and management functionality as follows:

  • the + and - buttons at the top [1] expand and collapse all branches
  • the individual branch buttons [2] expand/collapse each branch alternatively
  • for every page there are Edit Page and Remove Page buttons [3]
  • reordering and nesting of individual pages and whole branches [4] is available via drag-and-drop within the tree view
  • a help button [5] to the online README

Wiki Tree View

[↓ Bottom] [↑ Top]

Wiki Page New / Edit

Creating a new Wiki page always places it after the last page under the (root) node, then it can be moved anywhere in the Wiki tree hierarchy.

You only need to specify a title and fill in some content. The content is rich text enabled through MD, embedded markdown editing tools [1] are available.

Wiki Page New

When editing an exising page there is an additional dropdown menu [2] which allows to change the parent page of the one currently being edited. It will show a hierarchy tree of all the pages allowed for nesting. For obvious reasons you cannot nest a page anywhere within its own branch, so all the pages under that branch will not be available in the dropdown.

Wiki Page Edit

[↓ Bottom] [↑ Top]

Wiki Page Details

The detailed view of the selected page [1] shows its content as well as some additional information related to the page. If you don't see a selected page [1] in the tree view on the left, then most probably you have collapsed some parent branches. The Go to Selected Wiki Page arrow button [2] on top of the tree view will automatically expand all branches to the selected page in order to make it visible.

Wiki Page Details

The elements of the detailed view besides its content are as follows:

  • a collapsable section containing page attributes [3], such as creation and modification dates and users, as well as editions info (see the Wiki Page Editions section below)
  • a collapsable section of links to direct subpages [4] which may be empty if the page has no nested children
  • an action panel [5] right under the title, which contains buttons for editing and removing the page, as well as viewing and managing the editions (see the Wiki Page Editions section below)
  • a bottom section for attachments [6] for viewing and managing images an files attached to this article (see the Wiki Page Attachments section below)

[↓ Bottom] [↑ Top]

Wiki Page Attachments

At the bottom of a Wiki page there is a section that allows for adding, managing and viewing of attachments. There are in general two types of attachments: images and all the others that are not directly viewable.

Images are considered all *.gif, *.jpg, *.jpeg and *.png, those are displayed with preview and can be browsed in a gallery. All the other attachments are listed in a table below the image thumbnails.

A common way to add an image is [1] to make a screenshot (or copy a part of an image) to the clipboard and then paste it into the provided form. This will create internally a PNG image [1] that will be attached to the page as if it was a normal file. Clicking on any image thumbnail [2] will open a full preview of the image in the embedded article gallery.

An info tooltip [3] displays all the properties of the image which otherwise are displayed in the table below for the rest of the files. The dropdown menu of every image [4] allows to Download or Remove the image as an attachment of the page.

Note the Id of the attachment [5], be it image or any other file, if yo need to embed links within the article content later.

Wiki Page Attachments 1

In order to attach a document [6] there a form that allows for browsing or drag-and-dropping of practically any type of file. All the attached files from the list [6] can be managed through their menu [7], allowing Download and Remove. Some of them also have a View file option that will attempt to preview them in a separate browser window. The later include all the *.pdf, *.mp3, *.ogg, *.flac, *.wav, *.avi, *.webm, *.mov, *.m4v, *.mp4, *.svg files.

Wiki Page Attachments 2

If you need to embed an image or a link in the article itself using markdown and the Id of an attachment [5] you can follow these examples:

  • [8] embedding an image ![image alt descr](/wiki/file/<Id>/image)
  • [9] adding a file data link [file data link](/wiwi/file/<Id>/browser), unfortunately this link MUST be opened in a standalone browser tab/window in order to work correctly and MD does not provide a way to do make such links
  • [10] providing a file download link [file download link](/wiki/file/<Id>/download)

Wiki Page Attachments 3

[↓ Bottom] [↑ Top]

Wiki Page Editions

The editions view allows for viewing and managing previous editions Wiki page that were automatically stored. The global setting Saving Editions determines whether automatic saves of editions will take place when you make changes to the page (see the Wiki Plugin Settings section below).

You can return back to the detailed view of the page [1] at any moment, or you can simply click on another page from the tree view. On the editions list itself yo can observe and compare the detailed differences [2] in title, content and dates of the stored versions of the page. Each edition shows what changed since the edition before it, with +added −removed line counts. The newest edition's changes are open; the others expand on click.

  • Markdown shows a git-style line diff of the page source, Unified or Side by side, with changed words marked and long unchanged stretches folded
  • Rendered shows the rendered page with removed blocks struck through and added blocks highlighted
  • the choice is remembered in the browser; the page detail has a Last change link straight to the newest edition's changes
  • long histories are split into pages of 20 editions; Compare edition … with … compares any two editions on the page

Markdown, unified:

Edition changes, markdown unified

Markdown, side by side:

Edition changes, markdown side by side

Rendered:

Edition changes, rendered

Wiki Page Editions

Some of the editions may be missing if they were deleted. You can Restore or Delete an edition using the tool buttons [3] in the top right corner of each edition entry row.

  • restoring an edition saves its title and content as a new edition, so the history only grows and can be read top to bottom
  • you can only restore a version of the page that was previously saved as edition
  • you can only delete a version of the page that is not currently active
  • when you delete an edition it is permanently removed and can no longer be restored

[↓ Bottom] [↑ Top]

Wiki Plugin Settings

This section [1] is available from KB system menu: Settings ⥂ Wiki settings. You need ADMIN priveleges to access it.

Enabling or disabling of the Saving Editions option [2] determines whether automatic saves of editions will take place when you make changes to the pages' title or content. Reordering pages or reorganizing the hierarchy branches does NOT trigger creation of new editions. Turning the option off keeps the existing editions. When it is turned back on, edits made in the meantime are saved as their own edition (marked Changes made while edition saving was off) on the next save. Editions are stored as deltas from the previous edition, with a full copy every 20 editions. Editions saved by older plugin versions are full copies and are read as they are. Under Edition history storage, Compact edition history rewrites older editions as deltas, and Expand edition history rewrites every edition as a full copy. Each page is rewritten in one transaction and checked afterwards; a page that does not check out is left unchanged. Expand the edition history before installing an older version of this plugin: older versions would show stored deltas as page text. Expanding drops the made while edition saving was off mark.

The Public access options control what public projects share through their public link:

  • Show the wiki of public projects through their public link (on by default): when off, the public wiki pages are refused and the public board hides its wiki link.
  • Show attachments on public wiki pages (off by default): when on, public wiki pages list their attachments. The files are served only together with the project's public token, and only for that project's pages.

Wiki Plugin Settings

[↓ Bottom] [↑ Top]

Links to Wiki Pages

Link to wiki pages and attachments from any markdown in Kanboard (wiki pages, task descriptions, comments) by id:

See wiki:12
See [the release checklist](wiki:12)
Download [the spec](wiki-file:34)
![Architecture](wiki-file:35)

A plain wiki:<id> becomes a link titled with the page title, like #<id> for tasks. In the markdown editor, typing wiki: lists the pages you can open; type digits to narrow by page id.

[text](wiki:<id>) links to a page, wiki-file:<id> links to an attachment, and ![...](wiki-file:<id>) embeds an image attachment. They work for users who can view the project. Anyone else sees only the text (or the image's alt text), without a link. On public pages (opened through a public link), page links point to the public view if the page's project is public, and attachments use the project's public token if Show attachments on public wiki pages is on; otherwise they stay plain text too.

The plugin provides this by replacing Kanboard's text helper with an extended one. Another plugin that also replaces that helper may override it, depending on load order.

[↓ Bottom] [↑ Top]

[↓ Bottom] [↑ Top]

🔳 Wiki Overview

Wiki Overview Link

Go to the project menu [1] and select the Wiki Overview [2] from the dropdown.

Wiki Overview Link

[↓ Bottom] [↑ Top]

Wiki Overview Table

The Wiki overview presents a fully expanded table view of the entire Wiki hierarchy, providing various details for each page. Its purpose is rather informative than functional, yet you can still remove pages or add new ones, as well as edit existing pages (and reorder them via the edit form).

Clicking on a title link [1] in the overview table will redirect to the Wiki content for displaying the selected Wiki page.

Wiki Overview Table

[↓ Bottom] [↑ Top]

[↓ Bottom] [↑ Top]

🔳 Search Wiki Pages

Search Wiki Pages Link

Since the functionality to search across Wiki pages is not project related it is available from the KB system menu [1]. Select the Wiki Pages item [2] from the dropdown.

Search Wiki Pages Link

[↓ Bottom] [↑ Top]

Search Wiki Pages Results

This system view allows to search Wiki pages by title and content [1] across all the projects accessible by the user. Additionally, some sorting [2] can be applied to the results after each search. Repeated clicking of the sorting method switches between ASC and DESC order.

A preview of each page's content [3] is available within collapsable sections.

Search Wiki Pages List

[↓ Bottom] [↑ Top]

[↓ Bottom] [↑ Top]

JSON-RPC API

The plugin exposes project-scoped Wiki page procedures through Kanboard's /jsonrpc.php endpoint. Use a Kanboard user API token with HTTP Basic Auth (username:api_token) or Kanboard's application API token according to the standard Kanboard JSON-RPC rules. Do not store real API keys in source code, documentation, logs, or issue reports.

Read procedures require project viewer access:

  • getWikiPages(project_id, filters = {})
  • getWikiPage(page_id)
  • searchWikiPages(project_id, query, limit = 20, offset = 0)
  • getWikiPageRevisions(page_id, limit = 20, offset = 0): each revision has comparedWith, added and removed (lines changed since the previous stored revision)
  • getWikiPageRevisionDiff(page_id, from_revision, to_revision = 0): +added −removed counts and a unified diff (like git diff) of the content; to_revision 0 compares with the current page
  • getWikiPageFiles(page_id)
  • downloadWikiPageFile(file_id)

Write procedures require project member access:

  • createWikiPage(project_id, page)
  • updateWikiPage(page_id, expected_revision, patch)
  • archiveWikiPage(page_id, expected_revision)
  • restoreWikiPage(page_id, expected_revision)
  • restoreWikiPageRevision(page_id, expected_revision, revision)
  • createWikiPageFile(page_id, name, blob)
  • removeWikiPageFile(file_id)

Example:

curl -sS https://kanboard.example.test/jsonrpc.php \
  -u 'KANBOARD_USERNAME:KANBOARD_USER_API_TOKEN' \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","method":"getWikiPages","id":1,"params":{"project_id":5}}'

Successful business responses use {"ok":true,"data":...}. Validation and revision failures use {"ok":false,"error":{"code":"...","message":"...","details":{...}}}. API writes require the caller to pass the current revision; stale writes return revision_conflict with currentRevision. Page and file IDs are resolved server-side to their project before authorization, and file download responses do not expose object-storage paths.

[↓ Bottom] [↑ Top]

Development

Roadmap
TODO
  • editions listing and restore
    • Related issues: #9
  • finish edit
  • ordering
    • drop down to switch
    • drag to move, requires css magic
  • subpages and pagination
  • fix wiki sidebar
    • use html template render properly to list wiki pages
    • still having difficulty getting template helper working, manually added for each page
  • get rid of additional old budget plugin code
  • kanboard JSON-RPC API support
  • translations, maybe buttons, won't be translating "Wiki" for most languages
  • active, archived wikipages?
  • global wiki page search
Testing

All commands run from the plugin folder and only need Docker.

Unit tests (same as the SQLite job in .github/workflows/tests.yaml):

Bash / Git Bash:

docker run --rm --mount "type=bind,source=${PWD},target=/plugin,readonly" composer:2 sh -c '
  git clone -q --depth 1 -b v1.2.57 https://github.com/kanboard/kanboard /k && cd /k &&
  mkdir -p plugins/Wiki && cp -r /plugin/. plugins/Wiki/ &&
  composer install -q --no-progress --ignore-platform-reqs &&
  ./vendor/bin/phpunit -c tests/units.sqlite.xml plugins/Wiki/Test/'

PowerShell:

docker run --rm --mount "type=bind,source=${PWD},target=/plugin,readonly" composer:2 sh -c '
  git clone -q --depth 1 -b v1.2.57 https://github.com/kanboard/kanboard /k && cd /k &&
  mkdir -p plugins/Wiki && cp -r /plugin/. plugins/Wiki/ &&
  composer install -q --no-progress --ignore-platform-reqs &&
  ./vendor/bin/phpunit -c tests/units.sqlite.xml plugins/Wiki/Test/'

If it fails with Could not resolve host: github.com, Docker cannot use your DNS server. Add --dns 1.1.1.1 after docker run --rm.

Local Kanboard with the plugin at http://localhost:8080 (default login admin / admin):

Bash / Git Bash:

docker run -d --name kanboard-wiki -p 8080:80 --mount "type=bind,source=${PWD},target=/var/www/app/plugins/Wiki" kanboard/kanboard:v1.2.57

PowerShell:

docker run -d --name kanboard-wiki -p 8080:80 --mount "type=bind,source=${PWD},target=/var/www/app/plugins/Wiki" kanboard/kanboard:v1.2.57

Stop it and delete its data:

Bash / Git Bash:

docker rm -f -v kanboard-wiki

PowerShell:

docker rm -f -v kanboard-wiki
Versions and Releases

The version comes from git tags, using the same rules locally and in CI (see scripts/version/versionRules.sh):

  • a commit with a release tag such as 0.5.0 is that version
  • dev and master are the newest tag plus the number of merges since it, e.g. 0.5.3
  • any other branch is dev's version with its commits ahead of dev added to the patch, e.g. 0.5.3 + 2 commits is 0.5.5

Print it locally. Bash / Git Bash:

bash scripts/version/generateVersion.sh

PowerShell:

./scripts/version/generateVersion.ps1

getPluginVersion() in the repository returns the placeholder 0.1.0; only release zips carry the real version. The unit test workflow shows the version in its run summary. Publishing a GitHub release runs the Release Bundle workflow, which writes the version into Plugin.php, builds the zip with make, checks that the zip reports that version, and attaches it to the release. It can also be run by hand from any branch or tag (Actions > Release Bundle > Run workflow); the zip is then kept as an artifact for 1 day.

After a release, update the "Wiki" entry in the Kanboard plugin directory with a pull request on kanboard/website, so Kanboard installs offer the new version. The Release Bundle run summary prints the updated entry, ready to paste.

[↓ Bottom] [↑ Top]


kanboard-plugin-TodoNotes kanboard-plugin-TodoNotes kanboard-plugin-TodoNotes kanboard-plugin-TodoNotes kanboard-plugin-TodoNotes kanboard-plugin-TodoNotes GitHub commits since latest release (by date)

About

Wiki Plugin to create and maintain documentation for Kanboard projects.

Topics

Resources

Stars

45 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages