git-svn-id: http://svn.silverstripe.com/projects/ss2doc/branches/v2@117891 467b73ca-7a2a-4603-9d3b-597d59a354a9
1.6 KiB
Sapphire Documentation Module
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.
See Writing Documentation for more information on how to write markdown files which are available here.
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 page.
Setup
Enabling Search
The module provides automatic search functionality via Lucene Search. To enable search you need to add the following to your applications _config.php file:
DocumentationSearch::enable();
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
http://yoursite.com/dev/tasks/RebuildLuceneDocsIndex?flush=1
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
Using a URL other than /dev/docs/
By default, the documentation is available in dev/docs
. If you want it to live on the webroot instead of a subfolder,
add the following configuration to your.
DocumentationViewer::set_link_base('');
Director::addRules(1, array(
'$Action' => 'DocumentationViewer',
'' => 'DocumentationViewer'
));