doc.silverstripe.org/sapphiredocs
2011-02-11 03:21:20 +00:00
..
code Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
css Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
docs/en Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
images Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
javascript Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
lang Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
templates Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
tests Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
thirdparty Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
_config.php Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
.piston.yml Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
LICENSE Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00
README.md Migrated sapphiredocs to piston 2011-02-11 03:21:20 +00:00

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.