Card Card
string → string → string → Param[] → Example[] → Card
Parameters
- string name
- string description
- string category
- Param[] params
- Example[] examples
Returns
Card
Struct that holds documentation information.
See also:
Card("new","creates a new instance of the DocGen class","DocGen",[
Param("string","name","(project name)",ParamType.INPUT),
Param("string","version","(project version)",ParamType.INPUT),
Param("DocGen","","",ParamType.OUTPUT)
],[
Example(
"new DocGen("Docs4d","v0.0.1")\n"
" .withLinks(links) \n"
" .withCards(cards) \n"
" .withPages(pages) \n"
" .generate(); \n"
)
])];
Example Example
string → Example
Parameters
- string code
Returns
Example
Struct that holds example info.
Example("auto doc = new DocGen(\"Docs4d\",\"v0.0.1\")")
generate void
generates the html files
Link Link
string → string → string → Link
Parameters
- string text
- string url
- string active (leave blank if link is not the active page, otherwise use text 'active')
Returns
Link
Link("Home","home.html")
new DocGen
string → string → string → DocGen
Parameters
- string name (project name)
- string version (project version)
- string githubUrl (base url to github branch e.g. master)
Returns
DocGen
Creates a new instance of the DocGen class.
new DocGen("Docs4d","v0.0.1")
.withLinks(links)
.withCards(cards)
.withPages(pages)
.generate();
Param Param
string → string → string → ParamType → Param
Parameters
- string type
- string id
- string description
- ParamType ParamType
Returns
Param
Param("string","name","(project name)",ParamType.INPUT)
ParamType ParamType
ParamType
Parameters
Returns
ParamType
(ParamType.INPUT,ParamType.OUTPUT)
Struct that holds parameter type info for params.
See also:
Param("string","name","(project name)",ParamType.INPUT)
withCards DocGen
Card[] → DocGen
Parameters
- Card[] cards (an array of Card structs)
Returns
DocGen
auto cards = [
Card("new","Creates a new instance of the DocGen class.","DocGen",[
Param("string","name","(project name)",ParamType.INPUT),
Param("string","version","(project version)",ParamType.INPUT),
Param("DocGen","","",ParamType.OUTPUT)
],[
Example(
"new DocGen("Docs4d","v0.0.1")\n"
" .withLinks(links) \n"
" .withCards(cards) \n"
" .withPages(pages) \n"
" .generate(); \n"
)
],[Link("Card","#Card")])];
new DocGen("Docs4d","v0.0.1").withCards(cards);
withLinks DocGen
Link[] → DocGen
Parameters
- Link[] links (an array of Link structs)
Returns
DocGen
Sets the links on the top navbar.
See also:
auto links = [
Link("Home","home.html"),
Link("Documentation","#","active"),
Link("Github","https://github.com/kingsleyh/docs4d")
];
new DocGen("Docs4d","v0.0.1").withLinks(links);
withPages DocGen
Page[] → DocGen
Parameters
- Page[] pages (an array of Page structs)
Returns
DocGen
auto pages = [
Page("home.html","Home",[
Link("Home","home.html","active"),
Link("Documentation","documentation.html"),
Link("Github","https://github.com/kingsleyh/docs4d")
],"README.md")
];