How to use the @microsoft/tsdoc.DocNodeKind.PlainText function in @microsoft/tsdoc

To help you get started, we’ve selected a few @microsoft/tsdoc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / rushstack / apps / api-documenter / src / markdown / MarkdownEmitter.ts View on Github external
protected writeNode(docNode: DocNode, context: IMarkdownEmitterContext, docNodeSiblings: boolean): void {
    const writer: IndentedWriter = context.writer;

    switch (docNode.kind) {
      case DocNodeKind.PlainText: {
        const docPlainText: DocPlainText = docNode as DocPlainText;
        this.writePlainText(docPlainText.text, context);
        break;
      }
      case DocNodeKind.HtmlStartTag:
      case DocNodeKind.HtmlEndTag: {
        const docHtmlTag: DocHtmlStartTag | DocHtmlEndTag = docNode as DocHtmlStartTag | DocHtmlEndTag;
        // write the HTML element verbatim into the output
        writer.write(docHtmlTag.emitAsHtml());
        break;
      }
      case DocNodeKind.CodeSpan: {
        const docCodeSpan: DocCodeSpan = docNode as DocCodeSpan;
        if (context.insideTable) {
          writer.write('<code>');
        } else {</code>
github microsoft / rushstack / apps / api-extractor / src / aedoc / ApiDocumentation.ts View on Github external
case 'paragraph':
            case 'table':
              // Don't put a Markup.PARAGRAPH after a structural element,
              // since it is implicit.
              break;
            default:
              result.push(Markup.PARAGRAPH);
              break;
          }
        }
        const docParagraph: DocParagraph = node as DocParagraph;
        for (const childNode of DocNodeTransforms.trimSpacesInParagraph(docParagraph).nodes) {
          this._renderAsMarkupElementsInto(result, childNode, sectionName, allowStructuredContent);
        }
        break;
      case DocNodeKind.PlainText:
        const docPlainText: DocPlainText = node as DocPlainText;
        Markup.appendTextElements(result, docPlainText.text);
        break;
      case DocNodeKind.SoftBreak:
        Markup.appendTextElements(result, ' ');
        break;
      default:
        this.reportError('Unsupported TSDoc element: ' + node.kind);
    }
  }
github microsoft / rushstack / apps / api-documenter / src / nodes / CustomDocNodeKind.ts View on Github external
public static get configuration(): TSDocConfiguration {
    if (CustomDocNodes._configuration === undefined) {
      const configuration: TSDocConfiguration = new TSDocConfiguration();

      configuration.docNodeManager.registerDocNodes('@micrososft/api-documenter', [
        { docNodeKind: CustomDocNodeKind.EmphasisSpan, constructor: DocEmphasisSpan },
        { docNodeKind: CustomDocNodeKind.Heading, constructor: DocHeading },
        { docNodeKind: CustomDocNodeKind.NoteBox, constructor: DocNoteBox },
        { docNodeKind: CustomDocNodeKind.Table, constructor: DocTable },
        { docNodeKind: CustomDocNodeKind.TableCell, constructor: DocTableCell },
        { docNodeKind: CustomDocNodeKind.TableRow, constructor: DocTableRow }
      ]);

      configuration.docNodeManager.registerAllowableChildren(CustomDocNodeKind.EmphasisSpan, [
        DocNodeKind.PlainText,
        DocNodeKind.SoftBreak
      ]);

      configuration.docNodeManager.registerAllowableChildren(DocNodeKind.Section, [
        CustomDocNodeKind.Heading,
        CustomDocNodeKind.NoteBox,
        CustomDocNodeKind.Table
      ]);

      configuration.docNodeManager.registerAllowableChildren(DocNodeKind.Paragraph, [
        CustomDocNodeKind.EmphasisSpan
      ]);

      CustomDocNodes._configuration = configuration;
    }
    return CustomDocNodes._configuration;