Go to file
2011-01-16 20:17:57 +00:00
code BUGFIX Fixed 404 display 2011-01-16 20:17:57 +00:00
css MINOR: dl styles. PATCH via ajshort 2010-07-23 10:34:49 +00:00
docs/en ENHANCEMENT: included zend/search/lucene with the module to avoid including the entire lucene module. ENHANCEMENT: added hourly task as well as buildtask for dealing with cron updates. MINOR: updated documentation 2011-01-11 01:35:59 +00:00
images ENHANCEMENT: moved away from DebugView display / layout 2010-03-04 10:18:02 +00:00
javascript MINOR Removing SyntaxHighlighter toolbar, it destroys the layout whitespace a bit 2011-01-12 21:32:00 +00:00
templates BUGFIX Fixed 404 display 2011-01-16 20:17:57 +00:00
tests MINOR Making anchors more readable and predictable by using lowercase only 2011-01-15 21:47:43 +00:00
thirdparty ENHANCEMENT: included zend/search/lucene with the module to avoid including the entire lucene module. ENHANCEMENT: added hourly task as well as buildtask for dealing with cron updates. MINOR: updated documentation 2011-01-11 01:35:59 +00:00
_config.php ENHANCEMENT: included zend/search/lucene with the module to avoid including the entire lucene module. ENHANCEMENT: added hourly task as well as buildtask for dealing with cron updates. MINOR: updated documentation 2011-01-11 01:35:59 +00:00
LICENSE FEATURE: initial commit of sapphire documentation viewer module. Parses each module with a docs folder and generates formatted trees for each. Parses single markdown files for display 2010-03-04 04:39:02 +00:00
README.md ENHANCEMENT: use urls in the format module/lang/version rather than version first. Tweaks to the parser to prevent infinite loops 2011-01-14 01:03:46 +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.

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.