QuickieDox is a purely vanilla PHP project that leverages the following libraries to display markdown files documentation.
Library | URL |
---|---|
CommonMark | Parses markdown files to be rendered as HTML. |
TailwindCSS | Nicely design and layout the documentation pages. |
Prism JS | For syntax highlighting of code blocks. |
Guzzle HTTP Client | Used for making HTTP requests if testing is enabled. |
The Installation steps simplifies how to get up and running with QuickieDox.
Below is a high level breakdown of what happens when you access the documentation website you just cloned.
The index.php
file at the root of the project handles vendor autoloading and setting of global variables defined in the .env
and config.php
files. The routes.php
file is then loaded and current url passed to the Router
class to serve content for the matching url.
The DocController.php
file then decides what content to serve. The constructor in the DocController
class sets values for the page to be parsed and returned. This will either be the documentation page the user requested (by clicking on a link in the navigation) or the default page defined in the config.php
file. Where a page was specified but a corresponding .md
file was not found, a default 404.md
is set as the page to parse and return.
Below are really the only types of content expected by the controller:
overview
page or installation
page. Completely up to you.navigation.md
file. A default 404.md
page is displayed if no .md
file was found for the link clicked on.The DocController then hands off the file to be parsed to the Doc
class defined in Core/Doc.php
. Parsing is handled by league/commonmark
and the resulting HTML is returned to the controller, where rendering is handed off to views/reader.php
.
At the view level, Javascript is then used to:
default_page_title
defined in the config file plus what was defined in the first <h1> tag of the documentation page being viewed. Example: the title for this page is set to QuickieDox Documentation: How QuickieDox Works. QuickieDox Documentation is what has been defined in the config.php file for default_page_title
. How QuickieDox Works is what has been defined as the first <h1> on this page.You are encouraged to just snoop around the code to better understand how documentation content is served. It is not complex at all.
In This Document