Skip to content
ro edited this page Oct 25, 2021 · 3 revisions

Here is the official wiki.py GitHub Wiki. This page is a general information sheet on how to work wiki.py

Commands

addPage

To add a page, run the command addPage(pageName), but replace pageName with the page you want. For example, addPage("MyPage"). Once you have finished the command, hit enter. A dialog box will pop up saying Now creating page: pageName, that means that the page has successfully been created. A page will not be created if it already exists or it contains a banned word.

editPage

This is similar to addPage, however instead of adding a page, it edits an already existing page. Keep in mind that this command is still under a heavy work in progress, so there will not be much info on how to use it here. It works the same way as the addPage command though, just enter in editPage(pageName) and replace pageName with the page name you want.

viewPage

This is useful if you just want to browse. To use it, do viewPage(pageName).

specialPage

Special pages in wiki.py are similar to special pages in MediaWiki. They tell you information about the wiki, all the pages, etc. Currently there are only 2 special pages in wiki.py, and they are AllPages and WikiInfo. To activate them, do either specialPage("AllPages") or specialPage("WikiInfo").

Files

database.json

database.json is the main function on how wiki.py works. Of course the code is pretty important too, but without database.json, you will not be able to view pages. You do not need to manually edit this file unless you want to change the isLocked value, which I'll dive into later. Make sure that this file is never removed or else wiki.py will NOT work. Here's a quick fire on the properties in database.json:

  • wikiPageName – Defines the page name.
  • wikiPageContent – Defines the page content.
  • isLocked – Defines if the page is locked. If it is, no one that doesn't have access to the database can change it. (Either True or False)

wikiInfo.json

This file is important for setting up your new wiki. After you have download all of the code from GitHub and imported it into your console, change the wikiName value to something else. Currently that is the only thing on wikiInfo, however as wiki.py expands it will soon add more things to wikiInfo.

bannedWords.json

NOTE: Please do not delete this file or leave any values blank. It will mess up the addPage function and will not allow you to create anymore pages.

The bannedWords.json file has no real use other than for banning words. Useful if you are making a family-friendly wiki or too many vandals are on your wiki and you want to stop them (really there's no way to stop them but you can stop them from creating pages with the word "hitler" in it).

Clone this wiki locally