2010-08-01 04:46:41 +00:00
# Sapphire Documentation Module
2010-06-24 14:22:41 +00:00
This module has been developed to read and display content from markdown files in webbrowser. It is an easy
way to bundle end user documentation within a SilverStripe installation.
2010-07-23 10:43:43 +00:00
See [Writing Documentation ](dev/docs/en/sapphiredocs/writing-documentation ) for more information on how to write markdown files which
2010-06-24 14:22:41 +00:00
are available here.
2010-07-23 10:43:43 +00:00
To include your docs file here create a __docs/en/index.md__ file. You can also include custom paths and versions. To configure the documentation system the configuration information is available on the [Configurations ](dev/docs/en/sapphiredocs/configuration-options )
2010-06-24 14:22:41 +00:00
page.
2010-08-01 04:46:41 +00:00
## Setup
2011-01-11 01:35:59 +00:00
### Enabling Search
The module provides automatic search functionality via [Lucene Search ](http://lucene.apache.org/java/docs/index.html ). To enable search
you need to add the following to your applications _config.php file:
DocumentationSearch::enable();
2011-03-12 17:11:21 +13:00
After adding that line you will also need to build the indexes of the search. You can do this either via your web browser by accessing
2011-01-11 01:35:59 +00:00
2011-03-12 17:11:21 +13:00
http://yoursite.com/dev/tasks/RebuildLuceneDocsIndex?flush=1
2011-01-11 01:35:59 +00:00
2011-03-12 17:11:21 +13:00
Or rebuild it via sake. You will want to set this up as a cron job if your documentation search needs to be updated on the fly
sake dev/tasks/RebuildLuceneDocsIndex flush=1
2011-01-11 01:35:59 +00:00
### Using a URL other than /dev/docs/
2010-08-01 04:46:41 +00:00
By default, the documentation is available in `dev/docs` . If you want it to live on the webroot instead of a subfolder,
2011-03-12 17:11:21 +13:00
add the following configuration to your.
2010-08-01 04:46:41 +00:00
DocumentationViewer::set_link_base('');
Director::addRules(1, array(
'$Action' => 'DocumentationViewer',
'' => 'DocumentationViewer'
2011-01-11 01:35:59 +00:00
));