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

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

Struct that holds parameter info.

See also:
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

Specifies the documentation for each item.

See also:
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);                             

withPages DocGen

Page[] → DocGen
Parameters
  • Page[] pages (an array of Page structs)
Returns DocGen

Specifies additional pages.

See also:
auto pages = [                                               
  Page("home.html","Home",[                              
    Link("Home","home.html","active"),                 
    Link("Documentation","documentation.html"),          
    Link("Github","https://github.com/kingsleyh/docs4d") 
    ],"README.md")                                         
];