\DocumentationManifest
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}
Synopsis
class DocumentationManifest
{
- // members
- private static boolean $automatic_registration = true;
- private static array $register_entities = ;
- protected $cache;
- protected $cacheKey;
- protected $inited;
- protected $forceRegen;
- protected array $pages = ;
- protected array $redirects = ;
- private DocumentationEntity $entity;
- private boolean $has_default_entity = false;
- private boolean $automaticallyPopulated = false;
- private ArrayList $registeredEntities;
- // methods
- public void __construct()
- public void setupEntities()
- public void getRealPath()
- public ArrayList getEntities()
- public void populateEntitiesFromInstall()
- protected void init()
- public array getPages()
- public void getRedirects()
- public DocumentationPage getPage()
- public string getRedirect()
- public void regenerate()
- protected string stripLinkBase()
- protected void addPage()
- protected void addRedirect()
- public void handleFolder()
- public void handleFile()
- public ArrayList generateBreadcrumbs()
- protected void buildUrl()
- public ArrayData getNextPage()
- public ArrayData getPreviousPage()
- public string normalizeUrl()
- public ArrayList getChildrenFor()
- public ArrayList getAllVersionsOfEntity()
- public DocumentationEntity getStableVersion()
- public ArrayList getVersions()
- public void getAllVersions()
- public boolean getHasDefaultEntity()
Members
private
- $automatic_registration — boolean
- $automaticallyPopulated — boolean
- $entity — DocumentationEntity
- $has_default_entity — boolean
- $register_entities — array
- $registeredEntities — ArrayList
protected
- $cache
- $cacheKey
- $forceRegen
- $inited
- $pages — array
- $redirects
Methods
protected
- addPage()
- addRedirect() — Add a redirect
- buildUrl() — Create a clean domain-relative URL form a docuetn URL
- init()
- stripLinkBase() — Remove the link_base from the start of a link
public
- __construct() — Constructs a new template manifest. The manifest is not actually built or loaded from cache until needed.
- generateBreadcrumbs() — Generate an {@link ArrayList} of the pages to the given page.
- getAllVersions() — Returns a sorted array of all the unique versions registered
- getAllVersionsOfEntity()
- getChildrenFor() — Return the children of the provided record path.
- getEntities()
- getHasDefaultEntity() — Gets whether there is a default entity or not
- getNextPage() — Determine the next page from the given page.
- getPage() — Returns a particular page for the requested URL.
- getPages() — Returns a map of all documentation pages.
- getPreviousPage() — Determine the previous page from the given page.
- getRealPath()
- getRedirect() — Get any redirect for the given url
- getRedirects()
- getStableVersion()
- getVersions()
- handleFile() — 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.
- handleFolder()
- normalizeUrl()
- populateEntitiesFromInstall() — Scans the current installation and picks up all the SilverStripe modules that contain a `docs` folder.
- regenerate() — Regenerates the manifest by scanning the base path.
- setupEntities() — Sets up the top level entities.