Merge branch 'manifest'

* manifest: (50 commits)
  TEST updated as clean name now respects the writing style conventions.
  FIX Showing the stable and outdated version number correctly.
  FIX: margin around edit too small and causes UI problems with nav.
  Upper case first letter
  Fixing text highlight css
  Reduce exception.
  Refactored EditLink
  Restore support for multiple versions in the masthead
  These changes make a number of improvements, mostly typographical, to improve readability and to render properly on small devices.
  Add support for exclude in children list
  Fix style of submenu
  Restore tests
  FIX: permission check broken
  Add alert as a valid alias as warning.
  Support one more layer in the template.
  Encode &amps; in api links.
  Minor style tweaks
  Upgrade parsedown extra to support markdown within code blocks
  FIX: API links should be urlencoded() to prevent special characters causing issues
  Correct title generation for index files in entity root
  ...

Conflicts:
	code/tasks/RebuildLuceneDocsIndex.php
This commit is contained in:
Will Rossiter 2014-12-16 23:14:19 +13:00
commit f1bd774437
142 changed files with 5464 additions and 12241 deletions

View File

@ -13,35 +13,39 @@
## Summary
Reads text files from a given list of folders from your installation and
provides a web interface for viewing.
Reads markdown files from a given list of folders from your installation and
provides a web interface for viewing the documentation. Ideal for providing
documentation alongside your module or project code.
To read documentation go to yoursite.com/dev/docs/
A variation of this module powers the main SilverStripe developer documentation
and the user help websites.
For more documentation on how to use the module please read /docs/Writing-Documentation.md
(or via this in /dev/docs/docsviewer/Writing-Documentation in your webbrowser)
**Note** This module assumes you are using numeric values for your versions.
## Installation
### HTML Publishing
composer require "silverstripe/docsviewer" "dev-master"
If you wish to generate a truly static version of your documentation after it
has been rendered through the website, add the [Static Publisher](https://github.com/silverstripe-labs/silverstripe-staticpublisher)
module to your documentation project and set the following configuration in your
applications config.yml:
## Usage
```
StaticExporter:
extensions:
- DocumentationStaticPublisherExtension
```
After installing the files via composer, rebuild the SilverStripe database..
If you don't plan on using static publisher for anything else and you have the
cms module installed, make sure you disable the CMS from being published.
sake dev/build
Again, in your applications config.yml file
Then start by viewing the documentation at `yoursite.com/dev/docs`.
```
StaticExporter:
disable_sitetree_export: true
```
Out of the box the module will display the documentation files that have been
bundled into any of your installed modules. To configure what is shown in the
documentation viewer see the detailed [documentation](docs/en/configuration.md).
For more information about how to use the module see each of the documentation
* [Configuration](docs/en/configuration.md)
* [Markdown Syntax](docs/en/markdown.md)
* [Syntax Highlighting](docs/en/syntax-highlighting.md)
* [Publishing Static Files](docs/en/statichtml.md)
## License
See LICENSE

View File

@ -15,9 +15,3 @@ if(!defined('DOCSVIEWER_DIR')) {
define('DOCSVIEWER_DIR', array_pop($dir));
}
// define filetypes to ignore
DocumentationService::set_ignored_files(array(
'.', '..', '.DS_Store',
'.svn', '.git', 'assets', 'themes', '_images', '_resources'
));

8
_config/docsviewer.yml Normal file
View File

@ -0,0 +1,8 @@
---
name: docsviewer
---
DocumentationViewer:
google_analytics_code: ''
DocumentationManifest:
automatic_registration: true

View File

@ -4,5 +4,5 @@ After: framework/routes#coreroutes
---
Director:
rules:
'dev/docs': 'DocumentationViewer'
'dev/docs//$Action/$ID/$OtherID': 'DocumentationViewer'
'DocumentationOpenSearchController//$Action': 'DocumentationOpenSearchController'

View File

@ -0,0 +1,90 @@
<?php
/**
* Collection of static helper methods for managing the documentation
*
* @package docsviewer
*/
class DocumentationHelper {
/**
* String helper for cleaning a file name to a readable version.
*
* @param string $name to convert
*
* @return string $name output
*/
public static function clean_page_name($name) {
$name = self::trim_extension_off($name);
$name = self::trim_sort_number($name);
$name = str_replace(array('-', '_'), ' ', $name);
return ucfirst(trim($name));
}
/**
* String helper for cleaning a file name to a URL safe version.
*
* @param string $name to convert
*
* @return string $name output
*/
public static function clean_page_url($name) {
$name = str_replace(array(' '), '_', $name);
$name = self::trim_extension_off($name);
$name = self::trim_sort_number($name);
if(preg_match('/^[\/]?index[\/]?/', $name)) {
return '';
}
return strtolower($name);
}
/**
* Removes leading numbers from pages (used to control sort order).
*
* @param string
*
* @return string
*/
public static function trim_sort_number($name) {
$name = preg_replace("/^[0-9]*[_-]+/", '', $name);
return $name;
}
/**
* Helper function to strip the extension off and return the name without
* the extension.
*
* @param string
*
* @return string
*/
public static function trim_extension_off($name) {
if(strrpos($name,'.') !== false) {
return substr($name, 0, strrpos($name,'.'));
}
return $name;
}
/**
* Helper function to get the extension of the filename.
*
* @param string
*
* @return string
*/
public static function get_extension($name) {
if(preg_match('/\.[a-z]+$/', $name)) {
return substr($name, strrpos($name,'.') + 1);
}
return null;
}
}

View File

@ -0,0 +1,670 @@
<?php
/**
* A class which builds a manifest of all documentation present in a project.
*
* The manifest is required to map the provided documentation URL rules to a
* file path on the server. The stored cache looks similar to the following:
*
* <code>
* array(
* 'en/someniceurl/' => array(
* 'filepath' => '/path/to/docs/en/SomeniceFile.md',
* 'title' => 'Some nice URL',
* 'summary' => 'Summary Text',
* 'basename' => 'SomeniceFile.md',
* 'type' => 'DocumentationPage'
* )
* )
* </code>
*
* URL format is in the following structures:
*
* {lang}/{path}
* {lang}/{module}/{path}
* {lang}/{module}/{version}/{/path}
*
* @package framework
* @subpackage manifest
*/
class DocumentationManifest {
/**
* @config
*
* @var boolean $automatic_registration
*/
private static $automatic_registration = true;
/**
* @config
*
* @var array $registered_entities
*/
private static $register_entities = array();
protected $cache;
protected $cacheKey;
protected $inited;
protected $forceRegen;
/**
* @var array $pages
*/
protected $pages = array();
/**
* @var DocumentationEntity
*/
private $entity;
/**
* @var boolean
*/
private $automaticallyPopulated = false;
/**
* @var ArrayList
*/
private $registeredEntities;
/**
* Constructs a new template manifest. The manifest is not actually built
* or loaded from cache until needed.
*
* @param bool $includeTests Include tests in the manifest.
* @param bool $forceRegen Force the manifest to be regenerated.
*/
public function __construct($forceRegen = false) {
$this->cacheKey = 'manifest';
$this->forceRegen = $forceRegen;
$this->registeredEntities = new ArrayList();
$this->cache = SS_Cache::factory('DocumentationManifest', 'Core', array(
'automatic_serialization' => true,
'lifetime' => null
));
$this->setupEntities();
}
/**
* Sets up the top level entities.
*
* Either manually registered through the YAML syntax or automatically
* loaded through investigating the file system for `docs` folder.
*/
public function setupEntities() {
if($this->registeredEntities->Count() > 0) {
return;
}
if(Config::inst()->get('DocumentationManifest', 'automatic_registration')) {
$this->populateEntitiesFromInstall();
}
$registered = Config::inst()->get('DocumentationManifest', 'register_entities');
foreach($registered as $details) {
// validate the details provided through the YAML configuration
$required = array('Path', 'Title');
foreach($required as $require) {
if(!isset($details[$require])) {
throw new Exception("$require is a required key in DocumentationManifest.register_entities");
}
}
// if path is not an absolute value then assume it is relative from
// the BASE_PATH.
$path = $this->getRealPath($details['Path']);
$key = (isset($details['Key'])) ? $details['Key'] : $details['Title'];
if($path && !is_dir($path)) {
throw new Exception($path . ' is not a valid documentation directory');
} else if(!$path) {
return;
}
$version = (isset($details['Version'])) ? $details['Version'] : '';
$langs = scandir($path);
if($langs) {
$possible = i18n::get_common_languages(true);
foreach($langs as $k => $lang) {
if(isset($possible[$lang])) {
$entity = Injector::inst()->create(
'DocumentationEntity', $key
);
$entity->setPath(Controller::join_links($path, $lang, '/'));
$entity->setTitle($details['Title']);
$entity->setLanguage($lang);
$entity->setVersion($version);
if(isset($details['Stable'])) {
$entity->setIsStable($details['Stable']);
}
if(isset($details['DefaultEntity'])) {
$entity->setIsDefaultEntity($details['DefaultEntity']);
}
$this->registeredEntities->push($entity);
}
}
}
}
}
public function getRealPath($path) {
if(substr($path, 0, 1) != '/') {
$path = realpath(Controller::join_links(BASE_PATH, $path));
}
return $path;
}
/**
* @return ArrayList
*/
public function getEntities() {
return $this->registeredEntities;
}
/**
* Scans the current installation and picks up all the SilverStripe modules
* that contain a `docs` folder.
*
* @return void
*/
public function populateEntitiesFromInstall() {
if($this->automaticallyPopulated) {
// already run
return;
}
foreach(scandir(BASE_PATH) as $key => $entity) {
if($key == "themes") {
continue;
}
$dir = Controller::join_links(BASE_PATH, $entity);
if(is_dir($dir)) {
// check to see if it has docs
$docs = Controller::join_links($dir, 'docs');
if(is_dir($docs)) {
$entities[] = array(
'Path' => $docs,
'Title' => DocumentationHelper::clean_page_name($entity),
'Version' => 'master',
'Stable' => true
);
}
}
}
Config::inst()->update(
'DocumentationManifest', 'register_entities', $entities
);
$this->automaticallyPopulated = true;
}
/**
*
*/
protected function init() {
if (!$this->forceRegen && $data = $this->cache->load($this->cacheKey)) {
$this->pages = $data;
$this->inited = true;
} else {
$this->regenerate();
}
}
/**
* Returns a map of all documentation pages.
*
* @return array
*/
public function getPages() {
if (!$this->inited) {
$this->init();
}
return $this->pages;
}
/**
* Returns a particular page for the requested URL.
*
* @return DocumentationPage
*/
public function getPage($url) {
$pages = $this->getPages();
$url = $this->normalizeUrl($url);
if(!isset($pages[$url])) {
return null;
}
$record = $pages[$url];
foreach($this->getEntities() as $entity) {
if(strpos($record['filepath'], $entity->getPath()) !== false) {
$page = Injector::inst()->create(
$record['type'],
$entity,
$record['basename'],
$record['filepath']
);
return $page;
}
}
}
/**
* Regenerates the manifest by scanning the base path.
*
* @param bool $cache
*/
public function regenerate($cache = true) {
$finder = new DocumentationManifestFileFinder();
$finder->setOptions(array(
'dir_callback' => array($this, 'handleFolder'),
'file_callback' => array($this, 'handleFile')
));
foreach($this->getEntities() as $entity) {
$this->entity = $entity;
$this->handleFolder('', $this->entity->getPath(), 0);
$finder->find($this->entity->getPath());
}
// groupds
$grouped = array();
foreach($this->pages as $url => $page) {
if(!isset($grouped[$page['entitypath']])) {
$grouped[$page['entitypath']] = array();
}
$grouped[$page['entitypath']][$url] = $page;
}
$this->pages = array();
foreach($grouped as $entity) {
uasort($entity, function($a, $b) {
// ensure parent directories are first
$a['filepath'] = str_replace('index.md', '', $a['filepath']);
$b['filepath'] = str_replace('index.md', '', $b['filepath']);
if(strpos($b['filepath'], $a['filepath']) === 0) {
return -1;
}
if ($a['filepath'] == $b['filepath']) {
return 0;
}
return ($a['filepath'] < $b['filepath']) ? -1 : 1;
});
$this->pages = array_merge($this->pages, $entity);
}
if ($cache) {
$this->cache->save($this->pages, $this->cacheKey);
}
$this->inited = true;
}
/**
*
*/
public function handleFolder($basename, $path, $depth) {
$folder = Injector::inst()->create(
'DocumentationFolder', $this->entity, $basename, $path
);
$link = ltrim(str_replace(
Config::inst()->get('DocumentationViewer', 'link_base'),
'',
$folder->Link()
), '/');
$this->pages[$link] = array(
'title' => $folder->getTitle(),
'basename' => $basename,
'filepath' => $path,
'type' => 'DocumentationFolder',
'entitypath' => $this->entity->getPath(),
'summary' => ''
);
}
/**
* Individual files can optionally provide a nice title and a better URL
* through the use of markdown meta data. This creates a new
* {@link DocumentationPage} instance for the file.
*
* If the markdown does not specify the title in the meta data it falls back
* to using the file name.
*
* @param string $basename
* @param string $path
* @param int $depth
*/
public function handleFile($basename, $path, $depth) {
$page = Injector::inst()->create(
'DocumentationPage',
$this->entity, $basename, $path
);
// populate any meta data
$page->getMarkdown();
$link = ltrim(str_replace(
Config::inst()->get('DocumentationViewer', 'link_base'),
'',
$page->Link()
), '/');
$this->pages[$link] = array(
'title' => $page->getTitle(),
'filepath' => $path,
'entitypath' => $this->entity->getPath(),
'basename' => $basename,
'type' => 'DocumentationPage',
'summary' => $page->getSummary()
);
}
/**
* Generate an {@link ArrayList} of the pages to the given page.
*
* @param DocumentationPage
* @param DocumentationEntityLanguage
*
* @return ArrayList
*/
public function generateBreadcrumbs($record, $base) {
$output = new ArrayList();
$parts = explode('/', trim($record->getRelativeLink(), '/'));
// Add the base link.
$output->push(new ArrayData(array(
'Link' => $base->Link(),
'Title' => $base->Title
)));
$progress = $base->Link();
foreach($parts as $part) {
if($part) {
$progress = Controller::join_links($progress, $part, '/');
$output->push(new ArrayData(array(
'Link' => $progress,
'Title' => DocumentationHelper::clean_page_name($part)
)));
}
}
return $output;
}
/**
* Determine the next page from the given page.
*
* Relies on the fact when the manifest was built, it was generated in
* order.
*
* @param string $filepath
* @param string $entityBase
*
* @return ArrayData
*/
public function getNextPage($filepath, $entityBase) {
$grabNext = false;
$fallback = null;
foreach($this->getPages() as $url => $page) {
if($grabNext && strpos($page['filepath'], $entityBase) !== false) {
return new ArrayData(array(
'Link' => $url,
'Title' => $page['title']
));
}
if($filepath == $page['filepath']) {
$grabNext = true;
} else if(!$fallback && strpos($page['filepath'], $filepath) !== false) {
$fallback = new ArrayData(array(
'Link' => $url,
'Title' => $page['title'],
'Fallback' => true
));
}
}
if(!$grabNext) {
return $fallback;
}
return null;
}
/**
* Determine the previous page from the given page.
*
* Relies on the fact when the manifest was built, it was generated in
* order.
*
* @param string $filepath
* @param string $entityBase
*
* @return ArrayData
*/
public function getPreviousPage($filepath, $entityPath) {
$previousUrl = $previousPage = null;
foreach($this->getPages() as $url => $page) {
if($filepath == $page['filepath']) {
if($previousUrl) {
return new ArrayData(array(
'Link' => $previousUrl,
'Title' => $previousPage['title']
));
}
}
if(strpos($page['filepath'], $entityPath) !== false) {
$previousUrl = $url;
$previousPage = $page;
}
}
return null;
}
/**
* @param string
*
* @return string
*/
public function normalizeUrl($url) {
$url = trim($url, '/') .'/';
// if the page is the index page then hide it from the menu
if(strpos(strtolower($url), '/index.md/')) {
$url = substr($url, 0, strpos($url, "index.md/"));
}
return $url;
}
/**
* Return the children of the provided record path.
*
* Looks for any pages in the manifest which have one more slash attached.
*
* @param string $path
*
* @return ArrayList
*/
public function getChildrenFor($entityPath, $recordPath = null) {
if(!$recordPath) {
$recordPath = $entityPath;
}
$output = new ArrayList();
$base = Config::inst()->get('DocumentationViewer', 'link_base');
$entityPath = $this->normalizeUrl($entityPath);
$recordPath = $this->normalizeUrl($recordPath);
$recordParts = explode(DIRECTORY_SEPARATOR, trim($recordPath,'/'));
$currentRecordPath = end($recordParts);
$depth = substr_count($entityPath, '/');
foreach($this->getPages() as $url => $page) {
$pagePath = $this->normalizeUrl($page['filepath']);
// check to see if this page is under the given path
if(strpos($pagePath, $entityPath) === false) {
continue;
}
// only pull it up if it's one more level depth
if(substr_count($pagePath, DIRECTORY_SEPARATOR) == ($depth + 1)) {
$pagePathParts = explode(DIRECTORY_SEPARATOR, trim($pagePath,'/'));
$currentPagePath = end($pagePathParts);
if($currentPagePath == $currentRecordPath) {
$mode = 'current';
}
else if(strpos($recordPath, $pagePath) !== false) {
$mode = 'section';
}
else {
$mode = 'link';
}
$children = new ArrayList();
if($mode == 'section' || $mode == 'current') {
$children = $this->getChildrenFor($pagePath, $recordPath);
}
$output->push(new ArrayData(array(
'Link' => Controller::join_links($base, $url, '/'),
'Title' => $page['title'],
'LinkingMode' => $mode,
'Summary' => $page['summary'],
'Children' => $children
)));
}
}
return $output;
}
/**
* @param DocumentationEntity
*
* @return ArrayList
*/
public function getAllVersionsOfEntity(DocumentationEntity $entity) {
$all = new ArrayList();
foreach($this->getEntities() as $check) {
if($check->getKey() == $entity->getKey()) {
if($check->getLanguage() == $entity->getLanguage()) {
$all->push($check);
}
}
}
return $all;
}
/**
* @param DocumentationEntity
*
* @return DocumentationEntity
*/
public function getStableVersion(DocumentationEntity $entity) {
foreach($this->getEntities() as $check) {
if($check->getKey() == $entity->getKey()) {
if($check->getLanguage() == $entity->getLanguage()) {
if($check->getIsStable()) {
return $check;
}
}
}
}
return $entity;
}
/**
* @param DocumentationEntity
*
* @return ArrayList
*/
public function getVersions($entity) {
if(!$entity) {
return null;
}
$output = new ArrayList();
foreach($this->getEntities() as $check) {
if($check->getKey() == $entity->getKey()) {
if($check->getLanguage() == $entity->getLanguage()) {
$same = ($check->getVersion() == $entity->getVersion());
$output->push(new ArrayData(array(
'Title' => $check->getVersion(),
'Link' => $check->Link(),
'LinkingMode' => ($same) ? 'current' : 'link'
)));
}
}
}
return $output;
}
/**
* Returns a sorted array of all the unique versions registered
*/
public function getAllVersions() {
$versions = array();
foreach($this->getEntities() as $entity) {
if($entity->getVersion()) {
$versions[$entity->getVersion()] = $entity->getVersion();
} else {
$versions['0.0'] = _t('DocumentationManifest.MASTER', 'Master');
}
}
asort($versions);
return $versions;
}
}

View File

@ -0,0 +1,38 @@
<?php
class DocumentationManifestFileFinder extends SS_FileFinder {
/**
* @var array
*/
private static $ignored_files = array(
'.', '..', '.ds_store',
'.svn', '.git', 'assets', 'themes', '_images'
);
/**
* @var array
*/
protected static $default_options = array(
'name_regex' => '/\.(md|markdown)$/i',
'file_callback' => null,
'dir_callback' => null,
'ignore_vcs' => true
);
/**
*
*/
public function acceptDir($basename, $pathname, $depth) {
$ignored = Config::inst()->get('DocumentationManifestFileFinder', 'ignored_files');
if($ignored) {
if(in_array(strtolower($basename), $ignored)) {
return false;
}
}
return true;
}
}

View File

@ -15,7 +15,7 @@ class DocumentationParser {
/**
* @var string Rewriting of api links in the format "[api:MyClass]" or "[api:MyClass::$my_property]".
*/
public static $api_link_base = 'http://api.silverstripe.org/search/lookup/?q=%s&version=%s&module=%s';
public static $api_link_base = 'http://api.silverstripe.org/search/lookup/?q=%s&amp;version=%s&amp;module=%s';
/**
* @var array
@ -42,7 +42,9 @@ class DocumentationParser {
* @return String
*/
public static function parse(DocumentationPage $page, $baselink = null) {
if(!$page || (!$page instanceof DocumentationPage)) return false;
if(!$page || (!$page instanceof DocumentationPage)) {
return false;
}
$md = $page->getMarkdown(true);
@ -52,10 +54,15 @@ class DocumentationParser {
$md = self::rewrite_api_links($md, $page);
$md = self::rewrite_heading_anchors($md, $page);
$md = self::rewrite_code_blocks($md);
$parser = new ParsedownExtra();
return $parser->text($md);
$parser->setBreaksEnabled(false);
$text = $parser->text($md);
return $text;
}
public static function rewrite_code_blocks($md) {
@ -63,46 +70,73 @@ class DocumentationParser {
$inner = false;
$mode = false;
$end = false;
$debug = false;
$lines = explode("\n", $md);
$output = array();
foreach($lines as $i => $line) {
if($debug) var_dump('Line '. ($i + 1) . ' '. $line);
// if line just contains whitespace, continue down the page.
// Prevents code blocks with leading tabs adding an extra line.
if(preg_match('/^\s$/', $line)) {
if(preg_match('/^\s$/', $line) && !$started) {
continue;
}
if(!$started && preg_match('/^[\t]*:::\s*(.*)/', $line, $matches)) {
// first line with custom formatting
if($debug) var_dump('Starts a new block with :::');
$started = true;
$mode = self::CODE_BLOCK_COLON;
$output[$i] = sprintf('<pre class="brush: %s">', (isset($matches[1])) ? $matches[1] : "");
$output[$i] = sprintf('```%s', (isset($matches[1])) ? trim($matches[1]) : "");
} else if(!$started && preg_match('/^\t*```\s*(.*)/', $line, $matches)) {
if($debug) var_dump('Starts a new block with ```');
$started = true;
$mode = self::CODE_BLOCK_BACKTICK;
$output[$i] = sprintf('<pre class="brush: %s">', (isset($matches[1])) ? $matches[1] : "");
$output[$i] = sprintf('```%s', (isset($matches[1])) ? trim($matches[1]) : "");
} else if($started && $mode == self::CODE_BLOCK_BACKTICK) {
// inside a backtick fenced box
if(preg_match('/^\t*```\s*/', $line, $matches)) {
if($debug) var_dump('End a block with ```');
// end of the backtick fenced box. Unset the line that contains the backticks
$end = true;
}
else {
if($debug) var_dump('Still in a block with ```');
// still inside the line.
$output[$i] = ($started) ? '' : '<pre>' . "\n";
$output[$i] .= htmlentities($line, ENT_COMPAT, 'UTF-8');
if(!$started) {
$output[$i - 1] = '```';
}
$output[$i] = $line;
$inner = true;
}
} else if(preg_match('/^[\ ]{0,3}?[\t](.*)/', $line, $matches)) {
// inner line of block, or first line of standard markdown code block
// regex removes first tab (any following tabs are part of the code).
$output[$i] = ($started) ? '' : '<pre>' . "\n";
$output[$i] .= htmlentities($matches[1], ENT_COMPAT, 'UTF-8');
if(!$started) {
if($debug) var_dump('Start code block because of tab. No fence');
$output[$i - 1] = '```';
} else {
if($debug) var_dump('Content is still tabbed so still inner');
}
$output[$i] = $matches[1];
$inner = true;
$started = true;
} else if($started && $inner && $mode == self::CODE_BLOCK_COLON && trim($line) === "") {
} else if($started && $inner && trim($line) === "") {
if($debug) var_dump('Inner line of code block');
// still inside a colon based block, if the line is only whitespace
// then continue with with it. We can continue with it for now as
// it'll be tidied up later in the $end section.
@ -118,6 +152,10 @@ class DocumentationParser {
// and include this line. The edge case where this will fail is
// new the following segment contains a code block as well as it
// will not open.
if($debug) {
var_dump('Contains something that isnt code. So end the code.');
}
$end = true;
$output[$i] = $line;
$i = $i - 1;
@ -126,6 +164,7 @@ class DocumentationParser {
}
if($end) {
if($debug) var_dump('End of code block');
$output = self::finalize_code_output($i, $output);
// reset state
@ -134,40 +173,33 @@ class DocumentationParser {
}
if($started) {
$output = self::finalize_code_output($i, $output);
$output = self::finalize_code_output($i+1, $output);
}
return join("\n", $output);
return implode("\n", $output);
}
/**
* Adds the closing code backticks. Removes trailing whitespace.
*
* @param int
* @param array
*
* @return array
*/
private static function finalize_code_output($i, $output) {
$j = $i;
while(isset($output[$j]) && trim($output[$j]) === "") {
unset($output[$j]);
$j--;
if(isset($output[$i]) && trim($output[$i])) {
$output[$i] .= "\n```\n";
}
if(isset($output[$j])) {
$output[$j] .= "</pre>\n";
}
else {
$output[$j] = "</pre>\n\n";
$output[$i] = "```";
}
return $output;
}
static function rewrite_image_links($md, $page) {
public static function rewrite_image_links($md, $page) {
// Links with titles
$re = '/
!
@ -179,29 +211,47 @@ class DocumentationParser {
\)
/x';
preg_match_all($re, $md, $images);
if($images) foreach($images[0] as $i => $match) {
if($images) {
foreach($images[0] as $i => $match) {
$title = $images[1][$i];
$url = $images[2][$i];
// Don't process absolute links (based on protocol detection)
$urlParts = parse_url($url);
if($urlParts && isset($urlParts['scheme'])) continue;
if($urlParts && isset($urlParts['scheme'])) {
continue;
}
// Rewrite URL (relative or absolute)
$baselink = Director::makeRelative(dirname($page->getPath(false, false)));
$baselink = Director::makeRelative(
dirname($page->getPath())
);
// if the image starts with a slash, it's absolute
if(substr($url, 0, 1) == '/') {
$relativeUrl = str_replace(BASE_PATH, '', Controller::join_links(
$page->getEntity()->getPath(),
$url
));
} else {
$relativeUrl = rtrim($baselink, '/') . '/' . ltrim($url, '/');
}
// Resolve relative paths
while(strpos($relativeUrl, '/..') !== FALSE) {
$relativeUrl = preg_replace('/\w+\/\.\.\//', '', $relativeUrl);
}
// Replace any double slashes (apart from protocol)
$relativeUrl = preg_replace('/([^:])\/{2,}/', '$1/', $relativeUrl);
// Make it absolute again
$absoluteUrl = Director::absoluteBaseURL() . $relativeUrl;
$absoluteUrl = Controller::join_links(
Director::absoluteBaseURL(),
$relativeUrl
);
// Replace any double slashes (apart from protocol)
// $absoluteUrl = preg_replace('/([^:])\/{2,}/', '$1/', $absoluteUrl);
// Replace in original content
$md = str_replace(
@ -210,6 +260,7 @@ class DocumentationParser {
$md
);
}
}
return $md;
}
@ -227,7 +278,7 @@ class DocumentationParser {
* @param DocumentationPage $page
* @return String
*/
static function rewrite_api_links($md, $page) {
public static function rewrite_api_links($md, $page) {
// Links with titles
$re = '/
`?
@ -244,10 +295,17 @@ class DocumentationParser {
foreach($linksWithTitles[0] as $i => $match) {
$title = $linksWithTitles[1][$i];
$subject = $linksWithTitles[2][$i];
$url = sprintf(self::$api_link_base, $subject, $page->getVersion(), $page->getEntity()->getFolder());
$url = sprintf(
self::$api_link_base,
urlencode($subject),
urlencode($page->getVersion()),
urlencode($page->getEntity()->getKey())
);
$md = str_replace(
$match,
sprintf('<code>[%s](%s)</code>', $title, $url),
sprintf('[%s](%s)', $title, $url),
$md
);
}
@ -265,10 +323,16 @@ class DocumentationParser {
if($links) {
foreach($links[0] as $i => $match) {
$subject = $links[1][$i];
$url = sprintf(self::$api_link_base, $subject, $page->getVersion(), $page->getEntity()->getFolder());
$url = sprintf(
self::$api_link_base,
$subject,
$page->getVersion(),
$page->getEntity()->getKey()
);
$md = str_replace(
$match,
sprintf('<code>[%s](%s)</code>', $subject, $url),
sprintf('[%s](%s)', $subject, $url),
$md
);
}
@ -287,6 +351,9 @@ class DocumentationParser {
return $md;
}
/**
*
*/
public static function _rewrite_heading_anchors_callback($matches) {
$heading = $matches[0];
$headingText = $matches[1];
@ -309,7 +376,7 @@ class DocumentationParser {
*
* @return String
*/
static function generate_html_id($title) {
public static function generate_html_id($title) {
$t = $title;
$t = str_replace('&amp;','-and-',$t);
$t = str_replace('&','-and-',$t);
@ -326,11 +393,11 @@ class DocumentationParser {
*
* @param String $md Markdown content
* @param DocumentationPage $page
* @param String $baselink
*
* @return String Markdown
*/
static function rewrite_relative_links($md, $page, $baselink = null) {
if(!$baselink) $baselink = $page->getEntity()->getRelativeLink();
public static function rewrite_relative_links($md, $page) {
$baselink = $page->getEntity()->Link();
$re = '/
([^\!]?) # exclude image format
@ -346,7 +413,20 @@ class DocumentationParser {
// relative path (relative to module base folder), without the filename.
// For "sapphire/en/current/topics/templates", this would be "templates"
$relativePath = dirname($page->getRelativePath());
if($relativePath == '.') $relativePath = '';
if(strpos($page->getRelativePath(), 'index.md')) {
$relativeLink = $page->getRelativeLink();
} else {
$relativeLink = dirname($page->getRelativeLink());
}
if($relativePath == '.') {
$relativePath = '';
}
if($relativeLink == ".") {
$relativeLink = '';
}
// file base link
$fileBaseLink = Director::makeRelative(dirname($page->getPath()));
@ -375,10 +455,10 @@ class DocumentationParser {
// Rewrite public URL
if(preg_match('/^\//', $url)) {
// Absolute: Only path to module base
$relativeUrl = Controller::join_links($baselink, $url);
$relativeUrl = Controller::join_links($baselink, $url, '/');
} else {
// Relative: Include path to module base and any folders
$relativeUrl = Controller::join_links($baselink, $relativePath, $url);
$relativeUrl = Controller::join_links($baselink, $relativeLink, $url, '/');
}
}

View File

@ -1,5 +1,12 @@
<?php
set_include_path(
dirname(dirname(__FILE__)) . '/thirdparty/'. PATH_SEPARATOR .
get_include_path()
);
require_once 'Zend/Search/Lucene.php';
/**
* Documentation Search powered by Lucene. You will need Zend_Lucene installed
* on your path.
@ -46,7 +53,7 @@ class DocumentationSearch {
* Defaults to 1.0, lower to decrease relevancy. Requires reindex.
* Uses {@link DocumentationPage->getRelativePath()} for comparison.
*/
static $boost_by_path = array();
private static $boost_by_path = array();
/**
* @var ArrayList - Results
@ -112,114 +119,31 @@ class DocumentationSearch {
}
/**
* Folder name for indexes (in the temp folder). You can override it using
* {@link DocumentationSearch::set_index_location($)}
* Folder name for indexes (in the temp folder).
*
* @config
* @var string
*/
private static $index_location;
/**
* Generate an array of every single documentation page installed on the system.
*
* @return ArrayList
*/
public static function get_all_documentation_pages() {
DocumentationService::load_automatic_registration();
$modules = DocumentationService::get_registered_entities();
$output = new ArrayList();
if($modules) {
foreach($modules as $module) {
foreach($module->getVersions() as $version) {
try {
$pages = DocumentationService::get_pages_from_folder($module, false, true, $version);
if($pages) {
foreach($pages as $page) {
$output->push($page);
}
}
}
catch(Exception $e) {
user_error($e, E_USER_WARNING);
}
}
}
}
return $output;
}
/**
* Enable searching documentation
*/
public static function enable($enabled = true) {
self::$enabled = $enabled;
if($enabled) {
// include the zend search functionality
set_include_path(
dirname(dirname(__FILE__)) . '/thirdparty/'. PATH_SEPARATOR .
get_include_path()
);
require_once 'Zend/Search/Lucene.php';
}
}
/**
* @return bool
*/
public static function enabled() {
return self::$enabled;
}
/**
* Enable advanced documentation search
*/
public static function enable_advanced_search($enabled = true) {
self::$advanced_search_enabled = ($enabled)? true: false;
}
/**
* @return bool
*/
public static function advanced_search_enabled() {
return self::$advanced_search_enabled;
}
/**
* @param string
*/
public static function set_index($index) {
self::$index_location = $index;
}
/**
* @return string
*/
public static function get_index_location() {
if(!self::$index_location) {
self::$index_location = DOCSVIEWER_DIR;
}
if(file_exists(self::$index_location)) {
return self::$index_location;
} else {
return Controller::join_links(
TEMP_FOLDER,
trim(self::$index_location, '/')
);
$location = Config::inst()->get('DocumentationSearch', 'index_location');
if(!$location) {
return Controller::join_links(TEMP_FOLDER, 'RebuildLuceneDocsIndex');
}
return $location;
}
/**
* Perform a search query on the index
*/
public function performSearch() {
try {
$index = Zend_Search_Lucene::open(self::get_index_location());
@ -284,20 +208,27 @@ class DocumentationSearch {
);
$start = ($request->requestVar('start')) ? (int)$request->requestVar('start') : 0;
$query = ($request->requestVar('Search')) ? $request->requestVar('Search') : '';
$query = ($request->requestVar('q')) ? $request->requestVar('q') : '';
$currentPage = floor( $start / $pageLength ) + 1;
$totalPages = ceil(count($this->results) / $pageLength );
if ($totalPages == 0) $totalPages = 1;
if ($currentPage > $totalPages) $currentPage = $totalPages;
if ($totalPages == 0) {
$totalPages = 1;
}
if ($currentPage > $totalPages) {
$currentPage = $totalPages;
}
$results = new ArrayList();
if($this->results) {
foreach($this->results as $k => $hit) {
if($k < ($currentPage-1)*$pageLength || $k >= ($currentPage*$pageLength)) continue;
if($k < ($currentPage-1)*$pageLength || $k >= ($currentPage*$pageLength)) {
continue;
}
$doc = $hit->getDocument();
@ -446,23 +377,29 @@ class DocumentationSearch {
}
/**
* Renders the search results into a template. Either
* the search results template or the Atom feed
* Renders the search results into a template. Either the search results
* template or the Atom feed.
*/
public function renderResults() {
if(!$this->results && $this->query) $this->performSearch();
if(!$this->outputController) return user_error('Call renderResults() on a DocumentationViewer instance.', E_USER_ERROR);
if(!$this->results && $this->query) {
$this->performSearch();
}
if(!$this->outputController) {
return user_error('Call renderResults() on a DocumentationViewer instance.', E_USER_ERROR);
}
$request = $this->outputController->getRequest();
$data = $this->getSearchResults($request);
$templates = array('DocumentationViewer_results', 'DocumentationViewer');
$templates = array('DocumentationViewer_search');
if($request->requestVar('format') && $request->requestVar('format') == "atom") {
// alter the fields for the opensearch xml.
$title = ($title = $this->getTitle()) ? ' - '. $title : "";
$link = Controller::join_links($this->outputController->Link(), 'DocumentationOpenSearchController/description/');
$link = Controller::join_links(
$this->outputController->Link(), 'DocumentationOpenSearchController/description/'
);
$data->setField('Title', $data->Title . $title);
$data->setField('DescriptionURL', $link);

View File

@ -1,606 +0,0 @@
<?php
/**
* DocumentationService
*
* Handles the management of the documentation services delivered by the entity.
*
* Includes registering which components to document and handles the entities being
* documented.
*
* @package docsviewer
*/
class DocumentationService {
/**
* A mapping of known / popular languages to nice titles.
*
* @var Array
*/
private static $language_mapping = array(
'en' => 'English',
'fr' => 'Français',
'de' => 'Deutsch'
);
/**
* Files to ignore from any documentation listing.
*
* @var array
*/
private static $ignored_files = array(
'.', '..', '.DS_Store',
'.svn', '.git', 'assets', 'themes', '_images'
);
/**
* Case insenstive values to use as extensions on markdown pages. The
* recommended extension is .md.
*
* @var array
*/
public static $valid_markdown_extensions = array('md', 'txt', 'markdown');
/**
* Registered {@link DocumentationEntity} objects to include in the
* documentation.
*
* Either pre-filled by the automatic filesystem parser or via
* {@link DocumentationService::register()}.
*
* Stores the {@link DocumentEntity} objects which contain the languages
* and versions of each entity.
*
* You can remove registered {@link DocumentationEntity} objects by using
* {@link DocumentationService::unregister()}
*
* @var array
*/
private static $registered_entities = array();
/**
* Should generation of documentation categories be automatic?
*
* If this is set to true then it will generate {@link DocumentationEntity}
* objects from the filesystem. This can be slow and also some projects
* may want to restrict to specific project folders (rather than everything).
*
* You can also disable or remove a given folder from registration using
* {@link DocumentationService::unregister()}
*
* @see DocumentationService::$registered_entities
* @see DocumentationService::set_automatic_registration();
*
* @var bool
*/
private static $automatic_registration = true;
/**
* by default pagenumbers start high at 10.000
*
* @var integer
*/
private static $pagenumber_start_at = 10000;
/**
* allow the use of key/value pairs in comments
*
* @var boolean
*/
private static $meta_comments_enabled = false;
/**
* Return the allowed extensions
*
* @return array
*/
public static function get_valid_extensions() {
return self::$valid_markdown_extensions;
}
/**
* Check to see if a given extension is a valid extension to be rendered.
* Assumes that $ext has a leading dot as that is what $valid_extension uses.
*
* @return bool
*/
public static function is_valid_extension($ext) {
return in_array(strtolower($ext), self::get_valid_extensions());
}
/**
* Set the ignored files list
*
* @param array
*/
public static function set_ignored_files($files) {
self::$ignored_files = $files;
}
/**
* Return the list of files which are ignored
*
* @return array
*/
public static function get_ignored_files() {
return self::$ignored_files;
}
/**
* Set automatic registration of entities and documentation folders
*
* @see DocumentationService::$automatic_registration
* @param bool
*/
public static function set_automatic_registration($bool = true) {
self::$automatic_registration = $bool;
if(!$bool) {
// remove current registed entities when disabling automatic registration
// needed to avoid caching issues when running all the tests
self::$registered_entities = array();
}
}
/**
* Is automatic registration of entities enabled.
*
* @return bool
*/
public static function automatic_registration_enabled() {
return self::$automatic_registration;
}
/**
* set the number to start default pagenumbering, allowing room for
* custom pagenumbers below.
*
* @param int $number
*/
public static function start_pagenumbers_at($number = 10000) {
if (is_int($number)) self::$pagenumber_start_at = $number;
}
/**
* return the startlevel for default pagenumbering
*
* @return int
*/
public static function get_pagenumber_start_at() {
return self::$pagenumber_start_at;
}
/**
* Allow the use of key/value pairs in comments?
*
* @param bool $allow
*/
public static function enable_meta_comments($allow = true) {
self::$meta_comments_enabled = (bool) $allow;
}
/**
* can we use key/value pairs
*
* @return bool
*/
public static function meta_comments_enabled() {
return self::$meta_comments_enabled;
}
/**
* Return the entities which are listed for documentation. Optionally only
* get entities which have a version or language given.
*
* @return array
*/
public static function get_registered_entities($version = false, $lang = false) {
$output = array();
if($entities = self::$registered_entities) {
if($version || $lang) {
foreach($entities as $entity) {
if(self::is_registered_entity($entity->getFolder(), $version, $lang)) {
$output[$entity->getFolder()] = $entity;
}
}
}
else {
$output = $entities;
}
}
return $output;
}
/**
* Check to see if a entity is registered with the documenter.
*
* @param String $entity entity name
* @param String $version version
* @param String $lang language
*
* @return DocumentationEntity $entity the registered entity
*/
public static function is_registered_entity($entity, $version = false, $lang = false) {
$check = ($entity instanceof DocumentationEntity) ? $entity->getFolder() : (string) $entity;
if(isset(self::$registered_entities[$check])) {
$entity = self::$registered_entities[$check];
if(($lang && !$entity->hasLanguage($lang)) || ($version && !$entity->hasVersion($version))) {
return false;
}
return $entity;
}
return false;
}
/**
* Register a entity to be included in the documentation. To unregister a entity
* use {@link DocumentationService::unregister()}. Must include the trailing slash
*
* @param String $entity Name of entity to register
* @param String $path Path to documentation root.
* @param Float $version Version of entity.
* @param String $title Nice title to use
* @param bool $latest - return is this the latest release.
*
* @throws InvalidArgumentException
*
* @return DocumentationEntity
*/
public static function register($entity, $path, $version = '', $title = false, $latest = false) {
if(!file_exists($path)) throw new InvalidArgumentException(sprintf('Path "%s" doesn\'t exist', $path));
// add the entity to the registered array
if(!isset(self::$registered_entities[$entity])) {
// entity is completely new
$output = new DocumentationEntity($entity, $version, $path, $title);
self::$registered_entities[$entity] = $output;
}
else {
// entity exists so add the version to it
$output = self::$registered_entities[$entity];
$output->addVersion($version, $path);
}
if($latest)
$output->setStableVersion($version);
return $output;
}
/**
* Unregister a entity from being included in the documentation. Useful
* for keeping {@link DocumentationService::$automatic_registration} enabled
* but disabling entities which you do not want to show. Combined with a
* {@link Director::isLive()} you can hide entities you don't want a client to see.
*
* If no version or lang specified then the whole entity is removed. Otherwise only
* the specified version of the documentation.
*
* @param String $entity
* @param String $version
*
* @return bool
*/
public static function unregister($entityName, $version = false) {
if(isset(self::$registered_entities[$entityName])) {
$entity = self::$registered_entities[$entityName];
if($version) {
$entity->removeVersion($version);
}
else {
// only given a entity so unset the whole entity
unset(self::$registered_entities[$entityName]);
}
return true;
}
return false;
}
/**
* Register the docs from off a file system if automatic registration is
* turned on.
*
* @see {@link DocumentationService::set_automatic_registration()}
*/
public static function load_automatic_registration() {
if(self::automatic_registration_enabled()) {
$entities = scandir(BASE_PATH);
if($entities) {
foreach($entities as $key => $entity) {
$dir = is_dir(Controller::join_links(BASE_PATH, $entity));
$ignored = in_array($entity, self::get_ignored_files(), true);
if($dir && !$ignored) {
// check to see if it has docs
$docs = Director::baseFolder() . '/' . Controller::join_links($entity, 'docs');
if(is_dir($docs)) {
self::register($entity, $docs, 'current', $entity, true);
}
}
}
}
}
}
/**
* Convert a language code to a 'nice' text string. Uses the
* {@link self::$language_mapping} array combined with translatable.
*
* @param String $code code
*/
public static function get_language_title($lang) {
$map = self::$language_mapping;
if(isset($map[$lang])) {
return _t("DOCUMENTATIONSERVICE.LANG-$lang", $map[$lang]);
}
return $lang;
}
/**
* Find a documentation page given a path and a file name. It ignores the
* extensions and simply compares the title.
*
* Name may also be a path /install/foo/bar.
*
* @param DocumentationEntity
* @param array exploded url string
* @param string version number
* @param string lang code
*
* @return String|false - File path
*/
static function find_page($entity, $path, $version = '', $lang = 'en') {
if($entity = self::is_registered_entity($entity, $version, $lang)) {
return self::find_page_recursive($entity->getPath($version, $lang), $path);
}
return false;
}
/**
* Recursive function for finding the goal of a path to a documentation
* page
*
* @return string
*/
private static function find_page_recursive($base, $goal) {
$handle = (is_dir($base)) ? opendir($base) : false;
$name = self::trim_extension_off(strtolower(array_shift($goal)));
if(!$name || $name == '/') $name = 'index';
if($handle) {
$ignored = self::get_ignored_files();
// ensure we end with a slash
$base = rtrim($base, '/') .'/';
while (false !== ($file = readdir($handle))) {
if(in_array($file, $ignored)) continue;
$formatted = self::trim_extension_off(strtolower($file));
// the folder is the one that we are looking for.
if(strtolower($name) == strtolower($formatted)) {
// if this file is a directory we could be displaying that
// or simply moving towards the goal.
if(is_dir(Controller::join_links($base, $file))) {
$base = $base . trim($file, '/') .'/';
// if this is a directory check that there is any more states to get
// to in the goal. If none then what we want is the 'index.md' file
if(count($goal) > 0) {
return self::find_page_recursive($base, $goal);
}
else {
// recurse but check for an index.md file next time around
return self::find_page_recursive($base, array('index'));
}
}
else {
// goal state. End of recursion.
// tidy up the URLs with single trailing slashes
$result = $base . ltrim($file, '/');
if(is_dir($result)) $result = (rtrim($result, '/') . '/');
return $result;
}
}
}
closedir($handle);
}
return false;
}
/**
* String helper for cleaning a file name to a readable version.
*
* @param String $name to convert
*
* @return String $name output
*/
public static function clean_page_name($name) {
// remove dashs and _
$name = str_replace(array('-', '_'), ' ', $name);
// remove extension
$name = self::trim_extension_off($name);
// if it starts with a number strip and contains a space strip it off
if(strpos($name, ' ') !== false) {
$space = strpos($name, ' ');
$short = substr($name, 0, $space);
if(is_numeric($short)) {
$name = substr($name, $space);
}
}
// convert first letter
return ucfirst(trim($name));
}
/**
* Helper function to strip the extension off and return the name without
* the extension. If you need the extension see {@link get_extension()}
*
* @param string
*
* @return string
*/
public static function trim_extension_off($name) {
$ext = self::get_extension($name);
if($ext) {
if(self::is_valid_extension($ext)) {
return substr($name, 0, strrpos($name,'.'));
}
}
return $name;
}
/**
* Returns the extension from a string. If you want to trim the extension
* off the end of the string see {@link trim_extension_off()}
*
* @param string
*
* @return string
*/
public static function get_extension($name) {
return substr(strrchr($name,'.'), 1);
}
/**
* Return the children from a given entity sorted by Title using natural ordering.
* It is used for building the tree of the page.
*
* @param DocumentationEntity path
* @param string - an optional path within a entity
* @param bool enable several recursive calls (more than 1 level)
* @param string - version to use
* @param string - lang to use
*
* @throws Exception
* @return ArrayList
*/
public static function get_pages_from_folder($entity, $relativePath = false, $recursive = true, $version = 'trunk', $lang = 'en') {
$output = new ArrayList();
$metaCommentsEnabled = self::meta_comments_enabled();
$pages = array();
if(!$entity instanceof DocumentationEntity)
user_error("get_pages_from_folder must be passed a entity", E_USER_ERROR);
$path = $entity->getPath($version, $lang);
if(self::is_registered_entity($entity)) {
self::get_pages_from_folder_recursive($path, $relativePath, $recursive, $pages);
}
else {
return user_error("$entity is not registered", E_USER_WARNING);
}
if(count($pages) > 0) {
$pagenumber = self::get_pagenumber_start_at();
natsort($pages);
foreach($pages as $key => $pagePath) {
// get file name from the path
$file = ($pos = strrpos($pagePath, '/')) ? substr($pagePath, $pos + 1) : $pagePath;
$page = new DocumentationPage();
$page->setTitle(self::clean_page_name($file));
$relative = str_replace($path, '', $pagePath);
// if no extension, put a slash on it
if(strpos($relative, '.') === false) $relative .= '/';
$page->setEntity($entity);
$page->setRelativePath($relative);
$page->setVersion($version);
$page->setLang($lang);
// does this page act as a folder?
$path = $page->getPath();
if (is_dir($path)) { $page->setIsFolder(true); }
$page->setPagenumber($pagenumber++);
// we need the markdown to get the comments
if ($metaCommentsEnabled) $page->getMarkdown();
$output->push($page);
}
}
return ($metaCommentsEnabled)? $output->sort('pagenumber') : $output;
}
/**
* Recursively search through a given folder
*
* @see {@link DocumentationService::get_pages_from_folder}
*/
private static function get_pages_from_folder_recursive($base, $relative, $recusive, &$pages) {
if(!is_dir($base)) throw new Exception(sprintf('%s is not a folder', $folder));
$folder = Controller::join_links($base, $relative);
if(!is_dir($folder)) return false;
$handle = opendir($folder);
if($handle) {
$ignore = self::get_ignored_files();
$files = array();
while (false !== ($file = readdir($handle))) {
if(!in_array($file, $ignore)) {
$path = Controller::join_links($folder, $file);
$relativeFilePath = Controller::join_links($relative, $file);
if(is_dir($path)) {
// dir
$pages[] = $relativeFilePath;
if($recusive) self::get_pages_from_folder_recursive($base, $relativeFilePath, $recusive, $pages);
}
else if(self::is_valid_extension(self::get_extension($path))) {
// file we want
$pages[] = $relativeFilePath;
}
}
}
}
closedir($handle);
}
}

View File

@ -20,8 +20,13 @@ class DocumentationOpenSearchController extends Controller {
public function description() {
$viewer = new DocumentationViewer();
if(!$viewer->canView()) return Security::permissionFailure($this);
if(!DocumentationSearch::enabled()) return $this->httpError('404');
if(!$viewer->canView()) {
return Security::permissionFailure($this);
}
if(!Config::inst()->get('DocumentationSearch', 'enabled')) {
return $this->httpError('404');
}
$data = DocumentationSearch::get_meta_data();
$link = Director::absoluteBaseUrl() .
@ -34,6 +39,8 @@ class DocumentationOpenSearchController extends Controller {
return $this->customise(
new ArrayData($data)
)->renderWith(array('OpenSearchDescription'));
)->renderWith(array(
'OpenSearchDescription'
));
}
}

View File

@ -4,10 +4,10 @@
* Documentation Viewer.
*
* Reads the bundled markdown files from documentation folders and displays the
* output (either via markdown or plain text)
* output (either via markdown or plain text).
*
* For more documentation on how to use this class see the documentation in the
* docs folder
* docs folder.
*
* @package docsviewer
*/
@ -17,24 +17,29 @@ class DocumentationViewer extends Controller {
/**
* @var array
*/
private static $allowed_actions = array(
'home',
'LanguageForm',
'doLanguageForm',
'handleRequest',
'DocumentationSearchForm',
'results'
private static $extensions = array(
'DocumentationViewerVersionWarning',
'DocumentationSearchExtension'
);
/**
* @var string
*/
public $version = "";
private static $google_analytics_code = '';
/**
* @var string
*/
public $language = "en";
private static $documentation_title = 'SilverStripe Documentation';
/**
* @var array
*/
private static $allowed_actions = array(
'all',
'results',
'handleAction'
);
/**
* The string name of the currently accessed {@link DocumentationEntity}
@ -42,27 +47,31 @@ class DocumentationViewer extends Controller {
*
* @var string
*/
public $entity = '';
/**
* @var array
*/
public $remaining = array();
protected $entity = '';
/**
* @var DocumentationPage
*/
public $currentLevelOnePage;
protected $record;
/**
* @var String Same as the routing pattern set through Director::addRules().
* @var DocumentationManifest
*/
protected static $link_base = 'dev/docs/';
protected $manifest;
/**
* @var String|array Optional permission check
* @config
*
* @var string same as the routing pattern set through Director::addRules().
*/
static $check_permission = 'ADMIN';
private static $link_base = 'dev/docs/';
/**
* @config
*
* @var string|array Optional permission check
*/
private static $check_permission = 'ADMIN';
/**
* @var array map of modules to edit links.
@ -71,67 +80,52 @@ class DocumentationViewer extends Controller {
private static $edit_links = array();
/**
* @var boolean $separate_submenu
*
*/
protected static $separate_submenu = true;
/**
* @var bool $recursive_submenu
*/
protected static $recursive_submenu = false;
/**
* @param bool $separate_submenu
*/
public static function set_separate_submenu($separate_submenu = true) {
self::$separate_submenu = $separate_submenu;
}
/**
* @param bool $recursive_submenu
*/
public static function set_recursive_submenu($recursive_submenu = false) {
self::$recursive_submenu = $recursive_submenu;
}
public function init() {
parent::init();
if(!$this->canView()) return Security::permissionFailure($this);
if(!$this->canView()) {
return Security::permissionFailure($this);
}
Requirements::javascript('//use.typekit.net/emt4dhq.js');
Requirements::customScript('try{Typekit.load();}catch(e){}');
Requirements::javascript(THIRDPARTY_DIR .'/jquery/jquery.js');
Requirements::combine_files(
'syntaxhighlighter.js',
array(
DOCSVIEWER_DIR .'/thirdparty/syntaxhighlighter/scripts/shCore.js',
DOCSVIEWER_DIR . '/thirdparty/syntaxhighlighter/scripts/shBrushJScript.js',
DOCSVIEWER_DIR . '/thirdparty/syntaxhighlighter/scripts/shBrushPhp.js',
DOCSVIEWER_DIR . '/thirdparty/syntaxhighlighter/scripts/shBrushXml.js',
DOCSVIEWER_DIR . '/thirdparty/syntaxhighlighter/scripts/shBrushCss.js',
DOCSVIEWER_DIR . '/thirdparty/syntaxhighlighter/scripts/shBrushYaml.js',
DOCSVIEWER_DIR . '/thirdparty/syntaxhighlighter/scripts/shBrushBash.js',
DOCSVIEWER_DIR . '/javascript/shBrushSS.js'
)
);
Requirements::javascript('https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js');
Requirements::javascript(DOCSVIEWER_DIR .'/javascript/DocumentationViewer.js');
Requirements::css(DOCSVIEWER_DIR .'/css/shSilverStripeDocs.css');
Requirements::css(DOCSVIEWER_DIR .'/css/DocumentationViewer.css');
Requirements::combine_files('docs.css', array(
DOCSVIEWER_DIR .'/css/normalize.css',
DOCSVIEWER_DIR .'/css/utilities.css',
DOCSVIEWER_DIR .'/css/typography.css',
DOCSVIEWER_DIR .'/css/forms.css',
DOCSVIEWER_DIR .'/css/layout.css',
DOCSVIEWER_DIR .'/css/small.css'
));
}
/**
* Can the user view this documentation. Hides all functionality for
* private wikis.
* Can the user view this documentation. Hides all functionality for private
* wikis.
*
* @return bool
*/
public function canView() {
return (Director::isDev() || Director::is_cli() ||
!self::$check_permission ||
Permission::check(self::$check_permission)
!$this->config()->get('check_permission') ||
Permission::check($this->config()->get('check_permission'))
);
}
public function hasAction($action) {
return true;
}
public function checkAccessAction($action) {
return true;
}
/**
* Overloaded to avoid "action doesn't exist" errors - all URL parts in
* this controller are virtual and handled through handleRequest(), not
@ -143,490 +137,226 @@ class DocumentationViewer extends Controller {
* @return SS_HTTPResponse
*/
public function handleAction($request, $action) {
try {
if(preg_match('/DocumentationSearchForm/', $request->getURL())) {
$action = 'results';
}
$response = parent::handleAction($request, $action);
} catch(SS_HTTPResponse_Exception $e) {
if(strpos($e->getMessage(), 'does not exist') !== FALSE) {
return $this;
} else {
throw $e;
}
}
return $response;
}
/**
* Handle the url parsing for the documentation. In order to make this
* user friendly this does some tricky things..
*
* The urls which should work
* / - index page
* /en/sapphire - the index page of sapphire (shows versions)
* /2.4/en/sapphire - the docs for 2.4 sapphire.
* /2.4/en/sapphire/installation/
*
* @return SS_HTTPResponse
*/
public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
DocumentationService::load_automatic_registration();
// if we submitted a form, let that pass
if(!$request->isGET() || isset($_GET['action_results'])) {
return parent::handleRequest($request, $model);
if(!$request->isGET()) {
return parent::handleAction($request, $action);
}
$firstParam = ($request->param('Action')) ? $request->param('Action') : $request->shift();
$secondParam = $request->shift();
$thirdParam = $request->shift();
$url = $request->getURL();
$this->Remaining = $request->shift(10);
//
// If the current request has an extension attached to it, strip that
// off and redirect the user to the page without an extension.
//
if(DocumentationHelper::get_extension($url)) {
$this->response = new SS_HTTPResponse();
$this->response->redirect(
DocumentationHelper::trim_extension_off($url) .'/',
301
);
// if no params passed at all then it's the homepage
if(!$firstParam && !$secondParam && !$thirdParam) {
return parent::handleRequest($request, $model);
$request->shift();
$request->shift();
return $this->response;
}
if($firstParam) {
// allow assets
if($firstParam == "assets") {
return parent::handleRequest($request, $model);
//
// Strip off the base url
//
$base = ltrim(
Config::inst()->get('DocumentationViewer', 'link_base'), '/'
);
if($base && strpos($url, $base) !== false) {
$url = substr(
ltrim($url, '/'),
strlen($base)
);
} else {
}
// check for permalinks
if($link = DocumentationPermalinks::map($firstParam)) {
//
// Handle any permanent redirections that the developer has defined.
//
if($link = DocumentationPermalinks::map($url)) {
// the first param is a shortcode for a page so redirect the user to
// the short code.
$this->response = new SS_HTTPResponse();
$this->redirect($link, 301); // 301 permanent redirect
$this->response->redirect($link, 301);
$request->shift();
$request->shift();
return $this->response;
}
// check to see if the request is a valid entity. If it isn't, then we
// need to throw a 404.
if(!DocumentationService::is_registered_entity($firstParam)) {
return $this->throw404();
//
// Validate the language provided. Language is a required URL parameter.
// as we use it for generic interfaces and language selection. If
// language is not set, redirects to 'en'
//
$languages = i18n::get_common_languages();
if(!$lang = $request->param('Lang')) {
$lang = $request->param('Action');
$action = $request->param('ID');
} else {
$action = $request->param('Action');
}
$this->entity = $firstParam;
$this->language = $secondParam;
if(isset($thirdParam) && (is_numeric($thirdParam) || in_array($thirdParam, array('master', 'trunk')))) {
$this->version = $thirdParam;
if(!$lang) {
return $this->redirect($this->Link('en'));
} else if(!isset($languages[$lang])) {
return $this->httpError(404);
}
else {
// current version so store one area para
array_unshift($this->Remaining, $thirdParam);
$this->version = false;
$request->shift(10);
$allowed = $this->config()->allowed_actions;
if(in_array($action, $allowed)) {
//
// if it's one of the allowed actions such as search or all then the
// URL must be prefixed with one of the allowed languages.
//
return parent::handleAction($request, $action);
} else {
//
// look up the manifest to see find the nearest match against the
// list of the URL. If the URL exists then set that as the current
// page to match against.
// strip off any extensions.
// if($cleaned !== $url) {
// $redirect = new SS_HTTPResponse();
// return $redirect->redirect($cleaned, 302);
// }
if($record = $this->getManifest()->getPage($url)) {
$this->record = $record;
$this->init();
$type = get_class($this->record);
$body = $this->renderWith(array(
"DocumentationViewer_{$type}",
"DocumentationViewer"
));
return new SS_HTTPResponse($body, 200);
} else if(!$url || $url == $lang) {
$body = $this->renderWith(array(
"DocumentationViewer_DocumentationFolder",
"DocumentationViewer"
));
return new SS_HTTPResponse($body, 200);
}
}
// 'current' version mapping
$entity = DocumentationService::is_registered_entity($this->entity, null, $this->getLang());
if($entity) {
$current = $entity->getStableVersion();
$version = $this->getVersion();
if(!$version) {
$this->version = $current;
return $this->httpError(404);
}
// Check if page exists, otherwise return 404
if(!$this->locationExists()) {
return $this->throw404();
}
return parent::handleRequest($request, $model);
}
return $this->throw404();
}
/**
* Helper function for throwing a 404 error from the {@link handleRequest}
* method.
* @param int $status
* @param string $message
*
* @return HttpResponse
* @return SS_HTTPResponse
*/
function throw404() {
public function httpError($status, $message = null) {
$this->init();
$class = get_class($this);
$body = $this->customise(new ArrayData(array(
'Message' => $message
)))->renderWith(array("{$class}_error", $class));
$body = $this->renderWith(array("{$class}_error", $class));
$this->response = new SS_HTTPResponse($body, 404);
return $this->response;
return new SS_HTTPResponse($body, $status);
}
/**
* Custom templates for each of the sections.
* @return DocumentationManifest
*/
function getViewer($action) {
// count the number of parameters after the language, version are taken
// into account. This automatically includes ' ' so all the counts
// are 1 more than what you would expect
public function getManifest() {
if(!$this->manifest) {
$flush = SapphireTest::is_running_test() || (isset($_GET['flush']));
if($this->entity || $this->Remaining) {
$paramCount = count($this->Remaining);
if($paramCount == 0) {
return parent::getViewer('folder');
}
else if($entity = $this->getEntity()) {
// if this is a folder return the folder listing
if($this->locationExists() == 2) {
return parent::getViewer('folder');
}
}
}
else {
return parent::getViewer('home');
$this->manifest = new DocumentationManifest($flush);
}
return parent::getViewer($action);
return $this->manifest;
}
/**
* Returns the current version. If no version is set then it is the current
* set version so need to pull that from the {@link Entity}.
*
* @return String
* @return string
*/
function getVersion() {
if($this->version) return $this->version;
if($entity = $this->getEntity()) {
$this->version = $entity->getStableVersion();
return $this->version;
public function getLanguage() {
if(!$lang = $this->request->param('Lang')) {
$lang = $this->request->param('Action');
}
return false;
return $lang;
}
/**
* Returns the current language
*
* @return String
*/
function getLang() {
return $this->language;
}
/**
* Return all the available languages for the {@link Entity}.
*
* @return array
*/
function getLanguages() {
$entity = $this->getEntity();
if($entity) {
return $entity->getLanguages();
}
return array('en' => 'English');
}
/**
* Get all the versions loaded for the current {@link DocumentationEntity}.
* the filesystem then they are loaded under the 'Current' namespace.
*
* @param String $entity name of {@link Entity} to limit it to eg sapphire
* @return ArrayList
*/
function getVersions($entity = false) {
if(!$entity) $entity = $this->entity;
$entity = DocumentationService::is_registered_entity($entity);
if(!$entity) return false;
$versions = $entity->getVersions();
$output = new ArrayList();
if($versions) {
$lang = $this->getLang();
$currentVersion = $this->getVersion();
foreach($versions as $key => $version) {
if(!$version) continue;
$linkingMode = ($currentVersion == $version) ? 'current' : 'link';
$output->push(new ArrayData(array(
'Title' => $version,
'Link' => $this->Link(implode('/',$this->Remaining), $entity->getFolder(), $version),
'LinkingMode' => $linkingMode,
'Version' => $version // separate from title, we may want to make title nicer.
)));
}
}
return $output;
}
/**
* Generate a list of entities which have been registered and which can
* Generate a list of {@link Documentation } which have been registered and which can
* be documented.
*
* @return DataObject
*/
public function getEntities($version = false, $lang = false) {
$entities = DocumentationService::get_registered_entities($version, $lang);
public function getMenu() {
$entities = $this->getManifest()->getEntities();
$output = new ArrayList();
$record = $this->getPage();
$current = $this->getEntity();
$currentEntity = $this->getEntity();
if($entities) {
foreach($entities as $entity) {
$mode = ($entity === $currentEntity) ? 'current' : 'link';
$folder = $entity->getFolder();
$link = $this->Link(array(), $folder, false, $lang);
$content = false;
if($page = $entity->getIndexPage($version, $lang)) {
$content = DBField::create_field('HTMLText', DocumentationParser::parse($page, $link));
// only show entities with the same language
if($entity->getLanguage() !== $this->getLanguage()) {
continue;
}
// only show entities with the same version
if($entity->getVersion() !== $current->getVersion()) {
continue;
}
$mode = 'link';
$children = new ArrayList();
if($entity->hasRecord($record) || $entity->getIsDefaultEntity()) {
$mode = 'current';
// add children
$children = $this->getManifest()->getChildrenFor(
$entity->getPath(), ($record) ? $record->getPath() : $entity->getPath()
);
} else {
if($current && $current->getKey() == $entity->getKey()) {
continue;
}
}
$link = $entity->Link();
$output->push(new ArrayData(array(
'Title' => $entity->getTitle(),
'Link' => $link,
'LinkingMode' => $mode,
'Content' => $content
'DefaultEntity' => $entity->getIsDefaultEntity(),
'Children' => $children
)));
}
}
return $output;
}
/**
* Get the currently accessed entity from the site.
*
* @return false|DocumentationEntity
*/
public function getEntity() {
if($this->entity) {
return DocumentationService::is_registered_entity(
$this->entity,
$this->version,
$this->language
);
}
return false;
}
/**
* Simple way to check for existence of page of folder
* without constructing too much object state. Useful for
* generating 404 pages. Returns 0 for not a page or
* folder, returns 1 for a page and 2 for folder
*
* @return int
*/
public function locationExists() {
$entity = $this->getEntity();
if($entity) {
$has_dir = is_dir(Controller::join_links(
$entity->getPath($this->getVersion(), $this->getLang()),
implode('/', $this->Remaining)
));
if($has_dir) return 2;
$has_page = DocumentationService::find_page(
$entity,
$this->Remaining,
$this->getVersion(),
$this->getLang()
);
if($has_page) return 1;
}
return 0;
}
/**
* @return DocumentationPage
*/
function getPage() {
$entity = $this->getEntity();
if(!$entity) return false;
$version = $this->getVersion();
$lang = $this->getLang();
$absFilepath = DocumentationService::find_page(
$entity,
$this->Remaining,
$version,
$lang
);
if($absFilepath) {
$relativeFilePath = str_replace(
$entity->getPath($version, $lang),
'',
$absFilepath
);
$page = new DocumentationPage();
$page->setRelativePath($relativeFilePath);
$page->setEntity($entity);
$page->setLang($lang);
$page->setVersion($version);
return $page;
}
return false;
}
/**
* Get the related pages to the current {@link DocumentationEntity} and
* the children to those pages
*
* @todo this only handles 2 levels. Could make it recursive
*
* @return false|ArrayList
*/
function getEntityPages() {
if($entity = $this->getEntity()) {
$pages = DocumentationService::get_pages_from_folder($entity, null, self::$recursive_submenu, $this->getVersion(), $this->getLang());
if($pages) {
foreach($pages as $page) {
if(strtolower($page->Title) == "index") {
$pages->remove($page);
continue;
}
$page->LinkingMode = 'link';
$page->Children = $this->_getEntityPagesNested($page, $entity);
if (!empty($page->Children)) {
$this->currentLevelOnePage = $page;
}
}
}
return $pages;
}
return false;
}
/**
* Get all the pages under a given page. Recursive call for {@link getEntityPages()}
*
* @todo Need to rethink how to support pages which are pulling content from their children
* i.e if a folder doesn't have 2 then it will load the first file in the folder
* however it doesn't yet pass the highlighting to it.
*
* @param ArrayData CurrentPage
* @param DocumentationEntity
* @param int Depth of page in the tree
*
* @return ArrayList|false
*/
private function _getEntityPagesNested(&$page, $entity, $level = 0) {
if(isset($this->Remaining[$level])) {
// compare segment successively, e.g. with "changelogs/alpha/2.4.0-alpha",
// first comparison on $level=0 is against "changelogs",
// second comparison on $level=1 is against "changelogs/alpha", etc.
$segments = array_slice($this->Remaining, 0, $level+1);
if(strtolower(implode('/', $segments)) == strtolower(trim($page->getRelativeLink(), '/'))) {
// its either in this section or is the actual link
$page->LinkingMode = (isset($this->Remaining[$level + 1])) ? 'section' : 'current';
$relativePath = Controller::join_links(
$entity->getPath($this->getVersion(), $this->getLang()),
$page->getRelativePath()
);
if(is_dir($relativePath)) {
$children = DocumentationService::get_pages_from_folder(
$entity,
$page->getRelativePath(),
self::$recursive_submenu,
$this->getVersion(),
$this->getLang()
);
$segments = array();
for($x = 0; $x <= $level; $x++) {
$segments[] = $this->Remaining[$x];
}
foreach($children as $child) {
if(strtolower($child->Title) == "index") {
$children->remove($child);
continue;
}
$child->LinkingMode = 'link';
$child->Children = $this->_getEntityPagesNested($child, $entity, $level + 1);
}
return $children;
}
} else {
if ($page->getRelativeLink() == $this->Remaining[$level]) {
$page->LinkingMode = 'current';
}
}
}
return false;
}
/**
* @return DocumentationPage
*/
public function getCurrentLevelOnePage() {
return $this->currentLevelOnePage;
}
/**
* returns 'separate' if the submenu should be displayed in a separate
* block, 'nested' otherwise. If no currentDocPage is defined, there is
* no submenu, so an empty string is returned.
*
* @return string
*/
public function getSubmenuLocation() {
if ($this->currentLevelOnePage) {
if (self::$separate_submenu && !self::$recursive_submenu) {
return 'separate';
} else {
return 'nested';
}
}
return '';
}
/**
* Return the content for the page. If its an actual documentation page then
* display the content from the page, otherwise display the contents from
@ -634,75 +364,102 @@ class DocumentationViewer extends Controller {
*
* @return HTMLText
*/
function getContent() {
public function getContent() {
$page = $this->getPage();
$html = $page->getHTML();
$html = $this->replaceChildrenCalls($html);
if($page) {
return DBField::create_field("HTMLText", $page->getHTML($this->getVersion(), $this->getLang()));
return $html;
}
// If no page found then we may want to get the listing of the folder.
// In case no folder exists, show a "not found" page.
$entity = $this->getEntity();
$url = $this->Remaining;
public function replaceChildrenCalls($html) {
$codes = new ShortcodeParser();
$codes->register('CHILDREN', array($this, 'includeChildren'));
if($url && $entity) {
$pages = DocumentationService::get_pages_from_folder(
$entity,
implode('/', $url),
false,
$this->getVersion(),
$this->getLang()
);
return $this->customise(array(
'Content' => false,
'Title' => DocumentationService::clean_page_name(array_pop($url)),
'Pages' => $pages
))->renderWith('DocFolderListing');
}
else {
return $this->customise(array(
'Content' => false,
'Title' => _t('DocumentationViewer.MODULES', 'Modules'),
'Pages' => $this->getEntities()
))->renderWith('DocFolderListing');
}
return false;
return $codes->parse($html);
}
/**
* Generate a list of breadcrumbs for the user. Based off the remaining params
* in the url
* Short code parser
*/
public function includeChildren($args) {
if(isset($args['Folder'])) {
$children = $this->getManifest()->getChildrenFor(
Controller::join_links(dirname($this->record->getPath()), $args['Folder'])
);
} else {
$children = $this->getManifest()->getChildrenFor(
dirname($this->record->getPath())
);
}
if(isset($args['Exclude'])) {
$exclude = explode(',', $args['Exclude']);
foreach($children as $k => $child) {
foreach($exclude as $e) {
if($child->Link == Controller::join_links($this->record->Link(), strtolower($e), '/')) {
unset($children[$k]);
}
}
}
}
return $this->customise(new ArrayData(array(
'Children' => $children
)))->renderWith('Includes/DocumentationPages');
}
/**
* @return ArrayList
*/
public function getChildren() {
if($this->record instanceof DocumentationFolder) {
return $this->getManifest()->getChildrenFor(
$this->record->getPath()
);
} else if($this->record) {
return $this->getManifest()->getChildrenFor(
dirname($this->record->getPath())
);
}
return new ArrayList();
}
/**
* Generate a list of breadcrumbs for the user.
*
* @return ArrayList
*/
public function getBreadcrumbs() {
if(!$this->Remaining) $this->Remaining = array();
$pages = array_merge(array($this->entity), $this->Remaining);
$output = new ArrayList();
if($pages) {
$path = array();
$version = $this->getVersion();
$lang = $this->getLang();
foreach($pages as $i => $title) {
if($title) {
// Don't add entity name, already present in Link()
if($i > 0) $path[] = $title;
$output->push(new ArrayData(array(
'Title' => DocumentationService::clean_page_name($title),
'Link' => rtrim($this->Link($path, false, $version, $lang), "/"). "/"
)));
if($this->record) {
return $this->getManifest()->generateBreadcrumbs(
$this->record,
$this->record->getEntity()
);
}
}
/**
* @return DocumentationPage
*/
public function getPage() {
return $this->record;
}
return $output;
/**
* @return DocumentationEntity
*/
public function getEntity() {
return ($this->record) ? $this->record->getEntity() : null;
}
/**
* @return ArrayList
*/
public function getVersions() {
return $this->manifest->getVersions($this->getEntity());
}
/**
@ -710,119 +467,59 @@ class DocumentationViewer extends Controller {
*
* @return string
*/
public function getPageTitle() {
if($pages = $this->getBreadcrumbs()) {
$output = "";
foreach($pages as $page) {
$output = $page->Title .' - '. $output;
}
return $output;
}
return false;
public function getTitle() {
return ($this->record) ? $this->record->getTitle() : null;
}
/**
* Return the base link to this documentation location
*
* @param string $path - subfolder path
* @param string $entity - name of entity
* @param float $version - optional version
* @param string $lang - optional lang
*
* @return String
* @return string
*/
public function Link($path = false, $entity = false, $version = false, $lang = false) {
$version = ($version === null) ? $this->getVersion() : $version;
$lang = (!$lang) ? $this->getLang() : $lang;
$entity = (!$entity && $this->entity) ? $this->entity : $entity;
$action = '';
if(is_string($path)) {
$action = $path;
}
else if(is_array($path)) {
$action = implode('/', $path);
public function AbsoluteLink($action) {
return Controller::join_links(
Director::absoluteBaseUrl(),
$this->Link($action)
);
}
// check for stable version: if so, remove version from link
// (see DocumentationEntity->getRelativeLink() )
$objEntity = $this->getEntity();
if ($objEntity && $objEntity->getStableVersion() == $version) $version = '';
/**
* Return the base link to this documentation location.
*
* @return string
*/
public function Link($action = '') {
$link = Controller::join_links(
Director::absoluteBaseURL(),
self::get_link_base(),
$entity,
($entity) ? $lang : "", // only include lang for entity - sapphire/en vs en/
($entity) ? $version :"",
$action
Config::inst()->get('DocumentationViewer', 'link_base'),
$this->getLanguage(),
$action,
'/'
);
return $link;
}
/**
* Build the language dropdown.
* Generate a list of all the pages in the documentation grouped by the
* first letter of the page.
*
* @todo do this on a page by page rather than global
*
* @return Form
* @return GroupedList
*/
public function LanguageForm() {
$langs = $this->getLanguages();
public function AllPages() {
$pages = $this->getManifest()->getPages();
$output = new ArrayList();
$fields = new FieldList(
$dropdown = new DropdownField(
'LangCode',
_t('DocumentationViewer.LANGUAGE', 'Language'),
$langs,
$this->Lang
)
);
foreach($pages as $url => $page) {
$first = strtoupper(trim(substr($page['title'], 0, 1)));
$actions = new FieldList(
new FormAction('doLanguageForm', _t('DocumentationViewer.CHANGE', 'Change'))
);
$dropdown->setDisabled(true);
return new Form($this, 'LanguageForm', $fields, $actions);
if($first) {
$output->push(new ArrayData(array(
'Link' => $url,
'Title' => $page['title'],
'FirstLetter' => $first
)));
}
}
/**
* Process the language change
*
*/
public function doLanguageForm($data, $form) {
$this->Lang = (isset($data['LangCode'])) ? $data['LangCode'] : 'en';
return $this->redirect($this->Link());
}
/**
* @param string
*/
public static function set_link_base($base) {
self::$link_base = $base;
}
/**
* @return string
*/
public static function get_link_base() {
return self::$link_base;
}
/**
* @see {@link Form::FormObjectLink()}
*/
public function FormObjectLink($name) {
return $name;
return GroupedList::create($output->sort('Title', 'ASC'));
}
/**
@ -832,215 +529,11 @@ class DocumentationViewer extends Controller {
* @return Form
*/
public function DocumentationSearchForm() {
if(!DocumentationSearch::enabled()) {
if(!Config::inst()->get('DocumentationSearch','enabled')) {
return false;
}
$q = ($q = $this->getSearchQuery()) ? $q->NoHTML() : "";
$entities = $this->getSearchedEntities();
$versions = $this->getSearchedVersions();
$fields = new FieldList(
new TextField('Search', _t('DocumentationViewer.SEARCH', 'Search'), $q)
);
if ($entities) $fields->push(
new HiddenField('Entities', '', implode(',', array_keys($entities)))
);
if ($versions) $fields->push(
new HiddenField('Versions', '', implode(',', $versions))
);
$actions = new FieldList(
new FormAction('results', 'Search')
);
$form = new Form($this, 'DocumentationSearchForm', $fields, $actions);
$form->disableSecurityToken();
$form->setFormMethod('GET');
$form->setFormAction(self::$link_base . 'DocumentationSearchForm');
return $form;
}
/**
* Return an array of folders and titles
*
* @return array
*/
function getSearchedEntities() {
$entities = array();
if(!empty($_REQUEST['Entities'])) {
if(is_array($_REQUEST['Entities'])) {
$entities = Convert::raw2att($_REQUEST['Entities']);
}
else {
$entities = explode(',', Convert::raw2att($_REQUEST['Entities']));
$entities = array_combine($entities, $entities);
}
}
else if($entity = $this->getEntity()) {
$entities[$entity->getFolder()] = Convert::raw2att($entity->getTitle());
}
return $entities;
}
/**
* Return an array of versions that we're allowed to return
*
* @return array
*/
public function getSearchedVersions() {
$versions = array();
if(!empty($_REQUEST['Versions'])) {
if(is_array($_REQUEST['Versions'])) {
$versions = Convert::raw2att($_REQUEST['Versions']);
$versions = array_combine($versions, $versions);
}
else {
$version = Convert::raw2att($_REQUEST['Versions']);
$versions[$version] = $version;
}
}
else if($version = $this->getVersion()) {
$version = Convert::raw2att($version);
$versions[$version] = $version;
}
return $versions;
}
/**
* Return the current search query
*
* @return HTMLText|null
*/
public function getSearchQuery() {
if(isset($_REQUEST['Search'])) {
return DBField::create_field('HTMLText', $_REQUEST['Search']);
}
}
/**
* Past straight to results, display and encode the query
*/
public function results($data, $form = false) {
$query = (isset($_REQUEST['Search'])) ? $_REQUEST['Search'] : false;
$search = new DocumentationSearch();
$search->setQuery($query);
$search->setVersions($this->getSearchedVersions());
$search->setModules($this->getSearchedEntities());
$search->setOutputController($this);
return $search->renderResults();
}
/**
* Returns an search form which allows people to express more complex rules
* and options than the plain search form.
*
* @todo client side filtering of checkable option based on the module selected.
*
* @return Form
*/
public function AdvancedSearchForm() {
$entities = DocumentationService::get_registered_entities();
$versions = array();
foreach($entities as $entity) {
$versions[$entity->getFolder()] = $entity->getVersions();
}
// get a list of all the unique versions
$uniqueVersions = array_unique(self::array_flatten(array_values($versions)));
asort($uniqueVersions);
$uniqueVersions = array_combine($uniqueVersions,$uniqueVersions);
$q = ($q = $this->getSearchQuery()) ? $q->NoHTML() : "";
// klude to take an array of objects down to a simple map
$entities = new ArrayList($entities);
$entities = $entities->map('Folder', 'Title');
// if we haven't gone any search limit then we're searching everything
$searchedEntities = $this->getSearchedEntities();
if(count($searchedEntities) < 1) $searchedEntities = $entities;
$searchedVersions = $this->getSearchedVersions();
if(count($searchedVersions) < 1) $searchedVersions = $uniqueVersions;
$fields = new FieldList(
new TextField('Search', _t('DocumentationViewer.KEYWORDS', 'Keywords'), $q),
new CheckboxSetField('Entities', _t('DocumentationViewer.MODULES', 'Modules'), $entities, $searchedEntities),
new CheckboxSetField('Versions', _t('DocumentationViewer.VERSIONS', 'Versions'),
$uniqueVersions, $searchedVersions
)
);
$actions = new FieldList(
new FormAction('results', _t('DocumentationViewer.SEARCH', 'Search'))
);
$required = new RequiredFields(array('Search'));
$form = new Form($this, 'AdvancedSearchForm', $fields, $actions, $required);
$form->disableSecurityToken();
$form->setFormMethod('GET');
$form->setFormAction(self::$link_base . 'DocumentationSearchForm');
return $form;
}
/**
* check if the Advanced SearchForm can be displayed
* enabled by default, to disable use:
* DocumentationSearch::enable_advanced_search(false);
*
* @return bool
*/
public function getAdvancedSearchEnabled() {
return DocumentationSearch::advanced_search_enabled();
}
/**
* Check to see if the currently accessed version is out of date or
* perhaps a future version rather than the stable edition
*
* @return false|ArrayData
*/
public function VersionWarning() {
$version = $this->getVersion();
$entity = $this->getEntity();
if($entity) {
$compare = $entity->compare($version);
$stable = $entity->getStableVersion();
// same
if($version == $stable) return false;
// check for trunk, if trunk and not the same then it's future
// also run through compare
if($version == "trunk" || $compare > 0) {
return $this->customise(new ArrayData(array(
'FutureRelease' => true,
'StableVersion' => DBField::create_field('HTMLText', $stable)
)));
}
else {
return $this->customise(new ArrayData(array(
'OutdatedRelease' => true,
'StableVersion' => DBField::create_field('HTMLText', $stable)
)));
}
}
return false;
return new DocumentationSearchForm($this);
}
/**
@ -1080,15 +573,20 @@ class DocumentationViewer extends Controller {
* @return string
*/
public function getEditLink() {
$page = $this->getPage();
if($page) {
$entity = $page->getEntity();
if($entity && isset(self::$edit_links[$entity->title])) {
if($entity && isset(self::$edit_links[strtolower($entity->title)])) {
// build the edit link, using the version defined
$url = self::$edit_links[$entity->title];
$version = $page->getVersion();
$url = self::$edit_links[strtolower($entity->title)];
$version = $entity->getVersion();
if($version == "trunk" && (isset($url['options']['rewritetrunktomaster']))) {
if($url['options']['rewritetrunktomaster']) {
@ -1099,8 +597,8 @@ class DocumentationViewer extends Controller {
return str_replace(
array('%entity%', '%lang%', '%version%', '%path%'),
array(
$entity->getFolder(),
$page->getLang(),
$entity->title,
$this->getLanguage(),
$version,
ltrim($page->getRelativePath(), '/')
),
@ -1113,25 +611,53 @@ class DocumentationViewer extends Controller {
return false;
}
/**
* Flattens an array
* Returns the next page. Either retrieves the sibling of the current page
* or return the next sibling of the parent page.
*
* @param array
* @return array
* @return DocumentationPage
*/
public static function array_flatten($array) {
if(!is_array($array)) return false;
$output = array();
foreach($array as $k => $v) {
if(is_array($v)) {
$output = array_merge($output, self::array_flatten($v));
public function getNextPage() {
return ($this->record)
? $this->getManifest()->getNextPage(
$this->record->getPath(), $this->getEntity()->getPath())
: null;
}
else {
$output[$k] = $v;
/**
* Returns the previous page. Either returns the previous sibling or the
* parent of this page
*
* @return DocumentationPage
*/
public function getPreviousPage() {
return ($this->record)
? $this->getManifest()->getPreviousPage(
$this->record->getPath(), $this->getEntity()->getPath())
: null;
}
/**
* @return string
*/
public function getGoogleAnalyticsCode() {
$code = $this->config()->get('google_analytics_code');
if($code) {
return $code;
}
}
return $output;
/**
* @return string
*/
public function getDocumentationTitle() {
return $this->config()->get('documentation_title');
}
public function getDocumentationBaseHref() {
return Config::inst()->get('DocumentationViewer', 'link_base');
}
}

View File

@ -0,0 +1,93 @@
<?php
class DocumentationSearchExtension extends Extension {
/**
* Return an array of folders and titles
*
* @return array
*/
public function getSearchedEntities() {
$entities = array();
if(!empty($_REQUEST['Entities'])) {
if(is_array($_REQUEST['Entities'])) {
$entities = Convert::raw2att($_REQUEST['Entities']);
}
else {
$entities = explode(',', Convert::raw2att($_REQUEST['Entities']));
$entities = array_combine($entities, $entities);
}
}
return $entities;
}
/**
* Return an array of versions that we're allowed to return
*
* @return array
*/
public function getSearchedVersions() {
$versions = array();
if(!empty($_REQUEST['Versions'])) {
if(is_array($_REQUEST['Versions'])) {
$versions = Convert::raw2att($_REQUEST['Versions']);
$versions = array_combine($versions, $versions);
}
else {
$version = Convert::raw2att($_REQUEST['Versions']);
$versions[$version] = $version;
}
}
return $versions;
}
/**
* Return the current search query.
*
* @return HTMLText|null
*/
public function getSearchQuery() {
if(isset($_REQUEST['Search'])) {
return DBField::create_field('HTMLText', $_REQUEST['Search']);
} else if(isset($_REQUEST['q'])) {
return DBField::create_field('HTMLText', $_REQUEST['q']);
}
}
/**
* Past straight to results, display and encode the query.
*/
public function getSearchResults() {
$query = $this->getSearchQuery();
$search = new DocumentationSearch();
$search->setQuery($query);
$search->setVersions($this->getSearchedVersions());
$search->setModules($this->getSearchedEntities());
$search->setOutputController($this->owner);
return $search->renderResults();
}
/**
* Returns an search form which allows people to express more complex rules
* and options than the plain search form.
*
* @return Form
*/
public function AdvancedSearchForm() {
return new DocumentationAdvancedSearchForm($this->owner);
}
/**
* @return bool
*/
public function getAdvancedSearchEnabled() {
return Config::inst()->get("DocumentationSearch", 'advanced_search_enabled');
}
}

View File

@ -28,30 +28,10 @@
class DocumentationStaticPublisherExtension extends Extension {
public function alterExportUrls(&$urls) {
// fetch all the documentation pages for all the registered modules
$modules = DocumentationService::get_registered_entities();
$manifest = new DocumentationManifest(true);
foreach($modules as $module) {
foreach($module->getLanguages() as $lang) {
foreach($module->getVersions() as $version) {
$pages = DocumentationService::get_pages_from_folder(
$module,
false,
true,
$version,
$lang
);
if($pages) {
foreach($pages as $page) {
$link = $page->getLink(false);
$urls[$link] = $link;
}
}
}
}
foreach($manifest->getPages() as $url => $page) {
$urls[$url] = $url;
}
}
}

View File

@ -0,0 +1,49 @@
<?php
/**
* Check to see if the currently accessed version is out of date or perhaps a
* future version rather than the stable edition.
*
* @return false|ArrayData
*/
class DocumentationViewerVersionWarning extends Extension {
public function VersionWarning() {
$page = $this->owner->getPage();
if(!$page) {
return false;
}
$entity = $page->getEntity();
if(!$entity) {
return false;
}
$versions = $this->owner->getManifest()->getAllVersionsOfEntity($entity);
if($entity->getIsStable()) {
return false;
}
$stable = $this->owner->getManifest()->getStableVersion($entity);
$compare = $entity->compare($stable);
if($entity->getVersion() == "master" || $compare > 0) {
return $this->owner->customise(new ArrayData(array(
'FutureRelease' => true,
'StableVersion' => DBField::create_field('HTMLText', $stable->getVersion())
)));
}
else {
return $this->owner->customise(new ArrayData(array(
'OutdatedRelease' => true,
'StableVersion' => DBField::create_field('HTMLText', $stable->getVersion())
)));
}
return false;
}
}

View File

@ -0,0 +1,58 @@
<?php
/**
* @package docsviewer
*/
class DocumentationAdvancedSearchForm extends Form {
public function __construct($controller) {
$versions = $controller->getManifest()->getAllVersions();
$entities = $controller->getManifest()->getEntities();
$q = ($q = $controller->getSearchQuery()) ? $q->NoHTML() : "";
// klude to take an array of objects down to a simple map
$entities = $entities->map('Folder', 'Title');
// if we haven't gone any search limit then we're searching everything
$searchedEntities = $controller->getSearchedEntities();
if(count($searchedEntities) < 1) {
$searchedEntities = $entities;
}
$searchedVersions = $controller->getSearchedVersions();
if(count($searchedVersions) < 1) {
$searchedVersions = $versions;
}
$fields = new FieldList(
new TextField('q', _t('DocumentationViewer.KEYWORDS', 'Keywords'), $q),
new CheckboxSetField('Entities', _t('DocumentationViewer.MODULES', 'Modules'), $entities, $searchedEntities),
new CheckboxSetField(
'Versions',
_t('DocumentationViewer.VERSIONS', 'Versions'),
$versions, $searchedVersions
)
);
$actions = new FieldList(
new FormAction('results', _t('DocumentationViewer.SEARCH', 'Search'))
);
$required = new RequiredFields(array('Search'));
parent::__construct(
$controller,
'AdvancedSearchForm',
$fields,
$actions,
$required
);
$this->disableSecurityToken();
$this->setFormMethod('GET');
$this->setFormAction($controller->Link('results'));
}
}

View File

@ -0,0 +1,23 @@
<?php
class DocumentationSearchForm extends Form {
public function __construct($controller) {
$fields = new FieldList(
TextField::create('q', _t('DocumentationViewer.SEARCH', 'Search'), '')
->setAttribute('placeholder', _t('DocumentationViewer.SEARCH', 'Search'))
);
$actions = new FieldList(
new FormAction('results', _t('DocumentationViewer.SEARCH', 'Search'))
);
parent::__construct($controller, 'DocumentationSearchForm', $fields, $actions);
$this->disableSecurityToken();
$this->setFormMethod('GET');
$this->setFormAction($controller->Link('results'));
$this->addExtraClass('search');
}
}

View File

@ -1,21 +1,16 @@
<?php
/**
* A {@link DocumentationEntity} is created when registering a module path
* with {@link DocumentationService::register()}. A {@link DocumentationEntity}
* represents a module or folder with documentation rather than a specific
* page. Individual pages are handled by {@link DocumentationPage}
* A {@link DocumentationEntity} represents a module or folder with stored
* documentation files. An entity not an individual page but a `section` of
* documentation arranged by version and language.
*
* Each folder must have at least one language subfolder, which is automatically
* determined through {@link addVersion()} and should not be included in the
* $path argument.
* Each entity has a version assigned to it (i.e master) and folders can be
* labeled with a specific version. For instance, doc.silverstripe.org has three
* DocumentEntities for Framework - versions 2.4, 3.0 and 3.1. In addition an
* entity can have a language attached to it. So for an instance with en, de and
* fr documentation you may have three {@link DocumentationEntities} registered.
*
* Versions are assumed to be in numeric format (e.g. '2.4'),
*
* They're also parsed through version_compare() in {@link getStableVersion()}
* which assumes a certain format:
*
* @see http://php.net/manual/en/function.version-compare.php
*
* @package docsviewer
* @subpackage models
@ -24,135 +19,236 @@
class DocumentationEntity extends ViewableData {
/**
* @var array
*/
private static $casting = array(
'Name' => 'Text'
);
/**
* @var string $folder folder name
*/
private $folder;
/**
* @var string $title nice title
*/
private $title;
/**
* @var array $version version numbers and the paths to each
*/
private $versions = array();
/**
* @var array
*/
private $stableVersion;
/**
* @var Array $langs a list of available langauges
*/
private $langs = array();
/**
* Constructor. You do not need to pass the langs to this as
* it will work out the languages from the filesystem
* The key to match entities with that is not localized. For instance, you
* may have three entities (en, de, fr) that you want to display a nice
* title for, but matching needs to occur on a specific key.
*
* @param string $folder folder name
* @param string $version version of this module
* @param string $path Absolute path to this module (excluding language folders)
* @param string $title
* @var string $key
*/
function __construct($folder, $version, $path, $title = false) {
$this->addVersion($version, $path);
$this->title = (!$title) ? $folder : $title;
$this->folder = $folder;
}
protected $key;
/**
* Return the languages which are available
* The human readable title of this entity. Set when the module is
* registered.
*
* @return array
* @var string $title
*/
public function getLanguages() {
return $this->langs;
}
protected $title;
/**
* Return whether this entity has a given language
* If the system is setup to only document one entity then you may only
* want to show a single entity in the URL and the sidebar. Set this when
* you register the entity with the key `DefaultEntity` and the URL will
* not include any version or language information.
*
* @return bool
* @var boolean $default_entity
*/
public function hasLanguage($lang) {
return (in_array($lang, $this->langs));
}
protected $defaultEntity;
/**
* Add a langauge or languages to the entity
*
* @param Array|String languages
* @var mixed
*/
public function addLanguage($language) {
if(is_array($language)) {
$this->langs = array_unique(array_merge($this->langs, $language));
}
else {
$this->langs[] = $language;
}
}
protected $path;
/**
* Get the folder name of this module
*
* @return String
* @see {@link http://php.net/manual/en/function.version-compare.php}
* @var float $version
*/
public function getFolder() {
return $this->folder;
}
protected $version;
/**
* Get the title of this module
* If this entity is a stable release or not. If it is not stable (i.e it
* could be a past or future release) then a warning message will be shown.
*
* @return String
* @var boolean $stable
*/
protected $stable;
/**
* @var string
*/
protected $language;
/**
*
*/
public function __construct($key) {
$this->key = DocumentationHelper::clean_page_url($key);
}
/**
* Get the title of this module.
*
* @return string
*/
public function getTitle() {
if(!$this->title) {
$this->title = DocumentationHelper::clean_page_name($this->key);
}
return $this->title;
}
/**
* Return the versions which have been registered for this entity.
* @param string $title
* @return this
*/
public function setTitle($title) {
$this->title = $title;
return $this;
}
/**
* Returns the web accessible link to this entity.
*
* @return array
* Includes the version information
*
* @return string
*/
public function getVersions() {
return array_keys($this->versions);
}
/**
* @return string|boo
*/
public function getStableVersion() {
if(!$this->hasVersions()) return false;
if($this->stableVersion) {
return $this->stableVersion;
public function Link() {
if($this->getIsDefaultEntity()) {
$base = Controller::join_links(
Config::inst()->get('DocumentationViewer', 'link_base'),
$this->getLanguage(),
'/'
);
} else {
$sortedVersions = $this->getVersions();
usort($sortedVersions, create_function('$a,$b', 'return version_compare($a,$b);'));
return array_pop($sortedVersions);
$base = Controller::join_links(
Config::inst()->get('DocumentationViewer', 'link_base'),
$this->getLanguage(),
$this->getKey(),
'/'
);
}
$base = ltrim(str_replace('//', '/', $base), '/');
if($this->stable) {
return $base;
}
return Controller::join_links(
$base,
$this->getVersion(),
'/'
);
}
/**
* @param String $version
* @return string
*/
public function setStableVersion($version) {
if(!$this->hasVersion($version)) throw new InvalidArgumentException(sprintf('Version "%s" does not exist', $version));
$this->stableVersion = $version;
public function __toString() {
return sprintf('DocumentationEntity: %s)', $this->getPath());
}
/**
* @param DocumentationPage $page
*
* @return boolean
*/
public function hasRecord($page) {
if(!$page) {
return false;
}
return strstr($page->getPath(), $this->getPath()) !== false;
}
/**
* @param boolean $bool
*/
public function setIsDefaultEntity($bool) {
$this->defaultEntity = $bool;
return $this;
}
/**
* @return boolean
*/
public function getIsDefaultEntity() {
return $this->defaultEntity;
}
/**
* @return string
*/
public function getKey() {
return $this->key;
}
/**
* @return string
*/
public function getLanguage() {
return $this->language;
}
/**
* @param string
*
* @return this
*/
public function setLanguage($language) {
$this->language = $language;
return $this;
}
/**
* @param string
*/
public function setVersion($version) {
$this->version = $version;
return $this;
}
/**
* @return float
*/
public function getVersion() {
return $this->version;
}
/**
* @return string
*/
public function getPath() {
return $this->path;
}
/**
* @param string $path
*
* @return this
*/
public function setPath($path) {
$this->path = $path;
return $this;
}
/**
* @param boolean
*/
public function setIsStable($stable) {
$this->stable = $stable;
return $this;
}
/**
* @return boolean
*/
public function getIsStable() {
return $this->stable;
}
/**
* Returns an integer value based on if a given version is the latest
* version. Will return -1 for if the version is older, 0 if versions are
@ -161,140 +257,20 @@ class DocumentationEntity extends ViewableData {
* @param string $version
* @return int
*/
public function compare($version) {
$latest = $this->getStableVersion();
return version_compare($version, $latest);
public function compare(DocumentationEntity $other) {
return version_compare($this->getVersion(), $other->getVersion());
}
/**
* Return whether we have a given version of this entity
*
* @return bool
* @return array
*/
public function hasVersion($version) {
return (isset($this->versions[$version]));
}
/**
* Return whether we have any versions at all0
*
* @return bool
*/
public function hasVersions() {
return (sizeof($this->versions) > 0);
}
/**
* Add another version to this entity
*
* @param Float $version Version number
* @param String $path path to folder
*/
public function addVersion($version = '', $path) {
$langs = scandir($path);
$available = array();
if($langs) {
foreach($langs as $key => $lang) {
if(!is_dir($path . $lang) || strlen($lang) > 2 || in_array($lang, DocumentationService::get_ignored_files(), true))
$lang = 'en';
if(!in_array($lang, $available))
$available[] = $lang;
}
}
$this->addLanguage($available);
$this->versions[$version] = $path;
}
/**
* Remove a version from this entity
*
* @param Float $version
*/
public function removeVersion($version = '') {
if(isset($this->versions[$version])) {
unset($this->versions[$version]);
}
}
/**
* Return the absolute path to this documentation entity on the
* filesystem
*
* @return string
*/
public function getPath($version = false, $lang = false) {
if(!$version) $version = $this->getStableVersion();
if(!$lang) $lang = 'en';
if($this->hasVersion($version)) {
$path = $this->versions[$version];
}
else {
$versions = $this->getVersions();
$path = $this->versions[$versions[0]];
}
return Controller::join_links($path, $lang);
}
/**
* Returns the web accessible link to this Entity
*
* @return string
*/
public function Link($version = false, $lang = false) {
return Controller::join_links(
Director::absoluteBaseURL(),
$this->getRelativeLink($version, $lang)
public function toMap() {
return array(
'Key' => $this->key,
'Path' => $this->getPath(),
'Version' => $this->getVersion(),
'IsStable' => $this->getIsStable(),
'Language' => $this->getLanguage()
);
}
function getRelativeLink($version = false, $lang = false) {
if(!$lang) $lang = 'en';
if($version == $this->getStableVersion()) $version = false;
return Controller::join_links(
DocumentationViewer::get_link_base(),
$this->getFolder(),
$lang,
$version
);
}
/**
* Return the summary / index text for this entity. Either pulled
* from an index file or some other summary field
*
* @return DocumentationPage
*/
function getIndexPage($version, $lang = 'en') {
$path = $this->getPath($version, $lang);
$absFilepath = Controller::join_links($path, 'index.md');
if(file_exists($absFilepath)) {
$relativeFilePath = str_replace($path, '', $absFilepath);
$page = new DocumentationPage();
$page->setRelativePath($relativeFilePath);
$page->setEntity($this);
$page->setLang($lang);
$page->setVersion($version);
return $page;
}
return false;
}
/**
* @return string
*/
function __toString() {
return sprintf('DocumentationEntity: %s)', $this->getPath());
}
}

View File

@ -0,0 +1,20 @@
<?php
/**
* A specific documentation folder within a {@link DocumentationEntity}.
*
* Maps to a folder on the file system.
*
* @package docsviewer
* @subpackage model
*/
class DocumentationFolder extends DocumentationPage {
/**
* @return string
*/
public function getTitle() {
return $this->getTitleFromFolder();
}
}

View File

@ -1,73 +1,88 @@
<?php
/**
* A specific page within a {@link DocumentationEntity}. Maps 1 to 1 to a file on the
* filesystem.
* A specific documentation page within a {@link DocumentationEntity}.
*
* Maps to a file on the file system. Note that the URL to access this page may
* not always be the file name. If the file contains meta data with a nicer URL
* sthen it will use that.
*
* @package docsviewer
* @subpackage model
*/
class DocumentationPage extends ViewableData {
/**
* @var string
*/
protected $title, $summary, $introduction;
/**
* @var DocumentationEntity
*/
protected $entity;
/**
* Stores the relative path (from the {@link DocumentationEntity} to
* this page. The actual file name can be accessed via {@link $this->getFilename()}
*
* @var String
*/
protected $relativePath;
/**
* @var String
*/
protected $lang = 'en';
/**
* @var string
*/
protected $title;
/**
* @var String
*/
protected $version;
/**
* @var Boolean
*/
protected $isFolder = false;
protected $path;
/**
* Filename
*
* @var integer
* @var string
*/
protected $pagenumber = 0;
protected $filename;
protected $read = false;
/**
* @param Boolean
* @param DocumentationEntity $entity
* @param string $filename
* @param string $path
*/
public function setIsFolder($isFolder = false) {
$this->isFolder = $isFolder;
public function __construct(DocumentationEntity $entity, $filename, $path) {
$this->filename = $filename;
$this->path = $path;
$this->entity = $entity;
}
/**
* @return Boolean
* @return string
*/
public function getIsFolder($isFolder = false) {
return $this->isFolder;
public function getExtension() {
return DocumentationHelper::get_extension($this->filename);
}
/**
* @param string - has to be plain text for open search compatibility.
*
* @param int $number
* @return string
*/
public function setPagenumber($number = 0) {
if (is_int($number )) $this->pagenumber = $number;
public function getBreadcrumbTitle($divider = ' - ') {
$pathParts = explode('/', trim($this->getRelativePath(), '/'));
// from the page from this
array_pop($pathParts);
// add the module to the breadcrumb trail.
$pathParts[] = $this->entity->getTitle();
$titleParts = array_map(array(
'DocumentationHelper', 'clean_page_name'
), $pathParts);
$titleParts = array_filter($titleParts, function($val) {
if($val) {
return $val;
}
});
if($this->getTitle()) {
array_unshift($titleParts, $this->getTitle());
}
return implode($divider, $titleParts);
}
/**
@ -77,234 +92,168 @@ class DocumentationPage extends ViewableData {
return $this->entity;
}
/**
* @param DocumentationEntity
*/
public function setEntity($entity) {
$this->entity = $entity;
}
/**
* @return string
*/
public function getRelativePath() {
return $this->relativePath;
}
/**
* @param string
*/
public function setRelativePath($path) {
$this->relativePath = $path;
}
/**
* @return string
*/
function getExtension() {
return DocumentationService::get_extension($this->getRelativePath());
}
/**
* Absolute path including version and lang folder.
*
* @throws InvalidArgumentException
*
* @param bool $defaultFile - If this is a folder and this is set to true then getPath
* will return the path of the first file in the folder
* @return string
*/
function getPath($defaultFile = false, $realpath = true) {
if($this->entity) {
$path = Controller::join_links(
$this->entity->getPath($this->getVersion(), $this->lang),
$this->getRelativePath()
);
if(!is_dir($path) && $realpath) $path = realpath($path);
else if($defaultFile) {
$file = DocumentationService::find_page($this->entity, explode('/', $this->getRelativePath()));
if($file) $path = $file;
}
}
else {
$path = $this->getRelativePath();
}
if(!file_exists($path)) {
throw new InvalidArgumentException(sprintf(
'Path could not be found. Module path: %s, file path: %s',
$this->entity->getPath(),
$this->getRelativePath()
));
}
return (is_dir($path)) ? rtrim($path, '/') . '/' : $path;
}
/**
* @param string - has to be plain text for open search compatibility.
*
* @return string
*/
function getBreadcrumbTitle($divider = ' - ') {
$pathParts = explode('/', $this->getRelativePath());
// add the module to the breadcrumb trail.
array_unshift($pathParts, $this->entity->getTitle());
$titleParts = array_map(array('DocumentationService', 'clean_page_name'), $pathParts);
return implode($divider, $titleParts + array($this->getTitle()));
}
/**
* Returns the public accessible link for this page.
*
* @param Boolean Absolute URL (incl. domain), or relative to webroot
* @return string
*/
function getLink($absolute=true) {
if($entity = $this->getEntity()) {
$link = $this->getRelativeLink();
$link = rtrim(DocumentationService::trim_extension_off($link), '/');
// folders should have a / on them. Looks nicer
try {
if(is_dir($this->getPath())) $link .= '/';
}
catch (Exception $e) {}
}
else {
$link = $this->getPath(true);
}
if($absolute) {
$fullLink = Controller::join_links($entity->Link($this->getVersion(), $this->lang), $link);
} else {
$fullLink = Controller::join_links($entity->getRelativeLink($this->getVersion(), $this->lang), $link);
}
return $fullLink;
}
/**
* Relative to the module base, not the webroot.
*
* @return string
*/
function getRelativeLink() {
$link = rtrim(DocumentationService::trim_extension_off($this->getRelativePath()), '/');
// folders should have a / on them. Looks nicer
try {
if(is_dir($this->getPath())) $link .= '/';
} catch (Exception $e) {};
return $link;
}
function getLang() {
return $this->lang;
}
function setLang($lang) {
$this->lang = $lang;
}
function getVersion() {
return $this->version ? $this->version : $this->entity->getStableVersion();
}
function setVersion($version) {
$this->version = $version;
}
function setTitle($title) {
$this->title = $title;
}
function getTitle() {
public function getTitle() {
if($this->title) {
return $this->title;
}
/**
* Set a variable from the metadata field on this class
*
* @param string key
* @param mixed value
*/
public function setMetaData($key, $value) {
$this->$key = $value;
$page = DocumentationHelper::clean_page_name($this->filename);
if($page == "Index") {
return $this->getTitleFromFolder();
}
return $page;
}
public function getTitleFromFolder() {
$folder = $this->getPath();
$entity = $this->getEntity()->getPath();
$folder = str_replace('index.md', '', $folder);
// if it's the root of the entity then we want to use the entity name
// otherwise we'll get 'En' for the entity folder
if($folder == $entity) {
return $this->getEntity()->getTitle();
} else {
$path = explode(DIRECTORY_SEPARATOR, trim($folder, DIRECTORY_SEPARATOR));
$folderName = array_pop($path);
}
return DocumentationHelper::clean_page_name($folderName);
}
/**
* @return string
*/
function getFilename() {
$path = rtrim($this->relativePath, '/');
try {
return (is_dir($this->getPath())) ? $path . '/' : $path;
}
catch (Exception $e) {}
return $path;
public function getSummary() {
return $this->summary;
}
/**
* Return the raw markdown for a given documentation page. Will throw
* an error if the path isn't a file.
* Return the raw markdown for a given documentation page.
*
* Will return empty if the type is not readable
* @param boolean $removeMetaData
*
* @return string
*/
function getMarkdown($removeMetaData = false) {
public function getMarkdown($removeMetaData = false) {
try {
$path = $this->getPath(true);
if ($md = file_get_contents($this->getPath())) {
$this->populateMetaDataFromText($md, $removeMetaData);
if($path) {
$ext = $this->getExtension();
if(empty($ext) || DocumentationService::is_valid_extension($ext)) {
if ($md = file_get_contents($path)) {
if ($this->title != 'Index') $this->getMetadataFromComments($md, $removeMetaData);
}
return $md;
}
$this->read = true;
}
catch(InvalidArgumentException $e) {
}
catch(InvalidArgumentException $e) {}
return false;
}
public function setMetaData($key, $value) {
$key = strtolower($key);
$this->$key = $value;
}
public function getIntroduction() {
if(!$this->read) {
$this->getMarkdown();
}
return $this->introduction;
}
/**
* Parse a file (with a lang and a version).
* Parse a file and return the parsed HTML version.
*
* @param string $baselink
*
* @return string
*/
function getHTML($version, $lang = 'en') {
return DocumentationParser::parse($this, $this->entity->getRelativeLink($version, $lang));
public function getHTML() {
$html = DocumentationParser::parse(
$this,
$this->entity->Link()
);
return $html;
}
/**
* get metadata from the first html block in the page, then remove the
* This should return the link from the entity root to the page. The link
* value has the cleaned version of the folder names. See
* {@link getRelativePath()} for the actual file path.
*
* @return string
*/
public function getRelativeLink() {
$path = $this->getRelativePath();
$url = explode('/', $path);
$url = implode('/', array_map(function($a) {
return DocumentationHelper::clean_page_url($a);
}, $url));
$url = trim($url, '/') . '/';
return $url;
}
/**
* This should return the link from the entity root to the page. For the url
* polished version, see {@link getRelativeLink()}.
*
* @return string
*/
public function getRelativePath() {
return str_replace($this->entity->getPath(), '', $this->getPath());
}
/**
* @return string
*/
public function getPath() {
return $this->path;
}
/**
* Returns the URL that will be required for the user to hit to view the
* given document base name.
*
* @param string $file
* @param string $path
*
* @return string
*/
public function Link() {
return ltrim(Controller::join_links(
$this->entity->Link(),
$this->getRelativeLink()
), '/');
}
/**
* Return metadata from the first html block in the page, then remove the
* block on request
*
* @param DocumentationPage $md
* @param bool $remove
*/
public function getMetadataFromComments(&$md, $removeMetaData = false) {
if($md && DocumentationService::meta_comments_enabled()) {
public function populateMetaDataFromText(&$md, $removeMetaData = false) {
if($md) {
// get the text up to the first whiteline
$extPattern = "/^(.+)\n(\r)*\n/Uis";
$matches = preg_match($extPattern, $md, $block);
if($matches && $block[1]) {
$metaDataFound = false;
@ -314,19 +263,28 @@ class DocumentationPage extends ViewableData {
foreach($meta['key'] as $index => $key) {
if(isset($meta['value'][$index])) {
// check if a property exists for this key
if (property_exists(get_class(), $key)) {
$this->setMetaData($key, $meta['value'][$index]);
$this->$key = $meta['value'][$index];
$metaDataFound = true;
}
}
}
// optionally remove the metadata block (only on the page that is displayed)
// optionally remove the metadata block (only on the page that
// is displayed)
if ($metaDataFound && $removeMetaData) {
$md = preg_replace($extPattern, '', $md);
}
}
}
}
public function getVersion() {
return $this->entity->getVersion();
}
public function __toString() {
return sprintf(get_class($this) .': %s)', $this->getPath());
}
}

View File

@ -0,0 +1,14 @@
<?php
class DocumentationBuild extends BuildTask {
public function run($request) {
$manifest = new DocumentationManifest(true);
echo "<pre>";
print_r($manifest->getPages());
echo "</pre>";
die();;
}
}

View File

@ -16,11 +16,11 @@ class RebuildLuceneDocsIndex extends BuildTask {
protected $description = "
Rebuilds the indexes used for the search engine in the docsviewer.";
function run($request) {
public function run($request) {
$this->rebuildIndexes();
}
function rebuildIndexes($quiet = false) {
public function rebuildIndexes($quiet = false) {
require_once 'Zend/Search/Lucene.php';
ini_set("memory_limit", -1);
@ -59,68 +59,74 @@ class RebuildLuceneDocsIndex extends BuildTask {
}
// includes registration
$pages = DocumentationSearch::get_all_documentation_pages();
$manifest = new DocumentationManifest(true);
$pages = $manifest->getPages();
if($pages) {
$count = 0;
// iconv complains about all the markdown formatting
// turn off notices while we parse
$error = error_reporting();
error_reporting('E_ALL ^ E_NOTICE');
foreach($pages as $page) {
$count++;
if(!is_dir($page->getPath())) {
$doc = new Zend_Search_Lucene_Document();
$content = $page->getMarkdown();
if($content) {
$md = new ParsedownExtra();
$content = $md->text($content);
if(!Director::is_cli()) {
echo "<ul>";
}
foreach($pages as $url => $record) {
$count++;
$page = $manifest->getPage($url);
$entity = ($entity = $page->getEntity()) ? $entity->getTitle() : "";
$doc = new Zend_Search_Lucene_Document();
$error = error_reporting();
error_reporting(E_ALL ^ E_NOTICE);
$content = $page->getHTML();
error_reporting($error);
$doc->addField(Zend_Search_Lucene_Field::Text('content', $content));
$doc->addField($titleField = Zend_Search_Lucene_Field::Text('Title', $page->getTitle()));
$doc->addField($breadcrumbField = Zend_Search_Lucene_Field::Text('BreadcrumbTitle', $page->getBreadcrumbTitle()));
$doc->addField(Zend_Search_Lucene_Field::Keyword('Version', $page->getVersion()));
$doc->addField(Zend_Search_Lucene_Field::Keyword('Language', $page->getLang()));
$doc->addField(Zend_Search_Lucene_Field::Keyword('Entity', $entity));
$doc->addField(Zend_Search_Lucene_Field::Keyword('Link', $page->getLink(false)));
$doc->addField(Zend_Search_Lucene_Field::Keyword(
'Version', $page->getEntity()->getVersion()
));
$doc->addField(Zend_Search_Lucene_Field::Keyword(
'Language', $page->getEntity()->getLanguage()
));
$doc->addField(Zend_Search_Lucene_Field::Keyword(
'Entity', $page->getEntity()
));
$doc->addField(Zend_Search_Lucene_Field::Keyword(
'Link', $page->Link()
));
// custom boosts
$titleField->boost = 3;
$breadcrumbField->boost = 1.5;
foreach(DocumentationSearch::$boost_by_path as $pathExpr => $boost) {
if(preg_match($pathExpr, $page->getRelativePath())) $doc->boost = $boost;
$boost = Config::inst()->get('DocumentationSearch', 'boost_by_path');
foreach($boost as $pathExpr => $boost) {
if(preg_match($pathExpr, $page->getRelativePath())) {
$doc->boost = $boost;
}
}
error_reporting(E_ALL ^ E_NOTICE);
$index->addDocument($doc);
}
if(!$quiet) echo "adding ". $page->getPath() ."\n";
if(!$quiet) {
if(Director::is_cli()) echo " * adding ". $page->getPath() ."\n";
else echo "<li>adding ". $page->getPath() ."</li>\n";
}
}
error_reporting($error);
}
$index->commit();
if(!$quiet) echo "complete.";
if(!$quiet) {
echo "complete.";
}
}
/**
* @package docsviewer
* @subpackage tasks
*/
class RebuildLuceneDocusIndex_Hourly extends HourlyTask {
function process() {
$reindex = new RebuildLuceneDocusIndex();
$reindex->rebuildIndexes(true);
}
}

View File

@ -15,7 +15,7 @@
}],
"require": {
"silverstripe/framework": "~3.1",
"erusev/parsedown-extra": "0.1.0"
"erusev/parsedown-extra": "0.2.2"
},
"suggest": {
"silverstripe/staticpublisher": "Allows publishing documentation as HTML"

View File

@ -1,1021 +0,0 @@
/**
* Documentation Viewer Styles.
*
* Vertical grid = 7px
*/
/*! reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
}
/*! core */
html {
background: #eff1f2;
font: 14px/21px Helvetica, arial, sans-serif;
color: #444;
}
img {
border: none;
}
/*! helpers */
.clear {
clear: both;
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
.clearfix:after {
clear: both;
content:' ';
display: block;
font-size: 0;
line-height: 0;
visibility: hidden;
width: 0;
height: 0
}
* html .clearfix,
*:first-child+html .clearfix{
zoom: 1;
}
/*! core */
body {
font: 14px/21px Helvetica, Arial,sans-serif;
color: #444;
}
/*! typography */
a {
color: #1389ce;
text-decoration: none;
}
a:hover,
a:focus {
text-decoration: underline;
}
p {
font-size: 14px;
line-height: 21px;
margin-bottom: 14px;
}
ul { margin: 14px 0 21px 20px; }
li, dd {
font-size: 12px; line-height: 21px;
}
li {
list-style-position: inside;
}
li ul,
li ol {
margin: 0 0 7px 20px;
}
dl { margin: 7px 0 21px 0; }
dt { font-weight: bold; }
dd { margin: 7px 0 7px 20px; }
h1 {
font-size: 32px;
line-height: 35px;
margin-bottom: 14px;
color: #111;
letter-spacing: -1px;
}
h1 + p {
font-size: 18px;
line-height: 21px;
}
h2 {
font-size: 24px;
line-height: 28px;
margin: 21px 0 7px;
color: #111;
}
h3 {
font-size: 18px;
line-height: 21px;
margin: 21px 0 7px;
color: #111;
}
h4 {
font-size: 16px;
margin-bottom: 14px;
line-height: 21px;
}
h5 {
font-size: 14px;
line-height: 14px;
margin-bottom: 7px;
}
h6 {
font-size: 12px;
line-height: 14px;
margin-bottom: 7px;
}
h1 .heading-anchor-link,
h2 .heading-anchor-link,
h3 .heading-anchor-link,
h4 .heading-anchor-link,
h5 .heading-anchor-link,
h6 .heading-anchor-link {
display: none;
color: #fff;
text-decoration: none;
}
h1.hover .heading-anchor-link,
h2.hover .heading-anchor-link,
h3.hover .heading-anchor-link,
h4.hover .heading-anchor-link,
h5.hover .heading-anchor-link,
h6.hover .heading-anchor-link {
display: inline;
}
.heading-anchor-link:hover {
color: #aaa;
}
img {
max-width: 100%;
border: none;
}
pre {
margin: 7px 0 21px;
font: 11px/14px 'Bitstream Vera Sans Mono',Monaco, 'Courier New', monospace;
background: #F9FAF4;
border: 1px solid #ddd;
padding: 6px;
overflow-x: scroll;
color: #444;
}
pre code {
background: none;
}
code {
background: none repeat scroll 0 0 #F9FAF4;
font: 11px/14px Monaco, 'Bitstream Vera Sans Mono', Courier, monospace;
}
code a {
color: #444;
}
/* Quotes */
blockquote {
margin: 28px 0; padding: 14px 14px 0 38px;
background: #f8f9fa url(../../docsviewer/images/quote.gif) no-repeat 9px 18px;
overflow: hidden;
}
blockquote h1,
blockquote h2,
blockquote h3,
blockquote h4,
blockquote h5,
blockquote h6 { font-style: italic; color: #627871; }
blockquote h4 { font-size: 18px; }
blockquote p { font-style: italic; font-size: 14px; color: #667D76; }
/* Tables */
table {
border-collapse: collapse;
width: 100%;
background-color: #fafafa;
margin-bottom: 28px;
border: 1px solid #c3cdca;
}
table tr:nth-child(even) {
background: #eef4f6;
}
table caption {
text-align: left;
font-weight: bold;
font-size: 18px;
line-height: 21px;
}
table thead {
background: #fafafa;
}
table thead th {
padding: 7px 10px 6px;
font-size: 12px;
text-align: left;
border-right: 1px solid #c3cdca;
}
table tbody tr {
border-top: 1px solid #c3cdca;
}
table td {
font-size: 12px;
line-height: 21px;
padding: 7px;
border-right: 1px solid #c3cdca;
}
/* Forms */
fieldset { border: none; }
/* Container */
#container {
margin: 28px auto 21px auto; padding: 14px 20px;
background: #fff;
overflow: hidden;
-webkit-box-shadow: 0 0 15px #e0e3e4;
-moz-box-shadow: 0 0 15px #e0e3e4;
box-shadow: 0 0 15px #e0e3e4;
-moz-border-radius: 4px;
border-radius: 4px;
}
/* Header */
#header {
}
#header h1 {
margin-bottom: 0px;
}
#header h1 a {
text-decoration: none; letter-spacing: -1px;
}
/* Language Bar */
#language { position: absolute; top: 12px; left: 50%; margin-left: -480px; width: 960px; }
#language label { float: left; width: 830px; line-height: 19px; text-align: right; font-size: 11px; color: #999;}
#language select { float: right; width: 120px;}
#language input.action { float: right; margin-top: 4px;}
/* Footer */
#footer {
margin: 21px auto;
}
#footer p {
font-size: 11px; line-height: 21px; color: #798D85;
}
#footer p a { color: #798D85;}
/* module and version selection */
#top-nav { float: left; }
/* Search */
#search { float: right; }
#search label { display: none; }
/* Breadcrumbs */
.doc-breadcrumbs { }
.doc-breadcrumbs p {
font-size: 11px;
margin: 0;
color: #999;
}
.doc-breadcrumbs p a {
color: #999;
}
/* Content */
#layout { }
#content { }
/* Versions */
.documentation-nav {
clear: both;
padding: 7px 0 0;
overflow: hidden; color: #999;
font-size: 11px;
line-height: 20px;
}
.documentation-nav h2 {
font-size: 11px;
font-weight: normal;
float: left;
margin: 0 5px 0 0;
color: #999;
line-height: 20px;
}
.documentation-nav ul {
margin: 0; padding: 0; float: left;
}
.documentation-nav li {
display: inline; list-style: none;
padding: 0; margin: 0;
font-size: 11px;
}
.documentation-nav li a {
margin-left: 5px; padding: 0px;
}
.documentation-nav li a.current {
background: #0973A6; color: #fff;
font-weight: bold;
padding: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.documentation-nav li a.current:hover,
.documentation-nav li a.current:focus {
text-decoration: none;
}
/* Links to API */
#left-column a[href^="http://api."] {
padding: 2px;
font-family: Monaco, 'Bitstream Vera Sans Mono', Courier, monospace;
background: url(../../ssorgsites/images/external_link.png) no-repeat right 3px;
padding-right: 14px;
}
#content-column {
}
#sidebar-column {
}
#sidebar-column .box {
margin: 0 12px 12px 0;
}
/* Nested tree */
.box ul.tree {}
.box ul.tree li {
list-style: none;
}
.box ul.tree li.folder {
background: #d5eefd;
font-size: 12px;
color: #29688c;
margin-bottom: 9px;
border: 1px solid #d5eefd;
padding: 2px 6px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
.undocumented-modules {
clear: both;
padding-top: 10px;
font-style: italic;
}
.module { margin: 10px 0; }
/**
* TOC
*/
.sidebar-box {
margin: 0 0 11px 0;
padding: 7px 15px;
background: #f6fbfe;
border: 1px solid #DDE8ED;
-moz-border-radius: 4px;
border-radius: 4px;
}
.sidebar-box ul {
margin: 0; padding: 0;
}
.sidebar-box h4 {
font-size: 12px;
margin: 0;
}
.sidebar-box ul li { list-style: none; }
.sidebar-box ul li .current { font-weight: bold;}
.sidebar-box ul li.h1 { margin-top: 11px; font-weight: bold;}
.sidebar-box ul li.h2,
.sidebar-box ul ul { margin-top: 8px;}
.sidebar-box ul li li { font-size: 11px; margin-left: 10px;}
.sidebar-box ul li.h3,
.sidebar-box ul li li li { margin-left: 20px; font-size: 10px; margin-left: 20px;}
.sidebar-box ul li.h4,
.sidebar-box ul li li li li { margin-right: 30px; font-size: 10px; margin-left: 20px; }
/* Code styles - each site should have syntaxhighlighter installed for
code blocks */
.syntaxhighlighter { padding: 9px 0; }
#edit-link {
margin: 7px 0;
}
#edit-link p {
margin: 0;
overflow: hidden;
}
#edit-link a {
display: block;
background: #fafafa; /* Old browsers */
background: -moz-linear-gradient(top, #fafafa 1%, #e6e6e6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#fafafa), color-stop(100%,#e6e6e6)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #fafafa 1%,#e6e6e6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #fafafa 1%,#e6e6e6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #fafafa 1%,#e6e6e6 100%); /* IE10+ */
background: linear-gradient(to bottom, #fafafa 1%,#e6e6e6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafafa', endColorstr='#e6e6e6',GradientType=0 ); /* IE6-9 */
border: 1px solid #d4d4d4;
border-bottom-color: #bcbcbc;
text-shadow: 0 1px 0 #fff;
color: #333;
font-weight: bold;
margin-bottom: 5px;
text-decoration: none;
padding: 5px 10px;
-moz-border-radius: 3px;
border-radius: 3px;
float: left;
}
#edit-link a:hover,
#edit-link a:focus {
color: #fff;
text-shadow: 0 -1px 1px #3072B3;
border-color: #518CC6;
background: #599BDC;
background: -moz-linear-gradient(top, #599BDC 1%, #3072B3 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#3072B3), color-stop(100%,#3072B3)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #599BDC 1%,#3072B3 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #599BDC 1%,#3072B3 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #599BDC 1%,#3072B3 100%); /* IE10+ */
background: linear-gradient(to bottom, #599BDC 1%,#3072B3 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#599BDC', endColorstr='#3072B3',GradientType=0 ); /* IE6-9 */
}
/* contains the arrow that marks a folder */
span.is-folder {float: right;}
#table-of-contents {
margin: 0 0 10px 0;
padding: 6px 6px 6px 10px;
background: #f6fbfe;
border: 1px solid #DDE8ED;
-moz-border-radius: 4px;
border-radius: 4px;
cursor: pointer;
margin-bottom: 21px;
}
#table-of-contents h4 {
font-size: 12px;
margin: 0;
padding: 0;
}
#table-of-contents h4 span.updown {
color: #a2c1d0;
margin-left: 6px;
font-size: 10px;
}
#table-of-contents h4:hover {
opacity: 0.8;
}
#table-of-contents ul {
margin: 0;
padding: 0;
}
#table-of-contents li {
line-height: 14px;
padding: 0;
list-style: none;
margin: 0;
line-height: 20px;
}
#table-of-contents li.H2 { padding-left:20px; }
#table-of-contents li.H3 { padding-left:40px; }
#table-of-contents li.H4 { padding-left:60px; }
#table-of-contents li.H5 { padding-left:80px; }
#table-of-contents li.H6 { padding-left:100px; }
#table-of-contents li li {
padding-left: 20px;
}
#table-of-contents a,
#table-of-contents a:visited {
color: #1389ce;
text-decoration: none;
}
#table-of-contents a:hover,
#table-of-contents a:focus {
text-decoration: underline;
color: #1389ce;
}
/* some settings adapted from themes/ssorgsites/css/core.css */
#sidebar-column a {
padding: 2px 10px;
}
#sidebar-column a:hover,
#sidebar-column a:focus,
#sidebar-column a:visited {
text-decoration: none;
color: #1389ce;
}
/* Container */
#container {
margin: 18px auto;
padding: 17px 1.25%;
background: #fff;
overflow: hidden;
border: 1px solid #dfdfdf;
-webkit-box-shadow: 0 0 20px #e8ebed;
-moz-box-shadow: 0 0 20px #e8ebed;
box-shadow: 0 0 20px #e8ebed;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
position: relative;
}
.container {
max-width: 960px;
margin: auto;
}
#content-column {
width: 72.5%;
float: right;
border-left: 1px solid #efefef;
padding-left: 2.5%;
}
#content-column.full-width,
.full-width#content-column {
width: 100%;
float: none;
border: none;
}
#content-column img {
max-width: 90%;
border: 1px solid #ccc;
box-shadow: 0 0 6px #ddd;
padding: 6px;
margin: 7px 0;
border-radius: 3px;
}
#sidebar-column {
width: 22.5%;
float: left;
}
/* Header */
#header {
padding: 0 0 14px 0;
overflow: hidden;
}
#header h1 {
margin: 0;
line-height: 38px;
float: left;
}
#header h1 a {
text-decoration: none;
font-size: 22px;
color: #0973A6;
letter-spacing: -1px;
}
#header .logo {
background: #fff url(../../docsviewer/images/logo.jpg) no-repeat bottom left;
height: 36px; width: 140px;
display: inline-block;
}
/* Breadcrumbs */
#breadcrumbs {
float: left;
}
#breadcrumbs p {
font-size: 11px; margin: 0; color: #798D85;
}
/* Search */
#search-bar {
border-top: 1px solid #E6EBE9;
border-bottom: 1px solid #E6EBE9;
margin-bottom: 21px;
padding: 6px 10px;
overflow: hidden;
}
#search {
float: right;
width: 252px;
margin-top: 6px;
position: relative;
}
#search label {
float: left;
font-size: 11px;
color: #999;
margin: 3px;
}
#search input.text {
float: right; width: 170px; height: 22px;
background: url(../../docsviewer/images/search.png) top left no-repeat;
font-size: 11px;
color: #495C56;
outline: none;
padding-left: 10px;
border: none;
}
#search fieldset {
width: 230px;
float: left;
}
#search input.action {
position: absolute;
top: 0; right: 0;
width: 22px; height: 22px;
border: none;
text-indent: 99999px;
cursor: pointer;
background: url(../../docsviewer/images/search.png) top right no-repeat;
}
/* Search Results */
#search-results {}
#search-results li {
list-style: none; border-bottom: 1px solid #ddd; padding: 0 0 17px 0; margin: 0 0 17px 0;
background: none;
}
/* Sidebar menu */
#sidebar-column .sidebar-box {
margin: 0 0 18px 0;
padding: 4.75%;
background: #f6fbfe;
border: 1px solid #DDE8ED;
-moz-border-radius: 4px;
border-radius: 4px;
}
#sidebar-column .sidebar-box ul {
margin: 0; padding: 0;
}
#sidebar-column .sidebar-box li {
list-style: none;
padding: 0; margin: 0;
}
#sidebar-column .sidebar-box li a:hover,
#sidebar-column .sidebar-box li a:focus,
#sidebar-column .sidebar-box li a.current,
#sidebar-column .sidebar-box li a.section {
background: #0973A6;
color: #fff;
}
#sidebar-column .sidebar-box li .current {
font-weight: bold;
}
#sidebar-column a {
display: block;
padding: 4px 8px 2px;
border-bottom: 1px solid #efefef;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
#sidebar-column a:hover,
#sidebar-column a:focus {
text-decoration: none;
}
#sidebar-column .sidebar-box li.h1 { font-weight: bold;}
#sidebar-column .sidebar-box li.h2,
#sidebar-column .sidebar-box li.h3,
#sidebar-column .sidebar-box li.h4,
#sidebar-column .sidebar-box ul#toc ul { margin: 0 0 0 9px; }
#sidebar-column .sidebar-box ul ul { margin: 0 0 9px 18px; }
#sidebar-column .sidebar-box li li {
font-size: 11px;
border-bottom: none;
}
#sidebar-column .sidebar-box li li a,
#sidebar-column .sidebar-box ul#toc li a {
border: none;
-webkit-border-radius: none;
-moz-border-radius: none;
border-radius: none;
font-size: 11px;
padding: 2px 0;
}
#sidebar-column .sidebar-box li li a:hover,
#sidebar-column .sidebar-box li li a:focus,
#sidebar-column .sidebar-box ul#toc li a:hover,
#sidebar-column .sidebar-box ul#toc li a:focus {
background: none;
color: #667D76;
text-decoration: underline;
}
#sidebar-column .sidebar-box li li a.current,
#sidebar-column .sidebar-box li li a.section,
#sidebar-column .sidebar-box ul#toc li a.current,
#sidebar-column .sidebar-box ul#toc li a.section {
background: none;
color: #333;
}
#sidebar-column .sidebar-box li li li li { margin: 0 0 0 20px; }
#sidebar-column .sidebar-box label.left {
font-weight: bold;
}
#sidebar-column .sidebar-box form li {
list-style: none;
}
#sidebar-column .sidebar-box form li label {
cursor: pointer;
}
#sidebar-column .sidebar-box .field {
border-bottom: 1px solid #ddd;
padding-bottom: 8px;
margin-bottom: 9px;
}
#sidebar-column .sidebar-box input.text {
padding: 3px 3px 4px 3px;
}
/* Footer */
#footer {
padding: 21px 1.25%;
max-width: 960px;
}
#footer p { font-size: 11px; line-height: 18px; color: #798D85;}
#footer p a { color: #798D85; text-decoration: underline; }
#footer .cc-logo { float: right; }
/**
* Pagination Styles
*/
#page-numbers span,
#page-numbers a {
padding: 3px 5px;
}
#page-numbers span {
background-color: #ACD5CA;
}
#page-numbers a:hover {
color: #FFFFFF;
background-color: #005F99;
}
ul.pagination {
margin: 27px 0;
}
ul.pagination li {
display: inline;
background: none;
padding: 0 4px 0 0;
}
.pagination li strong, .pagination li a {
padding: 1px 4px;
}
.pagination li.active strong {
background-color: #c3dbd4;
}
.pagination li a:hover {
background-color: #0973A6;
color: #fff;
text-decoration: none;
}
/* Messages */
/**
* Example:
* <div class="info">
* <h5>This is a info message</h5>
* <p>Body text</p>
* <a href="#" class="close" title="Close notification">close</a>
* </div>
*/
#content .warningBox h5,
#content .hint h5,
#content .notice h5,
#content .warning h5,
#content .info h5 {
margin-bottom: 0px;
}
.hint a.close,
.notice a.close,
.warning a.close,
.info a.close {
background:url(../../docsviewer/images/ico_close_off.png) no-repeat scroll left top transparent;
display:block;
font-size:0;
height:11px;
position:absolute;
right:3px;
text-indent:-9999px;
top:3px;
width:11px;
}
.hint,
.note {
border: 1px dotted #a5b5b0;
padding: 13px 10px 0px 60px;
clear: both;
margin: 9px 0 18px;
background: #f9fafa url(../../docsviewer/images/lightbulb.png) no-repeat 21px 14px;
}
.typography .note h3,
.typography .hint h3 {
line-height: 27px;
}
.pageSkip {
background-color: #f9fafa;
border: 1px solid #a5b5b0;
padding: 8px 10px 8px 10px;
text-align: center;
margin: 9px 0 18px;
}
.notice {
border: 1px solid #D3C200;
padding: 13px 10px 0px 60px;
margin: 9px 0 18px;
position: relative;
background: #FFFAC6 url(../../docsviewer/images/notification.png) no-repeat 18px 11px;
}
p.notice {
padding-bottom: 18px;
}
.warning {
border: 1px solid #f8c3cd;
padding: 13px 10px 13px 60px;
clear: both;
margin: 7px 0 21px;
position: relative;
background: #fdf1f3 url(../../docsviewer/images/error_button.png) no-repeat 18px 11px;
}
.info {
border: 1px solid #6baad8;
padding: 13px 10px 0px 60px;
clear: both;
margin: 9px 0 18px;
position: relative;
background: #f7fcff url(../../docsviewer/images/info_button.png) no-repeat 18px 11px;
}
.warning p {
margin-bottom: 0;
}
/* Used on 404 page not found */
.warningBox { margin:9px 0 18px; }
#content .warningBox p {
margin: 0;
}
.warningBoxTop {
background-color: #F9FAFA;
border: 1px solid #d3d9dc;
padding: 13px 9px 13px 66px;
background: #F9FAFA url(../../docsviewer/images/warning.png) no-repeat 18px 14px;
}
#content .warningBoxTop h1 {
font-size: 27px; margin-bottom: 0; letter-spacing: 0;
}
#content .warningBoxTop ul {
margin: 9px 0 18px;
}
#content .warningBoxTop li {
margin-bottom: 4px;
}
#content .warningBoxBottom {
background-color: #0973A6;
padding: 12px 0 16px;
}
#content .warningBoxBottom a { color: #fff; }
#content .warningBoxBottom a:hover { color: #f3fbfe; }
#content .warningBoxBottom ul { margin: 0 0 0 40px; }
#content .warningBoxBottom li { background: none; margin-bottom: 0; }
/* Comments */
#comments {
clear: both;
padding-top: 18px;
}
#comments .notice {
font-size: 12px;
}
/* Icons */
.typography a[href$=".pdf"],
.typography a[href$=".PDF"],
.typography a.pdf {
padding: 2px; padding-left: 20px;
background: url(../../docsviewer/images/icons/page_white_acrobat.png) no-repeat left center; }
.typography a[href$=".doc"],
.typography a[href$=".DOC"],
.typography a.doc {
padding: 2px; padding-left: 20px;
background: url(../../docsviewer/images/icons/page_word.png) no-repeat left center; }
.typography a[href$=".xls"],
.typography a[href$=".XLS"],
.typography a.xls {
padding: 2px; padding-left: 20px;
background: url(../../docsviewer/images/icons/page_excel.png) no-repeat left center;
}
.typography a[href$=".gz"],
.typography a[href$=".GZ"],
.typography a[href$=".gzip"],
.typography a[href$=".GZIP"],
.typography a[href$=".zip"],
.typography a[href$=".ZIP"],
.typography a.archive {
padding: 2px; padding-left: 20px;
background: url(../../docsviewer/images/icons/page_white_zip.png) no-repeat left center;
}
.typography a[href$=".exe"],
.typography a[href$=".EXE"],
.typography a.application {
padding: 2px; padding-left: 20px; background: url(../../docsviewer/images/icons/application.png) no-repeat left center;
}
@media screen and (max-width: 540px) {
#content-column {
width: 100%;
padding: 0;
}
#container {
padding: 15px;
}
#sidebar-column {
width: 100%;
}
#sidebar-column .sidebar-box {
padding: 10px;
}
#footer {
padding: 20px;
}
.pinned { position: absolute; left: 0; top: 0; background: #fff; width: 35%; overflow: hidden; overflow-x: scroll; border-right: 1px solid #ccc; border-left: 1px solid #ccc; }
.pinned table { border-right: none; border-left: none; width: 100%; }
.pinned table th, .pinned table td { white-space: nowrap; }
.pinned td:last-child { border-bottom: 0; }
div.table-wrapper { position: relative; margin-bottom: 20px; overflow: hidden; border-right: 1px solid #ccc; }
div.table-wrapper div.scrollable table { margin-left: 35%; }
div.table-wrapper div.scrollable { overflow: scroll; overflow-y: hidden; }
table td, table th { position: relative; white-space: nowrap; overflow: hidden; }
table th:first-child, table td:first-child, table td:first-child, .pinned table td { display: none; }
.pinned table td:first-child,
.pinned table th:first-child { display: block; }
}

35
css/forms.css Normal file
View File

@ -0,0 +1,35 @@
fieldset {
border: none;
margin: 0;
padding: 0 0 5px 0;
}
#DocumentationAdvancedSearchForm_AdvancedSearchForm_q {
width: 100%;
font-size: 15px;
padding: 10px 10px;
}
#DocumentationAdvancedSearchForm_AdvancedSearchForm #q {
width: 55%;
padding-right: 2%;
float: left;
}
#DocumentationAdvancedSearchForm_AdvancedSearchForm #Entities {
width: 25%;
padding-right: 2%;
float: left;
}
#DocumentationAdvancedSearchForm_AdvancedSearchForm #Versions {
width: 20%;
float: right;
}
.optionset ul {
margin: 0;
}
.optionset li {
list-style: none;
}

828
css/layout.css Normal file
View File

@ -0,0 +1,828 @@
html {
background: #fff;
font: 15px/1.5 "proxima-nova", "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #586667;
padding-bottom: 40px;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
/*! container */
.wrapper {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
.introduction {
}
.introduction h1 {
margin-bottom: 20px;
}
.introduction p {
font-size: 20px;
margin-bottom: 10px;
max-width: 80%;
}
.no-box {
padding: 15px;
}
/*! main content column */
#content {
float: right;
width: 72%;
}
#content .box {
padding: 30px;
}
/*! sidebar */
#sidebar {
float: left;
padding-top:24px;
}
#sidebar .nav,
#sidebar .minor-nav {
margin: 0;
padding: 0;
list-style: none;
}
#sidebar .nav {
font-size: 16px;
}
#sidebar .nav .top {
width: 100%;
display: block;
line-height: 15px;
color: #808c8d;
padding: 15px 15px 14px;
text-transform: uppercase;
}
#sidebar .nav a {
display:block;
padding-top:8px;
padding-bottom:8px;
padding-right:12px;
}
#sidebar .nav a:hover {
text-decoration: none;
background:#eee;
color:#808c8d;
}
#sidebar .nav .section .top {
background: #f6f7f8;
border: none;
}
#sidebar li {
margin: 0;
list-style:none;
}
#sidebar li a.current {
background:rgb(3, 91, 136);
color:#fff;
}
#sidebar .nav > li {
}
#sidebar .nav .section ul,
#sidebar .nav .current ul {
background: #f6f7f8;
border-bottom: 1px solid #eee;
margin: 0;
padding:0;
}
#sidebar .nav .section ul li a,
#sidebar .nav .current ul li a {
padding-left:24px;
}
#sidebar .nav .section ul li ul li a,
#sidebar .nav .current ul li ul li a {
padding-left:42px;
font-size:14px;
}
#sidebar .nav a.current {
}
#sidebar .minor-nav a {
color: #181C17;
opacity: 0.4;
}
#sidebar .search {
}
#sidebar .search fieldset {
border-bottom: 1px solid #eee;
padding: 15px 10px 14px;
}
#sidebar .search label,
#sidebar .search .Actions {
display: none;
}
#sidebar .search input {
width: 100%;
outline: none;
border-radius: 2px;
border: 1px solid #ddd;
padding: 9px;
}
#sidebar .search input:focus {
border-color: #1389ce;
}
#layout {
padding-bottom: 20px;
position:relative;
}
#masthead {
padding: 50px 0;
background:#f6f7f8;
position:relative;
}
#masthead.has_versions {
padding-bottom: 0;
}
#masthead .wrapper {
overflow: hidden;
}
.versions {
float: right;
}
.versions p {
margin: 0 0 5px;
font-size: 12px;
}
.versions ul {
margin: 0;
padding: 0;
}
.versions li {
list-style: none;
display: block;
float: left;
margin: 0 0 0 5px;
}
.versions li a {
padding: 10px 15px;
display: block;
}
.versions .current {
background: #fff;
}
.menu-toggle {
position:absolute;
right:20px;
top:14px;
}
.menu-toggle img {
width:32px;
}
/*! language */
#language {
}
#language label {
float: left;
width: 830px;
line-height: 19px;
text-align: right;
font-size: 11px;
color: #999;
}
#language select {
float: right;
width: 120px;
}
#language input.action {
float: right;
margin-top: 4px;
}
/* Header */
#header {
padding: 0 0 14px 0;
overflow: hidden;
}
#header h1 {
margin: 0;
line-height: 38px;
float: left;
}
#header h1 a {
text-decoration: none;
font-size: 22px;
color: #0973A6;
letter-spacing: -1px;
}
#header .logo {
background: #fff url(../../docsviewer/images/logo.jpg) no-repeat bottom left;
height: 36px; width: 140px;
display: inline-block;
}
/* Search Results */
#search-results {
}
#search-results li {
list-style: none;
border-bottom: 1px solid #ddd;
padding: 0 0 19px 0;
margin: 0 0 20px 0;
background: none;
}
/* Comments */
#comments {
clear: both;
padding-top: 18px;
}
#comments .notice {
font-size: 14px;
}
/* Footer */
#footer {
margin: 20px auto;
padding: 0 30px;
}
#footer p {
color: #798D85;
}
#footer p a {
color: #798D85;
}
/*! Pagination */
#page-numbers span,
#page-numbers a {
padding: 3px 5px;
}
#page-numbers span {
}
#page-numbers a:hover {
color: #FFFFFF;
background-color: #005F99;
}
.pagination {
margin: 27px 0;
}
.pagination li {
display: inline;
background: none;
padding: 0 4px 0 0;
}
.pagination li strong, .pagination li a {
padding: 1px 4px;
}
.pagination li.active strong {
background-color: #c3dbd4;
}
.pagination li a:hover {
background-color: #0973A6;
color: #fff;
text-decoration: none;
}
/* Table of contents */
#table-of-contents {
margin: 0 0 10px 0;
padding: 6px 6px 6px 10px;
background: #f6fbfe;
border: 1px solid #DDE8ED;
-moz-border-radius: 4px;
border-radius: 4px;
cursor: pointer;
margin-bottom: 21px;
}
#table-of-contents h4 {
font-size: 14px;
margin: 0;
padding: 0;
}
#table-of-contents h4 span.updown {
color: #a2c1d0;
margin-left: 6px;
font-size: 10px;
}
#table-of-contents h4:hover {
opacity: 0.8;
}
#table-of-contents ul {
margin: 0;
padding: 0;
}
#table-of-contents li {
line-height: 14px;
padding: 0;
list-style: none;
margin: 0;
line-height: 20px;
}
#table-of-contents li.H2 { padding-left:20px; }
#table-of-contents li.H3 { padding-left:40px; }
#table-of-contents li.H4 { padding-left:60px; }
#table-of-contents li.H5 { padding-left:80px; }
#table-of-contents li.H6 { padding-left:100px; }
#table-of-contents li li {
padding-left: 20px;
}
#table-of-contents a,
#table-of-contents a:visited {
color: #1389ce;
text-decoration: none;
}
#table-of-contents a:hover,
#table-of-contents a:focus {
text-decoration: underline;
color: #1389ce;
}
/*! Messages */
/**
* Example:
* <div class="info">
* <h5>This is a info message</h5>
* <p>Body text</p>
* <a href="#" class="close" title="Close notification">close</a>
* </div>
*/
#content .warningBox h5,
#content .hint h5,
#content .notice h5,
#content .warning h5,
#content .info h5 {
margin-bottom: 0px;
}
.hint a.close,
.notice a.close,
.warning a.close,
.info a.close {
background:url(../../docsviewer/images/ico_close_off.png) no-repeat scroll left top transparent;
display:block;
font-size:0;
height:11px;
position:absolute;
right:3px;
text-indent:-9999px;
top:3px;
width:11px;
}
.hint,
.note,
.notice,
.warning,
.alert,
.info,
.pageSkip,
.warningBox {
border-radius:4px;
padding: 10px 20px;
clear: both;
position: relative;
margin: 40px 0;
}
.typography .note h3,
.typography .hint h3 {
line-height: 27px;
}
.hint p,
.note p,
.notice p,
.alert p,
.warning p,
.info p,
.warningBox p {
margin-bottom: 0;
font-weight:400;
}
.pageSkip {
background-color: #f9fafa;
border: 1px solid #a5b5b0;
text-align: center;
}
.notice,
.note,
.warningBox {
background: #F9F17A;
}
.warning,
.alert {
background: #e75242;
color:#fff;
}
.warning a,
.alert a {
color:#fff;
text-decoration:underline;
}
.warning code,
.alert code {
color:#666;
}
.info {
background: rgb(184, 229, 250);
}
.warning p {
margin-bottom: 0;
}
.warningBoxTop {
padding: 10px 10px 10px 70px;
background: url(../../docsviewer/images/warning.png) no-repeat 18px 14px;
}
.warningBoxTop h1 {
margin-bottom: 0;
}
.warningBoxTop ul {
margin: 9px 0 18px;
}
.warningBoxTop li {
margin-bottom: 0;
}
.warningBox {
margin-top: 0;
}
.warningBoxBottom {
background-color: #0973A6;
padding: 12px 0 16px;
}
.warningBoxBottom a { color: #fff; }
.warningBoxBottom a:hover { color: #f3fbfe; }
.warningBoxBottom ul { margin: 0 0 0 40px; }
.warningBoxBottom li { background: none; margin-bottom: 0; }
.doc-breadcrumbs {
}
.doc-breadcrumbs p {
margin: 0 0 5px 0;
color: #999;
font-size: 38px;
}
.doc-breadcrumbs p a {
color: rgb(3, 91, 136);
text-decoration:none;
font-weight:200;
}
.doc-breadcrumbs p a.current {
color:#696868;
}
.menu-toggle {
display:none;
}
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 40px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
}
.well h4 {
margin-top: 0;
}
.result {
}
.result h2 {
margin-bottom: 0;
}
.documentation_children {
overflow: hidden;
padding-bottom: 20px;
}
.documentation_children ul {
margin: 0;
}
.documentation_children h3 {
font-size: 18px;
border-top: 1px solid #ddd;
padding-top: 19px;
margin-top: 0;
margin-bottom: 0 0 1px 0;
}
.documentation_children li {
float: left;
width: 33%;
margin: 0 0 40px;
padding: 0 3% 0 0;
list-style: none;
}
.documentation_children li:nth-child(3n+1) {
clear: both;
}
.documentation_children p {
font-size: 15px;
opacity: 0.9;
}
.btn {
background: #eee;
padding: 10px;
border-radius: 4px;
font-weight: 400;
}
.btn:hover {
text-decoration:none;
background:#E7E6E6;
}
.next-prev {
border-top: 1px solid #eee;
margin-top: 20px;
padding-top: 19px;
}
.next-prev a {
color: #798D85;
}
.next-prev p {
margin: 0;
}
.next-prev .prev-link {
float: left;
}
.next-prev .next-link {
float: right;
}
@media (max-width: 767px) {
a.breadcrumb, .introduction p {
font-size:14px;
}
.documentation_children li {
float: none;
width: auto;
}
.next-prev .prev-link,
.next-prev .next-link {
float:none;
margin:20px 0;
}
}
@media (min-width: 768px) {
.wrapper {
width: 750px;
}
.documentation_children li {
width: 50%;
}
}
@media (min-width: 992px) {
.wrapper {
width: 970px;
}
#sidebar {
width: 25%;
}
.documentation_children li {
width:33%;
}
}
@media (min-width: 1200px) {
.wrapper {
width: 1170px;
}
}
@media (max-width: 991px) {
#sidebar {
width: 265px;
position: fixed;
background: #fff;
left: -300px;
bottom: 0;
top: 0;
z-index: 9999;
-moz-box-shadow: -3px 3px 5px 6px #ccc;
-webkit-box-shadow: -3px 3px 5px 6px #ccc;
box-shadow: -2px 1px 12px -3px #ccc;
overflow-y:auto;
overflow-x:hidden;
}
#content {
float:none;
width:auto;
}
#masthead {
padding:20px 0;
}
.doc-breadcrumbs p {
font-size:18px;
}
.introduction p {
font-size:14px;
}
.menu-toggle {
display:block;
}
}
#content pre {
display: block;
background-color: #333;
border-radius:4px;
padding:13px 16px;
margin-bottom:30px;
}
#content pre code {
color:#fff;
font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
font-weight:bold;
}
pre .nocode {
background-color: none;
color: #000;
}
pre .str {
color: #ffa0a0;
}
pre .kwd {
color: #f0e68c;
font-weight: bold;
}
pre .com {
color: #87ceeb;
}
pre .typ {
color: #98fb98;
}
pre .lit {
color: #cd5c5c;
}
pre .pun {
color: #fff;
}
pre .pln {
color: #fff;
}
pre .tag {
color: #f0e68c;
font-weight: bold;
}
pre .atn {
color: #bdb76b;
font-weight: bold;
}
pre .atv {
color: #ffa0a0;
}
pre .dec {
color: #98fb98;
}
ol.linenums {
margin-top: 0;
margin-bottom: 0;
color: #AEAEAE;
}
li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 {
list-style-type: none;
}
li.L1,li.L3,li.L5,li.L7,li.L9 {
}
@media print {
#content pre.prettyprint {
background-color: none;
display: block;
background-color: #333;
border-radius:4px;
padding:13px 16px;
margin-bottom:30px;
}
pre .str,code .str {
color: #060;
}
pre .kwd,code .kwd {
color: #006;
font-weight: bold;
}
pre .com,code .com {
color: #600;
font-style: italic;
}
pre .typ,code .typ {
color: #404;
font-weight: bold;
}
pre .lit,code .lit {
color: #044;
}
pre .pun,code .pun {
color: #440;
}
pre .pln,code .pln {
color: #000;
}
pre .tag,code .tag {
color: #006;
font-weight: bold;
}
pre .atn,code .atn {
color: #404;
}
pre .atv,code .atv {
color: #060;
}
}

425
css/normalize.css vendored Normal file
View File

@ -0,0 +1,425 @@
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit; /* 1 */
font: inherit; /* 2 */
margin: 0; /* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}

View File

@ -16,7 +16,7 @@
float: none !important;
height: auto !important;
left: auto !important;
line-height: 14px !important;
line-height: 20px !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
@ -38,13 +38,16 @@
.syntaxhighlighter {
width: 100% !important;
margin: 7px 0 21px !important;
margin: 20px 0 30px 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 11px !important;
line-height: 14px !important;
background-color: #f9faf4 !important;
border: 1px solid #ddd !important;
font-size: 13px !important;
line-height: 20px !important;
background-color: #f6f7f8 !important;
-webkit-border-radius: 3px;
border-radius: 3px;
padding: 14px 0;
border: 1px solid #e9eaed !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;

36
css/small.css Normal file
View File

@ -0,0 +1,36 @@
@media screen and (max-width: 540px) {
#content-column {
width: 100%;
padding: 0;
}
#container {
padding: 15px;
}
#sidebar-column {
width: 100%;
}
#sidebar-column .sidebar-box {
padding: 10px;
}
#footer {
padding: 20px;
}
.pinned { position: absolute; left: 0; top: 0; background: #fff; width: 35%; overflow: hidden; overflow-x: scroll; border-right: 1px solid #ccc; border-left: 1px solid #ccc; }
.pinned table { border-right: none; border-left: none; width: 100%; }
.pinned table th, .pinned table td { white-space: nowrap; }
.pinned td:last-child { border-bottom: 0; }
div.table-wrapper { position: relative; margin-bottom: 20px; overflow: hidden; border-right: 1px solid #ccc; }
div.table-wrapper div.scrollable table { margin-left: 35%; }
div.table-wrapper div.scrollable { overflow: scroll; overflow-y: hidden; }
table td, table th { position: relative; white-space: nowrap; overflow: hidden; }
table th:first-child, table td:first-child, table td:first-child, .pinned table td { display: none; }
.pinned table td:first-child,
.pinned table th:first-child { display: block; }
}

350
css/typography.css Normal file
View File

@ -0,0 +1,350 @@
/*! text selection */
::-moz-selection {
text-shadow:none;
color: #ffffff;
background: #1389CE;
}
::selection {
text-shadow: none;
color: #ffffff;
background: #1389CE;
}
/*! links */
a {
color: #1389ce;
text-decoration: none;
}
a:hover,
a:focus {
text-decoration: underline;
}
a[href$=".pdf"],
a[href$=".PDF"],
a.pdf {
padding: 2px; padding-left: 20px;
background: url(../../docsviewer/images/icons/page_white_acrobat.png) no-repeat left center; }
a[href$=".doc"],
a[href$=".DOC"],
a.doc {
padding: 2px; padding-left: 20px;
background: url(../../docsviewer/images/icons/page_word.png) no-repeat left center; }
a[href$=".xls"],
a[href$=".XLS"],
a.xls {
padding: 2px; padding-left: 20px;
background: url(../../docsviewer/images/icons/page_excel.png) no-repeat left center;
}
a[href$=".gz"],
a[href$=".GZ"],
a[href$=".gzip"],
a[href$=".GZIP"],
a[href$=".zip"],
a[href$=".ZIP"],
a.archive {
padding: 2px; padding-left: 20px;
background: url(../../docsviewer/images/icons/page_white_zip.png) no-repeat left center;
}
a[href$=".exe"],
a[href$=".EXE"],
a.application {
padding: 2px; padding-left: 20px; background: url(../../docsviewer/images/icons/application.png) no-repeat left center;
}
/*! pargraphs */
p {
font-size: 15px;
line-height: 1.5;
margin: 0 0 25px;
}
.text-wrap {
word-break: break-all;
}
/*! lists */
ul {
margin: 10px 0 20px 20px;
padding: 0;
}
li, dd, li p {
font-size: 15px;
margin: 0 0 10px 0;
line-height: 1.5;
}
li {
list-style-position: inside;
}
li ul,
li ol {
margin: 0 0 5px 20px;
}
dl {
margin: 7px 0 21px 0;
}
dt {
font-weight: bold;
}
dd {
margin: 5px 0 10px 20px;
}
.semantic {
list-style: none;
margin: 0;
padding: 0;
}
ul.third {
overflow: hidden;
}
ul.third li {
float: left;
width: 33.3%;
padding-right: 30px;
padding-bottom: 20px;
}
ul.third li:nth-child(3n+1) {
clear: both;
}
/*! headers */
h1 {
font-size: 35px;
line-height: 40px;
margin-bottom: 10px;
margin-top: 0;
letter-spacing: -1px;
color:rgb(3, 91, 136);
}
#table-of-contents + p {
font-size: 18px;
line-height: 20px;
}
h1 + p {
margin-top: 30px;
}
h2 {
font-size: 28px;
line-height: 30px;
margin: 40px 0 20px;
border-top: 1px solid #eee;
padding-top: 29px;
letter-spacing: -1px;
color: rgb(3, 91, 136);
}
h3 {
font-size: 20px;
line-height: 20px;
margin: 30px 0 10px;
color: #181c1d;
}
h4 {
font-size: 16px;
margin-bottom: 14px;
line-height: 21px;
}
h5 {
font-size: 14px;
line-height: 14px;
margin-bottom: 7px;
}
h6 {
font-size: 12px;
line-height: 15px;
margin-bottom: 10px;
}
h1 .heading-anchor-link,
h2 .heading-anchor-link,
h3 .heading-anchor-link,
h4 .heading-anchor-link,
h5 .heading-anchor-link,
h6 .heading-anchor-link {
display: none;
color: #fff;
text-decoration: none;
}
h1.hover .heading-anchor-link,
h2.hover .heading-anchor-link,
h3.hover .heading-anchor-link,
h4.hover .heading-anchor-link,
h5.hover .heading-anchor-link,
h6.hover .heading-anchor-link {
display: inline;
}
.heading-anchor-link:hover {
color: #aaa;
}
/*! images */
img {
max-width: 100%;
border: 1px solid #ccc;
padding: 6px;
margin: 10px 0;
border-radius: 3px;
}
/*! code */
pre {
margin: 20px 0 30px;
font: 13px/20px Monaco, 'Bitstream Vera Sans Mono', 'Courier New', monospace;
background-color: #f6f7f8;
border: 1px solid #e9eaed;
padding: 14px;
-webkit-border-radius: 3px;
border-radius: 3px;
overflow-x: scroll;
color: #4E5661;
}
pre code {
background: none;
font-weight: normal;
padding: 0;
}
code {
font: 13px/15px Monaco, 'Bitstream Vera Sans Mono', Courier, monospace;
background: #ecf0f1;
padding: 2px;
}
code a {
color: #4E5661;
}
/*! quotes */
blockquote {
margin: 28px 0;
padding: 14px 14px 0 38px;
background: #f8f9fa url(../../docsviewer/images/quote.gif) no-repeat 9px 18px;
overflow: hidden;
}
blockquote h1,
blockquote h2,
blockquote h3,
blockquote h4,
blockquote h5,
blockquote h6 {
font-style: italic; color: #627871;
}
blockquote h4 {
font-size: 18px;
}
blockquote p {
font-style: italic;
font-size: 14px;
color: #667D76;
}
/*! tables */
table {
border-collapse: collapse;
width: 100%;
background-color: #fafafa;
margin-bottom: 28px;
border: 1px solid #c3cdca;
}
table tr:nth-child(even) {
background: #eef4f6;
}
table caption {
text-align: left;
font-weight: bold;
font-size: 18px;
line-height: 21px;
}
table thead {
background: #fafafa;
}
table thead th {
padding: 7px 10px 6px;
font-size: 15px;
text-align: left;
border-right: 1px solid #c3cdca;
}
table tbody tr {
border-top: 1px solid #c3cdca;
}
table td {
font-size: 15px;
line-height: 21px;
padding: 7px;
border-right: 1px solid #c3cdca;
}
/*! Edit Link */
#edit-link {
margin: 30px 0;
}
#edit-link p {
margin: 0;
overflow: hidden;
}
#edit-link a {
display: block;
background: #fafafa; /* Old browsers */
background: -moz-linear-gradient(top, #fafafa 1%, #e6e6e6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#fafafa), color-stop(100%,#e6e6e6)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #fafafa 1%,#e6e6e6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #fafafa 1%,#e6e6e6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #fafafa 1%,#e6e6e6 100%); /* IE10+ */
background: linear-gradient(to bottom, #fafafa 1%,#e6e6e6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafafa', endColorstr='#e6e6e6',GradientType=0 ); /* IE6-9 */
border: 1px solid #d4d4d4;
border-bottom-color: #bcbcbc;
text-shadow: 0 1px 0 #fff;
color: #333;
font-weight: bold;
margin-bottom: 5px;
text-decoration: none;
padding: 5px 10px;
-moz-border-radius: 3px;
border-radius: 3px;
float: left;
}
#edit-link a:hover,
#edit-link a:focus {
color: #fff;
text-shadow: 0 -1px 1px #3072B3;
border-color: #518CC6;
background: #599BDC;
background: -moz-linear-gradient(top, #599BDC 1%, #3072B3 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#3072B3), color-stop(100%,#3072B3)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #599BDC 1%,#3072B3 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #599BDC 1%,#3072B3 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #599BDC 1%,#3072B3 100%); /* IE10+ */
background: linear-gradient(to bottom, #599BDC 1%,#3072B3 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#599BDC', endColorstr='#3072B3',GradientType=0 ); /* IE6-9 */
}

24
css/utilities.css Normal file
View File

@ -0,0 +1,24 @@
.clear {
clear: both;
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
.clearfix:after {
clear: both;
content:' ';
display: block;
font-size: 0;
line-height: 0;
visibility: hidden;
width: 0;
height: 0
}
* html .clearfix,
*:first-child+html .clearfix{
zoom: 1;
}

View File

@ -1,104 +0,0 @@
# Configuration Options
## Registering what to document
By default the documentation system will parse all the directories in your project
and include the documentation. If you want to only specify a few folders you can
disable it and register your paths manually
:::php
// turns off automatic parsing of filesystem
DocumentationService::set_automatic_registration(false);
// registers module 'sapphire'
try {
DocumentationService::register("sapphire", BASE_PATH ."/sapphire/docs/", 'trunk');
} catch(InvalidArgumentException $e) {
}
If you only want to disable documentation for one module you can correspondingly
call unregister()
:::php
DocumentationService::unregister($module, $version = false, $lang = false)
Unregister a module. You can specify the module, the version and the lang. If
no version is specified then all folders of that lang are removed. If you do
not specify a version or lang the whole module will be removed from the
documentation.
## Hiding files from listing
If you want to ignore (hide) certain file types from being included in the
listings. By default this is the list of hidden files
:::php
$files = array(
'.', '..', '.DS_Store', '.svn', '.git', 'assets', 'themes', '_images'
);
DocumentationService::set_ignored_files($files);
## Permalinks
Permalinks can be setup to make nicer urls or to help redirect older urls
to new structures.
DocumentationPermalinks::add(array(
'debugging' => 'sapphire/en/topics/debugging',
'templates' => 'sapphire/en/topics/templates'
));
## Custom metadata and pagesorting
Custom metadata can be added to the head of the MarkDown file like this:
pagenumber: 1
title: A custom title
Make sure to add an empty line to separate the metadata from the content of
the file.
You now need to explicitly enable the use of metadata by adding the following to
your _config.php:
```php
DocumentationService::enable_meta_comments();
```
**Note:** SilverStripe needs to read the contents of each page to retrieve the
metadata. This is expensive, so if you do not plan to use custom sorting,
do not enable this feature:
### Custom page sorting
By default pages in the lefthand menu are sorted alphabetically. Adding a
pagenumber to the metadata, like in the example above, allows for custom
pagenumbering.
**Note:** although folders appear in the menu as 'pages', you obviously can't
number them, so you need to number their index.php page instead.
Pages that have no custom pagenumber, keep their original
order, but for them not to interfere with custom sort, they also receive a
pagenumber, starting at 10.000.
You can change this starting point for default pagenumbers:
```php
DocumentationService:: start_pagenumbers_at(80);
```
### Other key-value pairs
Basically all DocumentationPage properties can be added to the metadata comment
block. Beware that the outcome isn't always predictable. Adding a title
property to the block will change the menu title, but the breadcrumbs
are at this time not yet supported.

View File

@ -1,3 +1,5 @@
title: Syntax Highlighting
# Syntax Highlighting
The custom Markdown parser can render custom prefixes for code blocks, and
@ -9,12 +11,12 @@ To include the syntax highlighter source, add the following to your `Documentati
```php
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',
@ -33,6 +35,3 @@ 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.

View File

@ -1,62 +0,0 @@
# Writing Documentation
The files have to end with the __.md__ or __.markdown__ extension. The
documentation viewer will automatically replace hyphens (-) with spaces.
my-documentation-file.md
Translates to:
My documentation file
The module also support number prefixing for specifying the order of pages in
the index pages and navigation trees.
03-foo.md
1-bar.md
4-baz.md
Will be output as the following in the listing views.
Bar
Foo
Baz
## Localization
All documentation folder should be localized. Even if you do not plan on supporting
multiple languages you need to write your documentation in a 'en' subfolder
/module/docs/en/
## Syntax
Documentation should be written in markdown with an `.md` extension attached.
To view the syntax for page formatting check out [Daring Fireball](http://daringfireball.net/projects/markdown/syntax).
To see how to use the documentation from examples, I recommend opening up this
file in your text editor and playing around. As these files are plain text, any
text editor will be able to open and write markdown files.
## Creating Hierarchy
The document viewer supports a hierarchical folder structure so you can categorize
documentation and create topics.
## Directory Listing
Each folder you create should also contain a __index.md__ file which contains
an overview of the module and related links. If no index is available, the
default behaviour is to display an ordered list of links.
## Table of Contents
The table of contents on each module page is generated based on where and what
headers you use.
## Images and Files
If you want to attach images and other assets to a page you need to bundle those
in a directory called _images at the same level as your documentation.

95
docs/en/configuration.md Executable file
View File

@ -0,0 +1,95 @@
# Configuration Options
## Registering what to document
By default the documentation system will parse all the directories in your
project and include the documentation from those modules `docs` directory.
If you want to only specify a few folders or have documentation in a non
standard location you can disable the autoload behaviour and register your
folders manually through the `Config` API.
In YAML this looks like:
`mysite/_config/docsviewer.yml`
:::yaml
---
name: docsviewer
after: docsviewer#docsviewer
---
DocumentationManifest:
automatic_registration: false
register_entities:
-
Path: "framework/docs/"
Title: "Framework Documentation"
## Permalinks
Permalinks can be setup to make nicer urls or to help redirect older urls
to new structures.
DocumentationPermalinks::add(array(
'debugging' => 'sapphire/en/topics/debugging',
'templates' => 'sapphire/en/topics/templates'
));
## Custom metadata and pagesorting
Custom metadata can be added to the head of the MarkDown file like this:
title: A custom title
Make sure to add an empty line to separate the metadata from the content of
the file.
The currently utilized metadata tags for the module are
title: 'A custom title for menus, breadcrumbs'
summary: 'A custom introduction text'
### Custom page sorting
By default pages in the left hand menu are sorted as how they appear in the file
system. You can manually set the order by prefixing filenames with numbers. For
example:
00_file-first.md
01_second-file.md
The leading numbers will be scrubbed from the URL and page link.
## Syntax
Documentation should be written in markdown with an `.md` extension attached.
To view the syntax for page formatting check out [Daring Fireball](http://daringfireball.net/projects/markdown/syntax).
To see how to use the documentation from examples, I recommend opening up this
file in your text editor and playing around. As these files are plain text, any
text editor will be able to open and write markdown files.
## Creating Hierarchy
The document viewer supports a hierarchical folder structure so you can categorize
documentation and create topics.
## Directory Listing
Each folder you create should also contain a __index.md__ file which contains
an overview of the module and related links. If no index is available, the
default behaviour is to display an ordered list of links.
## Table of Contents
The table of contents on each module page is generated based on where and what
headers you use.
## Images and Files
If you want to attach images and other assets to a page you need to bundle those
in a directory called _images at the same level as your documentation.

View File

@ -4,6 +4,11 @@ This module has been developed to read and display content from markdown and
plain text files in web browser. It provides an easy way to bundle end user
documentation within a SilverStripe installation or module.
:::bash
$> composer require
## Setup
The module includes the ability to read documentation from any folder on your
@ -79,7 +84,7 @@ By default, the documentation is available in `dev/docs`. If you want it to
live on the webroot instead of a subfolder or on another url address, add the
following configuration to your _config.php file:
DocumentationViewer::set_link_base('');
Config::inst()->update('DocumentationViewer', 'link_base', '');
Director::addRules(1, array(
'$Action' => 'DocumentationViewer',

View File

@ -108,7 +108,8 @@ Currently this is not supported, as all HTML is generated on the fly.
### Can I contribute to the parser and rendering project?
Of course, the `docsviewer` code is BSD licensed - we're looking forward to your contributions!
Of course, the `docsviewer` code is BSD licensed - we're looking forward to your
contributions!
## Related ##

24
docs/en/statichtml.md Normal file
View File

@ -0,0 +1,24 @@
title: Publishing Static Files
# HTML Publishing
If you wish to generate a truly static version of your documentation after it
has been rendered through the website, add the [Static Publisher](https://github.com/silverstripe-labs/silverstripe-staticpublisher)
module to your documentation project and set the following configuration in your
applications config.yml:
```
StaticExporter:
extensions:
- DocumentationStaticPublisherExtension
```
If you don't plan on using static publisher for anything else and you have the
cms module installed, make sure you disable the CMS from being published.
Again, in your applications config.yml file
```
StaticExporter:
disable_sitetree_export: true
```

BIN
images/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -77,7 +77,7 @@
*
* Transform a #table-of-contents div to a nested list
*/
if($("#content-column").length > 0) {
if($("#table-contents-holder").length > 0) {
var toc = '<div id="table-of-contents" class="open">' +
'<h4>Table of contents<span class="updown">&#9660;</span></h4><ul style="display: none;">';
@ -85,7 +85,7 @@
var pageURL = window.location.href.replace(/#[a-zA-Z0-9\-\_]*/g, '');
var itemCount = 0;
$('#content-column h1[id], #content-column h2[id], #content-column h3[id], #content-column h4[id]').each(function(i) {
$('#content h1[id], #content h2[id], #content h3[id], #content h4[id]').each(function(i) {
var current = $(this);
var tagName = current.prop("tagName");
if(typeof tagName == "String") tagName = tagName.toLowerCase();
@ -98,18 +98,7 @@
toc += '</ul></div>';
// Table of content location
var title = $('#content-column h1:first');
if (title.length > 0) {
title.after(toc);
} else {
var breadcrums = $('#content-column .doc-breadcrumbs');
if (breadcrums.length > 0) {
breadcrums.after(toc);
} else {
$('#content-column').prepend(toc);
}
}
$('#table-contents-holder').prepend(toc);
// Toggle the TOC
$('#table-of-contents').attr('href', 'javascript:void()').toggle(
@ -133,7 +122,7 @@
*/
var url = window.location.href;
$("#content-column h1[id], #content-column h2[id], #content-column h3[id], #content-column h4[id], #content-column h5[id], #content-column h6[id]").each(function() {
$("#content h1[id], #content h2[id], #content h3[id], #content h4[id], #content h5[id], #content h6[id]").each(function() {
var link = '<a class="heading-anchor-link" title="Link to this section" href="'+ url + '#' + $(this).attr('id') + '">&para;</a>';
$(this).append(' ' + link);
});
@ -146,6 +135,58 @@
$(this).removeClass('hover');
});
$(".search input").live("keyup", function(e) {
clearTimeout($.data(this, 'timer'));
var string = $(this).val();
var self = $(this);
if (string == '') {
$(".search .autocomplete-results").hide();
} else {
var container;
if($(this).siblings('.autocomplete-results').length == 0) {
container = $("<div class='autocomplete-results'></div");
$(this).after(container);
} else {
container = $(this).siblings('.autocomplete-results').first();
}
$(this).data('timer', setTimeout(function() {
if(string !== '') {
$.getJSON(
self.parents('form').attr('action'),
{ query: string },
function(results) {
if(results) {
var list = $("<ul></ul>");
$.each(results, function(i, elem) {
list.append(
$("<li></li>")
.append(
$("<a></a>").attr('href', elem.link).text(elem.title)
).append(
elem.path
)
);
});
container.append(list);
} else {
container.hide().removeClass('loading');
}
}
);
}
return false;
}, 100));
};
});
/** ---------------------------------------------
* LANGAUGE SELECTER
*
@ -157,7 +198,30 @@
$("#Form_LanguageForm").submit();
});
SyntaxHighlighter.defaults.toolbar = false;
SyntaxHighlighter.all();
/** ---------------------------------------------
* SYNTAX HIGHLIGHTER
*
* As the Markdown parser now uses the GFM structure (```yml) this does
* not work with SyntaxHighlighter. The below translates the GFM output
* to one SyntaxHighter can use
*/
$("pre").each(function(i, elem) {
var code = $(elem).find('code[class^=language]');
if(code.length > 0) {
var brush = code.attr('class').replace('language-', '');
$(elem).attr('class', 'prettyprint lang-' + brush);
// $(elem).html(code.html());
}
});
$('.menu-toggle').on('click', function (e) {
e.preventDefault();
var left = $('#sidebar').is('.visible') ? -270 : 0;
$('#sidebar').animate({ left: left}, 'fast', function() {
$(this).toggleClass('visible');
});
})
});
})(jQuery);

View File

@ -1,76 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*
* Modified from shBrushXML.js by SilverStripe Ltd.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = "control if end_if else elseif end_control";
function process(match, regexInfo)
{
var constructor = SyntaxHighlighter.Match,
code = match[0],
tag = new XRegExp('(&lt;|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)', 'xg').exec(code),
result = []
;
if (match.attributes != null)
{
var attributes,
regex = new XRegExp('(?<name> [\\w:\\-\\.]+)' +
'\\s*=\\s*' +
'(?<value> ".*?"|\'.*?\'|\\w+)',
'xg');
while ((attributes = regex.exec(code)) != null)
{
result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
}
}
if (tag != null)
result.push(
new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
);
return result;
}
this.regexList = [
{ regex: new XRegExp('(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
{ regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // <!-- ... -->
{ regex: /(&lt;|<)%--[\s\S]*?--%(&gt;|>)/gm, css: 'comments' }, // <%-- ... --%>
{ regex: /\$[\w]*/gm, css: 'color2' }, // $Var
{ regex: new XRegExp('(&lt;|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(&gt;|>)', 'sg'), func: process },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['ss', 'silverstripe'];
SyntaxHighlighter.brushes.SS = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,13 +0,0 @@
<div id="folder-listing">
<h2>$Title</h2>
<% if Pages %>
<ul>
<% loop Pages %>
<li><a href="$Link">$Title</a></li>
<% end_loop %>
</ul>
<% else %>
<p>No documentation pages found for $Title. If you need help writing documentation please consult the README.</p>
<% end_if %>
</div>

View File

@ -0,0 +1,12 @@
<% if Children %>
<div class="documentation_children">
<ul>
<% loop Children %>
<li>
<h3><a href="$Link">$Title</a></h3>
<% if Summary %><p>$Summary</p><% end_if %>
</li>
<% end_loop %>
</ul>
</div>
<% end_if %>

View File

@ -1,63 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<% base_tag %>
<meta charset="utf-8" />
<title>SilverStripe Documentation</title>
<% require css(docsviewer/css/DocumentationViewer.css) %>
</head>
<% include DocumentationHead %>
<body>
<div id="container" class="container">
<div id="header">
<h1><a href="$Link"><% _t('SILVERSTRIPEDOCUMENTATION', 'SilverStripe Documentation') %></a></h1>
<div id="language">
$LanguageForm
</div>
</div>
<div id="layout">
<div id="search-bar">
<div id="search">
$DocumentationSearchForm
</div>
<div id="top-nav">
<% if Entities %>
<div id="entities-nav" class="documentation-nav clearfix">
<h2>Modules:</h2>
<ul>
<% loop Entities %>
<li><a href="$Link" class="$LinkingMode">$Title</a></li>
<% end_loop %>
</ul>
<div class="clear"><!-- --></div>
<div id="masthead" <% if Versions %>class="has_versions"<% end_if %>>
<div class="wrapper">
<% if Breadcrumbs.count > 1 %>
<% include DocumentationBreadcrumbs %>
<% else_if Page.Title %>
<h1>$Page.Title</h1>
<% end_if %>
<% if Page.Introduction %>
<div class="introduction">
<p>$Page.Introduction</p>
</div>
<% end_if %>
<% if Versions %>
<div id="versions-nav" class="documentation-nav clearfix">
<h2>Versions:</h2>
<ul>
<% loop Versions %>
<li><a href="$Link" class="$LinkingMode">$Title</a></li>
<% end_loop %>
</ul>
</div>
<% end_if %>
<% include DocumentationVersions %>
</div>
</div>
<div id="content" class="typography">
<div class="wrapper">
<div id="layout" class="clearfix">
<% include DocumentationSidebar %>
<div id="content">
$Layout
</div>
</div>
</div>
<% include DocumentationFooter %>
</body>
</div>
</div>
</div>
<% if GoogleAnalyticsCode %>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '$GoogleAnalyticsCode', 'auto');
ga('send', 'pageview');
</script>
<% end_if %>
<% include DocumentationEnd %>
</html>

View File

@ -1,7 +0,0 @@
<div class="doc-breadcrumbs">
<p>
<% loop Breadcrumbs %>
<a href="$Link">$Title</a> <% if Last %><% else %>&rsaquo;<% end_if %>
<% end_loop %>
</p>
</div>

View File

@ -1,28 +0,0 @@
<% if EntityPages %>
<div id="sibling-pages" class="sidebar-box">
<h4>In this module:</h4>
<ul>
<% loop EntityPages %>
<li>
<a href="$Link" class="$LinkingMode">$Title</a>
<% if Top.SubmenuLocation = nested %>
<% if Children %>
<% include DocSubmenu %>
<% end_if %>
<% end_if %>
</li>
<% end_loop %>
</ul>
</div>
<% end_if %>
<% if SubmenuLocation = separate %>
<% loop CurrentLevelOnePage %>
<% if Children %>
<div class = "sidebar-box">
<h4>$title</h4>
<% include DocSubmenu %>
</div>
<% end_if %>
<% end_loop %>
<% end_if %>

View File

@ -1,14 +0,0 @@
<ul id="submenu">
<% loop Children %>
<li><a href="$Link" class="$LinkingMode">
$Title <% if IsFolder %><span class="is-folder">&#9658;</span><% end_if %>
</a>
<% if Children %>
<ul>
<% loop Children %>
<li><a href="$Link" class="$LinkingMode">$Title</a></li>
<% end_loop %>
</ul><% end_if %>
</li>
<% end_loop %>
</ul>

View File

@ -0,0 +1,11 @@
<div class="doc-breadcrumbs">
<p>
<a class="menu-toggle"><img src="docsviewer/images/menu.png"></a>
<% loop Breadcrumbs %>
<% if not First %>
<a class="breadcrumb <% if Last %>current<% end_if %>" href="$Link">$Title</a> <% if Last %><% else %><span>/</span><% end_if %>
<% end_if %>
<% end_loop %>
</p>
</div>

View File

@ -0,0 +1 @@
<!-- include this file in your theme with the Disqus Universal Code -->

View File

@ -0,0 +1,7 @@
<div id="edit-link">
<p>
<a target="_blank" href="$EditLink">
Edit this page <small>(requires github.com login)</small>
</a>
</p>
</div>

View File

@ -0,0 +1 @@
</body>

View File

@ -0,0 +1,9 @@
<head>
<% base_tag %>
<meta charset="utf-8" />
<title><% if Title %>$Title &#8211; <% end_if %>$DocumentationTitle</title>
</head>
<body>

View File

@ -0,0 +1,11 @@
<% if NextPage || PreviousPage %>
<div class="next-prev clearfix">
<% if PreviousPage %>
<p class="prev-link"><a class="btn" href="$PreviousPage.Link">&laquo; $PreviousPage.Title</a></p>
<% end_if %>
<% if NextPage %>
<p class="next-link"><a class="btn" href="$NextPage.Link">$NextPage.Title &raquo;</a></p>
<% end_if %>
</div>
<% end_if %>

View File

@ -0,0 +1,12 @@
<% if Children %>
<div class="documentation_children">
<ul>
<% loop Children %>
<li>
<h3><a href="$Link">$Title</a></h3>
<% if Summary %><p>$Summary</p><% end_if %>
</li>
<% end_loop %>
</ul>
</div>
<% end_if %>

View File

@ -0,0 +1,65 @@
<div id="sidebar">
<div class="box">
$DocumentationSearchForm
<ul class="nav">
<li><a href="$DocumentationBaseHref" class="top">Home</a></li>
<% loop Menu %>
<% if DefaultEntity %>
<% loop Children %>
<li class="$LinkingMode <% if Last %>last<% end_if %>">
<a href="$Link" class="top">$Title</a>
<% if LinkingMode == section || LinkingMode == current %>
<% if Children %>
<ul class="$FirstLast">
<% loop Children %>
<li><a href="$Link" class="$LinkingMode">$Title</a>
<% if LinkingMode == section || LinkingMode == current %>
<% if Children %>
<ul class="$FirstLast">
<% loop Children %>
<li><a href="$Link" class="$LinkingMode">$Title</a></li>
<% end_loop %>
</ul>
<% end_if %>
<% end_if %>
</li>
<% end_loop %>
</ul><% end_if %>
<% end_if %>
</li>
<% end_loop %>
<% else %>
<li class="$LinkingMode <% if Last %>last<% end_if %>"><a href="$Link" class="top">$Title <% if IsFolder %><span class="is-folder">&#9658;</span><% end_if %></a>
<% if LinkingMode == section || LinkingMode == current %>
<% if Children %>
<ul class="$FirstLast">
<% loop Children %>
<li><a href="$Link" class="$LinkingMode">$Title</a>
<% if LinkingMode == section || LinkingMode == current %>
<% if Children %>
<ul class="$FirstLast">
<% loop Children %>
<li><a href="$Link" class="$LinkingMode">$Title</a></li>
<% end_loop %>
</ul>
<% end_if %>
<% end_if %>
</li>
<% end_loop %>
</ul><% end_if %>
<% end_if %>
</li>
<% end_if %>
<% end_loop %>
</ul>
</div>
<div class="no-box">
<ul class="minor-nav">
<li><a href="{$Link(all)}">Documentation Index</a></li>
</ul>
</div>
</div>

View File

@ -0,0 +1 @@
<div id="table-contents-holder"></div>

View File

@ -2,11 +2,9 @@
<div class="warningBoxTop">
<% loop VersionWarning %>
<% if OutdatedRelease %>
<p>This document contains information for an <strong>outdated</strong> version <% if Top.Version %>(<strong>$Top.Version</strong>)<% end_if %> and may not be maintained any more.</p>
<p>If some of your projects still use this version, consider upgrading as soon as possible.</p>
<p>This document contains information for an <strong>outdated</strong> version <% if $Version %>(<strong>$Version</strong>)<% end_if %> and may not be maintained any more. If some of your projects still use this version, consider upgrading as soon as possible.</p>
<% else_if FutureRelease %>
<p>This document contains information about a <strong>future</strong> release <% if StableVersion %>and not the current stable version (<strong>$StableVersion</strong>)<% end_if %>.</p>
<p>Be aware that information on this page may change and API's may not be stable for production use.</p>
<p>This document contains information about a <strong>future</strong> release <% if $VersionWarning.StableVersion %>and not the current stable version (<strong>$VersionWarning.StableVersion</strong>)<% end_if %>. Be aware that information on this page may change and API's may not be stable for production use.</p>
<% end_if %>
<% end_loop %>
</div>

View File

@ -0,0 +1,11 @@
<% if Versions %>
<div class="versions">
<p>Versions:</p>
<ul>
<% loop Versions %>
<li><a href="$Link" class="$LinkingMode">$Title</a></li>
<% end_loop %>
</ul>
</div>
<% end_if %>

View File

@ -1,29 +0,0 @@
<% if VersionWarning %>
<% include DocumentationVersion_warning %>
<% end_if %>
<div id="documentation-page">
<div id="content-column">
<% if Breadcrumbs %>
<% include DocBreadcrumbs %>
<% end_if %>
$Content
<% if EditLink %>
<div id="edit-link">
<p>
<a target="_blank" href="$EditLink">
Edit this page <small>(requires github.com login)</small>
</a>
</p>
</div>
<% end_if %>
</div>
<% if Content %>
<div id="sidebar-column">
<% include DocInThisModule %>
</div>
<% end_if %>
</div>

View File

@ -0,0 +1,53 @@
<div class="box">
<% if Introduction %>
<div class="introduction">
<h1>$Title</h1>
<% if Introduction %>
<p>$Introduction</p>
<% end_if %>
</div>
<% if Breadcrumbs %>
<% include DocumentationBreadcrumbs %>
<% end_if %>
<% else %>
<% if Breadcrumbs %>
<% include DocumentationBreadcrumbs %>
<% end_if %>
<h1>$Title</h1>
<% end_if %>
<% if VersionWarning %>
<% include DocumentationVersion_warning %>
<% end_if %>
<% include DocumentationTableContents %>
<% if Children %>
<div class="documentation_children">
<ul>
<% loop Children %>
<li>
<h3><a href="$Link">$Title</a></h3>
<% if Summary %><p>$Summary</p><% end_if %>
</li>
<% end_loop %>
</ul>
</div>
<% else %>
<div class="documentation_children">
<ul>
<% loop Menu %>
<li>
<h3><a href="$Link">$Title</a></h3>
<% if Summary %><p>$Summary</p><% end_if %>
</li>
<% end_loop %>
</ul>
</div>
<% end_if %>
<% include DocumentationNextPrevious %>
</div>

View File

@ -0,0 +1,19 @@
<div id="documentation-page" class="box">
<% if VersionWarning %>
<% include DocumentationVersion_warning Version=$Entity.Version %>
<% end_if %>
<% include DocumentationTableContents %>
$Content.RAW
<% include DocumentationNextPrevious %>
<% if EditLink %>
<% include DocumentationEditLink %>
<% end_if %>
<% include DocumentationComments %>
</div>

View File

@ -0,0 +1,23 @@
<div id="documentation_index" class="box">
<h1>Documentation Index</h1>
<div id="page-numbers">
<span>
<% loop $AllPages.GroupedBy(FirstLetter) %>
<a href="#$FirstLetter">$FirstLetter</a>
<% end_loop %>
</span>
</div>
<% loop $AllPages.GroupedBy(FirstLetter) %>
<h2 id="$FirstLetter">$FirstLetter</h2>
<ul class="third semantic">
<% loop $Children %>
<li>
<a href="$Link">$Title</a>
</li>
<% end_loop %>
</ul>
<% end_loop %>
</div>

View File

@ -1,4 +1,4 @@
<div id="documentation-page" class="documentation-error-page">
<div id="documentation_error_page" class="box">
<div class="warningBox" id="pageNotFoundWarning">
<div class="warningBoxTop">
<h1>We're sorry&#8230;</h1>

View File

@ -1,30 +0,0 @@
<% if VersionWarning %>
<% include DocumentationVersion_warning %>
<% end_if %>
<div id="module-home">
<div id="content-column">
<% if Content %>
<% if Breadcrumbs %>
<% include DocBreadcrumbs %>
<% end_if %>
$Content
<% if EditLink %>
<div id="edit-link">
<p>
<a target="_blank" href="$EditLink">
Edit this page <small>(requires github.com login)</small>
</a>
</p>
</div>
<% end_if %>
<% else %>
<h2>$Title</h2>
<% end_if %>
</div>
<div id="sidebar-column">
<% include DocInThisModule %>
</div>
</div>

View File

@ -1,13 +0,0 @@
<div id="home">
<h2><% _t('DOCUMENTEDMODULES', 'Documented Modules') %></h2>
<% if Entities %>
<% loop Entities %>
<div class="module">
<h3><a href="$Link">$Title</a></h3>
</div>
<% end_loop %>
<% else %>
<p><% _t('NOMODULEDOCUMENTATION', 'No modules with documentation installed could be found.') %></p>
<% end_if %>
</div>

56
templates/Layout/DocumentationViewer_results.ss Executable file → Normal file
View File

@ -1,55 +1,3 @@
<div id="documentation-page">
<div id="content-column">
<p>Your search for <strong>&quot;$Query.XML&quot;</strong> found $TotalResults result<% if TotalResults != 1 %>s<% end_if %>.</p>
<% if Modules || Versions %>
<p>Limited search to <% if Modules %>$Modules <% if Versions %>of<% end_if %><% end_if %> <% if Versions %>versions $Versions<% end_if %>
<% end_if %>
<% if Results %>
<p>Showing page $ThisPage of $TotalPages</p>
<% loop Results %>
<h2><a href="$Link"><% if BreadcrumbTitle %>$BreadcrumbTitle<% else %>$Title<% end_if %></a></h2>
<p>$Content.LimitCharacters(200)</p>
<% end_loop %>
<% if SearchPages %>
<ul class="pagination">
<% if PrevUrl = false %><% else %>
<li class="prev"><a href="$PrevUrl">Prev</a></li>
<% end_if %>
<% loop SearchPages %>
<% if IsEllipsis %>
<li class="ellipsis">...</li>
<% else %>
<% if Current %>
<li class="active"><strong>$PageNumber</strong></li>
<% else %>
<li><a href="$Link">$PageNumber</a></li>
<% end_if %>
<% end_if %>
<% end_loop %>
<% if NextUrl = false %>
<% else %>
<li class="next"><a href="$NextUrl">Next</a></li>
<% end_if %>
</ul>
<% end_if %>
<% else %>
<p>No Results</p>
<% end_if %>
</div>
<% if AdvancedSearchEnabled %>
<div id="sidebar-column">
<div class="sidebar-box">
<h4><% _t('ADVANCEDSEARCH', 'Advanced Search') %></h4>
$AdvancedSearchForm
</div>
</div>
<% end_if %>
<div class="box">
$SearchResults
</div>

View File

@ -0,0 +1,46 @@
<% if AdvancedSearchEnabled %>
<div class="well">
$AdvancedSearchForm
</div>
<% end_if %>
<% if Results %>
<p class="intro">Your search for <strong>&quot;$SearchQuery.XML&quot;</strong> found $TotalResults result<% if TotalResults != 1 %>s<% end_if %>. Showing page $ThisPage of $TotalPages</p>
<% loop Results %>
<div class="result">
<h2><a href="$Link">$Title</a></h2>
<p><small>$BreadcrumbTitle</small></p>
<p>$Content.LimitCharacters(200)</p>
</div>
<% end_loop %>
<% if SearchPages %>
<ul class="pagination">
<% if PrevUrl = false %><% else %>
<li class="prev"><a href="$PrevUrl">Prev</a></li>
<% end_if %>
<% loop SearchPages %>
<% if IsEllipsis %>
<li class="ellipsis">...</li>
<% else %>
<% if Current %>
<li class="active"><strong>$PageNumber</strong></li>
<% else %>
<li><a href="$Link">$PageNumber</a></li>
<% end_if %>
<% end_if %>
<% end_loop %>
<% if NextUrl = false %>
<% else %>
<li class="next"><a href="$NextUrl">Next</a></li>
<% end_if %>
</ul>
<% end_if %>
<% else %>
<p>No Results</p>
<% end_if %>

View File

@ -1,34 +0,0 @@
<?php
/**
* @package docsviewer
* @subpackage tests
*/
class DocumentationEntityTest extends SapphireTest {
function testDocumentationEntityAccessing() {
$entity = new DocumentationEntity('docs', '1.0', DOCSVIEWER_PATH .'/tests/docs/', 'My Test');
$this->assertEquals($entity->getTitle(), 'My Test');
$this->assertEquals($entity->getVersions(), array('1.0'));
$this->assertEquals($entity->getLanguages(), array('en', 'de'));
$this->assertEquals($entity->getFolder(), 'docs');
$this->assertTrue($entity->hasVersion('1.0'));
$this->assertFalse($entity->hasVersion('2.0'));
$this->assertTrue($entity->hasLanguage('en'));
$this->assertFalse($entity->hasLanguage('fr'));
}
function testgetStableVersion() {
$entity = new DocumentationEntity('docs', '1.0', DOCSVIEWER_PATH. '/tests/docs/', 'My Test');
$entity->addVersion('1.1', DOCSVIEWER_PATH. '/tests/docs-v2.4/');
$entity->addVersion('0.0', DOCSVIEWER_PATH. '/tests/docs-v3.0/');
$this->assertEquals('1.1', $entity->getStableVersion(), 'Automatic version sorting');
$entity = new DocumentationEntity('docs', '1.0', DOCSVIEWER_PATH. '/tests/docs/', 'My Test');
$entity->addVersion('1.1.', DOCSVIEWER_PATH .'/tests/docs-v2.4/');
$entity->setStableVersion('1.0');
$this->assertEquals('1.0', $entity->getStableVersion(), 'Manual setting');
}
}

View File

@ -0,0 +1,70 @@
<?php
/**
* @package docsviewer
* @subpackage tests
*/
class DocumentationHelperTests extends SapphireTest {
public function testCleanName() {
$this->assertEquals("File path", DocumentationHelper::clean_page_name(
'00_file-path.md'
));
}
public function testCleanUrl() {
$this->assertEquals("some_path", DocumentationHelper::clean_page_url(
'Some Path'
));
$this->assertEquals("somefilepath", DocumentationHelper::clean_page_url(
'00_SomeFilePath.md'
));
}
public function testTrimSortNumber() {
$this->assertEquals('file', DocumentationHelper::trim_sort_number(
'0_file'
));
$this->assertEquals('2.1', DocumentationHelper::trim_sort_number(
'2.1'
));
$this->assertEquals('dev/tasks/2.1', DocumentationHelper::trim_sort_number(
'dev/tasks/2.1'
));
}
public function testTrimExtension() {
$this->assertEquals('file', DocumentationHelper::trim_extension_off(
'file.md'
));
$this->assertEquals('dev/path/file', DocumentationHelper::trim_extension_off(
'dev/path/file.md'
));
}
public function testGetExtension() {
$this->assertEquals('md', DocumentationHelper::get_extension(
'file.md'
));
$this->assertEquals('md', DocumentationHelper::get_extension(
'dev/tasks/file.md'
));
$this->assertEquals('txt', DocumentationHelper::get_extension(
'dev/tasks/file.txt'
));
$this->assertNull(DocumentationHelper::get_extension(
'doc_test/2.3'
));
$this->assertNull(DocumentationHelper::get_extension(
'dev/docs/en/doc_test/2.3/subfolder'
));
}
}

View File

@ -0,0 +1,211 @@
<?php
/**
* @package docsviewer
* @subpackage tests
*/
class DocumentationManifestTests extends SapphireTest {
private $manifest;
public function setUp() {
parent::setUp();
Config::nest();
// explicitly use dev/docs. Custom paths should be tested separately
Config::inst()->update(
'DocumentationViewer', 'link_base', 'dev/docs'
);
// disable automatic module registration so modules don't interfere.
Config::inst()->update(
'DocumentationManifest', 'automatic_registration', false
);
Config::inst()->remove('DocumentationManifest', 'register_entities');
Config::inst()->update(
'DocumentationManifest', 'register_entities', array(
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs/",
'Title' => 'Doc Test',
'Key' => 'testdocs',
'Version' => '2.3'
),
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs-v2.4/",
'Title' => 'Doc Test',
'Version' => '2.4',
'Key' => 'testdocs',
'Stable' => true
),
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs-v3.0/",
'Title' => 'Doc Test',
'Key' => 'testdocs',
'Version' => '3.0'
),
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs-manifest/",
'Title' => 'Manifest',
'Key' => 'manifest'
)
)
);
$this->manifest = new DocumentationManifest(true);
}
public function tearDown() {
parent::tearDown();
Config::unnest();
}
/**
* Check that the manifest matches what we'd expect.
*/
public function testRegenerate() {
$match = array(
'de/testdocs/2.3/',
'de/testdocs/2.3/german/',
'de/testdocs/2.3/test/',
'en/testdocs/2.3/',
'en/testdocs/2.3/sort/',
'en/testdocs/2.3/sort/basic/',
'en/testdocs/2.3/sort/intermediate/',
'en/testdocs/2.3/sort/advanced/',
'en/testdocs/2.3/sort/some-page/',
'en/testdocs/2.3/sort/another-page/',
'en/testdocs/2.3/subfolder/',
'en/testdocs/2.3/subfolder/subpage/',
'en/testdocs/2.3/subfolder/subsubfolder/',
'en/testdocs/2.3/subfolder/subsubfolder/subsubpage/',
'en/testdocs/2.3/test/',
'en/testdocs/',
'en/testdocs/test/',
'en/testdocs/3.0/',
'en/testdocs/3.0/changelog/',
'en/testdocs/3.0/tutorials/',
'en/testdocs/3.0/empty/',
'en/manifest/',
'en/manifest/guide/',
'en/manifest/guide/test/',
'en/manifest/second-guide/',
'en/manifest/second-guide/afile/'
);
$this->assertEquals($match, array_keys($this->manifest->getPages()));
}
public function testGetNextPage() {
// get next page at the end of one subfolder goes back up to the top
// most directory
$this->assertStringEndsWith('2.3/test/', $this->manifest->getNextPage(
DOCSVIEWER_PATH . '/tests/docs/en/subfolder/subsubfolder/subsubpage.md',
DOCSVIEWER_PATH . '/tests/docs/en/'
)->Link);
// after sorting, 2 is shown.
$this->assertContains('/intermediate/', $this->manifest->getNextPage(
DOCSVIEWER_PATH . '/tests/docs/en/sort/01-basic.md',
DOCSVIEWER_PATH . '/tests/docs/en/'
)->Link);
// next gets the following URL
$this->assertContains('/test/', $this->manifest->getNextPage(
DOCSVIEWER_PATH . '/tests/docs-v2.4/en/index.md',
DOCSVIEWER_PATH . '/tests/docs-v2.4/en/'
)->Link);
// last folder in a entity does not leak
$this->assertNull($this->manifest->getNextPage(
DOCSVIEWER_PATH . '/tests/docs/en/test.md',
DOCSVIEWER_PATH . '/tests/docs/en/'
));
}
public function testGetPreviousPage() {
// goes right into subfolders
$this->assertContains('subfolder/subsubfolder/subsubpage', $this->manifest->getPreviousPage(
DOCSVIEWER_PATH . '/tests/docs/en/test.md',
DOCSVIEWER_PATH . '/tests/docs/en/'
)->Link);
// does not leak between entities
$this->assertNull($this->manifest->getPreviousPage(
DOCSVIEWER_PATH . '/tests/docs/en/index.md',
DOCSVIEWER_PATH . '/tests/docs/en/'
));
// does not leak between entities
$this->assertNull($this->manifest->getPreviousPage(
DOCSVIEWER_PATH . ' /tests/docs/en/index.md',
DOCSVIEWER_PATH . '/tests/docs/en/'
));
}
public function testGetPage() {
$this->markTestIncomplete();
}
public function testGenerateBreadcrumbs() {
$this->markTestIncomplete();
}
public function testGetChildrenFor() {
$expected = array(
array('Title' => 'Test', 'LinkingMode' => 'link')
);
$this->assertDOSContains($expected, $this->manifest->getChildrenFor(
DOCSVIEWER_PATH . "/tests/docs/en/"
));
$expected = array(
array('Title' => 'ChangeLog', 'LinkingMode' => 'current'),
array('Title' => 'Tutorials'),
array('Title' => 'Empty')
);
$this->assertDOSContains($expected, $this->manifest->getChildrenFor(
DOCSVIEWER_PATH . '/tests/docs-v3.0/en/',
DOCSVIEWER_PATH . '/tests/docs-v3.0/en/ChangeLog.md'
));
}
public function testGetAllVersions() {
$expected = array(
'2.3' => '2.3',
'2.4' => '2.4',
'3.0' => '3.0',
'0.0' => 'Master'
);
$this->assertEquals($expected, $this->manifest->getAllVersions());
}
public function testGetAllEntityVersions() {
$expected = array(
'Version' => '2.3',
'Version' => '2.4',
'Version' => '3.0'
);
$entity = $this->manifest->getEntities()->find('Language', 'en');
$this->assertEquals(3, $this->manifest->getAllVersionsOfEntity($entity)->count());
$entity = $this->manifest->getEntities()->find('Language', 'de');
$this->assertEquals(1, $this->manifest->getAllVersionsOfEntity($entity)->count());
}
public function testGetStableVersion() {
$this->markTestIncomplete();
}
}

View File

@ -4,89 +4,87 @@
* @package docsviewer
* @subpackage tests
*/
class DocumentationPageTest extends SapphireTest {
function testGetLink() {
$entity = new DocumentationEntity('testmodule', null, DOCSVIEWER_PATH .'/tests/docs/');
protected $entity;
$page = new DocumentationPage();
$page->setRelativePath('test.md');
$page->setEntity($entity);
public function setUp() {
parent::setUp();
$this->entity = new DocumentationEntity('doctest');
$this->entity->setPath(DOCSVIEWER_PATH . '/tests/docs/en/');
$this->entity->setVersion('2.4');
$this->entity->setLanguage('en');
Config::nest();
// explicitly use dev/docs. Custom paths should be tested separately
Config::inst()->update(
'DocumentationViewer', 'link_base', 'dev/docs/'
);
$manifest = new DocumentationManifest(true);
}
public function tearDown() {
parent::tearDown();
Config::unnest();
}
public function testGetLink() {
$page = new DocumentationPage(
$this->entity,
'test.md',
DOCSVIEWER_PATH . '/tests/docs/en/test.md'
);
// single layer
$this->assertStringEndsWith('testmodule/en/test', $page->Link, 'The page link should have no extension and have a language');
$this->assertEquals('dev/docs/en/doctest/2.4/test/', $page->Link(),
'The page link should have no extension and have a language'
);
$folder = new DocumentationPage();
$folder->setRelativePath('sort');
$folder->setEntity($entity);
$page = new DocumentationFolder(
$this->entity,
'sort',
DOCSVIEWER_PATH . '/tests/docs/en/sort/'
);
// folder, should have a trailing slash
$this->assertStringEndsWith('testmodule/en/sort/', $folder->Link);
$this->assertEquals('dev/docs/en/doctest/2.4/sort/', $page->Link());
// second
$nested = new DocumentationPage();
$nested->setRelativePath('subfolder/subpage.md');
$nested->setEntity($entity);
$page = new DocumentationFolder(
$this->entity,
'1-basic.md',
DOCSVIEWER_PATH . '/tests/docs/en/sort/1-basic.md'
);
$this->assertStringEndsWith('testmodule/en/subfolder/subpage', $nested->Link);
// test with version.
$entity = DocumentationService::register("versionlinks", DOCSVIEWER_PATH ."/tests/docs-v2.4/", '1');
$entity->addVersion('2', DOCSVIEWER_PATH ."/tests/docs-v3.0/");
$entity->setStableVersion('2');
$page = new DocumentationPage();
$page->setRelativePath('test.md');
$page->setEntity($entity);
$page->setVersion('1');
$this->assertStringEndsWith('versionlinks/en/1/test', $page->Link);
$this->assertEquals('dev/docs/en/doctest/2.4/sort/basic/', $page->Link());
}
public function testGetBreadcrumbTitle() {
$page = new DocumentationPage(
$this->entity,
'test.md',
DOCSVIEWER_PATH . '/tests/docs/en/test.md'
);
function testGetRelativePath() {
$page = new DocumentationPage();
$page->setRelativePath('test.md');
$page->setEntity(new DocumentationEntity('mymodule', null, DOCSVIEWER_PATH . '/tests/docs/'));
$this->assertEquals("Test - Doctest", $page->getBreadcrumbTitle());
$this->assertEquals('test.md', $page->getRelativePath());
$page = new DocumentationFolder(
$this->entity,
'1-basic.md',
DOCSVIEWER_PATH . '/tests/docs/en/sort/1-basic.md'
);
$page = new DocumentationPage();
$page->setRelativePath('subfolder/subpage.md');
$page->setEntity(new DocumentationEntity('mymodule', null, DOCSVIEWER_PATH . '/tests/docs/'));
$this->assertEquals('Basic - Sort - Doctest', $page->getBreadcrumbTitle());
$this->assertEquals('subfolder/subpage.md', $page->getRelativePath());
}
$page = new DocumentationFolder(
$this->entity,
'',
DOCSVIEWER_PATH . '/tests/docs/en/sort/'
);
function testGetPath() {
$absPath = DOCSVIEWER_PATH .'/tests/docs/';
$page = new DocumentationPage();
$page->setRelativePath('test.md');
$page->setEntity(new DocumentationEntity('mymodule', null, $absPath));
$this->assertEquals($absPath . 'en/test.md', $page->getPath());
$page = new DocumentationPage();
$page->setRelativePath('subfolder/subpage.md');
$page->setEntity(new DocumentationEntity('mymodule', null, $absPath));
$this->assertEquals($absPath . 'en/subfolder/subpage.md', $page->getPath());
}
function testGetBreadcrumbTitle() {
$entity = new DocumentationEntity('testmodule', null, DOCSVIEWER_PATH . '/tests/docs/');
$page = new DocumentationPage();
$page->setRelativePath('test.md');
$page->setEntity($entity);
$this->assertEquals("Testmodule - Test", $page->getBreadcrumbTitle());
$page = new DocumentationPage();
$page->setRelativePath('subfolder/subpage.md');
$page->setEntity(new DocumentationEntity('mymodule', null, DOCSVIEWER_PATH . '/tests/docs/'));
$this->assertEquals('Mymodule - Subfolder - Subpage', $page->getBreadcrumbTitle());
}
$this->assertEquals('Sort - Doctest', $page->getBreadcrumbTitle());
}
}

View File

@ -1,10 +1,272 @@
<?php
/**
* @package docsviewer
* @subpackage tests
*/
class DocumentationParserTest extends SapphireTest {
function testGenerateHtmlId() {
protected $entity, $entityAlt, $page, $subPage, $subSubPage, $filePage, $metaDataPage, $indexPage;
public function tearDown() {
parent::tearDown();
Config::unnest();
}
public function setUp() {
parent::setUp();
Config::nest();
// explicitly use dev/docs. Custom paths should be tested separately
Config::inst()->update(
'DocumentationViewer', 'link_base', 'dev/docs/'
);
$this->entity = new DocumentationEntity('DocumentationParserTest');
$this->entity->setPath(DOCSVIEWER_PATH . '/tests/docs/en/');
$this->entity->setVersion('2.4');
$this->entity->setLanguage('en');
$this->entityAlt = new DocumentationEntity('DocumentationParserParserTest');
$this->entityAlt->setPath(DOCSVIEWER_PATH . '/tests/docs-parser/en/');
$this->entityAlt->setVersion('2.4');
$this->entityAlt->setLanguage('en');
$this->page = new DocumentationPage(
$this->entity,
'test.md',
DOCSVIEWER_PATH . '/tests/docs/en/test.md'
);
$this->subPage = new DocumentationPage(
$this->entity,
'subpage.md',
DOCSVIEWER_PATH. '/tests/docs/en/subfolder/subpage.md'
);
$this->subSubPage = new DocumentationPage(
$this->entity,
'subsubpage.md',
DOCSVIEWER_PATH. '/tests/docs/en/subfolder/subsubfolder/subsubpage.md'
);
$this->filePage = new DocumentationPage(
$this->entityAlt,
'file-download.md',
DOCSVIEWER_PATH . '/tests/docs-parser/en/file-download.md'
);
$this->metaDataPage = new DocumentationPage(
$this->entityAlt,
'MetaDataTest.md',
DOCSVIEWER_PATH . '/tests/docs-parser/en/MetaDataTest.md'
);
$this->indexPage = new DocumentationPage(
$this->entity,
'index.md',
DOCSVIEWER_PATH. '/tests/docs/en/index.md'
);
$manifest = new DocumentationManifest(true);
}
public function testRewriteCodeBlocks() {
$codePage = new DocumentationPage(
$this->entityAlt,
'CodeSnippets.md',
DOCSVIEWER_PATH . '/tests/docs-parser/en/CodeSnippets.md'
);
$result = DocumentationParser::rewrite_code_blocks(
$codePage->getMarkdown()
);
$expected = <<<HTML
#### <% control Foo %>
```
code block
<% without formatting prefix %>
```
Paragraph with a segment of <% foo %>
```
code block
that has a line in it
```
This is a yaml block
```yaml
foo: bar
baz: qux
```
This is a yaml block with tab in that new line
```yaml
foo: bar
baz: qux
```
HTML;
$this->assertEquals($expected, $result, 'Code blocks support line breaks');
$result = DocumentationParser::rewrite_code_blocks(
$this->page->getMarkdown()
);
$expected = <<<HTML
```php
code block
with multiple
lines
and tab indent
and escaped < brackets
```
Normal text after code block
HTML;
$this->assertContains($expected, $result, 'Custom code blocks with ::: prefix');
$expected = <<<HTML
```
code block
without formatting prefix
```
HTML;
$this->assertContains($expected, $result, 'Traditional markdown code blocks');
$expected = <<<HTML
```
Fenced code block
```
HTML;
$this->assertContains($expected, $result, 'Backtick code blocks');
$expected = <<<HTML
```php
Fenced box with
new lines in
between
content
```
HTML;
$this->assertContains($expected, $result, 'Backtick with newlines');
}
public function testRelativeLinks() {
// index.md
$result = DocumentationParser::rewrite_relative_links(
$this->indexPage->getMarkdown(),
$this->indexPage
);
$this->assertContains(
'[link: subfolder index](dev/docs/en/documentationparsertest/2.4/subfolder/)',
$result
);
// test.md
$result = DocumentationParser::rewrite_relative_links(
$this->page->getMarkdown(),
$this->page
);
$this->assertContains(
'[link: subfolder index](dev/docs/en/documentationparsertest/2.4/subfolder/)',
$result
);
$this->assertContains(
'[link: subfolder page](dev/docs/en/documentationparsertest/2.4/subfolder/subpage/)',
$result
);
$this->assertContains(
'[link: http](http://silverstripe.org)',
$result
);
$this->assertContains(
'[link: api](api:DataObject)',
$result
);
$result = DocumentationParser::rewrite_relative_links(
$this->subPage->getMarkdown(),
$this->subPage
);
# @todo this should redirect to /subpage/
$this->assertContains(
'[link: relative](dev/docs/en/documentationparsertest/2.4/subfolder/subpage.md/)',
$result
);
$this->assertContains(
'[link: absolute index](dev/docs/en/documentationparsertest/2.4/)',
$result
);
# @todo this should redirect to /
$this->assertContains(
'[link: absolute index with name](dev/docs/en/documentationparsertest/2.4/index/)',
$result
);
$this->assertContains(
'[link: relative index](dev/docs/en/documentationparsertest/2.4/)',
$result
);
$this->assertContains(
'[link: relative parent page](dev/docs/en/documentationparsertest/2.4/test/)',
$result
);
$this->assertContains(
'[link: absolute parent page](dev/docs/en/documentationparsertest/2.4/test/)',
$result
);
$result = DocumentationParser::rewrite_relative_links(
$this->subSubPage->getMarkdown(),
$this->subSubPage
);
$this->assertContains(
'[link: absolute index](dev/docs/en/documentationparsertest/2.4/)',
$result
);
$this->assertContains(
'[link: relative index](dev/docs/en/documentationparsertest/2.4/subfolder/)',
$result
);
$this->assertContains(
'[link: relative parent page](dev/docs/en/documentationparsertest/2.4/subfolder/subpage/)',
$result
);
$this->assertContains(
'[link: relative grandparent page](dev/docs/en/documentationparsertest/2.4/test/)',
$result
);
$this->assertContains(
'[link: absolute page](dev/docs/en/documentationparsertest/2.4/test/)',
$result
);
}
public function testGenerateHtmlId() {
$this->assertEquals('title-one', DocumentationParser::generate_html_id('title one'));
$this->assertEquals('title-one', DocumentationParser::generate_html_id('Title one'));
$this->assertEquals('title-and-one', DocumentationParser::generate_html_id('Title &amp; One'));
@ -13,107 +275,62 @@ class DocumentationParserTest extends SapphireTest {
$this->assertEquals('title-one', DocumentationParser::generate_html_id('Title--one'));
}
function testRewriteCodeBlocks() {
$page = new DocumentationPage();
$page->setRelativePath('test.md');
$page->setEntity(new DocumentationEntity('mymodule', '2.4', DOCSVIEWER_PATH . '/tests/docs/'));
$page->setLang('en');
$page->setVersion('2.4');
$result = DocumentationParser::rewrite_code_blocks($page->getMarkdown());
$expected = <<<HTML
<pre class="brush: php">
code block
with multiple
lines
and tab indent
and escaped &lt; brackets</pre>
Normal text after code block
HTML;
$this->assertContains($expected, $result, 'Custom code blocks with ::: prefix');
public function testImageRewrites() {
$expected = <<<HTML
<pre>
code block
without formatting prefix</pre>
HTML;
$this->assertContains($expected, $result, 'Traditional markdown code blocks');
$expected = <<<HTML
<pre class="brush: ">
Fenced code block
</pre>
HTML;
$this->assertContains($expected, $result, 'Backtick code blocks');
$expected = <<<HTML
<pre class="brush: php">
Fenced box with
new lines in
between
content
</pre>
HTML;
$this->assertContains($expected, $result, 'Backtick with newlines');
}
function testImageRewrites() {
// Page on toplevel
$page = new DocumentationPage();
$page->setRelativePath('subfolder/subpage.md');
$page->setEntity(new DocumentationEntity('mymodule', '2.4', DOCSVIEWER_PATH . '/tests/docs/'));
$page->setLang('en');
$page->setVersion('2.4');
$result = DocumentationParser::rewrite_image_links($page->getMarkdown(), $page, 'mycontroller/cms/2.4/en/');
$this->assertContains(
'[relative image link](' . Director::absoluteBaseURL() .'/'. DOCSVIEWER_DIR . '/tests/docs/en/subfolder/_images/image.png)',
$result
$result = DocumentationParser::rewrite_image_links(
$this->subPage->getMarkdown(),
$this->subPage
);
$expected = Controller::join_links(
Director::absoluteBaseURL(), DOCSVIEWER_DIR, '/tests/docs/en/subfolder/_images/image.png'
);
$this->assertContains(
'[parent image link](' . Director::absoluteBaseURL() . '/'. DOCSVIEWER_DIR. '/tests/docs/en/_images/image.png)',
sprintf('[relative image link](%s)', $expected),
$result
);
// $this->assertContains(
// '[absolute image link](' . Director::absoluteBaseURL() . '/'. DOCSVIEWER_DIR. '/tests/docs/en/_images/image.png)',
// $result
// );
}
function testApiLinks() {
// Page on toplevel
$page = new DocumentationPage();
$page->setRelativePath('test.md');
$page->setEntity(new DocumentationEntity('mymodule', '2.4', DOCSVIEWER_PATH .'/tests/docs/'));
$page->setLang('en');
$page->setVersion('2.4');
$result = DocumentationParser::rewrite_api_links($page->getMarkdown(), $page, 'mycontroller/cms/2.4/en/');
$this->assertContains(
'[link: api](http://api.silverstripe.org/search/lookup/?q=DataObject&version=2.4&module=mymodule)',
sprintf('[parent image link](%s)', Controller::join_links(
Director::absoluteBaseURL(), DOCSVIEWER_DIR, '/tests/docs/en/_images/image.png'
)),
$result
);
$this->assertContains( '[DataObject::$has_one](http://api.silverstripe.org/search/lookup/?q=DataObject::$has_one&version=2.4&module=mymodule)',
$expected = Controller::join_links(
Director::absoluteBaseURL(), DOCSVIEWER_DIR, '/tests/docs/en/_images/image.png'
);
$this->assertContains(
sprintf('[absolute image link](%s)', $expected),
$result
);
}
function testHeadlineAnchors() {
$page = new DocumentationPage();
$page->setRelativePath('test.md');
$page->setEntity(new DocumentationEntity('mymodule', '2.4', DOCSVIEWER_PATH . '/tests/docs/'));
$page->setLang('en');
$page->setVersion('2.4');
public function testApiLinks() {
$result = DocumentationParser::rewrite_api_links(
$this->page->getMarkdown(),
$this->page
);
$result = DocumentationParser::rewrite_heading_anchors($page->getMarkdown(), $page);
$this->assertContains(
'[link: api](http://api.silverstripe.org/search/lookup/?q=DataObject&amp;version=2.4&amp;module=documentationparsertest)',
$result
);
$this->assertContains(
'[DataObject::$has_one](http://api.silverstripe.org/search/lookup/?q=DataObject::$has_one&amp;version=2.4&amp;module=documentationparsertest)',
$result
);
}
public function testHeadlineAnchors() {
$result = DocumentationParser::rewrite_heading_anchors(
$this->page->getMarkdown(),
$this->page
);
/*
# Heading one {#Heading-one}
@ -143,117 +360,16 @@ HTML;
}
function testRelativeLinks() {
// Page on toplevel
$page = new DocumentationPage();
$page->setRelativePath('test.md');
$page->setEntity(new DocumentationEntity('mymodule', '2.4', DOCSVIEWER_PATH . '/tests/docs/'));
$result = DocumentationParser::rewrite_relative_links($page->getMarkdown(), $page, 'mycontroller/cms/2.4/en/');
public function testRetrieveMetaData() {
DocumentationParser::retrieve_meta_data($this->metaDataPage);
$this->assertContains(
'[link: subfolder index](mycontroller/cms/2.4/en/subfolder/)',
$result
);
$this->assertContains(
'[link: subfolder page](mycontroller/cms/2.4/en/subfolder/subpage)',
$result
);
$this->assertContains(
'[link: http](http://silverstripe.org)',
$result
);
$this->assertContains(
'[link: api](api:DataObject)',
$result
);
$this->assertContains(
'[link: relative](mycontroller/cms/2.4/a-relative-file.md)',
$result
);
// Page in subfolder
$page = new DocumentationPage();
$page->setRelativePath('subfolder/subpage.md');
$page->setEntity(new DocumentationEntity('mymodule', '2.4', DOCSVIEWER_PATH . '/tests/docs/'));
$result = DocumentationParser::rewrite_relative_links($page->getMarkdown(), $page, 'mycontroller/cms/2.4/en/');
$this->assertContains(
'[link: relative](mycontroller/cms/2.4/en/subfolder/subpage.md)',
$result
);
$this->assertContains(
'[link: absolute index](mycontroller/cms/2.4/en/)',
$result
);
$this->assertContains(
'[link: absolute index with name](mycontroller/cms/2.4/en/index)',
$result
);
$this->assertContains(
'[link: relative index](mycontroller/cms/2.4/en/)',
$result
);
$this->assertContains(
'[link: relative parent page](mycontroller/cms/2.4/en/test)',
$result
);
$this->assertContains(
'[link: absolute parent page](mycontroller/cms/2.4/en/test)',
$result
);
// Page in nested subfolder
$page = new DocumentationPage();
$page->setRelativePath('subfolder/subsubfolder/subsubpage.md');
$page->setEntity(new DocumentationEntity('mymodule', '2.4', DOCSVIEWER_PATH . '/tests/docs/'));
$result = DocumentationParser::rewrite_relative_links($page->getMarkdown(), $page, 'mycontroller/cms/2.4/en/');
$this->assertContains(
'[link: absolute index](mycontroller/cms/2.4/en/)',
$result
);
$this->assertContains(
'[link: relative index](mycontroller/cms/2.4/en/subfolder/)',
$result
);
$this->assertContains(
'[link: relative parent page](mycontroller/cms/2.4/en/subfolder/subpage)',
$result
);
$this->assertContains(
'[link: relative grandparent page](mycontroller/cms/2.4/en/test)',
$result
);
$this->assertContains(
'[link: absolute page](mycontroller/cms/2.4/en/test)',
$result
);
$this->assertEquals('Dr. Foo Bar.', $this->metaDataPage->author);
$this->assertEquals("Foo Bar's Test page.", $this->metaDataPage->getTitle());
}
function testRetrieveMetaData() {
$page = new DocumentationPage();
$page->setRelativePath('MetaDataTest.md');
$page->setEntity(new DocumentationEntity('parser', '2.4', DOCSVIEWER_PATH . '/tests/docs-parser/'));
DocumentationParser::retrieve_meta_data($page);
$this->assertEquals('Dr. Foo Bar.', $page->Author);
$this->assertEquals("Foo Bar's Test page.", $page->getTitle());
$this->assertEquals("Foo Bar's Test page.", $page->Title);
}
function testRewritingRelativeLinksToFiles() {
$folder = DOCSVIEWER_PATH . '/tests/docs-parser/';
$page = new DocumentationPage();
$page->setRelativePath('file-download.md');
$page->setEntity(new DocumentationEntity('parser', '2.4', $folder));
$parsed = DocumentationParser::parse($page, $folder);
public function testRewritingRelativeLinksToFiles() {
$parsed = DocumentationParser::parse($this->filePage);
$this->assertContains(
DOCSVIEWER_DIR .'/tests/docs-parser/en/_images/external_link.png',

View File

@ -1,26 +1,35 @@
<?php
/**
* @package docsviewer
* @subpackage tests
*/
class DocumentationPermalinksTest extends FunctionalTest {
function testSavingAndAccessingMapping() {
public function testSavingAndAccessingMapping() {
// basic test
DocumentationPermalinks::add(array(
'foo' => 'current/en/sapphire/subfolder/foo',
'bar' => 'current/en/cms/bar'
'foo' => 'en/framework/subfolder/foo',
'bar' => 'en/cms/bar'
));
$this->assertEquals('current/en/sapphire/subfolder/foo', DocumentationPermalinks::map('foo'));
$this->assertEquals('current/en/cms/bar', DocumentationPermalinks::map('bar'));
$this->assertEquals('en/framework/subfolder/foo',
DocumentationPermalinks::map('foo')
);
$this->assertEquals('en/cms/bar',
DocumentationPermalinks::map('bar')
);
}
/**
* Tests to make sure short codes get translated to full paths
* Tests to make sure short codes get translated to full paths.
*
*/
function testRedirectingMapping() {
// testing the viewer class but clearer here
public function testRedirectingMapping() {
DocumentationPermalinks::add(array(
'foo' => 'current/en/sapphire/subfolder/foo',
'bar' => 'current/en/cms/bar'
'foo' => 'en/framework/subfolder/foo',
'bar' => 'en/cms/bar'
));
$this->autoFollowRedirection = false;
@ -29,6 +38,6 @@ class DocumentationPermalinksTest extends FunctionalTest {
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'foo'), DataModel::inst());
$this->assertEquals('301', $response->getStatusCode());
$this->assertContains('current/en/sapphire/subfolder/foo', $response->getHeader('Location'));
$this->assertContains('en/framework/subfolder/foo', $response->getHeader('Location'));
}
}

View File

@ -7,40 +7,56 @@
class DocumentationSearchTest extends FunctionalTest {
function setUp() {
public function setUp() {
parent::setUp();
if(!DocumentationSearch::enabled()) return;
Config::nest();
DocumentationService::set_automatic_registration(false);
DocumentationService::register('docs-search', DOCSVIEWER_PATH . '/tests/docs-search/');
// explicitly use dev/docs. Custom paths should be tested separately
Config::inst()->update(
'DocumentationViewer', 'link_base', 'dev/docs'
);
// disable automatic module registration so modules don't interfere.
Config::inst()->update(
'DocumentationManifest', 'automatic_registration', false
);
Config::inst()->remove('DocumentationManifest', 'register_entities');
Config::inst()->update('DocumentationSearch', 'enabled', true);
Config::inst()->update(
'DocumentationManifest', 'register_entities', array(
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs-search/",
'Title' => 'Docs Search Test', )
)
);
$this->manifest = new DocumentationManifest(true);
}
function testGetAllPages() {
if(!DocumentationSearch::enabled()) return;
public function tearDown() {
parent::tearDown();
DocumentationService::set_automatic_registration(false);
DocumentationService::register('docs-search', DOCSVIEWER_PATH . '/tests/docs-search/');
$search = DocumentationSearch::get_all_documentation_pages();
$this->assertEquals(7, $search->Count(), '5 pages. 5 pages in entire folder');
Config::unnest();
}
function testOpenSearchControllerAccessible() {
public function testOpenSearchControllerAccessible() {
$c = new DocumentationOpenSearchController();
$response = $c->handleRequest(new SS_HTTPRequest('GET', ''), DataModel::inst());
$this->assertEquals(404, $response->getStatusCode());
// test accessing it when the search isn't active
DocumentationSearch::enable(false);
Config::inst()->update('DocumentationSearch', 'enabled', false);
$response = $c->handleRequest(new SS_HTTPRequest('GET', 'description/'), DataModel::inst());
$this->assertEquals(404, $response->getStatusCode());
// test we get a response to the description. The meta data test will check
// that the individual fields are valid but we should check urls are there
DocumentationSearch::enable(true);
// test we get a response to the description. The meta data test will
// check that the individual fields are valid but we should check urls
// are there
Config::inst()->update('DocumentationSearch', 'enabled', true);
$response = $c->handleRequest(new SS_HTTPRequest('GET', 'description'), DataModel::inst());
$this->assertEquals(200, $response->getStatusCode());

View File

@ -1,112 +0,0 @@
<?php
/**
* @package docsviewer
* @subpackage tests
*/
class DocumentationServiceTest extends SapphireTest {
function testGetPagesFromFolder() {
$entity = DocumentationService::register('testdocs', DOCSVIEWER_PATH . '/tests/docs/');
$pages = DocumentationService::get_pages_from_folder($entity);
$this->assertContains('index.md', $pages->column('Filename'), 'The tests/docs/en folder should contain a index file');
$this->assertContains('subfolder/', $pages->column('Filename'), 'The tests/docs/en folder should contain a subfolder called subfolder');
$this->assertContains('test.md', $pages->column('Filename'), 'The tests/docs/en folder should contain a test file');
$this->assertNotContains('_images', $pages->column('Filename'), 'It should not include hidden files');
$this->assertNotContains('.svn', $pages->column('Filename'), 'It should not include hidden files');
// test the order of pages
$pages = DocumentationService::get_pages_from_folder($entity, 'sort');
$this->assertEquals(
array('Basic', 'Intermediate', 'Advanced', 'Some page', 'Another page'),
$pages->column('Title')
);
}
function testGetPagesFromFolderRecursive() {
$entity = DocumentationService::register('testdocsrecursive', DOCSVIEWER_PATH . '/tests/docs-recursive/');
$pages = DocumentationService::get_pages_from_folder($entity, null, true);
// check to see all the pages are found, we don't care about order
$this->assertEquals($pages->Count(), 9);
$pages = $pages->column('Title');
foreach(array('Index', 'SubFolder TestFile', 'SubSubFolder TestFile', 'TestFile') as $expected) {
$this->assertContains($expected, $pages);
}
}
function testFindPath() {
DocumentationService::register("DocumentationViewerTests", DOCSVIEWER_PATH . "/tests/docs/");
// file
$path = DocumentationService::find_page('DocumentationViewerTests', array('test'));
$this->assertEquals(DOCSVIEWER_PATH . "/tests/docs/en/test.md", $path);
// the home page. The path finder should go to the index.md file in the default language
$path = DocumentationService::find_page('DocumentationViewerTests', array(''));
$this->assertEquals(DOCSVIEWER_PATH . "/tests/docs/en/index.md", $path);
// second level
$path = DocumentationService::find_page('DocumentationViewerTests', array('subfolder', 'subpage'));
$this->assertEquals(DOCSVIEWER_PATH . "/tests/docs/en/subfolder/subpage.md", $path);
// subsubfolder has no index file. It should fail instead the viewer should pick up on this
// and display the listing of the folder
$path = DocumentationService::find_page('DocumentationViewerTests', array('subfolder', 'subsubfolder'));
$this->assertFalse($path);
// third level
$path = DocumentationService::find_page('DocumentationViewerTests', array('subfolder', 'subsubfolder', 'subsubpage'));
$this->assertEquals(DOCSVIEWER_PATH . "/tests/docs/en/subfolder/subsubfolder/subsubpage.md", $path);
// with trailing slash
$path = DocumentationService::find_page('DocumentationViewerTests', array('subfolder', 'subsubfolder', 'subsubpage'));
$this->assertEquals(DOCSVIEWER_PATH . "/tests/docs/en/subfolder/subsubfolder/subsubpage.md", $path);
}
function testCleanPageNames() {
$names = array(
'documentation-Page',
'documentation_Page',
'documentation.md',
'documentation.pdf',
'documentation.file.txt',
'.hidden'
);
$should = array(
'Documentation Page',
'Documentation Page',
'Documentation',
'Documentation.pdf', // do not remove an extension we don't know
'Documentation.file', // .txt we do know about
'.hidden' // don't display something without a title
);
foreach($names as $key => $value) {
$this->assertEquals(DocumentationService::clean_page_name($value), $should[$key]);
}
}
function testIsValidExtension() {
$this->assertTrue(DocumentationService::is_valid_extension('md'));
$this->assertTrue(DocumentationService::is_valid_extension('markdown'));
$this->assertTrue(DocumentationService::is_valid_extension('MD'));
$this->assertTrue(DocumentationService::is_valid_extension('MARKDOWN'));
$this->assertFalse(DocumentationService::is_valid_extension('.markd'));
$this->assertFalse(DocumentationService::is_valid_extension('.exe'));
// require an extension as internally we check for extension, not using
// one could cause issues.
$this->assertFalse(DocumentationService::is_valid_extension(''));
}
}

View File

@ -12,255 +12,206 @@ class DocumentationViewerTest extends FunctionalTest {
protected $autoFollowRedirection = false;
function setUpOnce() {
parent::setUpOnce();
protected $manifest;
$this->origEnabled = DocumentationService::automatic_registration_enabled();
DocumentationService::set_automatic_registration(false);
$this->origModules = DocumentationService::get_registered_entities();
$this->origLinkBase = DocumentationViewer::get_link_base();
DocumentationViewer::set_link_base('dev/docs/');
foreach($this->origModules as $module) {
DocumentationService::unregister($module->getFolder());
public function setUp() {
parent::setUp();
Config::nest();
// explicitly use dev/docs. Custom paths should be tested separately
Config::inst()->update(
'DocumentationViewer', 'link_base', 'dev/docs/'
);
// disable automatic module registration so modules don't interfere.
Config::inst()->update(
'DocumentationManifest', 'automatic_registration', false
);
Config::inst()->remove('DocumentationManifest', 'register_entities');
Config::inst()->update(
'DocumentationManifest', 'register_entities', array(
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs/",
'Title' => 'Doc Test',
'Version' => '2.3'
),
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs-v2.4/",
'Title' => 'Doc Test',
'Version' => '2.4',
'Stable' => true
),
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs-v3.0/",
'Title' => 'Doc Test',
'Version' => '3.0'
),
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs-parser/",
'Title' => 'DocumentationViewerAltModule1'
),
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs-search/",
'Title' => 'DocumentationViewerAltModule2'
)
)
);
Config::inst()->update('SSViewer', 'theme_enabled', false);
$this->manifest = new DocumentationManifest(true);
}
// We set 3.0 as current, and test most assertions against 2.4 - to avoid 'current' rewriting issues
DocumentationService::register("DocumentationViewerTests", DOCSVIEWER_PATH . "/tests/docs/", '2.3');
DocumentationService::register("DocumentationViewerTests", DOCSVIEWER_PATH . "/tests/docs-v2.4/", '2.4', 'Doc Test', true);
DocumentationService::register("DocumentationViewerTests", DOCSVIEWER_PATH . "/tests/docs-v3.0/", '3.0', 'Doc Test');
public function tearDown() {
parent::tearDown();
DocumentationService::register("DocumentationViewerAltModule1", DOCSVIEWER_PATH . "/tests/docs-parser/", '1.0');
DocumentationService::register("DocumentationViewerAltModule2", DOCSVIEWER_PATH . "/tests/docs-search/", '1.0');
}
function tearDownOnce() {
parent::tearDownOnce();
DocumentationService::unregister("DocumentationViewerTests");
DocumentationService::set_automatic_registration($this->origEnabled);
DocumentationViewer::set_link_base($this->origLinkBase);
Config::unnest();
}
/**
* This tests that all the locations will exist if we access it via the urls.
*/
function testLocationsExists() {
$response = $this->get('dev/docs/DocumentationViewerTests/en/2.3/subfolder');
public function testLocationsExists() {
$this->autoFollowRedirection = false;
$response = $this->get('dev/docs/en/doc_test/2.3/subfolder/');
$this->assertEquals($response->getStatusCode(), 200, 'Existing base folder');
$response = $this->get('dev/docs/DocumentationViewerTests/en/2.4');
$response = $this->get('dev/docs/en/doc_test/2.3/subfolder/subsubfolder/');
$this->assertEquals($response->getStatusCode(), 200, 'Existing base folder');
$response = $this->get('dev/docs/DocumentationViewerTests/en/2.4/');
$response = $this->get('dev/docs/en/doc_test/2.3/subfolder/subsubfolder/subsubpage/');
$this->assertEquals($response->getStatusCode(), 200, 'Existing base folder');
$response = $this->get('dev/docs/DocumentationViewerTests/en/2.3/nonexistant-subfolder');
$response = $this->get('dev/docs/en/');
$this->assertEquals($response->getStatusCode(), 200, 'Lists the home index');
$response = $this->get('dev/docs/');
$this->assertEquals($response->getStatusCode(), 302, 'Go to english view');
$response = $this->get('dev/docs/en/doc_test/3.0/empty.md');
$this->assertEquals(301, $response->getStatusCode(), 'Direct markdown links also work. They should redirect to /empty/');
// 2.4 is the stable release. Not in the URL
$response = $this->get('dev/docs/en/doc_test/');
$this->assertEquals($response->getStatusCode(), 200, 'Existing base folder');
$this->assertContains('english test', $response->getBody(), 'Toplevel content page');
// accessing 2.4 is redirects to the version without the version number.
$response = $this->get('dev/docs/en/doc_test/2.4/');
$this->assertEquals($response->getStatusCode(), 404, 'Existing base folder redirects to without version');
$response = $this->get('dev/docs/en/doc_test/3.0/');
$this->assertEquals($response->getStatusCode(), 200, 'Existing base folder');
$response = $this->get('dev/docs/en/doc_test/2.3/nonexistant-subfolder');
$this->assertEquals($response->getStatusCode(), 404, 'Nonexistant subfolder');
$response = $this->get('dev/docs/DocumentationViewerTests/en/2.3/nonexistant-file.txt');
$response = $this->get('dev/docs/en/doc_test/2.3/nonexistant-file.txt');
$this->assertEquals($response->getStatusCode(), 301, 'Nonexistant file');
$response = $this->get('dev/docs/en/doc_test/2.3/nonexistant-file/');
$this->assertEquals($response->getStatusCode(), 404, 'Nonexistant file');
$response = $this->get('dev/docs/DocumentationViewerTests/en/2.3/test');
$response = $this->get('dev/docs/en/doc_test/2.3/test');
$this->assertEquals($response->getStatusCode(), 200, 'Existing file');
$response = $this->get('dev/docs/DocumentationViewerTests/en/3.0/empty?foo');
$response = $this->get('dev/docs/en/doc_test/3.0/empty?foo');
$this->assertEquals(200, $response->getStatusCode(), 'Existing page');
$response = $this->get('dev/docs/en/doc_test/3.0/empty/');
$this->assertEquals($response->getStatusCode(), 200, 'Existing page');
$response = $this->get('dev/docs/DocumentationViewerTests/en/3.0/empty.md');
$this->assertEquals($response->getStatusCode(), 200, 'Existing page');
$response = $this->get('dev/docs/DocumentationViewerTests/en/3.0/empty/');
$this->assertEquals($response->getStatusCode(), 200, 'Existing page');
$response = $this->get('dev/docs/DocumentationViewerTests/en/3.0/test');
$response = $this->get('dev/docs/en/doc_test/3.0/test');
$this->assertEquals($response->getStatusCode(), 404, 'Missing page');
$response = $this->get('dev/docs/DocumentationViewerTests/en/3.0/test.md');
$response = $this->get('dev/docs/en/doc_test/3.0/test.md');
$this->assertEquals($response->getStatusCode(), 301, 'Missing page');
$response = $this->get('dev/docs/en/doc_test/3.0/test/');
$this->assertEquals($response->getStatusCode(), 404, 'Missing page');
$response = $this->get('dev/docs/DocumentationViewerTests/en/3.0/test/');
$this->assertEquals($response->getStatusCode(), 404, 'Missing page');
$response = $this->get('dev/docs/en');
$this->assertEquals($response->getStatusCode(), 404, 'Must include a module');
$response = $this->get('dev/docs/DocumentationViewerTests/dk/');;
$response = $this->get('dev/docs/dk/');
$this->assertEquals($response->getStatusCode(), 404, 'Access a language that doesn\'t exist');
}
function testRouting() {
$response = $this->get('dev/docs/DocumentationViewerTests/en/2.4');
public function testGetMenu() {
$v = new DocumentationViewer();
// check with children
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'en/doc_test/2.3/'), DataModel::inst());
$expected = array(
'dev/docs/en/doc_test/2.3/sort/' => 'Sort',
'dev/docs/en/doc_test/2.3/subfolder/' => 'Subfolder',
'dev/docs/en/doc_test/2.3/test/' => 'Test'
);
$actual = $v->getMenu()->first()->Children->map('Link', 'Title');
$this->assertEquals($expected, $actual);
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'en/doc_test/'), DataModel::inst());
$this->assertEquals('current', $v->getMenu()->first()->LinkingMode);
// 2.4 stable release has 1 child page (not including index)
$this->assertEquals(1, $v->getMenu()->first()->Children->count());
// menu should contain all the english entities
$expected = array(
'dev/docs/en/doc_test/' => 'Doc Test',
'dev/docs/en/documentationvieweraltmodule1/' => 'DocumentationViewerAltModule1',
'dev/docs/en/documentationvieweraltmodule2/' => 'DocumentationViewerAltModule2'
);
$this->assertEquals($expected, $v->getMenu()->map('Link', 'Title'));
}
public function testGetLanguage() {
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'en/doc_test/2.3/'), DataModel::inst());
$this->assertEquals('en', $v->getLanguage());
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'en/doc_test/2.3/subfolder/subsubfolder/subsubpage/'), DataModel::inst());
$this->assertEquals('en', $v->getLanguage());
}
public function testAccessingAll() {
$response = $this->get('dev/docs/en/all/');
// should response with the documentation index
$this->assertEquals(200, $response->getStatusCode());
$this->assertContains('english test', $response->getBody(), 'Toplevel content page');
$response = $this->get('dev/docs/DocumentationViewerTests/en/2.4/');
$items = $this->cssParser()->getBySelector('#documentation_index');
$this->assertNotEmpty($items);
// should also have a DE version of the page
$response = $this->get('dev/docs/de/all/');
// should response with the documentation index
$this->assertEquals(200, $response->getStatusCode());
$this->assertContains('english test', $response->getBody(), 'Toplevel content page');
$response = $this->get('dev/docs/DocumentationViewerTests/en/2.4/index.md');
$this->assertEquals(200, $response->getStatusCode());
$this->assertContains('english test', $response->getBody(), 'Toplevel content page');
}
$items = $this->cssParser()->getBySelector('#documentation_index');
$this->assertNotEmpty($items);
function testGetModulePagesShort() {
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.3/subfolder/'), DataModel::inst());
$pages = $v->getEntityPages();
// accessing a language that doesn't exist should throw a 404
$response = $this->get('dev/docs/fu/all/');
$this->assertEquals(404, $response->getStatusCode());
$this->assertEquals(
$pages->column('Title'),
array('Sort', 'Subfolder', 'Test')
);
}
// accessing all without a language should fail
$response = $this->get('dev/docs/all/');
$this->assertEquals(404, $response->getStatusCode());
function testGetEntityPages() {
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.3/subfolder/'), DataModel::inst());
$pages = $v->getEntityPages();
$this->assertEquals(
array('sort/', 'subfolder/', 'test.md'),
$pages->column('Filename')
);
$this->assertEquals(
array('link','current', 'link'),
$pages->column('LinkingMode')
);
foreach($pages as $page) {
$page->setVersion('2.3');
}
$links = $pages->column('Link');
$this->assertStringEndsWith('DocumentationViewerTests/en/2.3/sort/', $links[0]);
$this->assertStringEndsWith('DocumentationViewerTests/en/2.3/subfolder/', $links[1]);
$this->assertStringEndsWith('DocumentationViewerTests/en/2.3/test', $links[2]);
$pageSort = $pages->find('Title', 'Sort');
$this->assertFalse($pageSort->Children);
$pageSubfolder = $pages->find('Title', 'Subfolder');
$this->assertEquals(
array('subfolder/subpage.md', 'subfolder/subsubfolder/'),
$pageSubfolder->Children->column('Filename')
);
$children = $pageSubfolder->Children;
foreach($children as $child) {
$child->setVersion('2.3');
}
$child2Links = $children->column('Link');
$this->assertStringEndsWith('DocumentationViewerTests/en/2.3/subfolder/subpage', $child2Links[0]);
$this->assertStringEndsWith('DocumentationViewerTests/en/2.3/subfolder/subsubfolder/', $child2Links[1]);
}
function testUrlParsing() {
// Module index
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.3/test'), DataModel::inst());
$this->assertEquals('2.3', $v->getVersion());
$this->assertEquals('en', $v->getLang());
$this->assertEquals('DocumentationViewerTests', $v->getEntity()->getTitle());
$this->assertEquals(array('test'), $v->Remaining);
// Module index without version and language. Should pick up the defaults
$v2 = new DocumentationViewer();
$response = $v2->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/test'), DataModel::inst());
$this->assertEquals('2.4', $v2->getVersion());
$this->assertEquals('en', $v2->getLang());
$this->assertEquals('DocumentationViewerTests', $v2->getEntity()->getTitle());
$this->assertEquals(array('test'), $v2->Remaining);
// Overall index
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', ''), DataModel::inst());
$this->assertEquals('', $v->getVersion());
$this->assertEquals('en', $v->getLang());
$this->assertEquals('', $v->module);
$this->assertEquals(array(), $v->Remaining);
}
function testBreadcrumbs() {
// Module index
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.4'), DataModel::inst());
$crumbs = $v->getBreadcrumbs();
$this->assertEquals(1, $crumbs->Count());
// Subfolder index
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.4/subfolder/'), DataModel::inst());
$crumbs = $v->getBreadcrumbs();
$this->assertEquals(2, $crumbs->Count());
// Subfolder page
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.4/subfolder/subpage'), DataModel::inst());
$crumbs = $v->getBreadcrumbs();
$this->assertEquals(3, $crumbs->Count());
}
function testGetVersion() {
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.4'), DataModel::inst());
$this->assertEquals('2.4', $v->getVersion());
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/1'), DataModel::inst());
$this->assertEquals('1', $v->getVersion());
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/3.0'), DataModel::inst());
$this->assertEquals('3.0', $v->getVersion());
}
function testGetEntities() {
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.4'), DataModel::inst());
$pages = $v->getEntities();
$this->assertEquals(3, $pages->Count(), 'Registered 3 entities');
// check to see the links don't have version or pages in them
foreach($pages as $page) {
$expected = Controller::join_links('docs', $page->Title, 'en');
$this->assertStringEndsWith($expected, $page->Link);
}
}
function testVersionWarning() {
$v = new DocumentationViewer();
// the current version is set to 2.4, no notice should be shown on that page
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.4'), DataModel::inst());
$this->assertFalse($v->VersionWarning());
// 2.3 is an older release, hitting that should return us an outdated flag
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.3'), DataModel::inst());
$warn = $v->VersionWarning();
$this->assertTrue($warn->OutdatedRelease);
$this->assertNull($warn->FutureRelease);
// 3.0 is a future release
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/3.0'), DataModel::inst());
$warn = $v->VersionWarning();
$this->assertNull($warn->OutdatedRelease);
$this->assertTrue($warn->FutureRelease);
}
/**
* Test that the pages comes back sorted by filename
*/
function testGetEntityPagesSortedByFilename() {
$v = new DocumentationViewer();
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/3.0/'), DataModel::inst());
$pages = $v->getEntityPages();
$links = $pages->column('Link');
$this->assertStringEndsWith('DocumentationViewerTests/en/3.0/ChangeLog', $links[0]);
$this->assertStringEndsWith('DocumentationViewerTests/en/3.0/Tutorials', $links[1]);
$this->assertStringEndsWith('DocumentationViewerTests/en/3.0/empty', $links[2]);
}
}

View File

@ -0,0 +1,86 @@
<?php
/**
* @package docsviewer
* @subpackage tests
*/
class DocumentationViewerVersionWarningTest extends SapphireTest {
protected $autoFollowRedirection = false;
private $manifest;
public function setUp() {
parent::setUp();
Config::nest();
// explicitly use dev/docs. Custom paths should be tested separately
Config::inst()->update(
'DocumentationViewer', 'link_base', 'dev/docs'
);
// disable automatic module registration so modules don't interfere.
Config::inst()->update(
'DocumentationManifest', 'automatic_registration', false
);
Config::inst()->remove('DocumentationManifest', 'register_entities');
Config::inst()->update(
'DocumentationManifest', 'register_entities', array(
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs/",
'Title' => 'Doc Test',
'Key' => 'testdocs',
'Version' => '2.3'
),
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs-v2.4/",
'Title' => 'Doc Test',
'Version' => '2.4',
'Key' => 'testdocs',
'Stable' => true
),
array(
'Path' => DOCSVIEWER_PATH . "/tests/docs-v3.0/",
'Title' => 'Doc Test',
'Key' => 'testdocs',
'Version' => '3.0'
)
)
);
$this->manifest = new DocumentationManifest(true);
}
public function tearDown() {
parent::tearDown();
Config::unnest();
}
public function testVersionWarning() {
$v = new DocumentationViewer();
// the current version is set to 2.4, no notice should be shown on that page
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'en/testdocs/'), DataModel::inst());
$this->assertFalse($v->VersionWarning());
// 2.3 is an older release, hitting that should return us an outdated flag
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'en/testdocs/2.3/'), DataModel::inst());
$warn = $v->VersionWarning();
$this->assertTrue($warn->OutdatedRelease);
$this->assertNull($warn->FutureRelease);
// 3.0 is a future release
$response = $v->handleRequest(new SS_HTTPRequest('GET', 'en/testdocs/3.0/'), DataModel::inst());
$warn = $v->VersionWarning();
$this->assertNull($warn->OutdatedRelease);
$this->assertTrue($warn->FutureRelease);
}
}

View File

@ -0,0 +1 @@
# File

View File

@ -0,0 +1 @@
# test

View File

@ -0,0 +1 @@
# Test

View File

@ -0,0 +1 @@
# File

View File

@ -0,0 +1 @@
# index

View File

@ -4,3 +4,21 @@
<% without formatting prefix %>
Paragraph with a segment of <% foo %>
code block
that has a line in it
This is a yaml block
:::yaml
foo: bar
baz: qux
This is a yaml block with tab in that new line
:::yaml
foo: bar
baz: qux

View File

@ -0,0 +1 @@
# Failure

2
tests/docs/de/german.md Normal file
View File

@ -0,0 +1,2 @@
# German

View File

@ -3,3 +3,6 @@
index
1.0
[link: subfolder index](subfolder)

View File

@ -9,7 +9,6 @@ test
[link: with anchor](/test#anchor)
[link: http](http://silverstripe.org)
[link: api](api:DataObject)
[link: relative](../a-relative-file.md)
[api:DataObject::$has_one]
@ -20,11 +19,14 @@ test
and tab indent
and escaped < brackets
Normal text after code block
code block
without formatting prefix
How about fences?
```
Fenced code block
```

View File

@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@ -1,20 +0,0 @@
Copyright (c) 2003, 2004 Jim Weirich
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,22 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Hello SyntaxHighlighter</title>
<script type="text/javascript" src="scripts/shCore.js"></script>
<script type="text/javascript" src="scripts/shBrushJScript.js"></script>
<link type="text/css" rel="stylesheet" href="styles/shCoreDefault.css"/>
<script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body style="background: white; font-family: Helvetica">
<h1>Hello SyntaxHighlighter</h1>
<pre class="brush: js;">
function helloSyntaxHighlighter()
{
return "hi!";
}
</pre>
</html>

View File

@ -1,17 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d<c.9;d++)i[c[d]]=a}2 o(c){1 a=r.H("J"),d=3;a.K=c;a.M="L/t";a.G="t";a.u=a.v=2(){6(!d&&(!8.7||8.7=="F"||8.7=="z")){d=q;e[c]=q;a:{4(1 p y e)6(e[p]==3)B a;j&&5.C(k)}a.u=a.v=x;a.D.O(a)}};r.N.R(a)}1 f=Q,l=h.P(),i={},e={},j=3,k=x,b;5.T=2(c){k=c;j=q};4(b=0;b<f.9;b++){1 m=f[b].w?f[b]:f[b].S(/\\s+/),g=m.w();n(m,g)}4(b=0;b<l.9;b++)6(g=i[l[b].E.A]){e[g]=3;o(g)}}})();',56,56,'|var|function|false|for|SyntaxHighlighter|if|readyState|this|length|||||||||||||||||true|document||javascript|onload|onreadystatechange|pop|null|in|complete|brush|break|highlight|parentNode|params|loaded|language|createElement|autoloader|script|src|text|type|body|removeChild|findElements|arguments|appendChild|split|all'.split('|'),0,{}))

View File

@ -1,59 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Created by Peter Atoria @ http://iAtoria.com
var inits = 'class interface function package';
var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' +
'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' +
'extends false final finally flash_proxy for get if implements import in include Infinity ' +
'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' +
'Null Number Object object_proxy override parseFloat parseInt private protected public ' +
'return set static String super switch this throw true try typeof uint undefined unescape ' +
'use void while with'
;
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
{ regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp('var', 'gm'), css: 'variable' }, // variable
{ regex: new RegExp('trace', 'gm'), css: 'color1' } // trace
];
this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['actionscript3', 'as3'];
SyntaxHighlighter.brushes.AS3 = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,75 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// AppleScript brush by David Chambers
// http://davidchambersdesign.com/
var keywords = 'after before beginning continue copy each end every from return get global in local named of set some that the then times to where whose with without';
var ordinals = 'first second third fourth fifth sixth seventh eighth ninth tenth last front back middle';
var specials = 'activate add alias AppleScript ask attachment boolean class constant delete duplicate empty exists false id integer list make message modal modified new no paragraph pi properties quit real record remove rest result reveal reverse run running save string true word yes';
this.regexList = [
{ regex: /(--|#).*$/gm,
css: 'comments' },
{ regex: /\(\*(?:[\s\S]*?\(\*[\s\S]*?\*\))*[\s\S]*?\*\)/gm, // support nested comments
css: 'comments' },
{ regex: /"[\s\S]*?"/gm,
css: 'string' },
{ regex: /(?:,|:|¬|'s\b|\(|\)|\{|\}|«|\b\w*»)/g,
css: 'color1' },
{ regex: /(-)?(\d)+(\.(\d)?)?(E\+(\d)+)?/g, // numbers
css: 'color1' },
{ regex: /(?:&(amp;|gt;|lt;)?|=|<7C> |>|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^)/g,
css: 'color2' },
{ regex: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g,
css: 'keyword' },
{ regex: /\b\d+(st|nd|rd|th)\b/g, // ordinals
css: 'keyword' },
{ regex: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g,
css: 'color3' },
{ regex: /\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g,
css: 'color3' },
{ regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
{ regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' }
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['applescript'];
SyntaxHighlighter.brushes.AppleScript = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,59 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne ge le';
var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
'vi watch wc whereis which who whoami Wget xargs yes'
;
this.regexList = [
{ regex: /^#!.*$/gm, css: 'preprocessor bold' },
{ regex: /\/[\w-\/]+/gm, css: 'plain' },
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
];
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['bash', 'shell'];
SyntaxHighlighter.brushes.Bash = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,65 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'abstract as base bool break byte case catch char checked class const ' +
'continue decimal default delegate do double else enum event explicit ' +
'extern false finally fixed float for foreach get goto if implicit in int ' +
'interface internal is lock long namespace new null object operator out ' +
'override params private protected public readonly ref return sbyte sealed set ' +
'short sizeof stackalloc static string struct switch this throw true try ' +
'typeof uint ulong unchecked unsafe ushort using virtual void while';
function fixComments(match, regexInfo)
{
var css = (match[0].indexOf("///") == 0)
? 'color1'
: 'comments'
;
return [new SyntaxHighlighter.Match(match[0], match.index, css)];
}
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword
{ regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial'
{ regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield'
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['c#', 'c-sharp', 'csharp'];
SyntaxHighlighter.brushes.CSharp = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,100 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Jen
// http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus
var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' +
'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' +
'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' +
'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' +
'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' +
'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' +
'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' +
'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' +
'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' +
'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' +
'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' +
'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' +
'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' +
'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' +
'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' +
'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' +
'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' +
'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' +
'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' +
'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' +
'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' +
'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' +
'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' +
'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' +
'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' +
'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' +
'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' +
'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' +
'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' +
'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' +
'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' +
'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' +
'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' +
'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' +
'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' +
'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' +
'XmlValidate Year YesNoFormat';
var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' +
'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' +
'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' +
'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' +
'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' +
'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' +
'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' +
'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' +
'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' +
'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' +
'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' +
'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' +
'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' +
'cfwindow cfxml cfzip cfzipparam';
var operators = 'all and any between cross in join like not null or outer some';
this.regexList = [
{ regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments
{ regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions
{ regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
];
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['coldfusion','cf'];
SyntaxHighlighter.brushes.ColdFusion = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,97 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Copyright 2006 Shin, YoungJin
var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' +
'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' +
'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' +
'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' +
'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' +
'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' +
'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' +
'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' +
'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' +
'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' +
'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' +
'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' +
'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' +
'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' +
'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' +
'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' +
'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' +
'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' +
'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' +
'__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' +
'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' +
'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' +
'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' +
'va_list wchar_t wctrans_t wctype_t wint_t signed';
var keywords = 'break case catch class const __finally __exception __try ' +
'const_cast continue private public protected __declspec ' +
'default delete deprecated dllexport dllimport do dynamic_cast ' +
'else enum explicit extern if for friend goto inline ' +
'mutable naked namespace new noinline noreturn nothrow ' +
'register reinterpret_cast return selectany ' +
'sizeof static static_cast struct switch template this ' +
'thread throw true false try typedef typeid typename union ' +
'using uuid virtual void volatile whcar_t while';
var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' +
'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' +
'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' +
'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' +
'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' +
'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' +
'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' +
'fwrite getc getchar gets perror printf putc putchar puts remove ' +
'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' +
'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' +
'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' +
'mbtowc qsort rand realloc srand strtod strtol strtoul system ' +
'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' +
'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' +
'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' +
'clock ctime difftime gmtime localtime mktime strftime time';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /^ *#.*/gm, css: 'preprocessor' },
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' },
{ regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' }
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['cpp', 'c'];
SyntaxHighlighter.brushes.Cpp = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,91 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
function getKeywordsCSS(str)
{
return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
};
function getValuesCSS(str)
{
return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
};
var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' +
'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+
'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';
var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
{ regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes
{ regex: /!important/g, css: 'color3' }, // !important
{ regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
{ regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
];
this.forHtmlScript({
left: /(&lt;|<)\s*style.*?(&gt;|>)/gi,
right: /(&lt;|<)\/\s*style\s*(&gt;|>)/gi
});
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['css'];
SyntaxHighlighter.brushes.CSS = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,55 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' +
'case char class comp const constructor currency destructor div do double ' +
'downto else end except exports extended false file finalization finally ' +
'for function goto if implementation in inherited int64 initialization ' +
'integer interface is label library longint longword mod nil not object ' +
'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' +
'pint64 pointer private procedure program property pshortstring pstring ' +
'pvariant pwidechar pwidestring protected public published raise real real48 ' +
'record repeat set shl shortint shortstring shr single smallint string then ' +
'threadvar to true try type unit until uses val var varirnt while widechar ' +
'widestring with word write writeln xor';
this.regexList = [
{ regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *)
{ regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { }
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags
{ regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345
{ regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['delphi', 'pascal', 'pas'];
SyntaxHighlighter.brushes.Delphi = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,41 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
this.regexList = [
{ regex: /^\+\+\+.*$/gm, css: 'color2' },
{ regex: /^\-\-\-.*$/gm, css: 'color2' },
{ regex: /^\s.*$/gm, css: 'color1' },
{ regex: /^@@.*@@$/gm, css: 'variable' },
{ regex: /^\+[^\+]{1}.*$/gm, css: 'string' },
{ regex: /^\-[^\-]{1}.*$/gm, css: 'comments' }
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['diff', 'patch'];
SyntaxHighlighter.brushes.Diff = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,52 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Jean-Lou Dupont
// http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html
// According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+
'case catch cond div end fun if let not of or orelse '+
'query receive rem try when xor'+
// additional
' module export import define';
this.regexList = [
{ regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' },
{ regex: new RegExp("\\%.+", 'gm'), css: 'comments' },
{ regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' },
{ regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' },
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['erl', 'erlang'];
SyntaxHighlighter.brushes.Erland = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,67 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Andres Almiray
// http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter
var keywords = 'as assert break case catch class continue def default do else extends finally ' +
'if in implements import instanceof interface new package property return switch ' +
'throw throws try while public protected private static';
var types = 'void boolean byte char short int long float double';
var constants = 'null';
var methods = 'allProperties count get size '+
'collect each eachProperty eachPropertyName eachWithIndex find findAll ' +
'findIndexOf grep inject max min reverseEach sort ' +
'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' +
'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' +
'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' +
'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' +
'transformChar transformLine withOutputStream withPrintWriter withStream ' +
'withStreams withWriter withWriterAppend write writeLine '+
'dump inspect invokeMethod print println step times upto use waitForOrKill '+
'getText';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /""".*"""/g, css: 'string' }, // GStrings
{ regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword
{ regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type
{ regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants
{ regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['groovy'];
SyntaxHighlighter.brushes.Groovy = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,52 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'break case catch continue ' +
'default delete do else false ' +
'for function if in instanceof ' +
'new null return super switch ' +
'this throw true try typeof var while with'
;
var r = SyntaxHighlighter.regexLib;
this.regexList = [
{ regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
{ regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
{ regex: r.singleLineCComments, css: 'comments' }, // one line comments
{ regex: r.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
];
this.forHtmlScript(r.scriptScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['js', 'jscript', 'javascript'];
SyntaxHighlighter.brushes.JScript = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,57 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'abstract assert boolean break byte case catch char class const ' +
'continue default do double else enum extends ' +
'false final finally float for goto if implements import ' +
'instanceof int interface long native new null ' +
'package private protected public return ' +
'short static strictfp super switch synchronized this throw throws true ' +
'transient try void volatile while';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
{ regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
{ regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
{ regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
];
this.forHtmlScript({
left : /(&lt;|<)%[@!=]?/g,
right : /%(&gt;|>)/g
});
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['java'];
SyntaxHighlighter.brushes.Java = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,58 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Patrick Webster
// http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html
var datatypes = 'Boolean Byte Character Double Duration '
+ 'Float Integer Long Number Short String Void'
;
var keywords = 'abstract after and as assert at before bind bound break catch class '
+ 'continue def delete else exclusive extends false finally first for from '
+ 'function if import in indexof init insert instanceof into inverse last '
+ 'lazy mixin mod nativearray new not null on or override package postinit '
+ 'protected public public-init public-read replace return reverse sizeof '
+ 'step super then this throw true try tween typeof var where while with '
+ 'attribute let private readonly static trigger'
;
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' },
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['jfx', 'javafx'];
SyntaxHighlighter.brushes.JavaFX = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,72 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by David Simmons-Duffin and Marty Kube
var funcs =
'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' +
'chroot close closedir connect cos crypt defined delete each endgrent ' +
'endhostent endnetent endprotoent endpwent endservent eof exec exists ' +
'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' +
'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' +
'getnetbyname getnetent getpeername getpgrp getppid getpriority ' +
'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' +
'getservbyname getservbyport getservent getsockname getsockopt glob ' +
'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' +
'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' +
'oct open opendir ord pack pipe pop pos print printf prototype push ' +
'quotemeta rand read readdir readline readlink readpipe recv rename ' +
'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' +
'semget semop send setgrent sethostent setnetent setpgrp setpriority ' +
'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' +
'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' +
'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' +
'system syswrite tell telldir time times tr truncate uc ucfirst umask ' +
'undef unlink unpack unshift utime values vec wait waitpid warn write';
var keywords =
'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
'for foreach goto if import last local my next no our package redo ref ' +
'require return sub tie tied unless untie until use wantarray while';
this.regexList = [
{ regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' },
{ regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' },
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
];
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['perl', 'Perl', 'pl'];
SyntaxHighlighter.brushes.Perl = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,88 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var funcs = 'abs acos acosh addcslashes addslashes ' +
'array_change_key_case array_chunk array_combine array_count_values array_diff '+
'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
'array_push array_rand array_reduce array_reverse array_search array_shift '+
'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+
'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
'strtoupper strtr strval substr substr_compare';
var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' +
'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' +
'function include include_once global goto if implements interface instanceof namespace new ' +
'old_function or private protected public return require require_once static switch ' +
'throw try use var while xor ';
var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\$\w+/g, css: 'variable' }, // variables
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions
{ regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword
];
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['php'];
SyntaxHighlighter.brushes.Php = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,33 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['text', 'plain'];
SyntaxHighlighter.brushes.Plain = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,74 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributes by B.v.Zanten, Getronics
// http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro
var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' +
'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' +
'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' +
'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' +
'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' +
'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' +
'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' +
'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' +
'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' +
'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' +
'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' +
'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' +
'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' +
'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' +
'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' +
'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' +
'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' +
'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' +
'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' +
'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' +
'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning';
var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' +
'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' +
'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' +
'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' +
'spps spsv sv tee cat cd cp h history kill lp ls ' +
'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' +
'erase rd ren type % \\?';
this.regexList = [
{ regex: /#.*$/gm, css: 'comments' }, // one line comments
{ regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1
{ regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' },
{ regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' }
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['powershell', 'ps'];
SyntaxHighlighter.brushes.PowerShell = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,64 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Gheorghe Milas and Ahmad Sherif
var keywords = 'and assert break class continue def del elif else ' +
'except exec finally for from global if import in is ' +
'lambda not or pass print raise return try yield while';
var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' +
'chr classmethod cmp coerce compile complex delattr dict dir ' +
'divmod enumerate eval execfile file filter float format frozenset ' +
'getattr globals hasattr hash help hex id input int intern ' +
'isinstance issubclass iter len list locals long map max min next ' +
'object oct open ord pow print property range raw_input reduce ' +
'reload repr reversed round set setattr slice sorted staticmethod ' +
'str sum super tuple type type unichr unicode vars xrange zip';
var special = 'None True False self cls class_';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' },
{ regex: /^\s*@\w+/gm, css: 'decorator' },
{ regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' },
{ regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' },
{ regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' },
{ regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' },
{ regex: /\b\d+\.?\w*/g, css: 'value' },
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
{ regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' }
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['py', 'python'];
SyntaxHighlighter.brushes.Python = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,55 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Erik Peterson.
var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' +
'END end ensure false for if in module new next nil not or raise redo rescue retry return ' +
'self super then throw true undef unless until when while yield';
var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' +
'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' +
'ThreadGroup Thread Time TrueClass';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants
{ regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols
{ regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['ruby', 'rails', 'ror', 'rb'];
SyntaxHighlighter.brushes.Ruby = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,94 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
function getKeywordsCSS(str)
{
return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
};
function getValuesCSS(str)
{
return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
};
var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' +
'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double '+
'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';
var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
var statements = '!important !default';
var preprocessor = '@import @extend @debug @warn @if @for @while @mixin @include';
var r = SyntaxHighlighter.regexLib;
this.regexList = [
{ regex: r.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: r.singleLineCComments, css: 'comments' }, // singleline comments
{ regex: r.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: r.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
{ regex: /\b(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)\b/g, css: 'value' }, // sizes
{ regex: /\$\w+/g, css: 'variable' }, // variables
{ regex: new RegExp(this.getKeywords(statements), 'g'), css: 'color3' }, // statements
{ regex: new RegExp(this.getKeywords(preprocessor), 'g'), css: 'preprocessor' }, // preprocessor
{ regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
{ regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['sass', 'scss'];
SyntaxHighlighter.brushes.Sass = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,51 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Yegor Jbanov and David Bernard.
var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' +
'override try lazy for var catch throw type extends class while with new final yield abstract ' +
'else do if return protected private this package false';
var keyops = '[_:=><%#@]+';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings
{ regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword
];
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['scala'];
SyntaxHighlighter.brushes.Scala = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,66 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var funcs = 'abs avg case cast coalesce convert count current_timestamp ' +
'current_user day isnull left lower month nullif replace right ' +
'session_user space substring sum system_user upper user year';
var keywords = 'absolute action add after alter as asc at authorization begin bigint ' +
'binary bit by cascade char character check checkpoint close collate ' +
'column commit committed connect connection constraint contains continue ' +
'create cube current current_date current_time cursor database date ' +
'deallocate dec decimal declare default delete desc distinct double drop ' +
'dynamic else end end-exec escape except exec execute false fetch first ' +
'float for force foreign forward free from full function global goto grant ' +
'group grouping having hour ignore index inner insensitive insert instead ' +
'int integer intersect into is isolation key last level load local max min ' +
'minute modify move name national nchar next no numeric of off on only ' +
'open option order out output partial password precision prepare primary ' +
'prior privileges procedure public read real references relative repeatable ' +
'restrict return returns revoke rollback rollup rows rule schema scroll ' +
'second section select sequence serializable set size smallint static ' +
'statistics table temp temporary then time timestamp to top transaction ' +
'translation trigger true truncate uncommitted union unique update values ' +
'varchar varying view when where with work';
var operators = 'all and any between cross in join like not null or outer some';
this.regexList = [
{ regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments
{ regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions
{ regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['sql'];
SyntaxHighlighter.brushes.Sql = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,56 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' +
'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' +
'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' +
'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' +
'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' +
'Function Get GetType GoSub GoTo Handles If Implements Imports In ' +
'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' +
'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' +
'NotInheritable NotOverridable Object On Option Optional Or OrElse ' +
'Overloads Overridable Overrides ParamArray Preserve Private Property ' +
'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' +
'Return Select Set Shadows Shared Short Single Static Step Stop String ' +
'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' +
'Variant When While With WithEvents WriteOnly Xor';
this.regexList = [
{ regex: /'.*$/gm, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['vb', 'vbnet'];
SyntaxHighlighter.brushes.Vb = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,69 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
function process(match, regexInfo)
{
var constructor = SyntaxHighlighter.Match,
code = match[0],
tag = new XRegExp('(&lt;|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)', 'xg').exec(code),
result = []
;
if (match.attributes != null)
{
var attributes,
regex = new XRegExp('(?<name> [\\w:\\-\\.]+)' +
'\\s*=\\s*' +
'(?<value> ".*?"|\'.*?\'|\\w+)',
'xg');
while ((attributes = regex.exec(code)) != null)
{
result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
}
}
if (tag != null)
result.push(
new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
);
return result;
}
this.regexList = [
{ regex: new XRegExp('(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
{ regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // <!-- ... -->
{ regex: new XRegExp('(&lt;|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(&gt;|>)', 'sg'), func: process }
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['xml', 'xhtml', 'xslt', 'html'];
SyntaxHighlighter.brushes.Xml = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,53 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.0.320 (July 26 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
* Copyright (C) 2009 Nicolas Perriault
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Yaml = function()
{
// Contributed by Nicolas Perriault
var constants = '~ true false on off';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // comment
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted string
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted string
{ regex: /^\s*([a-z0-9\._-])+\s*:/gmi, css: 'variable' }, // key
{ regex: /\s?(\.)([a-z0-9\._-])+\s?:/gmi, css: 'comments' }, // section
{ regex: /\s(@|:)([a-z0-9\._-])+\s*$/gmi, css: 'variable bold' }, // variable, reference
{ regex: /\s+\d+\s?$/gm, css: 'color2 bold' }, // integers
{ regex: /(\{|\}|\[|\]|,|~|:)/gm, css: 'constants' }, // inline hash and array, comma, null
{ regex: /^\s+(-)+/gm, css: 'string bold' }, // array list entry
{ regex: /^---/gm, css: 'string bold' }, // category
{ regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' } // constants
];
};
SyntaxHighlighter.brushes.Yaml.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Yaml.aliases = ['yaml', 'yml'];

View File

@ -1,17 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a<f.L;a++)I(f[a]===e)H a;H-1}M=6(f,e){K a=[],b=M.1B,c=0,d,h;I(M.1R(f)){I(e!==1d)1S 3m("2a\'t 5r 5I 5F 5B 5C 15 5E 5p");H r(f)}I(v)1S 2U("2a\'t W 3l M 59 5m 5g 5x 5i");e=e||"";O(d={2N:11,19:[],2K:6(g){H e.1i(g)>-1},3d:6(g){e+=g}};c<f.L;)I(h=B(f,c,b,d)){a.U(h.3k);c+=h.1C[0].L||1}Y I(h=n.X.W(z[b],f.1a(c))){a.U(h[0]);c+=h[0].L}Y{h=f.3a(c);I(h==="[")b=M.2I;Y I(h==="]")b=M.1B;a.U(h);c++}a=15(a.1K(""),n.Q.W(e,w,""));a.1w={1m:f,19:d.2N?d.19:N};H a};M.3v="1.5.0";M.2I=1;M.1B=2;K C=/\\$(?:(\\d\\d?|[$&`\'])|{([$\\w]+)})/g,w=/[^5h]+|([\\s\\S])(?=[\\s\\S]*\\1)/g,A=/^(?:[?*+]|{\\d+(?:,\\d*)?})\\??/,v=11,u=[],n={X:15.Z.X,1A:15.Z.1A,1C:1r.Z.1C,Q:1r.Z.Q,1e:1r.Z.1e},x=n.X.W(/()??/,"")[1]===1d,D=6(){K f=/^/g;n.1A.W(f,"");H!f.12}(),y=6(){K f=/x/g;n.Q.W("x",f,"");H!f.12}(),E=15.Z.3n!==1d,z={};z[M.2I]=/^(?:\\\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\\29-26-f]{2}|u[\\29-26-f]{4}|c[A-3o-z]|[\\s\\S]))/;z[M.1B]=/^(?:\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\\d*|x[\\29-26-f]{2}|u[\\29-26-f]{4}|c[A-3o-z]|[\\s\\S])|\\(\\?[:=!]|[?*+]\\?|{\\d+(?:,\\d*)?}\\??)/;M.1h=6(f,e,a,b){u.U({2q:r(f,"g"+(E?"y":"")),2b:e,3r:a||M.1B,2p:b||N})};M.2n=6(f,e){K a=f+"/"+(e||"");H M.2n[a]||(M.2n[a]=M(f,e))};M.3c=6(f){H r(f,"g")};M.5l=6(f){H f.Q(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,"\\\\$&")};M.5e=6(f,e,a,b){e=r(e,"g"+(b&&E?"y":""));e.12=a=a||0;f=e.X(f);H b?f&&f.P===a?f:N:f};M.3q=6(){M.1h=6(){1S 2U("2a\'t 55 1h 54 3q")}};M.1R=6(f){H 53.Z.1q.W(f)==="[2m 15]"};M.3p=6(f,e,a,b){O(K c=r(e,"g"),d=-1,h;h=c.X(f);){a.W(b,h,++d,f,c);c.12===h.P&&c.12++}I(e.1J)e.12=0};M.57=6(f,e){H 6 a(b,c){K d=e[c].1I?e[c]:{1I:e[c]},h=r(d.1I,"g"),g=[],i;O(i=0;i<b.L;i++)M.3p(b[i],h,6(k){g.U(d.3j?k[d.3j]||"":k[0])});H c===e.L-1||!g.L?g:a(g,c+1)}([f],0)};15.Z.1p=6(f,e){H J.X(e[0])};15.Z.W=6(f,e){H J.X(e)};15.Z.X=6(f){K e=n.X.1p(J,14),a;I(e){I(!x&&e.L>1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;b<e.L;b++)I(a=J.1w.19[b-1])e[a]=e[b];!D&&J.1J&&!e[0].L&&J.12>e.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;d<b.L;d++)I(b[d])14[0][b[d]]=14[d+1]}I(a&&f.1J)f.12=14[14.L-2]+14[0].L;H e.1p(N,14)});Y{c=J+"";c=n.Q.W(c,f,6(){K d=14;H n.Q.W(e,C,6(h,g,i){I(g)5b(g){24"$":H"$";24"&":H d[0];24"`":H d[d.L-1].1a(0,d[d.L-2]);24"\'":H d[d.L-1].1a(d[d.L-2]+d[0].L);5a:i="";g=+g;I(!g)H h;O(;g>d.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P<a.L&&3b.Z.U.1p(b,d.1a(1));h=d[0].L;c=f.12;I(b.L>=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a<d.L&&i==N;a++)i=p(d[a],b,c);H i}6 C(a,b){K c={},d;O(d 2g a)c[d]=a[d];O(d 2g b)c[d]=b[d];H c}6 w(a,b,c,d){6 h(g){g=g||1P.5y;I(!g.1F){g.1F=g.52;g.3N=6(){J.5w=11}}c.W(d||1P,g)}a.3g?a.3g("4U"+b,h):a.4y(b,h,11)}6 A(a,b){K c=e.1Y.2j,d=N;I(c==N){c={};O(K h 2g e.1U){K g=e.1U[h];d=g.4x;I(d!=N){g.1V=h.4w();O(g=0;g<d.L;g++)c[d[g]]=h}}e.1Y.2j=c}d=e.1U[c[a]];d==N&&b!=11&&1P.1X(e.13.1x.1X+(e.13.1x.3E+a));H d}6 v(a,b){O(K c=a.1e("\\n"),d=0;d<c.L;d++)c[d]=b(c[d],d);H c.1K("\\n")}6 u(a,b){I(a==N||a.L==0||a=="\\n")H a;a=a.Q(/</g,"&1y;");a=a.Q(/ {2,}/g,6(c){O(K d="",h=0;h<c.L-1;h++)d+=e.13.1W;H d+" "});I(b!=N)a=v(a,6(c){I(c.L==0)H"";K d="";c=c.Q(/^(&2s;| )+/,6(h){d=h;H""});I(c.L==0)H d;H d+\'<17 1g="\'+b+\'">\'+c+"</17>"});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.P<b.P)H-1;Y I(a.P>b.P)H 1;Y I(a.L<b.L)H-1;Y I(a.L>b.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'<a 2h="\'+c+\'">\'+c+"</a>"+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<a.L;c++)a[c].3s=="20"&&b.U(a[c]);H b}6 f(a){a=a.1F;K b=p(a,".20",R);a=p(a,".3O",R);K c=1E.4i("3t");I(!(!a||!b||p(a,"3t"))){B(b.1c);r(b,"1m");O(K d=a.3G,h=[],g=0;g<d.L;g++)h.U(d[g].4z||d[g].4A);h=h.1K("\\r");c.39(1E.4D(h));a.39(c);c.2C();c.4C();w(c,"4u",6(){c.2G.4E(c);b.1l=b.1l.Q("1m","")})}}I(1j 3F!="1d"&&1j M=="1d")M=3F("M").M;K e={2v:{"1g-27":"","2i-1s":1,"2z-1s-2t":11,1M:N,1t:N,"42-45":R,"43-22":4,1u:R,16:R,"3V-17":R,2l:11,"41-40":R,2k:11,"1z-1k":11},13:{1W:"&2s;",2M:R,46:11,44:11,34:"4n",1x:{21:"4o 1m",2P:"?",1X:"1v\\n\\n",3E:"4r\'t 4t 1D O: ",4g:"4m 4B\'t 51 O 1z-1k 4F: ",37:\'<!4T 1z 4S "-//4V//3H 4W 1.0 4Z//4Y" "1Z://2y.3L.3K/4X/3I/3H/3I-4P.4J"><1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v</1t></3J><3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;"><T 1L="2O-3D:3C;3w-32:1.6z;"><T 1L="25-22:6A-6E;">1v</T><T 1L="25-22:.6C;3w-6B:6R;"><T>3v 3.0.76 (72 73 3x)</T><T><a 2h="1Z://3u.2w/1v" 1F="38" 1L="2f:#3y">1Z://3u.2w/1v</a></T><T>70 17 6U 71.</T><T>6T 6X-3x 6Y 6D.</T></T><T>6t 61 60 J 1k, 5Z <a 2h="6u://2y.62.2w/63-66/65?64=5X-5W&5P=5O" 1L="2f:#3y">5R</a> 5V <2R/>5U 5T 5S!</T></T></3B></1z>\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'<T 1g="16">\',d=e.16.2x,h=d.2X,g=0;g<h.L;g++)c+=(d[h[g]].1H||b)(a,h[g]);c+="</T>";H c},2o:6(a,b,c){H\'<2W><a 2h="#" 1g="6e 6h\'+b+" "+b+\'">\'+c+"</a></2W>"},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h<c.L;h++)d.U(c[h]);c=d}c=c;d=[];I(e.13.2M)c=c.1O(z());I(c.L===0)H d;O(h=0;h<c.L;h++){O(K g=c[h],i=a,k=c[h].1l,j=3W 0,l={},m=1f M("^\\\\[(?<2V>(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g<c.L;g++){b=c[g];K i=b.1F,k=b.1n,j=k.1D,l;I(j!=N){I(k["1z-1k"]=="R"||e.2v["1z-1k"]==R){d=1f e.4l(j);j="4O"}Y I(d=A(j))d=1f d;Y 6H;l=i.3X;I(h.2M){l=l;K m=x(l),s=11;I(m.1i("<![6G[")==0){m=m.4h(9);s=R}K o=m.L;I(m.1i("]]\\>")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;m<j.L;m++)j[m].P+=l}K c=A(a),d,h=1f e.1U.5Y,g=J,i="2F 1H 2Q".1e(" ");I(c!=N){d=1f c;O(K k=0;k<i.L;k++)(6(){K j=i[k];g[j]=6(){H h[j].1p(h,14)}})();d.28==N?1P.1X(e.13.1x.1X+(e.13.1x.4g+a)):h.2J.U({1I:d.28.17,2D:6(j){O(K l=j.17,m=[],s=d.2J,o=j.P+j.18.L,F=d.28,q,G=0;G<s.L;G++){q=y(l,s[G]);b(q,o);m=m.1O(q)}I(F.18!=N&&j.18!=N){q=y(j.18,F.18);b(q,j.P);m=m.1O(q)}I(F.1b!=N&&j.1b!=N){q=y(j.1b,F.1b);b(q,j.P+j[0].5Q(j.1b));m=m.1O(q)}O(j=0;j<m.L;j++)m[j].1V=c.1V;H m}})}};e.4j=6(){};e.4j.Z={V:6(a,b){K c=J.1n[a];c=c==N?b:c;K d={"R":R,"11":11}[c];H d==N?c:d},3Y:6(a){H 1E.4i(a)},4c:6(a,b){K c=[];I(a!=N)O(K d=0;d<a.L;d++)I(1j a[d]=="2m")c=c.1O(y(b,a[d]));H J.4e(c.6b(D))},4e:6(a){O(K b=0;b<a.L;b++)I(a[b]!==N)O(K c=a[b],d=c.P+c.L,h=b+1;h<a.L&&a[b]!==N;h++){K g=a[h];I(g!==N)I(g.P>d)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P<d)a[h]=N}H a},4d:6(a){K b=[],c=2u(J.V("2i-1s"));v(a,6(d,h){b.U(h+c)});H b},3U:6(a){K b=J.V("1M",[]);I(1j b!="2m"&&b.U==N)b=[b];a:{a=a.1q();K c=3W 0;O(c=c=1Q.6c(c||0,0);c<b.L;c++)I(b[c]==a){b=c;1N a}b=-1}H b!=-1},2r:6(a,b,c){a=["1s","6i"+b,"P"+a,"6r"+(b%2==0?1:2).1q()];J.3U(b)&&a.U("67");b==0&&a.U("1N");H\'<T 1g="\'+a.1K(" ")+\'">\'+c+"</T>"},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i<d;i++){K k=b?b[i]:h+i,j;I(k==0)j=e.13.1W;Y{j=g;O(K l=k.1q();l.L<j;)l="0"+l;j=l}a=j;c+=J.2r(i,k,a)}H c},49:6(a,b){a=x(a);K c=a.1e("\\n");J.V("2z-1s-2t");K d=2u(J.V("2i-1s"));a="";O(K h=J.V("1D"),g=0;g<c.L;g++){K i=c[g],k=/^(&2s;|\\s)+/.X(i),j=N,l=b?b[g]:d+g;I(k!=N){j=k[0].1q();i=i.1o(j.L);j=j.Q(" ",e.13.1W)}i=x(i);I(i.L==0)i=e.13.1W;a+=J.2r(g,l,(j!=N?\'<17 1g="\'+h+\' 5N">\'+j+"</17>":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"</4a>":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i<b.L;i++){K k=b[i],j;I(!(k===N||k.L===0)){j=c(k);h+=u(a.1o(d,k.P-d),j+"48")+u(k.1T,j+k.23);d=k.P+k.L+(k.75||0)}}h+=u(a.1o(d),c()+"48");H h},1H:6(a){K b="",c=["20"],d;I(J.V("2k")==R)J.1n.16=J.1n.1u=11;1l="20";J.V("2l")==R&&c.U("47");I((1u=J.V("1u"))==11)c.U("6S");c.U(J.V("1g-27"));c.U(J.V("1D"));a=a.Q(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"").Q(/\\r/g," ");b=J.V("43-22");I(J.V("42-45")==R)a=n(a,b);Y{O(K h="",g=0;g<b;g++)h+=" ";a=a.Q(/\\t/g,h)}a=a;a:{b=a=a;h=/<2R\\s*\\/?>|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i<b.L&&g>0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i<b.L;i++)b[i]=b[i].1o(g);a=b.1K("\\n")}I(1u)d=J.4d(a);b=J.4c(J.2J,a);b=J.4b(a,b);b=J.49(b,d);I(J.V("41-40"))b=E(b);1j 2H!="1d"&&2H.3S&&2H.3S.1C(/5s/)&&c.U("5t");H b=\'<T 1c="\'+t(J.1c)+\'" 1g="\'+c.1K(" ")+\'">\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"</2d>":"")+\'<2d 1g="17"><T 1g="3O">\'+b+"</T></2d></3P></3T></3Z></T>"},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{}))

View File

@ -1,17 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3 u={8:{}};u.8={A:4(c,k,l,m,n,o){4 d(a,b){2 a!=1?a:b}4 f(a){2 a!=1?a.E():1}c=c.I(":");3 g=c[0],e={};t={"r":K};M=1;5=8.5;9(3 j R c)e[c[j]]="r";k=f(d(k,5.C));l=f(d(l,5.D));m=f(d(m,5.s));o=f(d(o,5.Q));n=f(d(n,5["x-y"]));2{P:g,C:d(t[e.O],k),D:d(t[e.N],l),s:d({"r":r}[e.s],m),"x-y":d(4(a,b){9(3 h=T S("^"+b+"\\\\[(?<q>\\\\w+)\\\\]$","U"),i=1,p=0;p<a.7;p++)6((i=h.J(a[p]))!=1)2 i.q;2 1}(c,"G"),n)}},F:4(c,k,l,m,n,o){4 d(){9(3 a=H,b=0;b<a.7;b++)6(a[b]!==1){6(z a[b]=="L"&&a[b]!="")2 a[b]+"";6(z a[b]=="X"&&a[b].q!="")2 a[b].q+""}2 1}4 f(a,b,h){h=12.13(h);9(3 i=0;i<h.7;i++)h[i].V("15")==b&&a.Y(h[i])}3 g=[];f(g,c,"Z");f(g,c,"W");6(g.7!==0)9(c=0;c<g.7;c++){3 e=g[c],j=d(e.B["14"],e.10,e.B.v,e.v);6(j!==1){j=u.8.A(j,k,l,m,n,o);8.11(j,e)}}}};',62,68,'|null|return|var|function|defaults|if|length|SyntaxHighlighter|for|||||||||||||||||value|true|collapse|reverse|dp|language||first|line|typeof|parseParams|attributes|gutter|toolbar|toString|HighlightAll|firstline|arguments|split|exec|false|string|result|nocontrols|nogutter|brush|ruler|in|XRegExp|new|gi|getAttribute|textarea|object|push|pre|className|highlight|document|getElementsByTagName|class|name'.split('|'),0,{}))

View File

@ -1,130 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
(function() {
var sh = SyntaxHighlighter;
/**
* Provides functionality to dynamically load only the brushes that a needed to render the current page.
*
* There are two syntaxes that autoload understands. For example:
*
* SyntaxHighlighter.autoloader(
* [ 'applescript', 'Scripts/shBrushAppleScript.js' ],
* [ 'actionscript3', 'as3', 'Scripts/shBrushAS3.js' ]
* );
*
* or a more easily comprehendable one:
*
* SyntaxHighlighter.autoloader(
* 'applescript Scripts/shBrushAppleScript.js',
* 'actionscript3 as3 Scripts/shBrushAS3.js'
* );
*/
sh.autoloader = function()
{
var list = arguments,
elements = sh.findElements(),
brushes = {},
scripts = {},
all = SyntaxHighlighter.all,
allCalled = false,
allParams = null,
i
;
SyntaxHighlighter.all = function(params)
{
allParams = params;
allCalled = true;
};
function addBrush(aliases, url)
{
for (var i = 0; i < aliases.length; i++)
brushes[aliases[i]] = url;
};
function getAliases(item)
{
return item.pop
? item
: item.split(/\s+/)
;
}
// create table of aliases and script urls
for (i = 0; i < list.length; i++)
{
var aliases = getAliases(list[i]),
url = aliases.pop()
;
addBrush(aliases, url);
}
// dynamically add <script /> tags to the document body
for (i = 0; i < elements.length; i++)
{
var url = brushes[elements[i].params.brush];
if (!url)
continue;
scripts[url] = false;
loadScript(url);
}
function loadScript(url)
{
var script = document.createElement('script'),
done = false
;
script.src = url;
script.type = 'text/javascript';
script.language = 'javascript';
script.onload = script.onreadystatechange = function()
{
if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'))
{
done = true;
scripts[url] = true;
checkAll();
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
script.parentNode.removeChild(script);
}
};
// sync way of adding script tags to the page
document.body.appendChild(script);
};
function checkAll()
{
for(var url in scripts)
if (scripts[url] == false)
return;
if (allCalled)
SyntaxHighlighter.highlight(allParams);
};
};
})();

View File

@ -1,1721 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
//
// Begin anonymous function. This is used to contain local scope variables without polutting global scope.
//
var SyntaxHighlighter = function() {
// CommonJS
if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined')
{
XRegExp = require('XRegExp').XRegExp;
}
// Shortcut object which will be assigned to the SyntaxHighlighter variable.
// This is a shorthand for local reference in order to avoid long namespace
// references to SyntaxHighlighter.whatever...
var sh = {
defaults : {
/** Additional CSS class names to be added to highlighter elements. */
'class-name' : '',
/** First line number. */
'first-line' : 1,
/**
* Pads line numbers. Possible values are:
*
* false - don't pad line numbers.
* true - automaticaly pad numbers with minimum required number of leading zeroes.
* [int] - length up to which pad line numbers.
*/
'pad-line-numbers' : false,
/** Lines to highlight. */
'highlight' : null,
/** Title to be displayed above the code block. */
'title' : null,
/** Enables or disables smart tabs. */
'smart-tabs' : true,
/** Gets or sets tab size. */
'tab-size' : 4,
/** Enables or disables gutter. */
'gutter' : true,
/** Enables or disables toolbar. */
'toolbar' : true,
/** Enables quick code copy and paste from double click. */
'quick-code' : true,
/** Forces code view to be collapsed. */
'collapse' : false,
/** Enables or disables automatic links. */
'auto-links' : true,
/** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */
'light' : false,
'html-script' : false
},
config : {
space : '&nbsp;',
/** Enables use of <SCRIPT type="syntaxhighlighter" /> tags. */
useScriptTags : true,
/** Blogger mode flag. */
bloggerMode : false,
stripBrs : false,
/** Name of the tag that SyntaxHighlighter will automatically look for. */
tagName : 'pre',
strings : {
expandSource : 'expand source',
help : '?',
alert: 'SyntaxHighlighter\n\n',
noBrush : 'Can\'t find brush for: ',
brushNotHtmlScript : 'Brush wasn\'t configured for html-script option: ',
// this is populated by the build script
aboutDialog : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>About SyntaxHighlighter</title></head><body style="font-family:Geneva,Arial,Helvetica,sans-serif;background-color:#fff;color:#000;font-size:1em;text-align:center;"><div style="text-align:center;margin-top:1.5em;"><div style="font-size:xx-large;">SyntaxHighlighter</div><div style="font-size:.75em;margin-bottom:3em;"><div>version 3.0.83 (July 02 2010)</div><div><a href="http://alexgorbatchev.com/SyntaxHighlighter" target="_blank" style="color:#005896">http://alexgorbatchev.com/SyntaxHighlighter</a></div><div>JavaScript code syntax highlighter.</div><div>Copyright 2004-2010 Alex Gorbatchev.</div></div><div>If you like this script, please <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2930402" style="color:#005896">donate</a> to <br/>keep development active!</div></div></body></html>'
}
},
/** Internal 'global' variables. */
vars : {
discoveredBrushes : null,
highlighters : {}
},
/** This object is populated by user included external brush files. */
brushes : {},
/** Common regular expressions. */
regexLib : {
multiLineCComments : /\/\*[\s\S]*?\*\//gm,
singleLineCComments : /\/\/.*$/gm,
singleLinePerlComments : /#.*$/gm,
doubleQuotedString : /"([^\\"\n]|\\.)*"/g,
singleQuotedString : /'([^\\'\n]|\\.)*'/g,
multiLineDoubleQuotedString : new XRegExp('"([^\\\\"]|\\\\.)*"', 'gs'),
multiLineSingleQuotedString : new XRegExp("'([^\\\\']|\\\\.)*'", 'gs'),
xmlComments : /(&lt;|<)!--[\s\S]*?--(&gt;|>)/gm,
url : /\w+:\/\/[\w-.\/?%&=:@;]*/g,
/** <?= ?> tags. */
phpScriptTags : { left: /(&lt;|<)\?=?/g, right: /\?(&gt;|>)/g },
/** <%= %> tags. */
aspScriptTags : { left: /(&lt;|<)%=?/g, right: /%(&gt;|>)/g },
/** <script></script> tags. */
scriptScriptTags : { left: /(&lt;|<)\s*script.*?(&gt;|>)/gi, right: /(&lt;|<)\/\s*script\s*(&gt;|>)/gi }
},
toolbar: {
/**
* Generates HTML markup for the toolbar.
* @param {Highlighter} highlighter Highlighter instance.
* @return {String} Returns HTML markup.
*/
getHtml: function(highlighter)
{
var html = '<div class="toolbar">',
items = sh.toolbar.items,
list = items.list
;
function defaultGetHtml(highlighter, name)
{
return sh.toolbar.getButtonHtml(highlighter, name, sh.config.strings[name]);
};
for (var i = 0; i < list.length; i++)
html += (items[list[i]].getHtml || defaultGetHtml)(highlighter, list[i]);
html += '</div>';
return html;
},
/**
* Generates HTML markup for a regular button in the toolbar.
* @param {Highlighter} highlighter Highlighter instance.
* @param {String} commandName Command name that would be executed.
* @param {String} label Label text to display.
* @return {String} Returns HTML markup.
*/
getButtonHtml: function(highlighter, commandName, label)
{
return '<span><a href="#" class="toolbar_item'
+ ' command_' + commandName
+ ' ' + commandName
+ '">' + label + '</a></span>'
;
},
/**
* Event handler for a toolbar anchor.
*/
handler: function(e)
{
var target = e.target,
className = target.className || ''
;
function getValue(name)
{
var r = new RegExp(name + '_(\\w+)'),
match = r.exec(className)
;
return match ? match[1] : null;
};
var highlighter = getHighlighterById(findParentElement(target, '.syntaxhighlighter').id),
commandName = getValue('command')
;
// execute the toolbar command
if (highlighter && commandName)
sh.toolbar.items[commandName].execute(highlighter);
// disable default A click behaviour
e.preventDefault();
},
/** Collection of toolbar items. */
items : {
// Ordered lis of items in the toolbar. Can't expect `for (var n in items)` to be consistent.
list: ['expandSource', 'help'],
expandSource: {
getHtml: function(highlighter)
{
if (highlighter.getParam('collapse') != true)
return '';
var title = highlighter.getParam('title');
return sh.toolbar.getButtonHtml(highlighter, 'expandSource', title ? title : sh.config.strings.expandSource);
},
execute: function(highlighter)
{
var div = getHighlighterDivById(highlighter.id);
removeClass(div, 'collapsed');
}
},
/** Command to display the about dialog window. */
help: {
execute: function(highlighter)
{
var wnd = popup('', '_blank', 500, 250, 'scrollbars=0'),
doc = wnd.document
;
doc.write(sh.config.strings.aboutDialog);
doc.close();
wnd.focus();
}
}
}
},
/**
* Finds all elements on the page which should be processes by SyntaxHighlighter.
*
* @param {Object} globalParams Optional parameters which override element's
* parameters. Only used if element is specified.
*
* @param {Object} element Optional element to highlight. If none is
* provided, all elements in the current document
* are returned which qualify.
*
* @return {Array} Returns list of <code>{ target: DOMElement, params: Object }</code> objects.
*/
findElements: function(globalParams, element)
{
var elements = element ? [element] : toArray(document.getElementsByTagName(sh.config.tagName)),
conf = sh.config,
result = []
;
// support for <SCRIPT TYPE="syntaxhighlighter" /> feature
if (conf.useScriptTags)
elements = elements.concat(getSyntaxHighlighterScriptTags());
if (elements.length === 0)
return result;
for (var i = 0; i < elements.length; i++)
{
var item = {
target: elements[i],
// local params take precedence over globals
params: merge(globalParams, parseParams(elements[i].className))
};
if (item.params['brush'] == null)
continue;
result.push(item);
}
return result;
},
/**
* Shorthand to highlight all elements on the page that are marked as
* SyntaxHighlighter source code.
*
* @param {Object} globalParams Optional parameters which override element's
* parameters. Only used if element is specified.
*
* @param {Object} element Optional element to highlight. If none is
* provided, all elements in the current document
* are highlighted.
*/
highlight: function(globalParams, element)
{
var elements = this.findElements(globalParams, element),
propertyName = 'innerHTML',
highlighter = null,
conf = sh.config
;
if (elements.length === 0)
return;
for (var i = 0; i < elements.length; i++)
{
var element = elements[i],
target = element.target,
params = element.params,
brushName = params.brush,
code
;
if (brushName == null)
continue;
// Instantiate a brush
if (params['html-script'] == 'true' || sh.defaults['html-script'] == true)
{
highlighter = new sh.HtmlScript(brushName);
brushName = 'htmlscript';
}
else
{
var brush = findBrush(brushName);
if (brush)
highlighter = new brush();
else
continue;
}
code = target[propertyName];
// remove CDATA from <SCRIPT/> tags if it's present
if (conf.useScriptTags)
code = stripCData(code);
// Inject title if the attribute is present
if ((target.title || '') != '')
params.title = target.title;
params['brush'] = brushName;
highlighter.init(params);
element = highlighter.getDiv(code);
// carry over ID
if ((target.id || '') != '')
element.id = target.id;
target.parentNode.replaceChild(element, target);
}
},
/**
* Main entry point for the SyntaxHighlighter.
* @param {Object} params Optional params to apply to all highlighted elements.
*/
all: function(params)
{
attachEvent(
window,
'load',
function() { sh.highlight(params); }
);
}
}; // end of sh
sh['all'] = sh.all;
sh['highlight'] = sh.highlight;
/**
* Checks if target DOM elements has specified CSS class.
* @param {DOMElement} target Target DOM element to check.
* @param {String} className Name of the CSS class to check for.
* @return {Boolean} Returns true if class name is present, false otherwise.
*/
function hasClass(target, className)
{
return target.className.indexOf(className) != -1;
};
/**
* Adds CSS class name to the target DOM element.
* @param {DOMElement} target Target DOM element.
* @param {String} className New CSS class to add.
*/
function addClass(target, className)
{
if (!hasClass(target, className))
target.className += ' ' + className;
};
/**
* Removes CSS class name from the target DOM element.
* @param {DOMElement} target Target DOM element.
* @param {String} className CSS class to remove.
*/
function removeClass(target, className)
{
target.className = target.className.replace(className, '');
};
/**
* Converts the source to array object. Mostly used for function arguments and
* lists returned by getElementsByTagName() which aren't Array objects.
* @param {List} source Source list.
* @return {Array} Returns array.
*/
function toArray(source)
{
var result = [];
for (var i = 0; i < source.length; i++)
result.push(source[i]);
return result;
};
/**
* Splits block of text into lines.
* @param {String} block Block of text.
* @return {Array} Returns array of lines.
*/
function splitLines(block)
{
return block.split('\n');
}
/**
* Generates HTML ID for the highlighter.
* @param {String} highlighterId Highlighter ID.
* @return {String} Returns HTML ID.
*/
function getHighlighterId(id)
{
var prefix = 'highlighter_';
return id.indexOf(prefix) == 0 ? id : prefix + id;
};
/**
* Finds Highlighter instance by ID.
* @param {String} highlighterId Highlighter ID.
* @return {Highlighter} Returns instance of the highlighter.
*/
function getHighlighterById(id)
{
return sh.vars.highlighters[getHighlighterId(id)];
};
/**
* Finds highlighter's DIV container.
* @param {String} highlighterId Highlighter ID.
* @return {Element} Returns highlighter's DIV element.
*/
function getHighlighterDivById(id)
{
return document.getElementById(getHighlighterId(id));
};
/**
* Stores highlighter so that getHighlighterById() can do its thing. Each
* highlighter must call this method to preserve itself.
* @param {Highilghter} highlighter Highlighter instance.
*/
function storeHighlighter(highlighter)
{
sh.vars.highlighters[getHighlighterId(highlighter.id)] = highlighter;
};
/**
* Looks for a child or parent node which has specified classname.
* Equivalent to jQuery's $(container).find(".className")
* @param {Element} target Target element.
* @param {String} search Class name or node name to look for.
* @param {Boolean} reverse If set to true, will go up the node tree instead of down.
* @return {Element} Returns found child or parent element on null.
*/
function findElement(target, search, reverse /* optional */)
{
if (target == null)
return null;
var nodes = reverse != true ? target.childNodes : [ target.parentNode ],
propertyToFind = { '#' : 'id', '.' : 'className' }[search.substr(0, 1)] || 'nodeName',
expectedValue,
found
;
expectedValue = propertyToFind != 'nodeName'
? search.substr(1)
: search.toUpperCase()
;
// main return of the found node
if ((target[propertyToFind] || '').indexOf(expectedValue) != -1)
return target;
for (var i = 0; nodes && i < nodes.length && found == null; i++)
found = findElement(nodes[i], search, reverse);
return found;
};
/**
* Looks for a parent node which has specified classname.
* This is an alias to <code>findElement(container, className, true)</code>.
* @param {Element} target Target element.
* @param {String} className Class name to look for.
* @return {Element} Returns found parent element on null.
*/
function findParentElement(target, className)
{
return findElement(target, className, true);
};
/**
* Finds an index of element in the array.
* @ignore
* @param {Object} searchElement
* @param {Number} fromIndex
* @return {Number} Returns index of element if found; -1 otherwise.
*/
function indexOf(array, searchElement, fromIndex)
{
fromIndex = Math.max(fromIndex || 0, 0);
for (var i = fromIndex; i < array.length; i++)
if(array[i] == searchElement)
return i;
return -1;
};
/**
* Generates a unique element ID.
*/
function guid(prefix)
{
return (prefix || '') + Math.round(Math.random() * 1000000).toString();
};
/**
* Merges two objects. Values from obj2 override values in obj1.
* Function is NOT recursive and works only for one dimensional objects.
* @param {Object} obj1 First object.
* @param {Object} obj2 Second object.
* @return {Object} Returns combination of both objects.
*/
function merge(obj1, obj2)
{
var result = {}, name;
for (name in obj1)
result[name] = obj1[name];
for (name in obj2)
result[name] = obj2[name];
return result;
};
/**
* Attempts to convert string to boolean.
* @param {String} value Input string.
* @return {Boolean} Returns true if input was "true", false if input was "false" and value otherwise.
*/
function toBoolean(value)
{
var result = { "true" : true, "false" : false }[value];
return result == null ? value : result;
};
/**
* Opens up a centered popup window.
* @param {String} url URL to open in the window.
* @param {String} name Popup name.
* @param {int} width Popup width.
* @param {int} height Popup height.
* @param {String} options window.open() options.
* @return {Window} Returns window instance.
*/
function popup(url, name, width, height, options)
{
var x = (screen.width - width) / 2,
y = (screen.height - height) / 2
;
options += ', left=' + x +
', top=' + y +
', width=' + width +
', height=' + height
;
options = options.replace(/^,/, '');
var win = window.open(url, name, options);
win.focus();
return win;
};
/**
* Adds event handler to the target object.
* @param {Object} obj Target object.
* @param {String} type Name of the event.
* @param {Function} func Handling function.
*/
function attachEvent(obj, type, func, scope)
{
function handler(e)
{
e = e || window.event;
if (!e.target)
{
e.target = e.srcElement;
e.preventDefault = function()
{
this.returnValue = false;
};
}
func.call(scope || window, e);
};
if (obj.attachEvent)
{
obj.attachEvent('on' + type, handler);
}
else
{
obj.addEventListener(type, handler, false);
}
};
/**
* Displays an alert.
* @param {String} str String to display.
*/
function alert(str)
{
window.alert(sh.config.strings.alert + str);
};
/**
* Finds a brush by its alias.
*
* @param {String} alias Brush alias.
* @param {Boolean} showAlert Suppresses the alert if false.
* @return {Brush} Returns bursh constructor if found, null otherwise.
*/
function findBrush(alias, showAlert)
{
var brushes = sh.vars.discoveredBrushes,
result = null
;
if (brushes == null)
{
brushes = {};
// Find all brushes
for (var brush in sh.brushes)
{
var info = sh.brushes[brush],
aliases = info.aliases
;
if (aliases == null)
continue;
// keep the brush name
info.brushName = brush.toLowerCase();
for (var i = 0; i < aliases.length; i++)
brushes[aliases[i]] = brush;
}
sh.vars.discoveredBrushes = brushes;
}
result = sh.brushes[brushes[alias]];
if (result == null && showAlert != false)
alert(sh.config.strings.noBrush + alias);
return result;
};
/**
* Executes a callback on each line and replaces each line with result from the callback.
* @param {Object} str Input string.
* @param {Object} callback Callback function taking one string argument and returning a string.
*/
function eachLine(str, callback)
{
var lines = splitLines(str);
for (var i = 0; i < lines.length; i++)
lines[i] = callback(lines[i], i);
return lines.join('\n');
};
/**
* This is a special trim which only removes first and last empty lines
* and doesn't affect valid leading space on the first line.
*
* @param {String} str Input string
* @return {String} Returns string without empty first and last lines.
*/
function trimFirstAndLastLines(str)
{
return str.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g, '');
};
/**
* Parses key/value pairs into hash object.
*
* Understands the following formats:
* - name: word;
* - name: [word, word];
* - name: "string";
* - name: 'string';
*
* For example:
* name1: value; name2: [value, value]; name3: 'value'
*
* @param {String} str Input string.
* @return {Object} Returns deserialized object.
*/
function parseParams(str)
{
var match,
result = {},
arrayRegex = new XRegExp("^\\[(?<values>(.*?))\\]$"),
regex = new XRegExp(
"(?<name>[\\w-]+)" +
"\\s*:\\s*" +
"(?<value>" +
"[\\w-%#]+|" + // word
"\\[.*?\\]|" + // [] array
'".*?"|' + // "" string
"'.*?'" + // '' string
")\\s*;?",
"g"
)
;
while ((match = regex.exec(str)) != null)
{
var value = match.value
.replace(/^['"]|['"]$/g, '') // strip quotes from end of strings
;
// try to parse array value
if (value != null && arrayRegex.test(value))
{
var m = arrayRegex.exec(value);
value = m.values.length > 0 ? m.values.split(/\s*,\s*/) : [];
}
result[match.name] = value;
}
return result;
};
/**
* Wraps each line of the string into <code/> tag with given style applied to it.
*
* @param {String} str Input string.
* @param {String} css Style name to apply to the string.
* @return {String} Returns input string with each line surrounded by <span/> tag.
*/
function wrapLinesWithCode(str, css)
{
if (str == null || str.length == 0 || str == '\n')
return str;
str = str.replace(/</g, '&lt;');
// Replace two or more sequential spaces with &nbsp; leaving last space untouched.
str = str.replace(/ {2,}/g, function(m)
{
var spaces = '';
for (var i = 0; i < m.length - 1; i++)
spaces += sh.config.space;
return spaces + ' ';
});
// Split each line and apply <span class="...">...</span> to them so that
// leading spaces aren't included.
if (css != null)
str = eachLine(str, function(line)
{
if (line.length == 0)
return '';
var spaces = '';
line = line.replace(/^(&nbsp;| )+/, function(s)
{
spaces = s;
return '';
});
if (line.length == 0)
return spaces;
return spaces + '<code class="' + css + '">' + line + '</code>';
});
return str;
};
/**
* Pads number with zeros until it's length is the same as given length.
*
* @param {Number} number Number to pad.
* @param {Number} length Max string length with.
* @return {String} Returns a string padded with proper amount of '0'.
*/
function padNumber(number, length)
{
var result = number.toString();
while (result.length < length)
result = '0' + result;
return result;
};
/**
* Replaces tabs with spaces.
*
* @param {String} code Source code.
* @param {Number} tabSize Size of the tab.
* @return {String} Returns code with all tabs replaces by spaces.
*/
function processTabs(code, tabSize)
{
var tab = '';
for (var i = 0; i < tabSize; i++)
tab += ' ';
return code.replace(/\t/g, tab);
};
/**
* Replaces tabs with smart spaces.
*
* @param {String} code Code to fix the tabs in.
* @param {Number} tabSize Number of spaces in a column.
* @return {String} Returns code with all tabs replaces with roper amount of spaces.
*/
function processSmartTabs(code, tabSize)
{
var lines = splitLines(code),
tab = '\t',
spaces = ''
;
// Create a string with 1000 spaces to copy spaces from...
// It's assumed that there would be no indentation longer than that.
for (var i = 0; i < 50; i++)
spaces += ' '; // 20 spaces * 50
// This function inserts specified amount of spaces in the string
// where a tab is while removing that given tab.
function insertSpaces(line, pos, count)
{
return line.substr(0, pos)
+ spaces.substr(0, count)
+ line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab
;
};
// Go through all the lines and do the 'smart tabs' magic.
code = eachLine(code, function(line)
{
if (line.indexOf(tab) == -1)
return line;
var pos = 0;
while ((pos = line.indexOf(tab)) != -1)
{
// This is pretty much all there is to the 'smart tabs' logic.
// Based on the position within the line and size of a tab,
// calculate the amount of spaces we need to insert.
var spaces = tabSize - pos % tabSize;
line = insertSpaces(line, pos, spaces);
}
return line;
});
return code;
};
/**
* Performs various string fixes based on configuration.
*/
function fixInputString(str)
{
var br = /<br\s*\/?>|&lt;br\s*\/?&gt;/gi;
if (sh.config.bloggerMode == true)
str = str.replace(br, '\n');
if (sh.config.stripBrs == true)
str = str.replace(br, '');
return str;
};
/**
* Removes all white space at the begining and end of a string.
*
* @param {String} str String to trim.
* @return {String} Returns string without leading and following white space characters.
*/
function trim(str)
{
return str.replace(/^\s+|\s+$/g, '');
};
/**
* Unindents a block of text by the lowest common indent amount.
* @param {String} str Text to unindent.
* @return {String} Returns unindented text block.
*/
function unindent(str)
{
var lines = splitLines(fixInputString(str)),
indents = new Array(),
regex = /^\s*/,
min = 1000
;
// go through every line and check for common number of indents
for (var i = 0; i < lines.length && min > 0; i++)
{
var line = lines[i];
if (trim(line).length == 0)
continue;
var matches = regex.exec(line);
// In the event that just one line doesn't have leading white space
// we can't unindent anything, so bail completely.
if (matches == null)
return str;
min = Math.min(matches[0].length, min);
}
// trim minimum common number of white space from the begining of every line
if (min > 0)
for (var i = 0; i < lines.length; i++)
lines[i] = lines[i].substr(min);
return lines.join('\n');
};
/**
* Callback method for Array.sort() which sorts matches by
* index position and then by length.
*
* @param {Match} m1 Left object.
* @param {Match} m2 Right object.
* @return {Number} Returns -1, 0 or -1 as a comparison result.
*/
function matchesSortCallback(m1, m2)
{
// sort matches by index first
if(m1.index < m2.index)
return -1;
else if(m1.index > m2.index)
return 1;
else
{
// if index is the same, sort by length
if(m1.length < m2.length)
return -1;
else if(m1.length > m2.length)
return 1;
}
return 0;
};
/**
* Executes given regular expression on provided code and returns all
* matches that are found.
*
* @param {String} code Code to execute regular expression on.
* @param {Object} regex Regular expression item info from <code>regexList</code> collection.
* @return {Array} Returns a list of Match objects.
*/
function getMatches(code, regexInfo)
{
function defaultAdd(match, regexInfo)
{
return match[0];
};
var index = 0,
match = null,
matches = [],
func = regexInfo.func ? regexInfo.func : defaultAdd
;
while((match = regexInfo.regex.exec(code)) != null)
{
var resultMatch = func(match, regexInfo);
if (typeof(resultMatch) == 'string')
resultMatch = [new sh.Match(resultMatch, match.index, regexInfo.css)];
matches = matches.concat(resultMatch);
}
return matches;
};
/**
* Turns all URLs in the code into <a/> tags.
* @param {String} code Input code.
* @return {String} Returns code with </a> tags.
*/
function processUrls(code)
{
var gt = /(.*)((&gt;|&lt;).*)/;
return code.replace(sh.regexLib.url, function(m)
{
var suffix = '',
match = null
;
// We include &lt; and &gt; in the URL for the common cases like <http://google.com>
// The problem is that they get transformed into &lt;http://google.com&gt;
// Where as &gt; easily looks like part of the URL string.
if (match = gt.exec(m))
{
m = match[1];
suffix = match[2];
}
return '<a href="' + m + '">' + m + '</a>' + suffix;
});
};
/**
* Finds all <SCRIPT TYPE="syntaxhighlighter" /> elementss.
* @return {Array} Returns array of all found SyntaxHighlighter tags.
*/
function getSyntaxHighlighterScriptTags()
{
var tags = document.getElementsByTagName('script'),
result = []
;
for (var i = 0; i < tags.length; i++)
if (tags[i].type == 'syntaxhighlighter')
result.push(tags[i]);
return result;
};
/**
* Strips <![CDATA[]]> from <SCRIPT /> content because it should be used
* there in most cases for XHTML compliance.
* @param {String} original Input code.
* @return {String} Returns code without leading <![CDATA[]]> tags.
*/
function stripCData(original)
{
var left = '<![CDATA[',
right = ']]>',
// for some reason IE inserts some leading blanks here
copy = trim(original),
changed = false,
leftLength = left.length,
rightLength = right.length
;
if (copy.indexOf(left) == 0)
{
copy = copy.substring(leftLength);
changed = true;
}
var copyLength = copy.length;
if (copy.indexOf(right) == copyLength - rightLength)
{
copy = copy.substring(0, copyLength - rightLength);
changed = true;
}
return changed ? copy : original;
};
/**
* Quick code mouse double click handler.
*/
function quickCodeHandler(e)
{
var target = e.target,
highlighterDiv = findParentElement(target, '.syntaxhighlighter'),
container = findParentElement(target, '.container'),
textarea = document.createElement('textarea'),
highlighter
;
if (!container || !highlighterDiv || findElement(container, 'textarea'))
return;
highlighter = getHighlighterById(highlighterDiv.id);
// add source class name
addClass(highlighterDiv, 'source');
// Have to go over each line and grab it's text, can't just do it on the
// container because Firefox loses all \n where as Webkit doesn't.
var lines = container.childNodes,
code = []
;
for (var i = 0; i < lines.length; i++)
code.push(lines[i].innerText || lines[i].textContent);
// using \r instead of \r or \r\n makes this work equally well on IE, FF and Webkit
code = code.join('\r');
// inject <textarea/> tag
textarea.appendChild(document.createTextNode(code));
container.appendChild(textarea);
// preselect all text
textarea.focus();
textarea.select();
// set up handler for lost focus
attachEvent(textarea, 'blur', function(e)
{
textarea.parentNode.removeChild(textarea);
removeClass(highlighterDiv, 'source');
});
};
/**
* Match object.
*/
sh.Match = function(value, index, css)
{
this.value = value;
this.index = index;
this.length = value.length;
this.css = css;
this.brushName = null;
};
sh.Match.prototype.toString = function()
{
return this.value;
};
/**
* Simulates HTML code with a scripting language embedded.
*
* @param {String} scriptBrushName Brush name of the scripting language.
*/
sh.HtmlScript = function(scriptBrushName)
{
var brushClass = findBrush(scriptBrushName),
scriptBrush,
xmlBrush = new sh.brushes.Xml(),
bracketsRegex = null,
ref = this,
methodsToExpose = 'getDiv getHtml init'.split(' ')
;
if (brushClass == null)
return;
scriptBrush = new brushClass();
for(var i = 0; i < methodsToExpose.length; i++)
// make a closure so we don't lose the name after i changes
(function() {
var name = methodsToExpose[i];
ref[name] = function()
{
return xmlBrush[name].apply(xmlBrush, arguments);
};
})();
if (scriptBrush.htmlScript == null)
{
alert(sh.config.strings.brushNotHtmlScript + scriptBrushName);
return;
}
xmlBrush.regexList.push(
{ regex: scriptBrush.htmlScript.code, func: process }
);
function offsetMatches(matches, offset)
{
for (var j = 0; j < matches.length; j++)
matches[j].index += offset;
}
function process(match, info)
{
var code = match.code,
matches = [],
regexList = scriptBrush.regexList,
offset = match.index + match.left.length,
htmlScript = scriptBrush.htmlScript,
result
;
// add all matches from the code
for (var i = 0; i < regexList.length; i++)
{
result = getMatches(code, regexList[i]);
offsetMatches(result, offset);
matches = matches.concat(result);
}
// add left script bracket
if (htmlScript.left != null && match.left != null)
{
result = getMatches(match.left, htmlScript.left);
offsetMatches(result, match.index);
matches = matches.concat(result);
}
// add right script bracket
if (htmlScript.right != null && match.right != null)
{
result = getMatches(match.right, htmlScript.right);
offsetMatches(result, match.index + match[0].lastIndexOf(match.right));
matches = matches.concat(result);
}
for (var j = 0; j < matches.length; j++)
matches[j].brushName = brushClass.brushName;
return matches;
}
};
/**
* Main Highlither class.
* @constructor
*/
sh.Highlighter = function()
{
// not putting any code in here because of the prototype inheritance
};
sh.Highlighter.prototype = {
/**
* Returns value of the parameter passed to the highlighter.
* @param {String} name Name of the parameter.
* @param {Object} defaultValue Default value.
* @return {Object} Returns found value or default value otherwise.
*/
getParam: function(name, defaultValue)
{
var result = this.params[name];
return toBoolean(result == null ? defaultValue : result);
},
/**
* Shortcut to document.createElement().
* @param {String} name Name of the element to create (DIV, A, etc).
* @return {HTMLElement} Returns new HTML element.
*/
create: function(name)
{
return document.createElement(name);
},
/**
* Applies all regular expression to the code and stores all found
* matches in the `this.matches` array.
* @param {Array} regexList List of regular expressions.
* @param {String} code Source code.
* @return {Array} Returns list of matches.
*/
findMatches: function(regexList, code)
{
var result = [];
if (regexList != null)
for (var i = 0; i < regexList.length; i++)
// BUG: length returns len+1 for array if methods added to prototype chain (oising@gmail.com)
if (typeof (regexList[i]) == "object")
result = result.concat(getMatches(code, regexList[i]));
// sort and remove nested the matches
return this.removeNestedMatches(result.sort(matchesSortCallback));
},
/**
* Checks to see if any of the matches are inside of other matches.
* This process would get rid of highligted strings inside comments,
* keywords inside strings and so on.
*/
removeNestedMatches: function(matches)
{
// Optimized by Jose Prado (http://joseprado.com)
for (var i = 0; i < matches.length; i++)
{
if (matches[i] === null)
continue;
var itemI = matches[i],
itemIEndPos = itemI.index + itemI.length
;
for (var j = i + 1; j < matches.length && matches[i] !== null; j++)
{
var itemJ = matches[j];
if (itemJ === null)
continue;
else if (itemJ.index > itemIEndPos)
break;
else if (itemJ.index == itemI.index && itemJ.length > itemI.length)
matches[i] = null;
else if (itemJ.index >= itemI.index && itemJ.index < itemIEndPos)
matches[j] = null;
}
}
return matches;
},
/**
* Creates an array containing integer line numbers starting from the 'first-line' param.
* @return {Array} Returns array of integers.
*/
figureOutLineNumbers: function(code)
{
var lines = [],
firstLine = parseInt(this.getParam('first-line'))
;
eachLine(code, function(line, index)
{
lines.push(index + firstLine);
});
return lines;
},
/**
* Determines if specified line number is in the highlighted list.
*/
isLineHighlighted: function(lineNumber)
{
var list = this.getParam('highlight', []);
if (typeof(list) != 'object' && list.push == null)
list = [ list ];
return indexOf(list, lineNumber.toString()) != -1;
},
/**
* Generates HTML markup for a single line of code while determining alternating line style.
* @param {Integer} lineNumber Line number.
* @param {String} code Line HTML markup.
* @return {String} Returns HTML markup.
*/
getLineHtml: function(lineIndex, lineNumber, code)
{
var classes = [
'line',
'number' + lineNumber,
'index' + lineIndex,
'alt' + (lineNumber % 2 == 0 ? 1 : 2).toString()
];
if (this.isLineHighlighted(lineNumber))
classes.push('highlighted');
if (lineNumber == 0)
classes.push('break');
return '<div class="' + classes.join(' ') + '">' + code + '</div>';
},
/**
* Generates HTML markup for line number column.
* @param {String} code Complete code HTML markup.
* @param {Array} lineNumbers Calculated line numbers.
* @return {String} Returns HTML markup.
*/
getLineNumbersHtml: function(code, lineNumbers)
{
var html = '',
count = splitLines(code).length,
firstLine = parseInt(this.getParam('first-line')),
pad = this.getParam('pad-line-numbers')
;
if (pad == true)
pad = (firstLine + count - 1).toString().length;
else if (isNaN(pad) == true)
pad = 0;
for (var i = 0; i < count; i++)
{
var lineNumber = lineNumbers ? lineNumbers[i] : firstLine + i,
code = lineNumber == 0 ? sh.config.space : padNumber(lineNumber, pad)
;
html += this.getLineHtml(i, lineNumber, code);
}
return html;
},
/**
* Splits block of text into individual DIV lines.
* @param {String} code Code to highlight.
* @param {Array} lineNumbers Calculated line numbers.
* @return {String} Returns highlighted code in HTML form.
*/
getCodeLinesHtml: function(html, lineNumbers)
{
html = trim(html);
var lines = splitLines(html),
padLength = this.getParam('pad-line-numbers'),
firstLine = parseInt(this.getParam('first-line')),
html = '',
brushName = this.getParam('brush')
;
for (var i = 0; i < lines.length; i++)
{
var line = lines[i],
indent = /^(&nbsp;|\s)+/.exec(line),
spaces = null,
lineNumber = lineNumbers ? lineNumbers[i] : firstLine + i;
;
if (indent != null)
{
spaces = indent[0].toString();
line = line.substr(spaces.length);
spaces = spaces.replace(' ', sh.config.space);
}
line = trim(line);
if (line.length == 0)
line = sh.config.space;
html += this.getLineHtml(
i,
lineNumber,
(spaces != null ? '<code class="' + brushName + ' spaces">' + spaces + '</code>' : '') + line
);
}
return html;
},
/**
* Returns HTML for the table title or empty string if title is null.
*/
getTitleHtml: function(title)
{
return title ? '<caption>' + title + '</caption>' : '';
},
/**
* Finds all matches in the source code.
* @param {String} code Source code to process matches in.
* @param {Array} matches Discovered regex matches.
* @return {String} Returns formatted HTML with processed mathes.
*/
getMatchesHtml: function(code, matches)
{
var pos = 0,
result = '',
brushName = this.getParam('brush', '')
;
function getBrushNameCss(match)
{
var result = match ? (match.brushName || brushName) : brushName;
return result ? result + ' ' : '';
};
// Finally, go through the final list of matches and pull the all
// together adding everything in between that isn't a match.
for (var i = 0; i < matches.length; i++)
{
var match = matches[i],
matchBrushName
;
if (match === null || match.length === 0)
continue;
matchBrushName = getBrushNameCss(match);
result += wrapLinesWithCode(code.substr(pos, match.index - pos), matchBrushName + 'plain')
+ wrapLinesWithCode(match.value, matchBrushName + match.css)
;
pos = match.index + match.length + (match.offset || 0);
}
// don't forget to add whatever's remaining in the string
result += wrapLinesWithCode(code.substr(pos), getBrushNameCss() + 'plain');
return result;
},
/**
* Generates HTML markup for the whole syntax highlighter.
* @param {String} code Source code.
* @return {String} Returns HTML markup.
*/
getHtml: function(code)
{
var html = '',
classes = [ 'syntaxhighlighter' ],
tabSize,
matches,
lineNumbers
;
// process light mode
if (this.getParam('light') == true)
this.params.toolbar = this.params.gutter = false;
className = 'syntaxhighlighter';
if (this.getParam('collapse') == true)
classes.push('collapsed');
if ((gutter = this.getParam('gutter')) == false)
classes.push('nogutter');
// add custom user style name
classes.push(this.getParam('class-name'));
// add brush alias to the class name for custom CSS
classes.push(this.getParam('brush'));
code = trimFirstAndLastLines(code)
.replace(/\r/g, ' ') // IE lets these buggers through
;
tabSize = this.getParam('tab-size');
// replace tabs with spaces
code = this.getParam('smart-tabs') == true
? processSmartTabs(code, tabSize)
: processTabs(code, tabSize)
;
// unindent code by the common indentation
code = unindent(code);
if (gutter)
lineNumbers = this.figureOutLineNumbers(code);
// find matches in the code using brushes regex list
matches = this.findMatches(this.regexList, code);
// processes found matches into the html
html = this.getMatchesHtml(code, matches);
// finally, split all lines so that they wrap well
html = this.getCodeLinesHtml(html, lineNumbers);
// finally, process the links
if (this.getParam('auto-links'))
html = processUrls(html);
if (typeof(navigator) != 'undefined' && navigator.userAgent && navigator.userAgent.match(/MSIE/))
classes.push('ie');
html =
'<div id="' + getHighlighterId(this.id) + '" class="' + classes.join(' ') + '">'
+ (this.getParam('toolbar') ? sh.toolbar.getHtml(this) : '')
+ '<table border="0" cellpadding="0" cellspacing="0">'
+ this.getTitleHtml(this.getParam('title'))
+ '<tbody>'
+ '<tr>'
+ (gutter ? '<td class="gutter">' + this.getLineNumbersHtml(code) + '</td>' : '')
+ '<td class="code">'
+ '<div class="container">'
+ html
+ '</div>'
+ '</td>'
+ '</tr>'
+ '</tbody>'
+ '</table>'
+ '</div>'
;
return html;
},
/**
* Highlights the code and returns complete HTML.
* @param {String} code Code to highlight.
* @return {Element} Returns container DIV element with all markup.
*/
getDiv: function(code)
{
if (code === null)
code = '';
this.code = code;
var div = this.create('div');
// create main HTML
div.innerHTML = this.getHtml(code);
// set up click handlers
if (this.getParam('toolbar'))
attachEvent(findElement(div, '.toolbar'), 'click', sh.toolbar.handler);
if (this.getParam('quick-code'))
attachEvent(findElement(div, '.code'), 'dblclick', quickCodeHandler);
return div;
},
/**
* Initializes the highlighter/brush.
*
* Constructor isn't used for initialization so that nothing executes during necessary
* `new SyntaxHighlighter.Highlighter()` call when setting up brush inheritence.
*
* @param {Hash} params Highlighter parameters.
*/
init: function(params)
{
this.id = guid();
// register this instance in the highlighters list
storeHighlighter(this);
// local params take precedence over defaults
this.params = merge(sh.defaults, params || {})
// process light mode
if (this.getParam('light') == true)
this.params.toolbar = this.params.gutter = false;
},
/**
* Converts space separated list of keywords into a regular expression string.
* @param {String} str Space separated keywords.
* @return {String} Returns regular expression string.
*/
getKeywords: function(str)
{
str = str
.replace(/^\s+|\s+$/g, '')
.replace(/\s+/g, '|')
;
return '\\b(?:' + str + ')\\b';
},
/**
* Makes a brush compatible with the `html-script` functionality.
* @param {Object} regexGroup Object containing `left` and `right` regular expressions.
*/
forHtmlScript: function(regexGroup)
{
this.htmlScript = {
left : { regex: regexGroup.left, css: 'script' },
right : { regex: regexGroup.right, css: 'script' },
code : new XRegExp(
"(?<left>" + regexGroup.left.source + ")" +
"(?<code>.*?)" +
"(?<right>" + regexGroup.right.source + ")",
"sgi"
)
};
}
}; // end of Highlighter
return sh;
}(); // end of anonymous function
// CommonJS
typeof(exports) != 'undefined' ? exports['SyntaxHighlighter'] = SyntaxHighlighter : null;

View File

@ -1,157 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
var dp = {
SyntaxHighlighter : {}
};
dp.SyntaxHighlighter = {
parseParams: function(
input,
showGutter,
showControls,
collapseAll,
firstLine,
showColumns
)
{
function getValue(list, name)
{
var regex = new XRegExp('^' + name + '\\[(?<value>\\w+)\\]$', 'gi'),
match = null
;
for (var i = 0; i < list.length; i++)
if ((match = regex.exec(list[i])) != null)
return match.value;
return null;
};
function defaultValue(value, def)
{
return value != null ? value : def;
};
function asString(value)
{
return value != null ? value.toString() : null;
};
var parts = input.split(':'),
brushName = parts[0],
options = {},
straight = { 'true' : true }
reverse = { 'true' : false },
result = null,
defaults = SyntaxHighlighter.defaults
;
for (var i in parts)
options[parts[i]] = 'true';
showGutter = asString(defaultValue(showGutter, defaults.gutter));
showControls = asString(defaultValue(showControls, defaults.toolbar));
collapseAll = asString(defaultValue(collapseAll, defaults.collapse));
showColumns = asString(defaultValue(showColumns, defaults.ruler));
firstLine = asString(defaultValue(firstLine, defaults['first-line']));
return {
brush : brushName,
gutter : defaultValue(reverse[options.nogutter], showGutter),
toolbar : defaultValue(reverse[options.nocontrols], showControls),
collapse : defaultValue(straight[options.collapse], collapseAll),
// ruler : defaultValue(straight[options.showcolumns], showColumns),
'first-line' : defaultValue(getValue(parts, 'firstline'), firstLine)
};
},
HighlightAll: function(
name,
showGutter /* optional */,
showControls /* optional */,
collapseAll /* optional */,
firstLine /* optional */,
showColumns /* optional */
)
{
function findValue()
{
var a = arguments;
for (var i = 0; i < a.length; i++)
{
if (a[i] === null)
continue;
if (typeof(a[i]) == 'string' && a[i] != '')
return a[i] + '';
if (typeof(a[i]) == 'object' && a[i].value != '')
return a[i].value + '';
}
return null;
};
function findTagsByName(list, name, tagName)
{
var tags = document.getElementsByTagName(tagName);
for (var i = 0; i < tags.length; i++)
if (tags[i].getAttribute('name') == name)
list.push(tags[i]);
}
var elements = [],
highlighter = null,
registered = {},
propertyName = 'innerHTML'
;
// for some reason IE doesn't find <pre/> by name, however it does see them just fine by tag name...
findTagsByName(elements, name, 'pre');
findTagsByName(elements, name, 'textarea');
if (elements.length === 0)
return;
for (var i = 0; i < elements.length; i++)
{
var element = elements[i],
params = findValue(
element.attributes['class'], element.className,
element.attributes['language'], element.language
),
language = ''
;
if (params === null)
continue;
params = dp.SyntaxHighlighter.parseParams(
params,
showGutter,
showControls,
collapseAll,
firstLine,
showColumns
);
SyntaxHighlighter.highlight(params, element);
}
}
};

View File

@ -1,226 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}

View File

@ -1,328 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}
.syntaxhighlighter {
background-color: white !important;
}
.syntaxhighlighter .line.alt1 {
background-color: white !important;
}
.syntaxhighlighter .line.alt2 {
background-color: white !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #e0e0e0 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: black !important;
}
.syntaxhighlighter table caption {
color: black !important;
}
.syntaxhighlighter .gutter {
color: #afafaf !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #6ce26c !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #6ce26c !important;
color: white !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: blue !important;
background: white !important;
border: 1px solid #6ce26c !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: blue !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: red !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #6ce26c !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: black !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: black !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #008200 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: blue !important;
}
.syntaxhighlighter .keyword {
color: #006699 !important;
}
.syntaxhighlighter .preprocessor {
color: gray !important;
}
.syntaxhighlighter .variable {
color: #aa7700 !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #ff1493 !important;
}
.syntaxhighlighter .constants {
color: #0066cc !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #006699 !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: gray !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: red !important;
}
.syntaxhighlighter .keyword {
font-weight: bold !important;
}

View File

@ -1,331 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}
.syntaxhighlighter {
background-color: #0a2b1d !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #0a2b1d !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #0a2b1d !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #233729 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: #f8f8f8 !important;
}
.syntaxhighlighter .gutter {
color: #497958 !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #41a83e !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #41a83e !important;
color: #0a2b1d !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #96dd3b !important;
background: black !important;
border: 1px solid #41a83e !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #96dd3b !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: white !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #41a83e !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #ffe862 !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: #f8f8f8 !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #336442 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #9df39f !important;
}
.syntaxhighlighter .keyword {
color: #96dd3b !important;
}
.syntaxhighlighter .preprocessor {
color: #91bb9e !important;
}
.syntaxhighlighter .variable {
color: #ffaa3e !important;
}
.syntaxhighlighter .value {
color: #f7e741 !important;
}
.syntaxhighlighter .functions {
color: #ffaa3e !important;
}
.syntaxhighlighter .constants {
color: #e0e8ff !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #96dd3b !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: #eb939a !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #91bb9e !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #edef7d !important;
}
.syntaxhighlighter .comments {
font-style: italic !important;
}
.syntaxhighlighter .keyword {
font-weight: bold !important;
}

View File

@ -1,339 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}
.syntaxhighlighter {
background-color: white !important;
}
.syntaxhighlighter .line.alt1 {
background-color: white !important;
}
.syntaxhighlighter .line.alt2 {
background-color: white !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #c3defe !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: black !important;
}
.syntaxhighlighter .gutter {
color: #787878 !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #d4d0c8 !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #d4d0c8 !important;
color: white !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #3f5fbf !important;
background: white !important;
border: 1px solid #d4d0c8 !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #3f5fbf !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #aa7700 !important;
}
.syntaxhighlighter .toolbar {
color: #a0a0a0 !important;
background: #d4d0c8 !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: #a0a0a0 !important;
}
.syntaxhighlighter .toolbar a:hover {
color: red !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: black !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #3f5fbf !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #2a00ff !important;
}
.syntaxhighlighter .keyword {
color: #7f0055 !important;
}
.syntaxhighlighter .preprocessor {
color: #646464 !important;
}
.syntaxhighlighter .variable {
color: #aa7700 !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #ff1493 !important;
}
.syntaxhighlighter .constants {
color: #0066cc !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #7f0055 !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: gray !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: red !important;
}
.syntaxhighlighter .keyword {
font-weight: bold !important;
}
.syntaxhighlighter .xml .keyword {
color: #3f7f7f !important;
font-weight: normal !important;
}
.syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a {
color: #7f007f !important;
}
.syntaxhighlighter .xml .string {
font-style: italic !important;
color: #2a00ff !important;
}

View File

@ -1,324 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}
.syntaxhighlighter {
background-color: black !important;
}
.syntaxhighlighter .line.alt1 {
background-color: black !important;
}
.syntaxhighlighter .line.alt2 {
background-color: black !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #2a3133 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: #d3d3d3 !important;
}
.syntaxhighlighter .gutter {
color: #d3d3d3 !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #990000 !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #990000 !important;
color: black !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #ebdb8d !important;
background: black !important;
border: 1px solid #990000 !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #ebdb8d !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #ff7d27 !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #990000 !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #9ccff4 !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: #d3d3d3 !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #ff7d27 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #ff9e7b !important;
}
.syntaxhighlighter .keyword {
color: aqua !important;
}
.syntaxhighlighter .preprocessor {
color: #aec4de !important;
}
.syntaxhighlighter .variable {
color: #ffaa3e !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #81cef9 !important;
}
.syntaxhighlighter .constants {
color: #ff9e7b !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: aqua !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: #ebdb8d !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #ff7d27 !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #aec4de !important;
}

View File

@ -1,328 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}
.syntaxhighlighter {
background-color: #121212 !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #121212 !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #121212 !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #2c2c29 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: white !important;
}
.syntaxhighlighter .gutter {
color: #afafaf !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #3185b9 !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #3185b9 !important;
color: #121212 !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #3185b9 !important;
background: black !important;
border: 1px solid #3185b9 !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #3185b9 !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #d01d33 !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #3185b9 !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #96daff !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: white !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #696854 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #e3e658 !important;
}
.syntaxhighlighter .keyword {
color: #d01d33 !important;
}
.syntaxhighlighter .preprocessor {
color: #435a5f !important;
}
.syntaxhighlighter .variable {
color: #898989 !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #aaaaaa !important;
}
.syntaxhighlighter .constants {
color: #96daff !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #d01d33 !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: #ffc074 !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #4a8cdb !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #96daff !important;
}
.syntaxhighlighter .functions {
font-weight: bold !important;
}

View File

@ -1,324 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}
.syntaxhighlighter {
background-color: #222222 !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #222222 !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #222222 !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #253e5a !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: lime !important;
}
.syntaxhighlighter .gutter {
color: #38566f !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #435a5f !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #435a5f !important;
color: #222222 !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #428bdd !important;
background: black !important;
border: 1px solid #435a5f !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #428bdd !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: lime !important;
}
.syntaxhighlighter .toolbar {
color: #aaaaff !important;
background: #435a5f !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: #aaaaff !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #9ccff4 !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: lime !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #428bdd !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: lime !important;
}
.syntaxhighlighter .keyword {
color: #aaaaff !important;
}
.syntaxhighlighter .preprocessor {
color: #8aa6c1 !important;
}
.syntaxhighlighter .variable {
color: aqua !important;
}
.syntaxhighlighter .value {
color: #f7e741 !important;
}
.syntaxhighlighter .functions {
color: #ff8000 !important;
}
.syntaxhighlighter .constants {
color: yellow !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #aaaaff !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: red !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: yellow !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #ffaa3e !important;
}

View File

@ -1,324 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}
.syntaxhighlighter {
background-color: #0f192a !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #0f192a !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #0f192a !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #253e5a !important;
}
.syntaxhighlighter .line.highlighted.number {
color: #38566f !important;
}
.syntaxhighlighter table caption {
color: #d1edff !important;
}
.syntaxhighlighter .gutter {
color: #afafaf !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #435a5f !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #435a5f !important;
color: #0f192a !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #428bdd !important;
background: black !important;
border: 1px solid #435a5f !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #428bdd !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #1dc116 !important;
}
.syntaxhighlighter .toolbar {
color: #d1edff !important;
background: #435a5f !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: #d1edff !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #8aa6c1 !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: #d1edff !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #428bdd !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #1dc116 !important;
}
.syntaxhighlighter .keyword {
color: #b43d3d !important;
}
.syntaxhighlighter .preprocessor {
color: #8aa6c1 !important;
}
.syntaxhighlighter .variable {
color: #ffaa3e !important;
}
.syntaxhighlighter .value {
color: #f7e741 !important;
}
.syntaxhighlighter .functions {
color: #ffaa3e !important;
}
.syntaxhighlighter .constants {
color: #e0e8ff !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #b43d3d !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: #f8bb00 !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: white !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #ffaa3e !important;
}

View File

@ -1,324 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}
.syntaxhighlighter {
background-color: #1b2426 !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #1b2426 !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #1b2426 !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #323e41 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: #b9bdb6 !important;
}
.syntaxhighlighter table caption {
color: #b9bdb6 !important;
}
.syntaxhighlighter .gutter {
color: #afafaf !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #435a5f !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #435a5f !important;
color: #1b2426 !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #5ba1cf !important;
background: black !important;
border: 1px solid #435a5f !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #5ba1cf !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #5ce638 !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #435a5f !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #e0e8ff !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: #b9bdb6 !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #878a85 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #5ce638 !important;
}
.syntaxhighlighter .keyword {
color: #5ba1cf !important;
}
.syntaxhighlighter .preprocessor {
color: #435a5f !important;
}
.syntaxhighlighter .variable {
color: #ffaa3e !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #ffaa3e !important;
}
.syntaxhighlighter .constants {
color: #e0e8ff !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #5ba1cf !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: #e0e8ff !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: white !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #ffaa3e !important;
}

View File

@ -1,117 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: white !important;
}
.syntaxhighlighter .line.alt1 {
background-color: white !important;
}
.syntaxhighlighter .line.alt2 {
background-color: white !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #e0e0e0 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: black !important;
}
.syntaxhighlighter table caption {
color: black !important;
}
.syntaxhighlighter .gutter {
color: #afafaf !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #6ce26c !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #6ce26c !important;
color: white !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: blue !important;
background: white !important;
border: 1px solid #6ce26c !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: blue !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: red !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #6ce26c !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: black !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: black !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #008200 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: blue !important;
}
.syntaxhighlighter .keyword {
color: #006699 !important;
}
.syntaxhighlighter .preprocessor {
color: gray !important;
}
.syntaxhighlighter .variable {
color: #aa7700 !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #ff1493 !important;
}
.syntaxhighlighter .constants {
color: #0066cc !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #006699 !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: gray !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: red !important;
}
.syntaxhighlighter .keyword {
font-weight: bold !important;
}

View File

@ -1,120 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: #0a2b1d !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #0a2b1d !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #0a2b1d !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #233729 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: #f8f8f8 !important;
}
.syntaxhighlighter .gutter {
color: #497958 !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #41a83e !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #41a83e !important;
color: #0a2b1d !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #96dd3b !important;
background: black !important;
border: 1px solid #41a83e !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #96dd3b !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: white !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #41a83e !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #ffe862 !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: #f8f8f8 !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #336442 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #9df39f !important;
}
.syntaxhighlighter .keyword {
color: #96dd3b !important;
}
.syntaxhighlighter .preprocessor {
color: #91bb9e !important;
}
.syntaxhighlighter .variable {
color: #ffaa3e !important;
}
.syntaxhighlighter .value {
color: #f7e741 !important;
}
.syntaxhighlighter .functions {
color: #ffaa3e !important;
}
.syntaxhighlighter .constants {
color: #e0e8ff !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #96dd3b !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: #eb939a !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #91bb9e !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #edef7d !important;
}
.syntaxhighlighter .comments {
font-style: italic !important;
}
.syntaxhighlighter .keyword {
font-weight: bold !important;
}

View File

@ -1,128 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: white !important;
}
.syntaxhighlighter .line.alt1 {
background-color: white !important;
}
.syntaxhighlighter .line.alt2 {
background-color: white !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #c3defe !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: black !important;
}
.syntaxhighlighter .gutter {
color: #787878 !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #d4d0c8 !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #d4d0c8 !important;
color: white !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #3f5fbf !important;
background: white !important;
border: 1px solid #d4d0c8 !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #3f5fbf !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #aa7700 !important;
}
.syntaxhighlighter .toolbar {
color: #a0a0a0 !important;
background: #d4d0c8 !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: #a0a0a0 !important;
}
.syntaxhighlighter .toolbar a:hover {
color: red !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: black !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #3f5fbf !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #2a00ff !important;
}
.syntaxhighlighter .keyword {
color: #7f0055 !important;
}
.syntaxhighlighter .preprocessor {
color: #646464 !important;
}
.syntaxhighlighter .variable {
color: #aa7700 !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #ff1493 !important;
}
.syntaxhighlighter .constants {
color: #0066cc !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #7f0055 !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: gray !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: red !important;
}
.syntaxhighlighter .keyword {
font-weight: bold !important;
}
.syntaxhighlighter .xml .keyword {
color: #3f7f7f !important;
font-weight: normal !important;
}
.syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a {
color: #7f007f !important;
}
.syntaxhighlighter .xml .string {
font-style: italic !important;
color: #2a00ff !important;
}

View File

@ -1,113 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: black !important;
}
.syntaxhighlighter .line.alt1 {
background-color: black !important;
}
.syntaxhighlighter .line.alt2 {
background-color: black !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #2a3133 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: #d3d3d3 !important;
}
.syntaxhighlighter .gutter {
color: #d3d3d3 !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #990000 !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #990000 !important;
color: black !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #ebdb8d !important;
background: black !important;
border: 1px solid #990000 !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #ebdb8d !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #ff7d27 !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #990000 !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #9ccff4 !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: #d3d3d3 !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #ff7d27 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #ff9e7b !important;
}
.syntaxhighlighter .keyword {
color: aqua !important;
}
.syntaxhighlighter .preprocessor {
color: #aec4de !important;
}
.syntaxhighlighter .variable {
color: #ffaa3e !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #81cef9 !important;
}
.syntaxhighlighter .constants {
color: #ff9e7b !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: aqua !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: #ebdb8d !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #ff7d27 !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #aec4de !important;
}

View File

@ -1,117 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: #121212 !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #121212 !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #121212 !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #2c2c29 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: white !important;
}
.syntaxhighlighter .gutter {
color: #afafaf !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #3185b9 !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #3185b9 !important;
color: #121212 !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #3185b9 !important;
background: black !important;
border: 1px solid #3185b9 !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #3185b9 !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #d01d33 !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #3185b9 !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #96daff !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: white !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #696854 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #e3e658 !important;
}
.syntaxhighlighter .keyword {
color: #d01d33 !important;
}
.syntaxhighlighter .preprocessor {
color: #435a5f !important;
}
.syntaxhighlighter .variable {
color: #898989 !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #aaaaaa !important;
}
.syntaxhighlighter .constants {
color: #96daff !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #d01d33 !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: #ffc074 !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #4a8cdb !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #96daff !important;
}
.syntaxhighlighter .functions {
font-weight: bold !important;
}

View File

@ -1,113 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: #222222 !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #222222 !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #222222 !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #253e5a !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: lime !important;
}
.syntaxhighlighter .gutter {
color: #38566f !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #435a5f !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #435a5f !important;
color: #222222 !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #428bdd !important;
background: black !important;
border: 1px solid #435a5f !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #428bdd !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: lime !important;
}
.syntaxhighlighter .toolbar {
color: #aaaaff !important;
background: #435a5f !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: #aaaaff !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #9ccff4 !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: lime !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #428bdd !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: lime !important;
}
.syntaxhighlighter .keyword {
color: #aaaaff !important;
}
.syntaxhighlighter .preprocessor {
color: #8aa6c1 !important;
}
.syntaxhighlighter .variable {
color: aqua !important;
}
.syntaxhighlighter .value {
color: #f7e741 !important;
}
.syntaxhighlighter .functions {
color: #ff8000 !important;
}
.syntaxhighlighter .constants {
color: yellow !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #aaaaff !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: red !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: yellow !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #ffaa3e !important;
}

View File

@ -1,113 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: #0f192a !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #0f192a !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #0f192a !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #253e5a !important;
}
.syntaxhighlighter .line.highlighted.number {
color: #38566f !important;
}
.syntaxhighlighter table caption {
color: #d1edff !important;
}
.syntaxhighlighter .gutter {
color: #afafaf !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #435a5f !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #435a5f !important;
color: #0f192a !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #428bdd !important;
background: black !important;
border: 1px solid #435a5f !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #428bdd !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #1dc116 !important;
}
.syntaxhighlighter .toolbar {
color: #d1edff !important;
background: #435a5f !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: #d1edff !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #8aa6c1 !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: #d1edff !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #428bdd !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #1dc116 !important;
}
.syntaxhighlighter .keyword {
color: #b43d3d !important;
}
.syntaxhighlighter .preprocessor {
color: #8aa6c1 !important;
}
.syntaxhighlighter .variable {
color: #ffaa3e !important;
}
.syntaxhighlighter .value {
color: #f7e741 !important;
}
.syntaxhighlighter .functions {
color: #ffaa3e !important;
}
.syntaxhighlighter .constants {
color: #e0e8ff !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #b43d3d !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: #f8bb00 !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: white !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #ffaa3e !important;
}

View File

@ -1,113 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: #1b2426 !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #1b2426 !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #1b2426 !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #323e41 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: #b9bdb6 !important;
}
.syntaxhighlighter table caption {
color: #b9bdb6 !important;
}
.syntaxhighlighter .gutter {
color: #afafaf !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #435a5f !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #435a5f !important;
color: #1b2426 !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #5ba1cf !important;
background: black !important;
border: 1px solid #435a5f !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #5ba1cf !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #5ce638 !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #435a5f !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #e0e8ff !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: #b9bdb6 !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #878a85 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #5ce638 !important;
}
.syntaxhighlighter .keyword {
color: #5ba1cf !important;
}
.syntaxhighlighter .preprocessor {
color: #435a5f !important;
}
.syntaxhighlighter .variable {
color: #ffaa3e !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #ffaa3e !important;
}
.syntaxhighlighter .constants {
color: #e0e8ff !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #5ba1cf !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: #e0e8ff !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: white !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #ffaa3e !important;
}