@bold{This is easiest to use!} It works in Firefox and Chrome on the computer.
@itemlist[#:style 'ordered
@item{Install the extension: @hyperlink["https://addons.mozilla.org/en-US/firefox/addon/indie-wiki-buddy/" "Firefox"] or @hyperlink["https://chrome.google.com/webstore/detail/indie-wiki-buddy/fkagelmloambgokoeokbpihmgpkbgbfm" "Chrome"]}
@item{Click its icon and check "BreezeWiki is on" at the top.}
]
@bold{There you go, all done!} If it works, you can stop reading here.
If you want to be redirected in Safari on iOS or macOS, you can use Redirect Web for Safari.
@itemlist[#:style 'ordered
@item{Install @hyperlink["https://apps.apple.com/us/app/redirect-web-for-safari/id1571283503" "Redirect Web for Safari"]}
@item{Download this file: @url{https://docs.breezewiki.com/files/breezewiki-redirector.json}}
@item{Open the file with the @italic{Files} app, click on the @italic{Share} icon, click @italic{Redirect Web}, and click @italic{Import}. The redirect should now be enabled in Redirect Web's list.}
@item{Once it's imported, it's safe to delete the @italic{breezewiki.redirectweb} file.}
@item{Install the extension: @hyperlink["https://addons.mozilla.org/en-GB/firefox/addon/redirector/" "Firefox"] or @hyperlink["https://chrome.google.com/webstore/detail/redirector/ocgpenflpmgnfapjedencafcfakcekcd" "Chrome"]}
@item{Download this file: @url{https://docs.breezewiki.com/files/breezewiki-redirector.json}}
@item{Click on the Redirector extension icon, click @italic{Edit Redirects}, click @italic{Import}, then choose the @italic{breezewiki-redirector.json} file you just downloaded. It will say successfully imported.}
@item{Once it's imported, you can delete the @italic{breezewiki-redirector.json} file from your computer.}
@nested[#:style (style "block-note" null)]{Violentmonkey executes @italic{userscripts} created by other people, which can do many things to your web browser, more than just redirect you. Some may be helpful, some may be harmful. Make sure you only install userscripts that you trust.
Userscripts from this page are known to be trustworthy :)}
@item{@hyperlink["https://violentmonkey.github.io/get-it/" "Install the extension"] (or you can choose another userscript manager, like Greasemonkey or Tampermonkey)}
@item{@hyperlink["http://alphamethyl.barr0w.net/~barrow/src/barrownet_ca_redirector/breezewiki_redirector.user.js" "Install Barrow's userscript"], which will automatically send you to BreezeWiki. Alternatively, @hyperlink["https://docs.breezewiki.com/files/redirector.user.js" "Install Cadence's userscript"], which will show a big banner you can click to take you to BreezeWiki.}
@item{Violentmonkey will show you the code of the userscript, and offer to install it for you. If you want to proceed with the installation, click @italic{Confirm Installation}.}
LibRedirect is ideal if you're a privacy-minded Firefox user. It can redirect many popular websites such as YouTube, Reddit, Google Maps and Twitter to alternative viewers; you can configure which sites will be redirected.
Bug reports are important, and so are feature requests! Thank you for your interest. Here's how to send in yours.
There is the @italic{mailing list} which is the first line for people like you to report to. Once a bug is confirmed, I will copy it onto the @italic{todo tracker} as a task item.
Please spend one minute @hyperlink["https://todo.sr.ht/~cadence/breezewiki-todo" "checking the todo tracker"] so you don't submit a duplicate of somebody else's report.
You can interact with the mailing list and the todo tracker without needing to register any accounts on any websites! It's all done through regular email.
To actually send in your report, compose an email to @hyperlink["mailto:~cadence/breezewiki-discuss@lists.sr.ht" "~cadence/breezewiki-discuss@lists.sr.ht"] with a useful subject line and a description.
Please make sure to include the following information:
@itemlist[
@item{Which URL can I visit to see it for myself?}
@item{Which part of the page are you talking about?}
For real-time chat with the community, @hyperlink["https://matrix.to/#/#breezewiki:cadence.moe" "check out our chatroom!"]
To privately contact Cadence, the developer of BreezeWiki, @hyperlink["https://cadence.moe/contact" "here's their website with contact info."] If you run a wiki on Fandom or any other website, you're very welcome to send me a message! If you don't run any wikis, you're a normal amount of welcome :D
@item{Install Racket. Please install the latest version. 8.4 or later is required. @hyperlink["https://download.racket-lang.org/" "Download it here if your package manager is old."]}
@nested[#:style (style "block-note" null)]{If building in an automated environment, like CI or Docker, use @code{raco pkg install --batch --auto --no-docs --skip-installed req-lib} instead of step 3 above.}
@subsection{Updating the source code}
If you are running BreezeWiki from source code, you will need to follow these steps any time you pull the latest version. (Not required when running the executable or Docker.)
@itemlist[#:style 'ordered
@item{Make sure your version of Racket is still new enough to run BreezeWiki. The required version is listed above.}
@item{Run @code{raco pkg update --all} to update existing dependencies.}
@item{Run @code{raco req -d} to install any new dependencies.}
@nested[#:style (style "block-note" null)]{There is no official Docker support. Information herein is created by members of the community. Using Docker makes it more difficult to debug and find help if you encounter problems.}
Image provided by PussTheCat.org: @url{https://github.com/PussTheCat-org/docker-breezewiki-quay}
A full clone of BreezeWiki uses less than 10 MB of space on disk.
RAM usage is typically 400-500 MB.
CPU usage is difficult to specify, and depends on how frequently it sees incoming requests. When not servicing requests, it shouldn't be using any processing power.
If you're running BreezeWiki in production (i.e. not for development) then check out the @secref["Required options"] section of the configuration page.
Configuration options are added to the @code{config.ini} file. It is a regular INI file. When running from source, @code{config.ini} goes next to @code{breezewiki.rkt} in the root directory of the repo.
When running a compiled distribution of BreezeWiki, the main @code{config.ini} file will actually be a symlink to the real location of the file. Make sure not to erase the symlink, or your settings will be ignored!
By popular demand, environment variables can be used as an alternative to the configuration file. The configuration file will be read first and will override the default settings, then, if any environment variables are present, they will override the values in the configuration files.
Environment variables start with @code{bw_} and then the name of the setting. They can be uppercase or lowercase.
@subsubsection{Example}
Here is an example of using environment variables in a typical shell:
Which hostname to run the server on. The default value is auto. Auto means 127.0.0.1 in debug mode, otherwise, all interfaces. If you don't know what this means, don't change it.
When enabled, any text typed in the search box will be sent to Fandom servers in order to provide suggestions. It will be sent via the proxy if the strict_proxy option is set.
Whether to put more URLs through the proxy. If false, just a minimal set is proxied. If true, additionally proxies page stylesheets and links to image files, thereby reducing the potential for end-users to connect to Fandom servers.
If you are new to programming entirely, BreezeWiki is likely not a good introductory project for you. I recommend purchasing a physical book about programming targeted at beginners. (In 2022, internet searches for beginner programming questions are sadly filled with low quality results or straight up misinformation.)
If you already know programming concepts but are new to Racket, I recommend reading @hyperlink["https://docs.racket-lang.org/quick/" "Quick: An Introduction to Racket with Pictures"] and trying the instructions for yourself. This should fill you in on the basics of doing real things with the Racket language. After reading that, if you want to know the fundamentals even more in-depth, you can check out the @hyperlink["https://docs.racket-lang.org/guide/index.html" "Racket Guide"], which is better to jump around in rather than read from start to end. The Racket reference documentation is on the same website.
I @italic{recommend} using the official DrRacket IDE to write Racket code, particularly if you are a beginner. It applies useful indentation automatically and it has helpful hover hints. Once you are familiar with Racket, you could configure Emacs, VSCode, Vim, or your favourite other editor to understand Racket's style rules, though you might still miss out on syntax highlighting or hover hints in some situations.
@code{breezewiki.rkt} and @code{dist.rkt} are entrypoints. They do as little as possible, just requiring the page functions and starting the web server.
@code{src/page-*.rkt} contains the page functions. Each file has instructions on how to render a specific kind of page. For example, @code{src/page-wiki.rkt} renders the usual wiki pages by contacting Fandom servers, altering the HTML tree, and sending the response to the browser.
Everything else in @code{src/} is a utility file that is required in by the pages as needed.
@subsection{Fandom endpoints}
BreezeWiki mostly uses the MediaWiki APIs rather than scraping full pages pages. If I need to add functionality in the future that can't be covered through the APIs, I would consider changing to scraping full pages.
@subsection{HTML tree transformations}
@hyperlink["https://www.mediawiki.org/wiki/API:Parsing_wikitext" "MediaWiki's Parse API"] returns the contents of a page as HTML, but returning this wholesale isn't good enough. Several modifications need to be made to the page before it's suitable for display on BreezeWiki, such as altering links to have the correct prefix, making all images visible without JavaScript, and enclosing tables to allow horizontal scrolling.
To do these transformations, the @code{update-tree} function recurses through the whole HTML tree from MediaWiki, executing a function on each element. This function returns the new element to replace with, allowing update-tree to eventually build a whole brand new tree. If the function decides that there's nothing to be done for a particular element, it just returns the same element. You can see the largest example of this in @code{src/page-wiki.rkt}, where many transformations can be applied to every element.
Background: Racket is a dialect of Lisp, a class of programming languages that are good at manipulating lists of symbols. XML and HTML trees are represented as @italic{X-expressions}, which you can read a bit more about within the @hyperlink["https://docs.racket-lang.org/pollen/second-tutorial.html#%28part._.X-expressions%29" "Pollen documentation: X-expressions"]. (The rest of the Pollen documentation is unrelated.) An X-expression is often called an xexp or an xexpr for short. BreezeWiki includes @code{src/xexpr-utils.rkt} for some helpful functions that query and manipulate X-expressions.
@subsection{Programming}
If @code{breezewiki.rkt} is launched (in a REPL) it will dynamically load in the pages and watch them and their dependencies for changes. If you edit and save a file within @code{src/} it will likely be reloaded automatically.
Creating a new page requires editing @code{src/dispatcher-tree.rkt} to define which URLs the page should appear from, and @code{breezewiki.rkt} and @code{dist.rkt} to cause the page to actually be loaded. The first time you create a page it won't be loaded automatically and you'll need to restart BreezeWiki.
Automatic reloading helps with rapid development and avoiding long process startup times. But if the long startup times still frustrate you, you can use @code{raco make breezewiki.rkt dist.rkt} to byte-compile files for faster startup.
@subsection{Testing}
Most files also contain unit tests, within the @code["(module+ test"] sections. Evaluating a file within either DrRacket or Emacs-racket-mode automatically runs the tests in that file. Since almost all functions are pure functions (i.e. operate based on their inputs and outputs rather than relying on application state) they are easy to unit test.
You can run all tests in all files with @code["raco test --direct (grep -l 'module+ test' (git ls-files))"] which is helpful to check for regressions before committing.