Go to file
Will Rossiter 4a40b51ab2 MINOR: ignore ds store files 2012-04-08 21:19:29 +12:00
code BUGFIX: fixed search index field naming from module to entity to be consistent. BUGFIX: fixed url for opensearch description. ENHANCEMENT: moved author information to meta_data 2011-08-11 17:03:42 +12:00
css MINOR: include own syntax highlighting theme for ssdoc. 2011-08-11 13:32:09 +12:00
docs BUGFIX: fixed bug with linking to internal assets. 2011-07-04 16:58:15 +12:00
images ENHANCEMENT: moved away from DebugView display / layout 2010-03-04 10:18:02 +00:00
javascript MINOR: merging changes from ss2doc back. APICHANGE: renamed DocumentationOpenSearch_Controller to DocumentationOpenSearchController. MINOR: renamed left and right column to more generic content/sidebar columns 2011-08-02 15:30:58 +12:00
lang FEATURE: implemented initial cut of open search output and description functionality. 2011-01-21 04:10:41 +00:00
templates BUGFIX: fixed search index field naming from module to entity to be consistent. BUGFIX: fixed url for opensearch description. ENHANCEMENT: moved author information to meta_data 2011-08-11 17:03:42 +12:00
tests MINOR: removed assertInstanceOf call as this is phpunit 3.6 only. 2011-08-15 15:06:25 +12:00
thirdparty ENHANCEMENT: rolled out basic versioning support. 2011-07-01 13:19:35 +12:00
.gitignore MINOR: ignore ds store files 2012-04-08 21:19:29 +12:00
LICENSE ENHANCEMENT: rolled out basic versioning support. 2011-07-01 13:19:35 +12:00
README.md MINOR Documentation 2011-01-17 06:00:16 +00:00
_config.php APICHANGE: refactored DocumentationSearch to go back to a simple class rather than a controller. All requests interfacing with the search should go through DocumentationViewer. APICHANGE: migrated DocumentationSearch::opensearch() to its own controller. BUGFIX: declare default meta_data in the function rather than using the api to prevent inclusion order issues 2011-02-11 01:29:25 +00:00

README.md

Documentation Viewer Module

Maintainer Contact

Requirements

  • SilverStripe 2.4

Summary

Reads markdown documentation files from the /docs/ folder in . To read documentation go to yoursite.com/dev/docs/.

For more documentation on how to use the module please read /docs/Writing-Documentation.md (or via this in /dev/docs/sapphiredocs/Writing-Documentation in your webbrowser)

Note This module assumes you are using numeric values for your versions.

Search needs to be indexed manually with dev/tasks/RebuildLuceneDocsIndex.

Syntax Highlighting

The custom Markdown parser can render custom prefixes for code blocks, and render it via a javascript syntax highlighter.

In:

:::php
my sourcecode

Out:

<pre class="brush: php">
my sourcecode
</pre>

To include the syntax highlighter source, add the following to your DocumentationViewer->init():

Requirements::javascript(THIRDPARTY_DIR .'/jquery/jquery.js');
Requirements::javascript('sapphiredocs/thirdparty/syntaxhighlighter/scripts/shCore.js');
Requirements::javascript('sapphiredocs/thirdparty/syntaxhighlighter/scripts/shBrushJScript.js');
Requirements::javascript('sapphiredocs/thirdparty/syntaxhighlighter/scripts/shBrushPHP.js');
Requirements::javascript('sapphiredocs/thirdparty/syntaxhighlighter/scripts/shBrushXML.js');
// ... any additional syntaxes you want to support
Requirements::combine_files(
	'syntaxhighlighter.js',
	array(
		'sapphiredocs/thirdparty/syntaxhighlighter/scripts/shCore.js',
		'sapphiredocs/thirdparty/syntaxhighlighter/scripts/shBrushJScript.js',
		'sapphiredocs/thirdparty/syntaxhighlighter/scripts/shBrushPHP.js',
		'sapphiredocs/thirdparty/syntaxhighlighter/scripts/shBrushXML.js'
	)
);

Requirements::javascript('sapphiredocs/javascript/DocumentationViewer.js');

// css
Requirements::css('sapphiredocs/thirdparty/syntaxhighlighter/styles/shCore.css');
Requirements::css('sapphiredocs/thirdparty/syntaxhighlighter/styles/shCoreDefault.css');
Requirements::css('sapphiredocs/thirdparty/syntaxhighlighter/styles/shThemeRDark.css');

You can overload the DocumentationViewer class and add a custom route through Director::addRule() if you prefer not to modify the module file.