Konawiki3
Konawiki3 is a simple Wiki designed specifically for writing manuscripts, creating manuals, and sharing information.
Goals of Konawiki3
The data in the Wiki is stored as plain text files, so you can track detailed changes with Git.
You can use Konawiki3 as an alternative to a text editor.
Manage your documents with the small and simple Konawiki!
The main developer has used Konawiki to write dozens of technical books.
You can choose either Markdown or Konawiki's original markup language, KonaNotation, in the configuration and use whichever markup style you prefer.
Konawiki3 also includes a plugin system, making it easy to extend its functionality.
Text-based Wiki
Pages can be written as plain text files that support both KonaNotation and Markdown.
This makes it easy to track changes with Git and manage content efficiently.
You can also switch each page between KonaNotation and Markdown.
This flexibility lets you choose the markup language that best fits your needs and preferences.
In addition to changing the setting, you can switch markup modes by file extension.
A file named plain.txt is automatically treated as KonaNotation, while a file named plain.md is automatically processed as Markdown.
Configuration Through the Admin Page
Konawiki3 lets you configure many settings through the admin page. You do not need to edit the configuration file directly.
These settings include site appearance, user management, and plugin enablement.
After logging in as an administrator, open the configuration page to customize how the site works.
AI Writing Assistance
Konawiki3 includes AI writing assistance features. These include text summarization, proofreading, sentence rephrasing, and automatic continuation of writing.
You can access the AI assistance features by obtaining a ChatGPT API key and setting it in Konawiki.
Tag System for Page Organization
Konawiki3 includes a file-based tag system. Add #tag(TagName) to a page to organize pages by category.
Use tags to classify pages, and use #tags(TagName) to display a list of pages with a specific tag.
For details, see the Tag System documentation.
How to Install Konawiki3
You can easily install Konawiki3 if you have a web server that can run PHP.
Installing with Git
- Install a web server and PHP.
- Run the following commands to clone the repository and change permissions.
- Open
index.php in your browser, create an administrator user, and configure the site.
# clone the repository
git clone https://github.com/kujirahand/konawiki3.git
# chmod the data, cache, and private directories
chmod 766 data
chmod 766 cache
chmod 766 private
Installing on a Hosting Server with an Uploader
- Download the Konawiki3 zip file from releases.
- Unzip it.
- Run the following commands to change permissions.
- Open
index.php in your browser, create an administrator user, and configure the site.
chmod 766 data
chmod 766 cache
chmod 766 private
For details, see the installation guide.
Setting Up from the Command Line
You can create a new wiki and its administrator user without a browser, which is also handy for preparing test wikis.
Step 1: Create a new wiki together with an admin user
# Pass the password via an environment variable to keep it out of shell history
KONA3_ADMIN_PASSWORD='secret' php script/makewiki.php /path/to/wiki [email protected]
- The admin user is created only when
--admin is given. Setting the KONA3_ADMIN_USER environment variable alone does not create one.
- If the admin user ID is invalid or the password is missing, the script exits with an error (exit code 2) before creating the wiki.
Step 2: Add an admin user to an existing wiki
php script/create_admin.php --wiki=/path/to/wiki [email protected] 'secret'
# For this repository itself, --wiki can be omitted
[email protected] KONA3_ADMIN_PASSWORD='secret' php script/create_admin.php
# Overwriting an existing user requires --force
Note: Which OS user runs the script
Files created by the scripts (such as private/kona3adminuser.json.php and private/kona3json_iv.bin) are owned by the OS user who ran them. If you run them as a different user than the web server (for example with sudo as root), the web server may later fail to rewrite those files. Run the scripts as the same user as the web server, or fix the ownership afterwards.
# Example: when the web server runs as www-data
chown -R www-data:www-data /path/to/wiki
Using Docker (Local Environment)
Run the following command in your terminal to start Konawiki3. This runs Konawiki3 using PHP's built-in local server.
docker-compose up
Web Server Notes (Blocking Access to Internal Directories)
On Apache, .htaccess files in data/, private/ and docs/ deny direct access. Servers that ignore .htaccess (such as nginx) need an equivalent rule in the server configuration. In particular, the files in docs/ reveal the version of Konawiki3 by their presence, so deny access to docs/ as well.
location ~ ^/(data|private|docs)/ {
deny all;
}
Installing Libraries (Optional)
If you want to use features such as Git saving or simple PDF generation, install the libraries with Composer.
cd kona3engine
composer install
Depending on your hosting server, Git operations from PHP scripts may be restricted.
In that case, commit via SSH or use cron to commit regularly as follows:
cd konawiki_path
git pull
git add ./data
git commit -a
git push
Accessing the Configuration Page
First, log in as an administrator and open the configuration page.
[URI] index.php?go&editConf
Plugin List
Open the plugin list page in your Konawiki3 installation.
[URI] index.php?FrontPage&plugin&name=pluginlist
Local Plugins
Besides the built-in plugins (kona3engine/plugins/), you can place your own plugins in data/.plugins/*.inc.php.
Built-in plugins take priority over local plugins with the same name.
This lets you maintain plugins in a separate repository. See docs/plugins.md for details.
PDF Output (Optional)
- Open the configuration page and set PDF output to TRUE.
- If mojibake (garbled characters) occurs, place font files (
.ttf) in ./vendor/fonts. - PDF output manual
Static HTML Output (Optional)
Konawiki3 can export all public pages as static HTML, so that viewing does not need PHP. Editing stays on the PHP side.
- Open the config page and, in the "Static" group, enable
static_enable (and set static_outdir / static_base_url if needed).
- Pages are generated into
dist/ (default) when you save them. Admins can also press "Build static pages" (only updated pages) or "Rebuild all" on their user page.
- From the command line:
php script/build_static.php (diff build), --full (rebuild all), --purge (delete generated files). just build does the same.
- If
static_base_url is an absolute URL such as https://example.com/wiki/, sitemap.xml is generated too.
See docs/static_wiki.md for details.
Git Support (Optional)
You can commit Wiki diffs and push them to a Git repository.
# set a remote repository in the data directory
cd data
git remote add origin [email protected]:hoge/fuga.git
Then set git_enabled to true in the configuration.
For Developers
Konawiki3 uses the just task runner.
To run tests, execute just test.