dojox/highlight/_base.js

  • Provides:

    • dojox.highlight._base
  • dojox.highlight

    • type
      Object
    • summary
      Syntax highlighting with language auto-detection package
    • description
      Syntax highlighting with language auto-detection package.
      Released under CLA by the Dojo Toolkit, original BSD release
      available from: http://softwaremaniacs.org/soft/highlight/
  • C_NUMBER_RE

    • summary
  • dh.constants

    • summary
  • mode.keywordGroups

    • summary
  • environment

    • summary
  • container.innerHTML

    • summary
  • node.className

    • summary
  • node.innerHTML

    • summary
  • relevance

    • summary
  • relevanceMax

    • summary
  • dh.Code

    • summary
  • dojox.highlight.processString

    • type
      Function
    • parameters:
      • str: (typeof String)
      • lang: (typeof String)
    • source: [view]
        return lang ? highlightStringLanguage(lang, str) : highlightStringAuto(str);
    • summary
      highlight a string of text
    • return_summary
      Object containing:
      result - string of html with spans to apply formatting
      partialResult - if the formating failed: string of html
      up to the point of the failure, otherwise: undefined
      langName - the language used to do the formatting
  • dojox.highlight.init

    • type
      Function
    • parameters:
      • node: (typeof String|DomNode)
    • source: [view]
        node = dojo.byId(node);
        if(dojo.hasClass(node, "no-highlight")){ return; }
        if(!verifyText(node)){ return; }

       
        var classes = node.className.split(/\s+/),
         flag = dojo.some(classes, function(className){
          if(className.charAt(0) != "_" && dh.languages[className]){
           highlightLanguage(node, className);
           return true; // stop iterations
          }
          return false; // continue iterations
         });
        if(!flag){
         highlightAuto(node);
        }
    • summary
      Highlight a passed node
    • description
      Syntax highlight a passed DomNode or String ID of a DomNode
    • returns
      stop iterations|continue iterations
    • example
      
      	dojox.highlight.init("someId");
  • dojox.highlight.Code

    • type
      Function
    • parameters:
      • props: (typeof Object)
        Unused. Pass 'null' or {}. Positional usage to allow `dojo.parser` to instantiate
        this class as other Widgets would be.
      • node: (typeof String|DomNode)
        A String ID or DomNode reference to use as the root node of this instance.
    • source: [view]
        this.node = dojo.byId(node);
    • summary
      A Class object to allow for dojoType usage with the highlight engine. This is
      NOT a Widget in the conventional sense, and does not have any member functions for
      the instance. This is provided as a convenience. You likely should be calling
      `dojox.highlight.init` directly.
    • example
      
      	<pre><code dojoType="dojox.highlight.Code">for(var i in obj){ ... }</code></pre>
    • example
      
      	var inst = new dojox.highlight.Code({}, "someId");
  • dojox.highlight.Code.node

    • type
      String|DomNode
    • summary
      A String ID or DomNode reference to use as the root node of this instance.
  • dojox.highlight._base

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary