Writing Your Own Documentation

Bonfire makes including documentation with your application, or even just one of your custom modules, as simple as including some text files.

Docs Locations

To create application-specific documentation that can easily be versioned and shipped out with your application, simply place CommonMark-formatted text files in the application/docs folder.

For any modules that you create and want to create documentation for, just place the same CommonMark-formatted docs in the module's folder, under a new folder named docs.

my_module/
    css/
    docs/
    . . .

The files must have the file extension of .md in order to be recognized by the system.
When a help page is displayed, the Table of Contents in the sidebar will automatically find your docs and display them in the order found.

Custom Table of Contents

If you need more organization to your docs, you can specify a custom TOC to be used.
This allows for specifying custom names for the files, as well as splitting doc files into logical groups that you specify, but only one level deep.

To use a custom TOC, create a file called _toc.ini within your docs folder.
If this file is present, it will be used to display the links, instead of auto-generating the links from the existing files.
This file is a standard PHP .ini file.
The "options" within the file are the filename and the display name.
The filename is listed on the left of the '=' with the text used to display the link listed on the right.

my_page = My Great New Documentation Package

To group the files and provide a header, you would use the .ini's section syntax.

[Section 1]
my_page = My New Documentation Package

The filename must include in it's "path" the area the documentation came from, either 'application', 'bonfire', or your module's folder name.

application/my_page = My New Documentation Package
my_module/my_page   = My New Module Docs

Configuring Documentation

The docs system allows you to do some simple customization that allows you to integrate it into the needs of your application easily.
The system uses 2 groups 'application' and 'developer' to separate your application specific documentation from Bonfire's core documentation.

All documentation config settings can be found in the module's config file at bonfire/modules/docs/config/docs.php.

Theme

To specify a theme to be used only for the documentation, set the docs.theme setting.
This allows you to completely customize the how the information looks and is displayed to match your branding, ad needs, etc.

$config['docs.theme'] = 'docs';

Landing Page

You can customize the group that is shown if someone simply browses to /docs.

$config['docs.default_group'] = 'developer';

Which Groups Show?

You can configure whether application or developer documentation is displayed.

$config['docs.show_dev_docs'] = true;
$config['docs.show_app_docs'] = true;

Environment-based Display of docs

You can configure docs to be displayed based on the current environment by configuring the docs.permitted_environments variable.
If the current environment is not listed in the array, any user attempting to navigate to the docs module will be redirected to the site's base URL and an error message will be displayed.

$config['docs.permitted_environments'] = array('development', 'testing', 'production');

Override Application-configured CommonMark Driver

The docs module will use the application-configured CommonMark driver to parse the docs.
This value is normally set in /application/config/application.php.

If you use the CommonMark library elsewhere in your application, it will often make sense to configure one driver for your application and another for the docs module.
This can be done by setting docs.commonmark_driver in /docs/config/docs.php to the name of the desired driver.

$config['docs.commonmark_driver'] = 'MarkdownExtra';
Profiler
Profiler Console 0 Load Time 12.2ms Memory Used 1.11 MB Database 4 Queries vars & Config Files 87

Console

Memory Usage

Benchmarks

1 ms Loading Time: Base Classes
9 ms Controller Execution Time ( Docs / Index )
12 ms Total Execution Time

Queries

0.0002 SELECT GET_LOCK('a67o4nrdsea8m763fba5susg8f', 300) AS ci_session_lockSpeed: 0.0002 - Possible keys: - Key Used: - Type: - Rows: - Extra: No tables used
0.0003 SELECT `data` FROM `as_ci3_sessions` WHERE `id` = 'a67o4nrdsea8m763fba5susg8f'Speed: 0.0003 - Possible keys: - Key Used: - Type: - Rows: - Extra: no matching row IN const table
0.0004 SHOW TABLES FROM `agristandfr`
0.0000 SELECT * FROM `as_settings`Speed: 0.0000 - Possible keys: - Key Used: - Type: ALL - Rows: 37 - Extra:
0.0009 Total Query Execution Time

Session User Data

__ci_last_regenerate 1737599575
requested_page https://www.agristand.fr/public/index.php/docs/developer/writing_docs
previous_page https://www.agristand.fr/public/index.php/docs/developer/writing_docs

GET DATA

No GET data exists

POST DATA

No POST data exists

URI STRING

docs/developer/writing_docs

CLASS/METHOD

docs/index

HTTP HEADERS

HTTP_ACCEPT */*
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_CONNECTION
SERVER_PORT 443
SERVER_NAME www.agristand.fr
REMOTE_ADDR 18.223.209.114
SERVER_SOFTWARE Apache
HTTP_ACCEPT_LANGUAGE
SCRIPT_NAME /public/index.php
REQUEST_METHOD GET
HTTP_HOST
REMOTE_HOST
CONTENT_TYPE
SERVER_PROTOCOL HTTP/1.1
QUERY_STRING
HTTP_ACCEPT_ENCODING gzip
HTTP_X_FORWARDED_FOR 18.223.209.114

CONFIG VARIABLES

base_url https://www.agristand.fr/public/
index_page index.php
uri_protocol AUTO
url_suffix
language english
charset UTF-8
enable_hooks true
subclass_prefix MY_
composer_autoload false
permitted_uri_chars a-z 0-9~%.:_-
allow_get_array true
enable_query_strings false
controller_trigger c
function_trigger m
directory_trigger d
log_threshold 0
log_path /srv/data/web/vhosts/www.agristand.fr/htdocs/application/logs/
log_file_extension
log_file_permissions 420
log_date_format Y-m-d H:i:s
error_views_path
cache_path /srv/data/web/vhosts/www.agristand.fr/htdocs/application/cache/
cache_query_string false
encryption_key 83d1594730081fdd3021f856aa630ffc
sess_cookie_name bf_session
sess_expiration 7200
sess_time_to_update 300
sess_match_ip false
sess_expire_on_close false
sess_encrypt_cookie false
sess_use_database false
sess_table_name sessions
sess_match_useragent true
sess_driver database
sess_regenerate_destroy false
sess_save_path ci3_sessions
cookie_prefix
cookie_domain
cookie_path /
cookie_secure false
cookie_httponly false
standardize_newlines false
global_xss_filtering false
csrf_protection true
csrf_token_name ci_csrf_token
csrf_cookie_name ci_csrf_token
csrf_expire 7200
csrf_regenerate true
csrf_exclude_uris Array ( )
compress_output false
time_reference utc
rewrite_short_tags false
proxy_ips
bonfire.installed 1
site.default_user_timezone UM8
modules_locations Array ( [/srv/data/web/vhosts/www.agristand.fr/htdocs/application/modules/] => ../../application/modules/ [/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/modules/] => ../../bonfire/modules/ )
site.backup_folder archives/
contexts Array ( [0] => asass [1] => content [2] => reports [3] => settings [4] => developer )
enable_activity_logging true
sparks_path ../sparks/
template.site_path /srv/data/web/vhosts/www.agristand.fr/htdocs/public/
template.theme_paths Array ( [0] => themes )
template.default_layout index
template.ajax_layout ajax
template.use_mobile_themes false
template.default_theme default/
template.admin_theme admin
template.message_template <div class="alert alert-{type} alert-dismissable"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <div>{message}</div> </div>
template.breadcrumb_symbol :
template.parse_views false
assets.directories Array ( [base] => assets [cache] => cache [css] => css [image] => images [js] => js [module] => module )
assets.js_opener $(document).ready(function() {
assets.js_closer });
assets.css_combine false
assets.js_combine false
assets.css_minify true
assets.js_minify true
assets.encrypt_name false
assets.encode false
assets.base_folder assets
assets.asset_folders Array ( [css] => css [js] => js [image] => images )
ui.current_shortcuts Array ( [form_save] => Array ( [description] => Save any form in the admin area. [action] => $("input[name=save]").click();return false; ) [create_new] => Array ( [description] => Create a new record in the module. [action] => window.location.href=$("a#create_new").attr("href"); ) [select_all] => Array ( [description] => Select all records in an index page. [action] => $("table input[type=checkbox]").click();return false; ) [delete] => Array ( [description] => Delete the record(s). [action] => $("#delete-me.btn-danger").click(); ) [module_index] => Array ( [description] => Return to the index of the current module. [action] => window.location.href=$("a#list").attr("href"); ) [goto_content] => Array ( [description] => Jump to the Content context. [action] => window.location.href=$("#tb_content").attr("href") ) [goto_reports] => Array ( [description] => Jump to the Reports context. [action] => window.location.href=$("#tb_reports").attr("href") ) [goto_settings] => Array ( [description] => Jump to the Settings context. [action] => window.location.href=$("#tb_settings").attr("href") ) [goto_developer] => Array ( [description] => Jump to the Developer context. [action] => window.location.href=$("#tb_developer").attr("href") ) )
emailer.write_to_file false
migrate.auto_core false
migrate.auto_app false
commonmark.valid_drivers Array ( [0] => Parsedown [1] => Markdown [2] => MarkdownExtra [3] => LeagueCommonMark )
commonmark.driver MarkdownExtended
docs.theme docs
docs.default_group developer
docs.show_dev_docs true
docs.show_app_docs true
docs.toc_file _toc.ini
docs.permitted_environments Array ( [0] => development [1] => testing [2] => production )

Files

application.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/config/application.php
autoload.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/config/autoload.php
config.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/config/config.php
constants.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/config/constants.php
database.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/config/database.php
events.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/config/events.php
hooks.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/config/hooks.php
mimes.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/config/mimes.php
profiler.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/config/profiler.php
routes.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/config/routes.php
Base_Controller.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/core/Base_Controller.php
MY_Model.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/core/MY_Model.php
App_hooks.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/hooks/App_hooks.php
application_lang.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/language/english/application_lang.php
Profiler.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/libraries/Profiler.php
Base.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/third_party/MX/Base.php
Config.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/third_party/MX/Config.php
Controller.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/third_party/MX/Controller.php
Lang.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/third_party/MX/Lang.php
Loader.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/application/third_party/MX/Loader.php
Benchmark.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Benchmark.php
CodeIgniter.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/CodeIgniter.php
Common.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Common.php
Config.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Config.php
Controller.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Controller.php
Hooks.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Hooks.php
Input.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Input.php
Lang.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Lang.php
Loader.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Loader.php
Log.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Log.php
Model.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Model.php
Output.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Output.php
Router.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Router.php
Security.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Security.php
URI.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/URI.php
Utf8.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/Utf8.php
hash.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/compat/hash.php
mbstring.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/compat/mbstring.php
password.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/compat/password.php
standard.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/core/compat/standard.php
DB.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/database/DB.php
DB_driver.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/database/DB_driver.php
DB_query_builder.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/database/DB_query_builder.php
DB_result.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/database/DB_result.php
mysqli_driver.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/database/drivers/mysqli/mysqli_driver.php
mysqli_result.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/database/drivers/mysqli/mysqli_result.php
directory_helper.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/helpers/directory_helper.php
form_helper.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/helpers/form_helper.php
language_helper.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/helpers/language_helper.php
url_helper.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/helpers/url_helper.php
profiler_lang.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/language/english/profiler_lang.php
Cache.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/libraries/Cache/Cache.php
Cache_dummy.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/libraries/Cache/drivers/Cache_dummy.php
Driver.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/libraries/Driver.php
Session.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/libraries/Session/Session.php
Session_driver.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/libraries/Session/Session_driver.php
Session_database_driver.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/ci3/libraries/Session/drivers/Session_database_driver.php
BF_Lang.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/core/BF_Lang.php
BF_Loader.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/core/BF_Loader.php
BF_Model.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/core/BF_Model.php
BF_Router.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/core/BF_Router.php
BF_Security.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/core/BF_Security.php
BF_directory_helper.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/helpers/BF_directory_helper.php
BF_form_helper.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/helpers/BF_form_helper.php
application_helper.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/helpers/application_helper.php
config_file_helper.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/helpers/config_file_helper.php
markdown_extended_helper.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/helpers/markdown_extended_helper.php
markdown_helper.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/helpers/markdown_helper.php
Assets.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/libraries/Assets.php
CommonMark.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/libraries/CommonMark.php
CommonMarkDriver.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/libraries/CommonMark/CommonMarkDriver.php
CommonMark_MarkdownExtended.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/libraries/CommonMark/drivers/CommonMark_MarkdownExtended.php
Console.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/libraries/Console.php
Events.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/libraries/Events.php
Modules.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/libraries/Modules.php
Route.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/libraries/Route.php
Template.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/libraries/Template.php
docs.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/modules/docs/config/docs.php
routes.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/modules/docs/config/routes.php
Docs.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/modules/docs/controllers/Docs.php
docs_lang.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/modules/docs/language/english/docs_lang.php
_sidebar.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/modules/docs/views/_sidebar.php
index.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/modules/docs/views/index.php
Settings_lib.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/modules/settings/libraries/Settings_lib.php
Settings_model.php
/srv/data/web/vhosts/www.agristand.fr/htdocs/bonfire/modules/settings/models/Settings_model.php
index.php
index.php
index.php
themes/docs/index.php