Huh! WP Docs was initially dreamt up as huh by the amazing Dan Hauk from secret pizza party. After Silvan Hagen from required saw the potential in vastly improved documentation for users of the WordPress admin and the theme customizer, he couldn't help himself and needed to build upon what at first was just huh.
One thing that needed to be in Huh! WP Docs, was the possibility to add multiple sources for documentation. This was brought to life in a fork from huh by Daron Spence. Besides having multiple sources for documentation Silvan wanted more, so Huh! WP Docs was born.
Huh! WP Docs is a great way to offer in dashboard and in customizer documentation for all your WordPress projects. The content is generated from a markdown files which makes it super quick & easy to update your documentation whenever you want.
The plugin offers filters to add markdown files only to specific pages of the WordPress dashboard from either your theme or another plugin.
We think Huh! WP Docs is awesome and we really want you to use it in all your projects. It's totally free/open source and you can find it on GitHub.
If you found a bug, report it here. If you're a developer, we welcome pull requests of all types!
-
Make sure you have
git,node, andnpminstalled and a working WordPress installation. -
Clone this repository inside your plugin directory.
-
Activate the plugin from the
/wp-admin/plugins screen and enjoy.$ git clone https://github.com/neverything/huh-wp-docs.git $ cd huh-wp-docs -
Watch the front-end CSS/Sass and JS for changes and rebuild accordingly with Grunt. Please only modify the Sass files to keep the CSS consistent and clean. Please only modify the
js/src/huh-wp-docs.jsfile as this is the base for the compiled and minified version.$ npm install $ grunt watch -
Open
/wp-admin/in your browser. -
Have fun!
required is in the process of developing a managed WordPress experience of sorts and while the default plugins and themes we use are quite simple, there is still a need for a wee bit of documentation. External documentation is dumb and everything should be contained in the dashboard. We created Huh! WP Docs to make that happen.
Adding Huh! WP Docs to your WordPress installation is incredibly easy.
Huh! WP Docs pulls all of your <h1> tags to use as a table of contents. Each section of your documentation will be contained between these <h1> tags. For example:
# First section
The content of the first section of your documentation would go here. You can include links, bullets, images, anything!
# Second section
This would be the next section.
## You can even use subheadings
It will all be formatted correctly, but only the first-level headings will show on the table of contents.
Once you have your documentation formatted correctly, adding Huh! WP Docs to your WordPress install is simple.
Install the plugin and activate it. If you have WP_DEBUG set to true, it will show you what admin screen you are on and have this README.md available for you. From your theme or plugin, use the huh_wp_docs_filter_doc_urls filter hook to edit the array of docs.
function required_super_huh_wp_docs( $doc_urls ) {
// Unset the all index if you don't want the default README.md file
unset( $doc_urls['all'] );
// Use the array index all to show a doc on every screen.
$doc_urls['all'] = 'https://raw.githubusercontent.com/neverything/huh-wp-docs/master/README.md';
// Use a screen info like the following to add a custom thing.
$doc_urls['edit.php?post_type=post'] = 'https://raw.githubusercontent.com/neverything/huh-wp-docs/master/README.md';
// Be sure to return the array.
return $doc_urls;
}
add_filter( 'huh_wp_docs_filter_doc_urls', 'required_super_huh_wp_docs' );Make sure you change the URLs provided in the $doc_urls array to point to your markdown files. It's that easy!