Methods
# DefaultWrapper(props) → {React.Component}
Default Wrapper
Parameters:
Name | Type | Description |
---|---|---|
props |
Object
|
props |
- React Component
React.Component
# Documented()
Some documented component
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>
)
# 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.
- Tutorials:
-
- Tutorial: copy-code
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
void
Example
addImageCaption()
# addLineNumbers() → {void}
This script adds line numbers to all pre elements with the prettyprint class.
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.
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. |
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>
|
The HTML for the navigation sidebar.
string
# checkType(node) → {void}
Check type of node (dev only)
Parameters:
Name | Type | Description |
---|---|---|
node |
node
|
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 |
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 |
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
|
string
# getCommentAsString(member, src) → {string}
Extract comment from member jsDoc as string
Parameters:
Name | Type | Description |
---|---|---|
member |
||
src |
string
|
string
# 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 |
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. |
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. |
The HTML for the link.
# publish(taffyData, opts, tutorials)
Parameters:
Name | Type | Description |
---|---|---|
taffyData |
TAFFY
|
See http://taffydb.com/. |
opts |
object
|
|
tutorials |
Tutorial
|
# 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 |
- 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.
Example
// Assuming there are HTML elements with 'lang-mermaid' class and valid mermaid definitions.
renderMermaidLangs();
# search(input, targets) → {void}
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
void
Example
search(input, targets)
# sidebarIsVisible(show) → {void}
Toggles the sidebar
Parameters:
Name | Type | Description |
---|---|---|
show |
boolean
|
Whether to show or hide the sidebar |
void
Example
toggleSidebar(true)
toggleSidebar(false)
Type Definitions
string
|
number
|
'Specific string'
|
SomeOtherType
# SomeCombinedType
Example of union type definition
string
|
number
|
'Specific string'
|
SomeOtherType
# SomeCombinedType
Example of union type definition
T
|
SomeOtherGenericType.<T>
|
object
# SomeGenericType
Example of generic type definition with T as parameter
Properties:
Name | Type | Description |
---|---|---|
property |
T
|
|
other |
string
|
T
|
SomeOtherGenericType.<T>
|
object
# SomeGenericType
Example of generic type definition with T as parameter
Properties:
Name | Type | Description |
---|---|---|
property |
T
|
|
other |
string
|
object
# SomeOtherGenericType
Example of generic type definition with T as parameter
Properties:
Name | Type | Description |
---|---|---|
children |
Array
|
object
# SomeOtherGenericType
Example of generic type definition with T as parameter
Properties:
Name | Type | Description |
---|---|---|
children |
Array
|