Global

Methods

# DefaultWrapper(props) → {React.Component}

Default Wrapper

Parameters:
Name Type Description
props Object

props

View Source src/component-renderer.jsx, line 9

  • React Component
React.Component

# Documented()

Some documented component

View Source fixtures/test/component.jsx, line 31

Examples

Default example

const text = 'Meva'
return (
  <Documented2>
    <Documented text={text} />
  </Documented2>
)

Ala ma kota

const text = 'some example text 2'
return (
  <Documented2>
    <Documented text={text} header={'sime'} />
  </Documented2>
)

# Test()

Some documented component

View Source fixtures/component.jsx, line 18

Example
<Test size=‘4’/>

# addCopyButton() → {void}

This script adds a copy button to all pre elements with the prettyprint class. When the button is clicked, the code content will be copied to the clipboard.

Author:
  • Sherif Butt
Tutorials:
  • Tutorial: copy-code

View Source static/scripts/copycode.js, line 1

void
Example
addCopyButton()

# addImageCaption() → {void}

This script will add a caption to each image in the content The caption will be the alt text of the image The caption will be styled with CSS to appear below the image and centered with a gray background and white text.

Tutorials:
  • Tutorial: add-image-caption
To Do:
  • Add a caption to each image in the content

View Source static/scripts/img-alt-caption.js, line 1

void
Example
addImageCaption()

# addLineNumbers() → {void}

This script adds line numbers to all pre elements with the prettyprint class.

View Source static/scripts/linenumber.js, line 2

void
Example
addLineNumbers()

# addMermaidCaption() → {void}

This function adds a 'DOMContentLoaded' event listener to the window which finds all SVG elements within the '.content' class once the DOM is fully loaded. For each SVG, it retrieves the 'data-figcaption' attribute, creates a new 'div' element with the caption, and inserts this 'div' after the SVG element in the DOM.

View Source static/scripts/img-alt-caption.js, line 64

void
Example
// Assume the HTML structure is:
// <div class="content">
//   <svg data-figcaption="This is a test">...</svg>
// </div>

// After the function executes, the HTML structure will become:
// <div class="content">
//   <svg data-figcaption="This is a test">...</svg>
//   <div class="fig-caption"><b>Diagram 1 -</b> This is a test</div>
// </div>

# buildGroupNav(members, title) → {String}

Create a link to a tutorial.

Parameters:
Name Type Description
members Object

The members that will be used to create the sidebar.

classes array.<object>

The classes that will be used to create the sidebar.

components array.<object>

The components that will be used to create the sidebar.

externals array.<object>

The externals that will be used to create the sidebar.

globals array.<object>

The globals that will be used to create the sidebar.

mixins array.<object>

The mixins that will be used to create the sidebar.

modules array.<object>

The modules that will be used to create the sidebar.

namespaces array.<object>

The namespaces that will be used to create the sidebar.

tutorials array.<object>

The tutorials that will be used to create the sidebar.

events array.<object>

The events that will be used to create the sidebar.

interfaces array.<object>

The interfaces that will be used to create the sidebar.

title Object

The title of the sidebar.

View Source publish.js, line 437

The HTML for the navigation sidebar.

String
Example
buildGroupNav(members, title)

# buildNav(members) → {string}

Create the navigation sidebar.

Parameters:
Name Type Description
members object

The members that will be used to create the sidebar.

classes array.<object>
components array.<object>
externals array.<object>
globals array.<object>
mixins array.<object>
modules array.<object>
namespaces array.<object>
tutorials array.<object>
events array.<object>
interfaces array.<object>

View Source publish.js, line 493

The HTML for the navigation sidebar.

string

# checkType(node) → {void}

Check type of node (dev only)

Parameters:
Name Type Description
node node

View Source typescript/type-converter.js, line 58

Console log predicted types

void

# convertMembers(jsDocopt, wrapper, src, parentName) → {string}

Convert type properties to @property

Parameters:
Name Type Attributes Description
jsDoc string <optional>

existing jsdoc text where all @param comments should be appended

wrapper ts.TypeNode

ts node which has to be parsed

src string

source for an entire parsed file (we are fetching substrings from it)

parentName string

name of a parent element

View Source typescript/type-converter.js, line 136

modified jsDoc comment with appended @param tags

string

# convertParams(jsDocopt, wrapper, src, parentName) → {string}

converts function parameters to @params

Parameters:
Name Type Attributes Description
jsDoc string <optional>

existing jsdoc text where all @param comments should be appended

wrapper ts.FunctionDeclaration

ts node which has to be parsed

src string

source for an entire parsed file (we are fetching substrings from it)

parentName string

name of a parent element - NOT IMPLEMENTED YET

View Source typescript/type-converter.js, line 113

modified jsDoc comment with appended @param tags

string

# fillMethodComment(comment, member, src) → {string}

Fill missing method declaration

Parameters:
Name Type Description
comment string
member
src string

View Source typescript/type-converter.js, line 86

string

# getCommentAsString(member, src) → {string}

Extract comment from member jsDoc as string

Parameters:
Name Type Description
member
src string

View Source typescript/type-converter.js, line 185

string

# getName()

Fetches name from a node.

View Source typescript/type-converter.js, line 44

# getTypeName(type, src) → {string}

Get type from a node

Parameters:
Name Type Description
type ts.TypeNode

which should be parsed to string

src string

source for an entire parsed file

View Source typescript/type-converter.js, line 14

node type

string

# linktoExternal(longName, name)

Create a link to an external.

Parameters:
Name Type Description
longName Stirng

The long name of the external.

name String

The name of the external.

View Source publish.js, line 408

The HTML for the link.

# linktoTutorial(longName, name)

Create a link to a tutorial.

Parameters:
Name Type Description
longName String

The long name of the tutorial.

name String

The name of the tutorial.

View Source publish.js, line 398

The HTML for the link.

# publish(taffyData, opts, tutorials)

Parameters:
Name Type Description
taffyData TAFFY

See http://taffydb.com/.

opts object
tutorials Tutorial

View Source publish.js, line 533

# renderComponent(code) → {VueComponent}

This is a wrapper component for Vue.js It renders the code in the editor and displays the result in the preview window It also provides a button to toggle the editor

Parameters:
Name Type Description
code string

the code to be rendered

View Source src/vue-wrapper.js, line 4

  • the rendered component
VueComponent
Example
<vue-wrapper :default-code="code"></vue-wrapper>

# renderMermaidLangs()

Transforms mermaid diagrams written in markdown into interactive diagrams. Iterates through all HTML elements with the 'lang-mermaid' class, gets their content, and renders it into a diagram using the mermaid API. Replaces the original markdown element with the newly created diagram.

View Source static/scripts/jsdoc-mermaid.js, line 1

Example
// Assuming there are HTML elements with 'lang-mermaid' class and valid mermaid definitions.
renderMermaidLangs();

Search function

Parameters:
Name Type Description
input string

The input element

targets string

The targets to search in

Tutorials:
  • Tutorial: search
To Do:
  • Add a search function

View Source static/scripts/search.js, line 1

void
Example
search(input, targets)

# sidebarIsVisible(show) → {void}

Toggles the sidebar

Parameters:
Name Type Description
show boolean

Whether to show or hide the sidebar

View Source scripts/hamburger.js, line 11

void
Example
toggleSidebar(true)
toggleSidebar(false)

Type Definitions

string | number | 'Specific string' | SomeOtherType

# SomeCombinedType

Example of union type definition

View Source fixtures/typescript/type.ts, line 3

string | number | 'Specific string' | SomeOtherType

# SomeCombinedType

Example of union type definition

View Source fixtures/typescript/type.ts, line 3

T | SomeOtherGenericType.<T> | object

# SomeGenericType

Example of generic type definition with T as parameter

Properties:
Name Type Description
property T
other string

View Source fixtures/typescript/type.ts, line 11

T | SomeOtherGenericType.<T> | object

# SomeGenericType

Example of generic type definition with T as parameter

Properties:
Name Type Description
property T
other string

View Source fixtures/typescript/type.ts, line 11

object

# SomeOtherGenericType

Example of generic type definition with T as parameter

Properties:
Name Type Description
children Array

View Source fixtures/typescript/type.ts, line 17

object

# SomeOtherGenericType

Example of generic type definition with T as parameter

Properties:
Name Type Description
children Array

View Source fixtures/typescript/type.ts, line 17

boolean

# SomeOtherType

Example of simple type definition

View Source fixtures/typescript/type.ts, line 7

boolean

# SomeOtherType

Example of simple type definition

View Source fixtures/typescript/type.ts, line 7