\DocumentationViewer
Documentation Viewer.
Reads the bundled markdown files from documentation folders and displays the
output (either via markdown or plain text).
For more documentation on how to use this class see the documentation in the
docs folder.
Synopsis
class DocumentationViewer
extends Controller
implements
PermissionProvider
{
- // members
- private static array $extensions = ;
- private static string $google_analytics_code = '';
- private static string $documentation_title = 'SilverStripe Documentation';
- private static array $allowed_actions = ;
- protected string $entity = '';
- protected DocumentationPage $record;
- protected DocumentationManifest $manifest;
- private static string $link_base = 'dev/docs/';
- private static string|array $check_permission = 'CMS_VIEW_DEVDOCS';
- private static array $edit_links = ;
- private static bool $apply_default_theme = true;
- // methods
- public void init()
- public array providePermissions()
- public bool canView()
- public void hasAction()
- public void checkAccessAction()
- public SS_HTTPResponse handleAction()
- public SS_HTTPResponse httpError()
- public DocumentationManifest getManifest()
- public string getLanguage()
- public DataObject getMenu()
- public HTMLText getContent()
- public void replaceChildrenCalls()
- public void includeChildren()
- public ArrayList getChildren()
- public ArrayList getBreadcrumbs()
- public DocumentationPage getPage()
- public DocumentationEntity getEntity()
- public ArrayList getVersions()
- public string getTitle()
- public string AbsoluteLink()
- public string Link()
- public string getCanonicalUrl()
- public GroupedList AllPages()
- public GroupedList getAllVersionPages()
- public Form DocumentationSearchForm()
- public static void set_edit_link()
- public string|false getEditLink()
- public DocumentationPage|null getNextPage()
- public DocumentationPage|null getPreviousPage()
- public string|void getGoogleAnalyticsCode()
- public string getDocumentationTitle()
- public string getDocumentationBaseHref()
- public boolean getHasDefaultEntity()
- public string getRequestedVersion()
- public string getDocumentationIndexLink()
Hierarchy
Extends
- Controller
Implements
- PermissionProvider
Members
private
- $allowed_actions — array
- $apply_default_theme
—
bool
Determines whether css and js files are injected into the document. - $check_permission — string|array
- $documentation_title — string
- $edit_links — array
- $extensions — array
- $google_analytics_code — string
- $link_base — string
protected
- $entity
—
string
The string name of the currently accessed {@link DocumentationEntity} object. To access the entire object use {@link getEntity()} - $manifest — DocumentationManifest
- $record — DocumentationPage
Methods
public
- AbsoluteLink()
- AllPages() — Generate a list of all the pages in the documentation grouped by the first letter of the page.
- DocumentationSearchForm() — Documentation Search Form. Allows filtering of the results by many entities and multiple versions.
- Link() — Return the base link to this documentation location.
- canView() — Can the user view this documentation. Hides all functionality for private wikis.
- checkAccessAction()
- getAllVersionPages() — Return all Pages that apply to the current version (from the route)
- getBreadcrumbs() — Generate a list of breadcrumbs for the user.
- getCanonicalUrl() — Return the canonical URL from the page
- getChildren()
- getContent() — Return the content for the page. If its an actual documentation page then display the content from the page, otherwise display the contents from the index.md file if its a folder
- getDocumentationBaseHref()
- getDocumentationIndexLink() — Gets the link to the "documentation index" containing the currently requested version
- getDocumentationTitle()
- getEditLink() — Returns an edit link to the current page (optional).
- getEntity()
- getGoogleAnalyticsCode()
- getHasDefaultEntity() — Gets whether there is a default entity or not
- getLanguage()
- getManifest()
- getMenu() — Generate a list of {@link Documentation } which have been registered and which can be documented.
- getNextPage() — Returns the next page. Either retrieves the sibling of the current page or return the next sibling of the parent page.
- getPage()
- getPreviousPage() — Returns the previous page. Either returns the previous sibling or the parent of this page
- getRequestedVersion() — Gets the requested version from the URL
- getTitle() — Generate a string for the title tag in the URL.
- getVersions()
- handleAction() — Overloaded to avoid "action doesn't exist" errors - all URL parts in this controller are virtual and handled through handleRequest(), not controller methods.
- hasAction()
- httpError()
- includeChildren() — Short code parser
- init()
- providePermissions() — Permission provider to allow more control over who can view docs
- replaceChildrenCalls()
- set_edit_link() — Sets the mapping between a entity name and the link for the end user to jump into editing the documentation.