[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/infrastructure/markup/ -> PhabricatorMarkupEngine.php (summary)

Manages markup engine selection, configuration, application, caching and pipelining. @{class:PhabricatorMarkupEngine} can be used to render objects which implement @{interface:PhabricatorMarkupInterface} in a batched, cache-aware way. For example, if you have a list of comments written in remarkup (and the objects implement the correct interface) you can render them by first building an engine and adding the fields with @{method:addObject}.

File Size: 606 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 23 functions

  renderOneObject()
  addObject()
  process()
  getOutput()
  getEngineMetadata()
  requireKeyProcessed()
  getMarkupFieldKey()
  loadPreprocessorCaches()
  setViewer()
  newManiphestMarkupEngine()
  newPhrictionMarkupEngine()
  newPhameMarkupEngine()
  newFeedMarkupEngine()
  newDifferentialMarkupEngine()
  newDiffusionMarkupEngine()
  getEngine()
  getMarkupEngineDefaultConfiguration()
  newMarkupEngine()
  extractPHIDsFromMentions()
  extractFilePHIDsFromEmbeddedFiles()
  summarize()
  loadCustomInlineRules()
  loadCustomBlockRules()

Functions
Functions that are not part of a class:

renderOneObject(PhabricatorMarkupInterface $object,$field,PhabricatorUser $viewer)   X-Ref
Convenience method for pushing a single object through the markup
pipeline.

param: PhabricatorMarkupInterface  The object to render.
param: string                      The field to render.
param: PhabricatorUser             User viewing the markup.
return: string                     Marked up output.

addObject(PhabricatorMarkupInterface $object, $field)   X-Ref
Queue an object for markup generation when @{method:process} is
called. You can retrieve the output later with @{method:getOutput}.

param: PhabricatorMarkupInterface  The object to render.
param: string                      The field to render.
return: this

process()   X-Ref
Process objects queued with @{method:addObject}. You can then retrieve
the output with @{method:getOutput}.

return: this

getOutput(PhabricatorMarkupInterface $object, $field)   X-Ref
Get the output of markup processing for a field queued with
@{method:addObject}. Before you can call this method, you must call
@{method:process}.

param: PhabricatorMarkupInterface  The object to retrieve.
param: string                      The field to retrieve.
return: string                     Processed output.

getEngineMetadata(PhabricatorMarkupInterface $object,$field,$metadata_key,$default = null)   X-Ref
Retrieve engine metadata for a given field.

param: PhabricatorMarkupInterface  The object to retrieve.
param: string                      The field to retrieve.
param: string                      The engine metadata field to retrieve.
param: wild                        Optional default value.

requireKeyProcessed($key)   X-Ref


getMarkupFieldKey(PhabricatorMarkupInterface $object,$field)   X-Ref


loadPreprocessorCaches(array $engines, array $objects)   X-Ref


setViewer(PhabricatorUser $viewer)   X-Ref
Set the viewing user. Used to implement object permissions.

param: PhabricatorUser The viewing user.
return: this

newManiphestMarkupEngine()   X-Ref


newPhrictionMarkupEngine()   X-Ref


newPhameMarkupEngine()   X-Ref


newFeedMarkupEngine()   X-Ref


newDifferentialMarkupEngine(array $options = array()   X-Ref


newDiffusionMarkupEngine(array $options = array()   X-Ref


getEngine($ruleset = 'default')   X-Ref


getMarkupEngineDefaultConfiguration()   X-Ref


newMarkupEngine(array $options)   X-Ref


extractPHIDsFromMentions(PhabricatorUser $viewer,array $content_blocks)   X-Ref
No description

extractFilePHIDsFromEmbeddedFiles(PhabricatorUser $viewer,array $content_blocks)   X-Ref
No description

summarize($corpus)   X-Ref
Produce a corpus summary, in a way that shortens the underlying text
without truncating it somewhere awkward.

TODO: We could do a better job of this.

param: string  Remarkup corpus to summarize.
return: string Summarized corpus.

loadCustomInlineRules()   X-Ref
No description

loadCustomBlockRules()   X-Ref
No description



Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1