Wiki
This page is about /wiki which on this website is located at: https://development.guide/wiki You are looking at a wiki page now.
Purpose & Behavior
This is the wiki addon for Hubzilla that allows you to create a wiki that others can contribute to. Different pages are shown based on which parameters are passed.
When viewing a wiki page, the URL is in the format of: example.com/wiki/channel-name/name-of-wiki/document-title
Using the Hubzilla permission systems, you can grant individuals and groups the ability to edit the wiki. They would need to sign on with Magic Sign On (OpenWebAuth) to access the edit functions. Users from any platform that supports OpenWebAuth can sign on, which includes Hubzilla, (streams), Forte, and others.
Note: The appearance may be modified by a theme's CSS.
Observer
The behavior of this URL changes based on whether someone is logged in or not.
- Logged Out - Depends on Permissions assigned by Channel.
- Logged In (Local User) - Depends on Permissions assigned by Channel.
- Logged In (Admin) - Depends on Permissions assigned by Channel.
- Signed On (OWA) - Depends on Permissions assigned by Channel.
URLs
- /wiki - Redirects to the wiki list or the home page of the website.
- /wiki/channel-name - Lists wiki pages for a particular channel.
- /wiki/channel-name/wiki-name - Redirects to home page for the wiki.
- /wiki/channel-name/wiki-name/Home - The home page for the wiki.
- /wiki/channel-name/wiki-name/entry-title - The specific wiki entry.
- /admin/addons/wiki - The admin page for enabling and disabling the wiki addon.
Core Code
This code appears in Hubzilla. Not all files are listed here; check the modules files for references to other dependencies and files.
The links mentioning Hubzilla Core and Hubzilla Addons below will take you to their respecitive repositories.
Documentation
Module & Main Code
Templates
Page Description Language (PDL)
Application
Layout
Note: Layouts are used by multiple pages.
Database
- Wiki entries are stored in the items table.
- title is set to
wiki
- resource_type is set to
nwikipage
- comment_policy determines who can edit the entry.
- It is unclear how it determines which is the latest version.
- It is unclear if information is stored elsewhere.
- Where is the information about the URL and title of the page stored?
Known Mods
Addons and themes can modify the default behavior.
Addons
Themes
Widgets
Notes
Hubzilla
Pitfalls
- You cannot add a
.tpl file to your theme to override the default template. You can only override the CSS.
- While Hubzilla supports HTML within a Markdown document, once you add HTML, they cannot be ported back to a system that does not allow HTML in a Markdown document.
- Formatting of lists is a bit wonky. Sometimes you have to add
<br /> after a list to get it to format correctly.
- Hubzilla-specific BBCode does not work when in Markdown or HTML mode, which means you can't use
[observer] and other tags.
- Unless the admin has allowed the channel to add code, your HTML will be filtered. This includes code blocks. Prohibited tags will simply vanish when viewed. For code blocks, if necessary, use
< instead of < for the first bracket so it does not strip out the prohibited tag. Be sure to proofread to make sure your tags are not being suppressed when displayed.
- If you try to write
&lt; it will convert it to < every time you edit again. So it works the first time, but then gets corrupted.
Incompatibilities
- None that we are aware of.
Suggestions and Ideas
- Store the title of the document in the item table.
- Use the title of the document as the
<title> tag so it shows up in the browser tab and elsewhere.
- Allow the summary field to be used as
<meta name="description"> and for search.
- Add BBCode support to HTML and Markdown modes.
- Change wiki page history to use cards instead of tables.
- Change it so that a theme can override the addon's templates.