Saber Docs

Saber Docs is a free WordPress plugin from SaberWP. It is used to present great documentation. The key features includes it's automated side menu and AJAX content loading which enable users to quickly navigation through an entire documentation section.

This documentation is a "doc page" from Saber Docs. The menu on the left is built out of the "doc category" taxonomy. All of the documentation you find here on saberwp.com is created using the Saber Docs plugin.

File Reference

plugin.php

readme.txt

templates/menu.php

templates/single-doc.php

js/main.js

inc/post-types/doc.php

inc/taxonomies/doc-category.php

inc/Doc.php

inc/TaxonomyTree.php

Installation

Download Saber Docs plugin for free at https://github.com/saberwp/saber-docs/.

Look under releases for the latest package. Upload the zip to your WordPress site.

Q2, April - June 2023

Several important issues will be fixed in the upcoming release of Saber Docs including:

  • Provide mechanism for ordering doc categories.
  • Improved activation hook to ensure rewrite flush to setup routing for the doc pages post type.

Goal for the next release with multiple issues fixes is end of March 2023.

The remainder of the quarter will be focused upon providing improved style options including template overrides and style presets. The release dates for these features will be at or near the end of May 2023.

Editing UI

Doc category editor (custom taxonomy doc-category).

Index Post

A doc post that you associate with the parent term will become the index post for that documentation tree. You should only have 1 index post, as only the first post will be rendered into the menu. This index post will be the default screen shown when the documentation tree is loaded.

Creating Doc Posts

In the WordPress admin a new menu item "Doc" will be added by Saber Docs. Click "Add new" to begin the process of publishing a new doc post.

The most important aspect of writing a doc post is using the doc-category taxonomy. This custom taxonomy is used to build the automatic doc menu. You will need to choose a "secondary", that is second-level term in order for the post to show in the generated menu. You can also select the top level term which is helpful for finding the associated posts later in the post list because you'll be able to click on the parent category term and use it as a filter. The important point however is that items that are only associated to the top level will not appear on the menu. This is because the top level is reserved only for the index page, and all doc posts in each tree are expected to be organized in subcategories.

Doc Menu

The doc menu is generated automatically from the doc-category taxonomy terms. Understanding how the menu parses the doc-category terms will be very helpful in making sure your doc menu is rendered exactly how you want it to look.

The top-level items in the doc-category are considered by Saber Docs to be different "documentation trees". This is how the plugin supports writing docs for entirely different products or API's. You'll notice here on saberwp.com we use the structure that each documentation tree is specific to one plugin or theme. We are then able to create subcategories (level 2) which will automatically appear in the doc menu. Doc posts are then organized into these level 2 terms.