瀏覽代碼

Add more documentation.

Ian Rose 7 年之前
父節點
當前提交
0113ba1ab7

+ 6 - 0
packages/rendermime-interfaces/src/index.ts

@@ -326,6 +326,12 @@ namespace IRenderMime {
      *
      * @param element - the DOM element to typeset. The typesetting may
      *   happen synchronously or asynchronously.
+     *
+     * #### Notes
+     * The application-wide rendermime object has a settable
+     * `latexTypesetter` property which is used wherever LaTeX
+     * typesetting is required. Extensions wishing to provide their
+     * own typesetter may replace that on the global `lab.rendermime`.
      */
     typeset(element: HTMLElement): void;
   }

+ 5 - 0
packages/rendermime/src/latex.ts

@@ -30,6 +30,11 @@ export
 class MathJaxTypesetter implements IRenderMime.ILatexTypesetter {
   /**
    * Typeset the math in a node.
+   *
+   * #### Notes
+   * MathJax schedules the typesetting asynchronously,
+   * but there are not currently any callbacks or Promises
+   * firing when it is done.
    */
   typeset(node: HTMLElement): void {
     if (!this._initialized) {

+ 4 - 0
packages/rendermime/src/rendermime.ts

@@ -80,6 +80,10 @@ class RenderMime {
 
   /**
    * The LaTeX typesetter for the rendermime.
+   *
+   * #### Notes
+   * This is settable so that extension authors may provide
+   * alternative implementations of the `IRenderMime.ILatexTypesetter`.
    */
   get latexTypesetter(): IRenderMime.ILatexTypesetter {
     return this._latexTypesetter;