├── LICENSE ├── README.md ├── _config.yml ├── assets └── dox_title.png ├── dox ├── .doxignoreA ├── .doxignoreallA ├── atom.lua ├── base64.lua ├── css.lua ├── dox.lua ├── doxnew.lua ├── html.lua ├── parse.lua ├── pulsar.lua ├── settings.lua ├── theme.lua └── util.lua ├── favicon_io ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico └── site.webmanifest └── help ├── dox └── welcome.html ├── index.html ├── modules ├── dox.base64.html ├── dox.css.html ├── dox.html ├── dox.html.html ├── dox.parse.html ├── dox.theme.html └── dox.util.html └── style.css /README.md: -------------------------------------------------------------------------------- 1 | # DOX HAS BEEN REWRITTEN AND MOVED 2 | --- 3 | ### LuaEx's new class system has allowed me to rewrite Dox from scratch making it more versatile, powerful and, modular. 4 | ### Dox has been rewritten and integrated into LuaEx. 5 | --- 6 | ### You can now find Dox at the [LuaEx repository](https://github.com/CentauriSoldier/LuaEx). 7 | ### This page will remain here as a guidepost to the new Dox. 8 | #### Note: this version is hereby archived. 9 | 10 | --- 11 | ![DOX](assets/dox_title.png) 12 | 13 | ## 🆆🅷🅰🆃 🅸🆂 🅳🅾🆇❓ 🔬 14 | Dox is a lua documentation generator script. 15 | 16 | ## 🆁🅴🆂🅾🆄🆁🅲🅴🆂 17 | - Logo: https://cooltext.com/ 18 | - Special ASCII Fonts: https://fsymbols.com/generators/carty/ 19 | 20 | ## 🆅🅴🆁🆂🅸🅾🅽 ⚗ 21 | 22 | #### Alpha v0.6 23 |
24 | See Changes 25 | 26 | ### 🇨​​​​​🇭​​​​​🇦​​​​​🇳​​​​​🇬​​​​​🇪​​​​​🇱​​​​​🇴​​​​​🇬​​​​​ 27 | 28 | **v0.6** 29 | - Feature: TODO update this changelog 30 |
31 | 32 | ## 🅿🅻🅰🅽🅽🅴🅳 🅵🅴🅰🆃🆄🆁🅴🆂 33 | - [ ] Add dox core function snippets to the Atom snippets file (if not already present) when writing to the Atom snippets file. 34 | - [ ] Add dox function and module comment snippets to the Atom snippets file (if not already present) when writing to the Atom snippets file. 35 | - [ ] Use Bootstrap for CSS. 36 | 37 | ## 🅻🅸🅲🅴🅽🆂🅴 © 38 | 39 | All code is placed in the public domain under [The Unlicense](https://opensource.org/licenses/unlicense "The Unlicense") *(except where otherwise noted)*. 40 | 41 | ## 🅵🅰🆀🆂 42 | * *Can I use my own css?* 43 | * Currently, no. But, if there are enough requests for this feature, I'll add it in the future. 44 | * *Is Dox cross-platform?* 45 | * So far, Dox is tested and working on Linux and Windows. 46 | * *How do I use Dox?* 47 | * View the readme file for that info. 48 | * *Do you plan to create autocomplete scripts for other editors/IDEs?* 49 | * Not at this time; however, enough interest in a specific IDE/editor may change my mind. 50 | 51 | ## 🆂🅴🆃🆄🅿 52 | 1. Download the **dox** folder from this repository and place it in your project. 53 | 2. Require the dox module. 54 | ```lua 55 | require('dox.dox'); 56 | ``` 57 | 58 | ## 🅷🅾🆆 🆃🅾 🅲🅾🅼🅼🅴🅽🆃 🆈🅾🆄🆁 🅲🅾🅳🅴 59 | Commenting functions and modules is very straight-forward and simple. Below is a comprehensive overview of the process. 60 | 61 | ## 🇫​​​​​🇺​​​​​🇳​​​​​🇨​​​​​🇹​​​​​🇮​​​​​🇴​​​​​🇳​​​​​ 🇧​​​​​🇱​​​​​🇴​​​​​🇨​​​​​🇰​​​​​ 62 | This is the primary element of Dox that makes it work. In fact, without at least one function info block, Dox will not process the target module since there would be no information to process. 63 | 64 | The function info block is wrapped in a multi-line lua comment whose start tag is ***--[[!*** and end tag is ***!]]***. 65 | 66 | #### Block Tags 67 | Elements inside the function info block are designated by an ***@*** symbol directly followed by the desired tag and tag information. 68 | 69 | Below is a list of currently usable tags *(as well as acceptable abbreviations)* for this block as well as their formatting and usage details. Following the description of each tag is an indicator of whether it is required or optional. 70 | 71 | *Note: tags are **not** case sensitive.* 72 | 73 | - **description** *(**des**, **desc**)* This informs the reader what your function does. *(**optional**)* 74 | - **example** *(**ex**, **examples**)* Code to help the reader understand how it works. *(**optional**)* 75 | - **function** *(**fun**, **func**)* The name of the function *(**required**)* 76 | - **module** *(**mod**)* To which module this function belongs. *(**optional**)* 77 | - **parameter** *(**param**)* *See description below* *(**optional**)* 78 | - **return** *(**ret**)* *See description below* *(**optional**)* 79 | - **scope** Whether global or local. 80 | - **usage** How the function is intended to be used, it's features, limitations, etc. 81 | - #### Special Tags 82 | > The **return** and **parameter** tags behave a little differently than the other tags in that they accept up to three input sections delimited by a space. 83 | 84 | - The **Parameter** tag. 85 | - First is the descriptive name *(**required**)*, then the type input *(**required**)* and a description of the input value *(**optional**)*. 86 | 87 | - ##### Example usage of a parameter tag. 88 | 89 | ```lua 90 | @param pInputFile string The path to the file dox reads. 91 | ``` 92 | 93 | - The **Return** tag. 94 | - First is the descriptive name *(**required**)*, then the type returned *(**required**)* and a description of the returned value *(**optional**)*. 95 | 96 | - ##### Example usage of a return tag. 97 | 98 | ```lua 99 | @ret sPath string The local path from which dox is run. 100 | ``` 101 | 102 | *** 103 | # THIS SECTION IN-PROGRESS 104 | ## 🇲​​​​​🇴​​​​​🇩​​​​​🇺​​​​​🇱​​​​​🇪​​​​​ 🇧​​​​​🇱​​​​​🇴​​​​​🇨​​​​​🇰​​​​​ 105 | The module information is wrapped in a multiline lua comment whose start tag is ***--[[**** and end tag is ****]]***. The content of this block is displayed at the top of the module page within an accordion menu on the left of the page. 106 | - Note on module block requirements: 107 | > *Unlike (at least one) function block, the module block is **not required**. Dox will function just fine with or without the module block; you may omit the entire thing if you wish. Additionally, if you do choose to use the module block, only one of the tags (listed below) is required: the 'module' tag is required if using the module block although you may use none, one, some or all of the other tags* 108 | 109 | Like the function block, the module block has no tags that are sensitive to spaces and new lines. This feature makes it very easy to use html within your module block. As you can see, you're reading text right now that has been formatted within the comment block of the dox.lua file. 110 | 111 | Within the block are tags. These tags start and end just like html tags do, with as the start tag and as the end tag where tagname is the name of the tag. Below is a complete list of supported tags. The tags are not case sensitive. 112 | 113 | * authors 114 | * copyright 115 | * dependencies 116 | * description 117 | * features 118 | * email 119 | * license 120 | * moduleid *required tag* 121 | * plannedfeatures 122 | * todo 123 | * usage 124 | * version 125 | * versionhistory 126 | * website 127 | 128 | #### The moduleid Tag 129 | 130 | You may enter one to many items for the 'moduleid' tag. For example, if your module name is myClass then you'd enter it exactly as the class name since the 'moduleid' tag is case sensitive.; however, you can control how it's displayed at the top of the page. To include a display name, simply use a pipe (|) and type the display name next like this: 131 | ```lua 132 | @moduleid myClass|MyClass 133 | ``` 134 | If you have sub modules such as myClass.otherStuff and you'd like the module block for myClass to display on the myClass.otherStuff page, use a comma to indicate another module and simlpy add it the 'moduleid' tag like so: 135 | ```lua 136 | @moduleid myClass|MyClass,myClass.otherStuff 137 | ``` 138 | And if you'd like a different display name for that module too, just add it in: 139 | ```lua 140 | @moduleid myClass|MyClass,myClass.otherStuff|MyClass.otherStuff 141 | ``` 142 | It's that easy. 143 | 144 | ### Tag Content 145 | Tag text can be plain text and/or html. 146 | 147 | #### Special Characters 148 | 149 | The '@' symbol cannot be used in your text without escaping it since it is a special character that tells Dox where to start a line; however, you can escape it in your text using a backslash (\\) and the '@' will be put there by Dox when processing is complete. 150 | 151 | Additionaly, any text inside free-format items (like authors, website, description, etc. as opposed to items like param, function, etc. that are more restricted) is treated like html including any html tags you may want to use. Of course, this means that you'll need to escape the '<' and '>' symbols in your text if you want them to be presented as-is. 152 | 153 | Below is a complete list of special characters that need to be escaped in order to be displayed as themselves. 154 | 155 | @ 156 | > 157 | < 158 | 159 | ### Give Me Space! 160 | Each tag **must** have a space after it before your text starts. Failing to provide a space will give unpredictable results. 161 | 162 | ## Example Usage 163 | 164 | ### Comment a Function or Two 165 | ```lua 166 | --[[! 167 | @module dox 168 | @func import 169 | @scope local 170 | @desc A version of the 'require()' function that uses the local path. Used to require the other local modules the 'dox.lua' file needs. 171 | !]] 172 | ``` 173 | ### Comment Your Module(s) if You Want *(NOT REQUIRED)* 174 | ```lua 175 | --[[* 176 | @authors Centauri Soldier 177 | @copyright Copyright © 2022 Centauri Soldier 178 | @description 179 |

Dox

180 |

The Simple Lua Documentation Generator

181 |

Dox is a light-weight script designed to parse crafted lua comments regarding modules and functions and output them to readable, sorted and linked HTML. Dox enables you to quickly and simply create documentation for your lua code without the need to install programs or to run anything other than the Dox script. In fact, it's so simple, you can have documentation in as few as 2 lines of code.

182 | @license

The MIT License (MIT)
183 |
184 | Copyright (c) 2016 Centauri Soldier
185 |
186 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
187 |
188 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
189 |
190 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 191 |

192 | @moduleid dox|Dox,dox.base64|Dox.Base64,dox.css|Dox.CSS,dox.html|Dox.HTML,dox.theme|Dox.Theme,dox.parse|Dox.Parse,dox.util|Dox.Util 193 | @version 0.0.7 194 | @versionhistory 195 | 202 | @website https://github.com/CentauriSoldier/Dox 203 | *]] 204 | ``` 205 | ### Generate Your Documentation 206 | Dox is very easy to use. Once you've commented your code appropriately, all you need are your scripts and an empty directory where Dox can output the html files. 207 | 208 | #### Note: 209 | Dox will ***NOT*** create directories. Be sure the output directory exists or Dox will (silently) fail to output any files. 210 | 211 | ```lua 212 | dox.processDir(sPathToMyLuaFiles, sPathToTheOutputDirectory); 213 | ``` 214 | #### That's it! 215 | Tada, you've got documentation! 216 | 217 | ## Atom Snippets 218 | If you're using the [Atom](https://atom.io/) text editor, you can tell dox to non-destructively generate snippets for it (snippets allow user-created auto-complete in the Atom text editor). 219 | All you need to do (after you generate your documentation with the dox.ProcessDir() (or dox.ProcessFile()) funcion) is call the dox.atom.writeSnippets() function. 220 | 221 | Dox will even keep separate sections for your various code projects to prevent overwriting other text in the snippets file. It does this by using section names. In addition to keeping separate sections secure from overwrite, Dox also preserves the non-dox snippet code in the file by non-destructively writing it's snippets at the end of the file thus allowing you to retain the ability to manually write snippets that have nothing to do with dox. 222 | 223 | ```lua 224 | dox.atom.writeSnippets(sPathToMyAtomSnippetsFile, sSnippetSectionName) 225 | ``` 226 | 227 | ## Credits 228 | Nifty background image by [Vecteezy](https://www.vecteezy.com/free-vector/space) 229 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-hacker -------------------------------------------------------------------------------- /assets/dox_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentauriSoldier/Dox/efb46913f905cdcba503c137fb164a02841d2173/assets/dox_title.png -------------------------------------------------------------------------------- /dox/.doxignoreA: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentauriSoldier/Dox/efb46913f905cdcba503c137fb164a02841d2173/dox/.doxignoreA -------------------------------------------------------------------------------- /dox/.doxignoreallA: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentauriSoldier/Dox/efb46913f905cdcba503c137fb164a02841d2173/dox/.doxignoreallA -------------------------------------------------------------------------------- /dox/atom.lua: -------------------------------------------------------------------------------- 1 | dox.atom = {}; 2 | 3 | --[[! 4 | @module dox.atom 5 | @func dox.atom.writeSnippets 6 | @scope global 7 | @desc Writes Atom snippets to the snippets file provided based on the lua files which were processed for documentation. 8 | @param pAtomSnippetsFile string The full path to the atom snippets file. If it does not exist, it will be created. 9 | @param sSnippetSection string The section name for the snippets. Having sections allows for mutiple calls to write to the same file without overwrites. 10 | !]] 11 | --TODO account for json or cson. Right now, only cson is supported. 12 | --TODO check for auto-file creation. If this doesn't happen, make it happen. 13 | function dox.atom.writeSnippets(pAtomSnippetsFile, sSnippetSection) 14 | 15 | --try to process atom snippets 16 | if (type(pAtomSnippetsFile) == "string" and 17 | type(sSnippetSection) == "string" and 18 | sSnippetSection:gsub("%s", '') ~= "") then 19 | --snippet section names are NOT case sensitive 20 | local sSection = sSnippetSection:upper(); 21 | 22 | --open the snippets file 23 | local hSnippets = io.open(pAtomSnippetsFile, "r"); 24 | 25 | --process the snippets if the file exists 26 | if (hSnippets) then 27 | local tModules = dox.Modules; 28 | --this has the process order for the modules 29 | local tMeta = getmetatable(tModules); 30 | 31 | --read the snippets file 32 | local sSnippetsFile = hSnippets:read("*all"); 33 | --declare and preconfigure required variables 34 | local sPreAppend = sSnippetsFile; 35 | local sAppend = ""; --this is the actual snippet code 36 | local sPostAppend = ""; 37 | local sSectionOpenTag = dox.Markers.Snippet.Start..sSection; 38 | local sSectionCloseTag = dox.Markers.Snippet.End..sSection; 39 | local sSourceLuaPrefix = "'.source.lua':"; 40 | 41 | for sLine in hSnippets:lines() do 42 | 43 | --TODO get the number of indentations that the code blocks should use based on the source:lua line's indentations 44 | if (sLine:gsub('%s', '') == "'.source.lua':") then 45 | sSourceLuaPrefix = ""; 46 | end 47 | 48 | end 49 | 50 | --look for the section 51 | local nSectionOpenTagStart, nSectionOpenTagEnd = sSnippetsFile:find(sSectionOpenTag, 1, true); 52 | 53 | --if the section already exists, prepair to overwrite it 54 | if (nSectionOpenTagStart ~= nil and nSectionOpenTagEnd ~= nil) then 55 | local nSectionCloseTagStart, nSectionCloseTagEnd = sSnippetsFile:find(sSectionCloseTag, nSectionOpenTagEnd + 1, true); 56 | 57 | if (nSectionCloseTagStart ~= nil and nSectionCloseTagEnd ~= nil) then 58 | sPreAppend = sSnippetsFile:sub(1, nSectionOpenTagStart - 1); 59 | sPostAppend = sSnippetsFile:sub(nSectionCloseTagEnd + 1); 60 | end 61 | 62 | end 63 | 64 | --close the file for reading 65 | hSnippets:close(); 66 | 67 | for nIndex, sModule in pairs(tMeta.ProcessOrder) do 68 | local tModule = tModules[sModule]; 69 | 70 | for _, nBlockID in pairs(tModule.ProcessOrder) do 71 | local tBlock = tModule.Blocks[nBlockID]; 72 | local sSnippet = "\n '"..tBlock.Function.."':"; 73 | local sParameters = ""; 74 | local sParamterDescriptions = ""; 75 | 76 | --get the function's parameters (if present) 77 | local nMaxParameters = #tBlock.Parameters; 78 | 79 | for nParamIndex, sLine in pairs(tBlock.Parameters) do 80 | 81 | if sLine:gsub("%s", ' ') ~= "" then 82 | local sComma = ", "; 83 | 84 | --add this paramter (in its entirety) to the descriptions section 85 | sParamterDescriptions = sParamterDescriptions.."\n arg# "..tostring(nParamIndex)..": "..sLine; 86 | 87 | --remove the comma if not needed 88 | if (nParamIndex == 1) then 89 | sComma = ""; 90 | end 91 | 92 | --TODO redo all these to use ANY space character(%s) rather than only a specific space character 93 | local nTypeStart, nTypeEnd = sLine:find(" ", 1, true); 94 | 95 | if (nTypeStart ~= nil and nTypeEnd ~= nil) then 96 | sParameters = sParameters..sComma..sLine:sub(1, nTypeStart - 1); 97 | end 98 | 99 | end 100 | 101 | end 102 | 103 | --note if the scope is local 104 | local sScope = ""; 105 | 106 | if (tBlock.Scope:lower() == "local") then 107 | sScope = "\nlocal"; 108 | end 109 | 110 | --get the return value (if any) 111 | local sReturn = ""; 112 | local sReturnType = "nil"; 113 | 114 | for nIndex, sReturnValue in pairs(tBlock.Return) do 115 | 116 | if (sReturnValue:gsub("%s", '') ~= "") then 117 | local nReturnTypeStart, _ = sReturnValue:find(" ", 1, true); 118 | 119 | if (nReturnTypeStart) then 120 | local nReturnTypeEnd, _ = sReturnValue:find(" ", nReturnTypeStart + 1, true); 121 | 122 | if (nReturnTypeEnd) then 123 | local sType = sReturnValue:sub(nReturnTypeStart + 1, nReturnTypeEnd - 1); 124 | sReturn = "\n Returns: <"..sType.."> "..sReturnValue:sub(nReturnTypeEnd + 1); 125 | sReturnType = sType; 126 | end 127 | 128 | end 129 | 130 | end 131 | 132 | end 133 | 134 | --check for an example 135 | local sExample = ""; 136 | if (tBlock.Example:gsub("%s", '') ~= "") then 137 | sExample = "\n "..tBlock.Example; 138 | end 139 | 140 | --concat the snippet string 141 | sSnippet = sSnippet.."\n 'description': '''"..sScope..tBlock.Description..sParamterDescriptions..sExample..sReturn.."'''"; 142 | sSnippet = sSnippet.."\n 'prefix': '"..tBlock.Function.."'"; 143 | sSnippet = sSnippet.."\n 'body': '''"..tBlock.Function.."("..sParameters..");'''"; 144 | sSnippet = sSnippet.."\n 'leftLabelHTML': 'f'"; 145 | sSnippet = sSnippet.."\n 'rightLabelHTML': '"..sReturnType.."'"; 146 | 147 | --TODO add the 'More' tag for linking to dox-generated documentation 148 | 149 | --TODO complete the other desired sections 150 | --[[ 151 | File = getDefaultValue("Example"), 152 | Module = getDefaultValue("Module"), 153 | Usage = getDefaultValue("Usage"), 154 | ]] 155 | 156 | sAppend = sAppend..sSnippet; 157 | end 158 | 159 | end 160 | 161 | --TODO this is appending cumulative new lines...check for a new line before adding one afger the sPreAppend; also check for multiplt end-file new lines 162 | --assemble the full file text 163 | local sFileText = sPreAppend.."\n"..sSectionOpenTag.."\n"..sSourceLuaPrefix..sAppend.."\n"..sSectionCloseTag.."\n"..sPostAppend; 164 | 165 | --open the file for writing 166 | local hSnippets = io.open(pAtomSnippetsFile, "w"); 167 | 168 | if (hSnippets) then 169 | hSnippets:write(sFileText); 170 | hSnippets:close(); 171 | 172 | end 173 | 174 | end 175 | 176 | end 177 | 178 | end 179 | -------------------------------------------------------------------------------- /dox/css.lua: -------------------------------------------------------------------------------- 1 | dox.css = {}; 2 | local theme = dox.theme; 3 | 4 | 5 | --[[! 6 | @module dox.css 7 | @func getParserCSS 8 | @desc Concatenates the Parser strings from the 'dox.Types' table. This is used in 'dox.css.update()'. 9 | @scope local 10 | !]] 11 | local function getParserCSS() 12 | local sRet = ""; 13 | 14 | for sType, tType in pairs(dox.Types) do 15 | 16 | if dox.Types[sType].Parser and dox.Types[sType].ParserCSS then 17 | sRet = sRet.."\n\n"..dox.Types[sType].ParserCSS; 18 | end 19 | 20 | end 21 | 22 | return sRet 23 | end 24 | 25 | local nMenuPadding = 15; 26 | local nPagePadding = 5; 27 | local sPagePadding = nPagePadding.."px"; 28 | local sTopSectionHeight = "40px"; 29 | local sFooterHeight = "30px"; 30 | local nMenuWidth = 230; 31 | local sMenuWidth = nMenuWidth.."px" 32 | local sContentStart = (nPagePadding + nMenuPadding + nMenuWidth).."px"; 33 | local sContentBorder = 'border-radius: 0px 0px 20px 20px;\n\t-moz-border-radius: 0px 0px 20px 20px;\n\t-webkit-border-radius: 0px 0px 20px 20px;\n' 34 | --CSS [this OR dox.PageVars.CSSPathAndVersion must be blank] 35 | 36 | --[[! 37 | @module dox 38 | @func dox.css.update 39 | @description This informs the css of theme changes that may have occurred. 40 | !]] 41 | function dox.css.update() 42 | dox.PageVars.CSS = [[ 43 | /* original page css courtesy of http://www.dynamicdrive.com/style/layouts/item/css_liquid_layout_21_fixed_fluid/ */ 44 | 45 | html{ 46 | position: absolute; top: 0px; left: 0px; 47 | width: 100%; 48 | min-height: 100%; 49 | } 50 | 51 | body{ 52 | position: relative; 53 | left: 0px; 54 | ]]..theme.getBGImage()..[[ 55 | ]]..theme.getBGImageRepeat()..[[ 56 | width: 100% 57 | height: 100%; 58 | margin:0; 59 | padding:0; 60 | line-height: 1.5em; 61 | background: ]]..theme.getColor("BackgroundSurround")..[[ 62 | 63 | } 64 | 65 | 66 | a { 67 | transition: color .4s; 68 | color: ]]..theme.getColor("LinkText")..[[; 69 | } 70 | 71 | a:link, a:visited { color: ]]..theme.getColor("LinkText")..[[; } 72 | a:hover { color: ]]..theme.getColor("LinkHover")..[[; } 73 | a:active { 74 | transition: color .3s; 75 | color: ]]..theme.getColor("LinkText")..[[; 76 | } 77 | 78 | .link { text-decoration: none; } 79 | 80 | ]]..getParserCSS()..[[ 81 | 82 | b{ 83 | font-size: 130%; 84 | } 85 | 86 | em{ 87 | color: ]]..theme.getColor("SectionTitle")..[[; 88 | } 89 | 90 | #maincontainer{ 91 | display: inline-block; 92 | position: relative; 93 | top: 0; 94 | width: 100%; /*Width of main container*/ 95 | min-height: 100%; 96 | margin: 0 auto; /*Center container on page*/ 97 | background: #FFF; 98 | } 99 | 100 | p{ 101 | font-size: 100%; 102 | color: ]]..theme.getColor("ParagraphText")..[[; 103 | } 104 | 105 | #topsection{ 106 | position: fixed; 107 | top: ]]..sPagePadding..[[; 108 | left: ]]..sContentStart..[[; 109 | width: calc(100% - ]]..sContentStart..[[ - ]]..sPagePadding..[[); 110 | background: ]]..theme.getColor("BackgroundContent")..[[; 111 | height: ]]..sTopSectionHeight..[[; /*Height of top section*/ 112 | border-radius: 20px 20px 0px 0px; 113 | -moz-border-radius: 20px 20px 0px 0px; 114 | -webkit-border-radius: 20px 20px 0px 0px; 115 | border: 0px solid #000000; 116 | } 117 | 118 | #topsection h1{ 119 | margin: 0; 120 | padding-top: ]]..sPagePadding..[[; 121 | color: ]]..theme.getColor("PageHeader")..[[; 122 | font-size:xx-large; 123 | text-align:center; 124 | } 125 | 126 | #contentwrapper{ 127 | display: inline-block; 128 | position: fixed; 129 | left: 0; 130 | top: calc(]]..sTopSectionHeight..[[ + ]]..sPagePadding..[[); /*Height of top section*/ 131 | margin-left: ]]..sContentStart..[[; 132 | width: calc(100% - ]]..sContentStart..[[ - ]]..(nPagePadding * 6)..[[px + 1px); 133 | height: calc(100vh - ]]..sTopSectionHeight..[[ - ]]..sFooterHeight..[[ - ]]..(nPagePadding * 8)..[[px); 134 | ]]..sContentBorder..[[ 135 | } 136 | 137 | #contentcolumn{ 138 | position: relative; 139 | background: ]]..theme.getColor("BackgroundContent")..[[; 140 | width: 100%; 141 | height: 100%; 142 | overflow: hidden; 143 | padding: 12px; 144 | ]]..sContentBorder..[[ 145 | } 146 | 147 | #modulecontentwrapper{ 148 | display: inline-block; 149 | position: fixed; 150 | left: 0; 151 | top: 0; 152 | margin-left: 0; 153 | width: 100%; 154 | height: 100%; 155 | ]]..sContentBorder..[[ 156 | } 157 | 158 | #modulecontentcolumn{ 159 | position: relative; 160 | background: ]]..theme.getColor("BackgroundContent")..[[; 161 | width: 100%; 162 | height: 100%; 163 | overflow: auto; 164 | padding: 0px; 165 | ]]..sContentBorder..[[ 166 | } 167 | 168 | /* The frame that loads the module pages */ 169 | #module{ 170 | margin: 0px; 171 | padding: 0px; 172 | height: 98%; 173 | width: 100%; 174 | border-radius: 20px 20px 0px 20px; 175 | -moz-border-radius: 20px 20px 0px 20px; 176 | -webkit-border-radius: 20px 20px 0px 20px; 177 | border: none; 178 | } 179 | 180 | #footer{ 181 | position: fixed; 182 | clear: left; 183 | width: 100%; 184 | height: ]]..sFooterHeight..[[; 185 | color: ]]..theme.getColor("ParagraphText")..[[; 186 | background: ]]..theme.getColor("BackgroundSurround")..[[; 187 | text-align: center; 188 | padding: 4px 0; 189 | bottom: 0px; 190 | } 191 | 192 | #footer a{ 193 | color: ]]..theme.getColor("SectionTitle")..[[; 194 | } 195 | 196 | /* MOVE TO THE MODULE SECTION 197 | .innertubecontent{ 198 | 199 | } 200 | */ 201 | 202 | .innertubemenu{ 203 | height: 100%; 204 | margin: 10px; /*Margins for inner DIV inside the side bar (to provide padding)*/ 205 | margin-top: 0; 206 | } 207 | 208 | #welcome{ 209 | Background-color: ]]..theme.getColor("BackgroundContent")..[[; 210 | background-image: url("data:image/png;base64,]]..dox.base64.getData("keepcalm")..[["); 211 | background-repeat: no-repeat; 212 | background-attachment: fixed; 213 | background-position: center; 214 | padding: 0; 215 | margin: 0; 216 | width: 100%; 217 | height: 100%; 218 | } 219 | 220 | hr.moduleitemBACKUP{ 221 | height: 12px; 222 | border: 0; 223 | box-shadow: inset 0 12px 12px -12px rgba(0, 0, 0, 0.5); 224 | color: ]]..theme.getColor("MenuNormal")..[[; 225 | } 226 | 227 | hr.moduleitem{ 228 | border: 0; 229 | height: 55px; 230 | background-image: url("data:image/png;base64,]]..dox.base64.getData("pacman")..[["); 231 | background-repeat: no-repeat; 232 | background-position: center; 233 | } 234 | 235 | /*HEADER MENU SECTION*/ 236 | 237 | ul.headermenu { 238 | margin:0; 239 | list-style-type: none; 240 | } 241 | 242 | a.headermenu { 243 | margin:0; 244 | list-style-type: none; 245 | } 246 | 247 | /*NAV MENU SECTION*/ 248 | 249 | div.navmenu{ 250 | position: fixed; 251 | top: ]]..sPagePadding..[[; /* top section height*/ 252 | left: ]]..sPagePadding..[[; 253 | padding: 2px; 254 | max-height: calc(96vh - ]]..sFooterHeight..[[); /*subtract the padding, top section and footer*/ 255 | overflow-y: auto; 256 | overflow-x: hidden; 257 | width: ]]..sMenuWidth..[[; 258 | border-radius: 20px 20px 0px 20px; 259 | -moz-border-radius: 20px 20px 0px 20px; 260 | -webkit-border-radius: 20px 20px 0px 20px; 261 | border: 2px solid ]]..theme.getColor("BackgroundOutline")..[[; 262 | -webkit-box-shadow: 7px 10px 5px 0px rgba(0,0,0,0.5); 263 | -moz-box-shadow: 7px 10px 5px 0px rgba(0,0,0,0.5); 264 | box-shadow: 7px 10px 5px 0px rgba(0,0,0,0.5); 265 | } 266 | 267 | .menu { 268 | margin: 0 auto; 269 | padding: 0; 270 | width: 100%; 271 | } 272 | 273 | .menu li { list-style: none; } 274 | 275 | .menu li a { 276 | display: table; 277 | margin-top: 1px; 278 | padding: 14px 10px; 279 | width: 100%; 280 | background: ]]..theme.getColor("BackgroundSurround")..[[; 281 | text-decoration: none; 282 | text-align: left; 283 | vertical-align: middle; 284 | color: ]]..theme.getColor("SectionTitle")..[[; 285 | overflow: hidden; 286 | -webkit-transition-property: background; 287 | -webkit-transition-duration: 0.4s; 288 | -webkit-transition-timing-function: ease-out; 289 | transition-property: background; 290 | transition-duration: 0.4s; 291 | transition-timing-function: ease-out; 292 | } 293 | 294 | .menu > li:first-child a { margin-top: 0; } 295 | 296 | .menu li a:hover { 297 | background: ]]..theme.getColor("BackgroundContent")..[[; 298 | -webkit-transition-property: background; 299 | -webkit-transition-duration: 0.2s; 300 | -webkit-transition-timing-function: ease-out; 301 | transition-property: background; 302 | transition-duration: 0.2s; 303 | transition-timing-function: ease-out; 304 | } 305 | 306 | .menu li ul { 307 | max-height: calc(50vh - 90px - ]]..sFooterHeight..[[); /*similar to the div settings*/; 308 | overflow-y: auto; 309 | overflow-x: hidden; 310 | margin: 0; 311 | padding: 0; 312 | } 313 | 314 | .menu li li a { 315 | display: block; 316 | margin-top: 0; 317 | padding: 0 10px; 318 | height: 0; 319 | background: ]]..theme.getColor("MenuNormal")..[[; 320 | color: ]]..theme.getColor("MenuNormalText")..[[; 321 | -webkit-transition-property: all; 322 | -webkit-transition-duration: 0.5s; 323 | -webkit-transition-timing-function: ease-out; 324 | transition-property: all; 325 | transition-duration: 0.5s; 326 | transition-timing-function: ease-out; 327 | } 328 | 329 | .menu > li:hover li a { 330 | display: table; 331 | margin-top: 1px; 332 | padding: 10px; 333 | width: 100%; 334 | height: 1em; 335 | -webkit-transition-property: all; 336 | -webkit-transition-duration: 0.3s; 337 | -webkit-transition-timing-function: ease-out; 338 | transition-property: all; 339 | transition-duration: 0.3s; 340 | transition-timing-function: ease-out; 341 | } 342 | 343 | .menu > li:hover li a:hover { 344 | background: ]]..theme.getColor("MenuHighlight")..[[; 345 | -webkit-transition-property: background; 346 | -webkit-transition-duration: 0.2s; 347 | -webkit-transition-timing-function: ease-out; 348 | transition-property: background; 349 | transition-duration: 0.2s; 350 | transition-timing-function: ease-out; 351 | } 352 | 353 | /*MODULE INFO SECTION*/ 354 | 355 | #miversion{ 356 | font-size: 60%; 357 | vertical-align: super; 358 | } 359 | 360 | #midisplayname{ 361 | font-size; 120%; 362 | } 363 | 364 | #miauthors{ 365 | font-style: italic; 366 | font-size; 30%; 367 | } 368 | 369 | /* horizontal menu */ 370 | 371 | p.mip{ 372 | 373 | } 374 | 375 | /* MODULE SECTION = MODULE SECTION = MODULE SECTION = MODULE SECTION*/ 376 | 377 | /* Allows for color alternating between functions for ease of reading.*/ 378 | .innertubecontentalt, .innertubecontent{ 379 | margin: 10px; /*Margins for inner DIV inside each column (to provide padding)*/ 380 | margin-top: 0; 381 | padding: 10px 10px 10px 12px; 382 | -webkit-box-shadow: 0px 11px 8px -4px rgba(0,0,0,0.49); 383 | -moz-box-shadow: 0px 11px 8px -4px rgba(0,0,0,0.49); 384 | box-shadow: 0px 11px 8px -4px rgba(0,0,0,0.49); 385 | border-radius: 20px 20px 0px 20px; 386 | -moz-border-radius: 20px 20px 0px 20px; 387 | -webkit-border-radius: 20px 20px 0px 20px; 388 | border-top: 2px groove; 389 | border-right: 2px groove; 390 | border-bottom: 2px groove; 391 | border-left: 2px solid ]]..theme.getColor("MenuNormal")..[[; 392 | } 393 | 394 | .innertubecontentalt{ 395 | background-color: rgba(0, 0, 0, 0.1); 396 | border-left: 2px solid ]]..theme.getColor("MenuHighlight")..[[; 397 | } 398 | 399 | /* The paramters of the function */ 400 | p.parameter{ 401 | font-size: 108%; 402 | } 403 | 404 | code{ 405 | 406 | } 407 | 408 | /*The name of the function*/ 409 | h2.functionname{ 410 | display: inline; 411 | font-size: 160%; 412 | } 413 | 414 | /* Titles such as Description, Parameters, etc. */ 415 | h3.blocklineheader{ 416 | font-size: 125%; 417 | } 418 | 419 | .scope{ 420 | font-style: italic; 421 | margin: 0px 0px 0px 3px; 422 | vertical-align: super; 423 | color: ]]..theme.getColor("Special_1")..[[; 424 | font-size: 115%; 425 | } 426 | 427 | p.blockdesc{ 428 | color: ]]..theme.getColor("ParagraphText")..[[; 429 | font-size: 120%; 430 | padding: 6px; 431 | max-width: 97%; 432 | /*-webkit-box-shadow: 7px 7px 3px 0px rgba(0,0,0,0.46); 433 | -moz-box-shadow: 7px 7px 3px 0px rgba(0,0,0,0.46); 434 | box-shadow: 7px 7px 3px 0px rgba(0,0,0,0.46); 435 | border-radius: 10px 10px 0px 10px; 436 | -moz-border-radius: 10px 10px 0px 1px; 437 | -webkit-border-radius: 10px 10px 0px 10px; 438 | border: 4px solid ]]..theme.getColor("BackgroundOutline")..[[;*/ 439 | } 440 | 441 | /* Original accorian menu courtesy of http://accordionslider.com/ each tab costs 35px (with this layout) and the base object's size is 700 */ 442 | 443 | 444 | 445 | .accordion > ul > li, 446 | .accordion-title, 447 | .accordion-content, 448 | .accordion-separator { 449 | float: left; 450 | } 451 | 452 | .accordion > ul > li { 453 | background-color: ]]..theme.getColor("BackgroundSurround")..[[; 454 | margin-right: -700px; 455 | margin-bottom: -0px; 456 | } 457 | 458 | .accordion-select:checked ~ .accordion-separator { 459 | margin-right: 700px; 460 | margin-bottom: 0px; 461 | } 462 | 463 | .accordion-title, 464 | .accordion-select { 465 | background-color: ]]..theme.getColor("BackgroundSurround")..[[; 466 | color: ]]..theme.getColor("SectionTitle")..[[; 467 | width: 35px; 468 | height: 310px; 469 | font-size: 15px; 470 | } 471 | 472 | .accordion-title span { 473 | margin-bottom: 18px; 474 | margin-left: 20px; 475 | } 476 | 477 | .accordion-select:hover ~ .accordion-title, 478 | .accordion-select:checked ~ .accordion-title { 479 | background-color: ]]..theme.getColor("MenuNormal")..[[; 480 | color: ]]..theme.getColor("MenuNormalText")..[[; 481 | } 482 | 483 | .accordion-title span { 484 | transform: rotate(-90deg); 485 | -o-transform: rotate(-90deg); 486 | -moz-transform: rotate(-90deg); 487 | -webkit-transform: rotate(-90deg); 488 | -ms-writing-mode: lr-bt; 489 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); 490 | margin-left: 0px; 491 | line-height: 35px; 492 | } 493 | 494 | .accordion-content { 495 | background-color: ]]..theme.getColor("BackgroundContent")..[[; 496 | color: ]]..theme.getColor("ParagraphText")..[[; 497 | height: 254px; 498 | width: 644px; 499 | padding: 28px; 500 | } 501 | 502 | .accordion-title, 503 | .accordion-select:checked ~ .accordion-content { 504 | margin-right: 0px; 505 | margin-bottom: 0px; 506 | } 507 | 508 | /* Do not change following properties, they aren't 509 | generated automatically and are common for each slider. */ 510 | .accordion { 511 | overflow: hidden; 512 | } 513 | 514 | .accordion > ul { 515 | margin: 0; 516 | padding: 0; 517 | list-style: none; 518 | width: 101%; 519 | } 520 | 521 | .accordion > ul > li, 522 | .accordion-title { 523 | position: relative; 524 | } 525 | 526 | .accordion-select { 527 | cursor: pointer; 528 | position: absolute; 529 | opacity: 0; 530 | top: 0; 531 | left: 0; 532 | margin: 0; 533 | z-index: 1; 534 | } 535 | 536 | .accordion-title span { 537 | display: block; 538 | position: absolute; 539 | bottom: 0px; 540 | width: 100%; 541 | white-space: nowrap; 542 | } 543 | 544 | .accordion-content { 545 | position: relative; 546 | overflow: auto; 547 | } 548 | 549 | .accordion-separator { 550 | transition: margin 0.3s ease 0.1s; 551 | -o-transition: margin 0.3s ease 0.1s; 552 | -moz-transition: margin 0.3s ease 0.1s; 553 | -webkit-transition: margin 0.3s ease 0.1s; 554 | } 555 | ]] 556 | end 557 | -------------------------------------------------------------------------------- /dox/doxnew.lua: -------------------------------------------------------------------------------- 1 | local dox; 2 | local doxdecoy; 3 | local doxmodule; 4 | local parse; 5 | 6 | doxmodule = class("doxmodule", --this is the class we want! 7 | {--metamethods 8 | 9 | }, 10 | {--static public 11 | 12 | }, 13 | {--private 14 | name_AUTO = "", 15 | }, 16 | {--protected 17 | 18 | }, 19 | {--public 20 | doxmodule = function(pFile) --TODO non-file constructor and ove this to import function 21 | 22 | end 23 | }, 24 | nil, --extending class 25 | nil, --interface(s) (either nil, an interface or a numerically-indexed table of interfaces) 26 | false --if the class is final 27 | ); 28 | 29 | 30 | 31 | doxactual = { 32 | pri = {--private 33 | name_AUTO = "", 34 | getProcessList = function (this, cdat, sDir, bRecurse, tFiles) 35 | local tRet = type(tFiles) == "table" and tFiles or {}; 36 | --TODO finish the unix commands 37 | --setup the commands 38 | local sGetFilesCommand = (_ == "\\") and ('dir "'..sDir..'\\*.*" /b /a-d'):gsub("\\\\", "\\") or ('find '..sDir.."/"..'-maxdepth 1 ! –type d'):gsub("//", "/"); 39 | local sGetDirsCommand = (_ == "\\") and ('dir "'..sDir..'\\*.*" /b /d'):gsub("\\\\", "\\") or ("ls -a -d /*"):gsub("//", "/"); 40 | 41 | local hFiles = io.popen(sGetFilesCommand); 42 | 43 | --process files and folders 44 | if (hFiles) then 45 | local bIgnore = false; 46 | local bIgnoreSub = false; 47 | local bIgnoreAll = false; 48 | local tFiles = {}; 49 | 50 | --look for ignore files 51 | for sFile in hFiles:lines() do 52 | 53 | if (sFile == sDoxIgnoreAllFile) then 54 | bIgnoreAll = true; 55 | break; --no need to continue at this point 56 | end 57 | 58 | if (sFile == sDoxIgnoreSubFile) then 59 | bIgnoreSub = true; 60 | end 61 | 62 | if (sFile == sDoxIgnoreFile) then 63 | bIgnore = true; 64 | end 65 | 66 | if not (bIgnoreAll or bIgnore) then 67 | tFiles[#tFiles + 1] = sFile; 68 | end 69 | 70 | end 71 | 72 | --only process items if the .doxignoreall file was NOT found 73 | if not (bIgnoreAll) then 74 | 75 | --add (any) files that exist to the return table 76 | for nIndex, sFile in pairs(tFiles) do 77 | 78 | --check that the file type is valid 79 | if (sFile:len() >= nMinFileLength and sFile:reverse():sub(1, 4):lower() == "aul.") then 80 | --add the file to the list 81 | tRet[#tRet + 1] = sDir.._..sFile; 82 | end 83 | 84 | end 85 | 86 | --process subdirectories 87 | if not (bIgnoreSub) then 88 | local hDirs = io.popen(sGetDirsCommand); 89 | 90 | if (hDirs) then 91 | 92 | for sDirectory in hDirs:lines() do 93 | dox.util.getProcessList(sDir.._..sDirectory, bRecurse, tRet); 94 | end 95 | 96 | end 97 | 98 | end 99 | 100 | end 101 | 102 | end 103 | 104 | return tRet; 105 | end, 106 | }, 107 | pub = {-- public 108 | importDir = function(this, cdat, pDir, bRecursive) 109 | 110 | end, 111 | importFile = function(this, cdat, pFile) 112 | 113 | end, 114 | 115 | }, 116 | }; 117 | 118 | 119 | return setmetatable({}, 120 | {--dox metatable 121 | 122 | 123 | }); 124 | -------------------------------------------------------------------------------- /dox/parse.lua: -------------------------------------------------------------------------------- 1 | dox.parse = {}; 2 | 3 | 4 | --[[! 5 | @module dox.parse 6 | @func blockToTable 7 | @desc Searches through a block (of any kind: module, function, etc.) and splits it based on the 'dox.SpecialChars[1].Intended' special character. 8 | @param sBlock string The plain text of the block to be processed. 9 | @scope local 10 | @ret tBlock table A table containg each valid item from the block string (such as description, function, authors. etc.). 11 | !]] 12 | local function blockToTable(sBlock) 13 | 14 | if sBlock ~= "" then 15 | local tRet = {}; 16 | local bContinue = true; 17 | local nSearchIndex = 0; 18 | local sDelimiter = dox.SpecialChars[1].Intended; 19 | 20 | --escape special characters with something else until the table is constructed. 21 | for nIndex, tChar in pairs(dox.SpecialChars) do 22 | sBlock = sBlock:gsub(tChar.Escaped, tChar.Temp); 23 | end 24 | 25 | while bContinue do 26 | local nStart, nEnd = sBlock:find(sDelimiter, nSearchIndex); 27 | 28 | if nStart then 29 | tRet[#tRet + 1] = sBlock:sub(nSearchIndex, nStart - 1); 30 | nSearchIndex = nEnd + 1; 31 | 32 | else 33 | tRet[#tRet + 1] = sBlock:sub(nSearchIndex); 34 | bContinue = false; 35 | 36 | end 37 | 38 | end 39 | 40 | 41 | if tRet[1] then 42 | 43 | --clear out the blank entries (if any exist). [1] is blank by default so it must be removed. 44 | for nLine, sLine in pairs(tRet) do 45 | 46 | if sLine:gsub(" ", ""):gsub("\n", "") == "" then 47 | table.remove(tRet, nLine); 48 | end 49 | 50 | end 51 | 52 | --put the special chars back but as they were intended to be displayed 53 | for nLine, sLine in pairs(tRet) do 54 | 55 | for nIndex, tChar in pairs(dox.SpecialChars) do 56 | tRet[nLine] = tRet[nLine]:gsub(tChar.Temp, tChar.Intended); 57 | end 58 | 59 | end 60 | 61 | end 62 | 63 | return tRet 64 | end 65 | 66 | end 67 | 68 | 69 | --[[! 70 | @module dox.parse 71 | @func createModuleEntry 72 | @desc Adds a module entry to the 'dox.Modules' table (if it doesn't already exist). 73 | @param sModule string The plain text of the module. 74 | @scope local 75 | !]] 76 | local function createModuleEntry(sModule) 77 | 78 | if not dox.Modules[sModule] then 79 | 80 | dox.Modules[sModule] = { 81 | Blocks = {}, 82 | Info = {}, 83 | ProcessOrder = {}, --organized alphabetically 84 | }; 85 | 86 | --populate the module's info table 87 | for sInfoAtt, _ in pairs(dox.ModuleItems) do 88 | 89 | --[[add each attribute placeholder to the table except 90 | 'moduleid' as it's only used for detecting which 91 | module to put the info into during processing.]] 92 | if sInfoAtt ~= "moduleid" then 93 | dox.Modules[sModule].Info[sInfoAtt] = ""; 94 | end 95 | 96 | end 97 | 98 | end 99 | 100 | end 101 | 102 | 103 | --[[! 104 | @module dox.parse 105 | @func getDefaultValue 106 | @desc Gets what the default value should be for each item in the 'tRet' table found within the 'processBlock()' function. It is worth noting that placing a default value at 'dox.Types[sType].DefaultValue' where 'sType' is the name of the type desired, causes this function to return that value. 107 | @param sType string The type desired such as Function, Description, etc. 108 | @ret vRet string,table This returns a table if multiple lines with this same type are allowed (such as param) and a string if not. 109 | @scope local 110 | @file parse.lua 111 | !]] 112 | local function getDefaultValue(sType) 113 | local vRet = ""; 114 | 115 | if dox.Types[sType] then 116 | 117 | if dox.Types[sType].AllowMultiple then 118 | vRet = {}; 119 | end 120 | 121 | end 122 | 123 | --check for an explicit, default value within the types table 124 | if dox.Types[sType].DefaultValue then 125 | vRet = dox.Types[sType].DefaultValue; 126 | end 127 | 128 | return vRet 129 | end 130 | 131 | 132 | --[[! 133 | @module dox.parse 134 | @func getLineType 135 | @scope local 136 | @desc Determines what sort of line the given string is: such as description, function, parameter, etc. 137 | @param sLine string The plain text of the line. 138 | @return sType string The type of the line or "__UNKNOWN__" if it doesn't exist. 139 | @return sVariation string The varation of the input. For example, if the line type is 'function', it may return 'func' or 'function' depending on what the user typed. This is not returned if the line type is unknown. 140 | !]] 141 | local function getLineType(sLine) 142 | local sRet = "__UNKNOWN__"; 143 | 144 | if type(sLine) == "string" then 145 | 146 | if sLine:len() > 0 then 147 | 148 | for sType, tTypeProperties in pairs(dox.Types) do 149 | 150 | for nIndex, sVariation in pairs(tTypeProperties.Variations) do 151 | local nLength = sVariation:len(); 152 | 153 | --ensure the type is one of those listed 154 | if sLine:sub(0, nLength):lower() == sVariation:lower() then 155 | 156 | if sLine:sub(0, nLength + 1):find("[%s]") then 157 | return sType, sVariation 158 | end 159 | 160 | end 161 | 162 | end 163 | 164 | end 165 | 166 | end 167 | 168 | end 169 | 170 | return sRet 171 | end 172 | 173 | 174 | --[[! 175 | @module dox.parse 176 | @func parseModuleIDs 177 | @scope local 178 | @desc Parses the 'moduleid' tag in the module block. Used in 'importModuleInfo()'. 179 | @param sModuleIDsText string the string from the 'moduleid' tag. 180 | @ret tModules table A numerically-indexed table whose values are tables with 'id' and 'displayname' as indices. 181 | !]] 182 | local function parseModuleIDs(sModuleIDsText) 183 | --place the input into bith fields to start just in case there is only one word 184 | local tRet = { 185 | [1] = { 186 | displayname = sModuleIDsText, 187 | id = sModuleIDsText, 188 | }, 189 | }; 190 | 191 | --start by splitting the IDs by commna delimiter 192 | local tIDs = {}; 193 | local bContinue = true; 194 | local nSearchIndex = 0; 195 | local sDelimiter = dox.ModuleDelimiter; 196 | 197 | while bContinue do 198 | local nStart, nEnd = sModuleIDsText:find(sDelimiter, nSearchIndex); 199 | 200 | if nStart then 201 | tIDs[#tIDs + 1] = sModuleIDsText:sub(nSearchIndex, nStart - 1); 202 | nSearchIndex = nEnd + 1; 203 | 204 | else 205 | tIDs[#tIDs + 1] = sModuleIDsText:sub(nSearchIndex); 206 | bContinue = false; 207 | 208 | end 209 | 210 | end 211 | 212 | 213 | --now look for display names for each module 214 | for nIndex, sModuleText in pairs(tIDs) do 215 | nSearchIndex = 0; 216 | sDelimiter = dox.ModuleInfoNameDelimiter; 217 | nStart, nEnd = sModuleText:find(sDelimiter, nSearchIndex); 218 | 219 | if nStart then 220 | nSearchIndex = nEnd + 1; 221 | 222 | tRet[nIndex] = { 223 | displayname = sModuleText:sub(nStart + 1), 224 | id = sModuleText:sub(1, nStart - 1), 225 | }; 226 | 227 | else 228 | tRet[nIndex] = { 229 | displayname = sModuleText, 230 | id = sModuleText, 231 | }; 232 | 233 | end 234 | 235 | end 236 | 237 | return tRet 238 | end 239 | 240 | 241 | --[[! 242 | @module dox.parse 243 | @func dox.parse.getBlocks 244 | @desc Retrieves the blocks (such as module and function blocks) from a string of lua code. Used in 'dox.processFile()'. 245 | @param sLua string The lua code to be processed. 246 | @ret tBlocks table A table containing any blocks found. If no blocks were found, an empty table is returned. 247 | !]] 248 | function dox.parse.getBlocks(sLua) 249 | local tBlocks = {}; 250 | local nSearchStart = 0; 251 | local tBlockMarkers = dox.Markers.Block; 252 | 253 | if type(sLua) == "string" then 254 | 255 | if sLua:len() > 0 then 256 | local _nBlockStart, nBlockStart_; 257 | local nSafety = 0; 258 | 259 | repeat 260 | nSafety = nSafety + 1; 261 | 262 | --look for the start of the block 263 | _nBlockStart, nBlockStart_ = sLua:find(tBlockMarkers.Start, nSearchStart, true); 264 | 265 | if _nBlockStart then 266 | local _nBlockEnd, nBlockEnd_; 267 | --look for the end of the block 268 | _nBlockEnd, nBlockEnd_ = sLua:find(tBlockMarkers.End, nSearchStart, true); 269 | 270 | if _nBlockEnd then 271 | local nSubStart = _nBlockStart + tBlockMarkers.Start:len(); 272 | local nSubEnd = nBlockEnd_ - tBlockMarkers.End:len(); 273 | local sBlock = sLua:sub(nSubStart, nSubEnd); 274 | 275 | --add the block to the 'tBlocks' table 276 | tBlocks[#tBlocks + 1] = sBlock; 277 | 278 | --update the search index 279 | nSearchStart = nBlockEnd_ + 1; 280 | 281 | --reset the safety value 282 | nSafety = 0; 283 | end 284 | 285 | end 286 | 287 | until _nBlockStart == nil or nSafety == 5 288 | 289 | end 290 | 291 | end 292 | 293 | return tBlocks 294 | end 295 | 296 | 297 | --[[! 298 | @module dox.parse 299 | @func dox.parse.getModuleCount 300 | @desc Counts the number of modules to rpevent processing if none are present. Used in 'dox.processFile()'. 301 | @ret nModules number returns the number of modules that exist. Will return 0 if there are no modules. 302 | !]] 303 | function dox.parse.getModuleCount() 304 | local nModules = 0; 305 | 306 | for sIndex, tModule in pairs(dox.Modules) do 307 | 308 | --confirm that this module contains info to be processed 309 | if #tModule.Blocks > 0 then 310 | nModules = nModules + 1 311 | end 312 | 313 | end 314 | 315 | return nModules 316 | end 317 | 318 | 319 | --[[! 320 | @module dox 321 | @func dox.parse.importBlockToModules 322 | @desc Pushes a block into the 'dox.Modules' table to await processing. Used in 'dox.processFile()'. 323 | !]] 324 | function dox.parse.importBlockToModules(tBlock) 325 | 326 | if type(tBlock) == "table" then 327 | local sModule = tBlock.Module; 328 | 329 | --create the module index if it doesn't already exist 330 | createModuleEntry(sModule); 331 | 332 | --import the module 333 | local nIndex = #dox.Modules[sModule].Blocks + 1; 334 | dox.Modules[sModule].Blocks[nIndex] = tBlock; 335 | 336 | end 337 | 338 | end 339 | 340 | 341 | --[[! 342 | @module dox.parse 343 | @func dox.parse.importModuleInfo 344 | @desc Gets the module info from a lua string, processes it and stores it in the module's Info table. There can be only one!...module block per module, that is. Any subsequent blocks will overwrite by the previous one(s). Also, at this point, the module must already exist or this will not process the block even if found. Modules without any functions are not processed. 345 | @param sLuaString string The lua string to search for the module block. 346 | !]] 347 | -- 348 | function dox.parse.importModuleInfo(sLuaString) 349 | local sMarkerStart = dox.Markers.Module.Start; 350 | local sMarkerEnd = dox.Markers.Module.End; 351 | 352 | --look for the start of the module block 353 | local _nModuleStart, nModuleStart_ = sLuaString:find(sMarkerStart, 0, true); 354 | 355 | if _nModuleStart then 356 | --look for the end of the module block 357 | local _nModuleEnd, nModuleEnd_ = sLuaString:find(sMarkerEnd, nModuleStart_ + 1, true); 358 | 359 | if _nModuleEnd then 360 | local sModuleBlock = sLuaString:sub(nModuleStart_ + 1, _nModuleEnd - 1); 361 | 362 | --if the string has text to process 363 | if sModuleBlock:gsub(" ", "") ~= "" then 364 | local tLines = {}; 365 | local tModuleNames; 366 | local tTempLines = blockToTable(sModuleBlock); 367 | local tModulesIDs; 368 | local tModuleItems = {}; 369 | 370 | for nIndex, sLine in pairs(tTempLines) do 371 | local nTypeEnd = sLine:find("[%s]"); 372 | 373 | if not nTypeEnd then 374 | --nTypeEnd = sLine:find("\n"); 375 | end 376 | 377 | if nTypeEnd then 378 | local sType = sLine:sub(1, nTypeEnd - 1):lower():gsub(" ", ""); 379 | 380 | if dox.ModuleItems[sType] then 381 | local sFormattedLine = sLine:sub(nTypeEnd + 1); 382 | 383 | if sType ~= "moduleid" then 384 | tLines[sType] = sFormattedLine; 385 | 386 | else --if this is the module name(s) 387 | local sModuleRaw = sFormattedLine:gsub(" ", ""):gsub("\n",""); 388 | 389 | if sModuleRaw ~= "" then 390 | tModuleNames = parseModuleIDs(sModuleRaw); 391 | end 392 | 393 | end 394 | 395 | end 396 | 397 | end 398 | 399 | end 400 | 401 | --TODO DONT FORGET TO ESCAPE HTML CHARS /???? Do I need to do this? 402 | 403 | if tModuleNames then 404 | 405 | for nIndex, tModule in pairs(tModuleNames) do 406 | local sModule = tModule.id; 407 | local sDisplayName = tModule.displayname; 408 | 409 | --create the module if it doesn't exist 410 | if not dox.Modules[sModule] then 411 | createModuleEntry(sModule); 412 | end 413 | 414 | --process each item 415 | for sMarker, tMarker in pairs(dox.ModuleItems) do 416 | 417 | if sMarker ~= "moduleid" and sMarker ~= "displayname" then 418 | 419 | if tLines[sMarker] then 420 | dox.Modules[sModule].Info[sMarker] = tLines[sMarker]; 421 | end 422 | 423 | elseif sMarker == "displayname" then 424 | dox.Modules[sModule].Info.displayname = sDisplayName; 425 | 426 | end 427 | 428 | end 429 | 430 | end 431 | 432 | end 433 | 434 | end 435 | 436 | end 437 | 438 | end 439 | 440 | end 441 | 442 | 443 | --[[! 444 | @module dox.parse 445 | @func dox.parse.processBlock 446 | @desc Processes a function block and validates all the lines input in the blocks string. Used in 'dox.processFile()'. 447 | @param sBlock string The function block to be processed. 448 | @ret tBlock table,nil The final Block table which can be used to create HTML or nil if any 'Required' line items are missing or blank. 449 | !]] 450 | function dox.parse.processBlock(sBlock) 451 | local tRet; 452 | 453 | if type(sBlock) == "string" then 454 | 455 | if sBlock:len() > 0 then 456 | tRet = { 457 | Description = getDefaultValue("Description"), 458 | Example = getDefaultValue("Example"), 459 | File = getDefaultValue("Example"), --TODO should this be 'File'? Check this 460 | Function = getDefaultValue("Function"), 461 | Module = getDefaultValue("Module"), 462 | Parameters = getDefaultValue("Parameters"), 463 | Return = getDefaultValue("Return"), 464 | Scope = getDefaultValue("Scope"), 465 | Usage = getDefaultValue("Usage"), 466 | }; 467 | 468 | 469 | --escape special characters with something else until the table is constructed. 470 | --[[for nIndex, tChar in pairs(dox.SpecialChars) do 471 | sBlock = sBlock:gsub(tChar.Escaped, tChar.Temp); 472 | end]] 473 | 474 | --construct the table 475 | local tLines = blockToTable(sBlock); 476 | 477 | --process each line 478 | for nIndex, sLine in pairs(tLines) do 479 | 480 | --[[put the special chars back 481 | for nIndex, tChar in pairs(dox.SpecialChars) do 482 | sLine = sLine:gsub(tChar.Temp, tChar.Intended); 483 | end]] 484 | 485 | --get the line type and remove the type indicator from the line itself so it's clean and ready for print-processing 486 | local sType, sVariation = getLineType(sLine); 487 | 488 | if dox.Types[sType] then 489 | --remove the tag form the line 490 | sLine = sLine:sub(sVariation:len() + 2); --account for the '@' symbol and the space 491 | 492 | --trim the whitespace 493 | sLine = dox.util.trim(sLine); 494 | 495 | --check for values belonging to types that may have multiple items and store in the appropriate table 496 | if dox.Types[sType].AllowMultiple then 497 | local nIndex = #tRet[sType] + 1; 498 | tRet[sType][nIndex] = sLine; 499 | 500 | --or store the value as-is in the appropriate table index 501 | else 502 | 503 | --check for type alias violations 504 | local tAllowedValues = dox.Types[sType].AllowedValues; 505 | local sDefaultValue = dox.Types[sType].DefaultValue; 506 | 507 | if tAllowedValues and sDefaultValue then 508 | local bIsAllowed = false; 509 | 510 | for nValueIndex, sValue in pairs(tAllowedValues) do 511 | 512 | --check to see if the input strings matches any of the allowed ones 513 | if sValue:gsub(" ", ""):lower() == sLine:gsub(" ", ""):lower() then 514 | bIsAllowed = true; 515 | break; 516 | end 517 | 518 | end 519 | 520 | --if it's not allowed, set it to the default value 521 | if not bIsAllowed then 522 | sLine = sDefaultValue; 523 | end 524 | 525 | end 526 | 527 | tRet[sType] = sLine; 528 | end 529 | 530 | end 531 | 532 | end 533 | 534 | --ensure the block is valid before returning it 535 | for sType, tType in pairs(dox.Types) do 536 | local sDataType = type(tRet[sType]); 537 | local bIsEmpty = false; 538 | 539 | --discover if the the item is empty 540 | if sDataType == "string" then 541 | 542 | if tRet[sType]:gsub(" ", "") == "" then 543 | bIsEmpty = true; 544 | end 545 | 546 | elseif sDataType == "table" then 547 | 548 | if #tRet[sType] < 1 then 549 | bIsEmpty = true; 550 | end 551 | 552 | end 553 | 554 | 555 | --try to get the default values for empty items 556 | if (tType.MustHaveChars or tType.RequiredType) and tType.DefaultValue and bIsEmpty then 557 | local sDefaultType = type(tType.DefaultValue); 558 | local bAllowDefault = false; 559 | 560 | --make sure the default value isn't empty 561 | if sDefaultType == "string" then 562 | 563 | if tType.DefaultValue:gsub(" ", "") ~= "" then 564 | bAllowDefault = true; 565 | end 566 | 567 | elseif sDefaultType == "table" then 568 | 569 | if #tType.DefaultValue > 0 then 570 | bAllowDefault = true; 571 | end 572 | 573 | end 574 | 575 | --insert the default value if allowed 576 | if bAllowDefault then 577 | tRet[sType] = tType.DefaultValue; 578 | bIsEmpty = false; 579 | end 580 | 581 | end 582 | 583 | --now, after all that, if the item is still invalid, return nil 584 | if tType.RequiredType and bIsEmpty then 585 | return nil 586 | end 587 | 588 | end 589 | 590 | end 591 | 592 | end 593 | 594 | return tRet 595 | end 596 | 597 | 598 | --[[! 599 | @module dox.parse 600 | @func dox.parse.sortModules 601 | @desc Sorts the modules and functions alphabetically. 602 | !]] 603 | function dox.parse.sortModules() 604 | --process the modules 605 | if dox.Modules then 606 | --sort them alphabetically 607 | local tModuleSorter = {}; 608 | --...but do so without case sensitivety 609 | local tModuleIndexer = {}; 610 | 611 | --store the 'dox.Modules' names in a numerically-indexed table for sorting 612 | for sModule, tModule in pairs(dox.Modules) do 613 | 614 | if #tModule.Blocks > 0 then 615 | --setup the module sorting tables 616 | local sModuleLC = string.lower(sModule); 617 | tModuleSorter[#tModuleSorter + 1] = sModuleLC; 618 | tModuleIndexer[sModuleLC] = sModule; 619 | 620 | local tFunctionSorter = {}; 621 | local tFunctionIndexer = {}; 622 | 623 | --sort the functions inside the modules as well 624 | for nIndex, tBlock in pairs(tModule.Blocks) do 625 | local sFunctionLC = string.lower(tBlock.Function); 626 | tFunctionSorter[nIndex] = sFunctionLC; 627 | tFunctionIndexer[sFunctionLC] = tBlock.Function 628 | end 629 | 630 | --sort the functions 631 | table.sort(tFunctionSorter); 632 | 633 | --reset the 'ProcessOrder' table 634 | dox.Modules[sModule].ProcessOrder = {}; 635 | 636 | --store the results in the 'ProcessOrder' table of each module 637 | for _, sFunctionLC in pairs(tFunctionSorter) do 638 | local sFunction = tFunctionIndexer[sFunctionLC]; 639 | 640 | for nBlockID, tBlock in pairs(tModule.Blocks) do 641 | 642 | if sFunction == tBlock.Function then 643 | local nNextIndex = #dox.Modules[sModule].ProcessOrder + 1; 644 | dox.Modules[sModule].ProcessOrder[nNextIndex] = nBlockID; 645 | break; 646 | end 647 | 648 | end 649 | 650 | end 651 | 652 | end 653 | 654 | end 655 | 656 | --sort it 657 | table.sort(tModuleSorter); 658 | 659 | --re/create the process order table 660 | local tMeta = { 661 | ProcessOrder = {}, 662 | }; 663 | 664 | --store the items in the metatable 665 | for nIndex, sModuleLC in pairs(tModuleSorter) do 666 | tMeta.ProcessOrder[nIndex] = tModuleIndexer[sModuleLC]; 667 | end 668 | 669 | --record the info in the meta table for later use 670 | setmetatable(dox.Modules, tMeta); 671 | 672 | --cleanup 673 | tTempModules = nil; 674 | end 675 | 676 | end -------------------------------------------------------------------------------- /dox/pulsar.lua: -------------------------------------------------------------------------------- 1 | dox.pulsar = {}; 2 | 3 | --[[! 4 | @module dox.pulsar 5 | @func dox.pulsar.writeSnippets 6 | @scope global 7 | @desc Writes pulsar snippets to the snippets file provided based on the lua files which were processed for documentation. 8 | @param pPulsarSnippetsFile string The full path to the pulsar snippets file. If it does not exist, it will be created. 9 | @param sSnippetSection string The section name for the snippets. Having sections allows for mutiple calls to write to the same file without overwrites. 10 | !]] 11 | --TODO account for json or cson. Right now, only cson is supported. 12 | --TODO check for auto-file creation. If this doesn't happen, make it happen. 13 | function dox.pulsar.writeSnippets(pPulsarSnippetsFile, sSnippetSection) 14 | 15 | --try to process pulsar snippets 16 | if (type(pPulsarSnippetsFile) == "string" and 17 | type(sSnippetSection) == "string" and 18 | sSnippetSection:gsub("%s", '') ~= "") then 19 | --snippet section names are NOT case sensitive 20 | local sSection = sSnippetSection:upper(); 21 | 22 | --open the snippets file 23 | local hSnippets = io.open(pPulsarSnippetsFile, "r"); 24 | 25 | --process the snippets if the file exists 26 | if (hSnippets) then 27 | local tModules = dox.Modules; 28 | --this has the process order for the modules 29 | local tMeta = getmetatable(tModules); 30 | 31 | --read the snippets file 32 | local sSnippetsFile = hSnippets:read("*all"); 33 | --declare and preconfigure required variables 34 | local sPreAppend = sSnippetsFile; 35 | local sAppend = ""; --this is the actual snippet code 36 | local sPostAppend = ""; 37 | local sSectionOpenTag = dox.Markers.Snippet.Start..sSection; 38 | local sSectionCloseTag = dox.Markers.Snippet.End..sSection; 39 | local sSourceLuaPrefix = "'.source.lua':"; 40 | 41 | for sLine in hSnippets:lines() do 42 | 43 | --TODO get the number of indentations that the code blocks should use based on the source:lua line's indentations 44 | if (sLine:gsub('%s', '') == "'.source.lua':") then 45 | sSourceLuaPrefix = ""; 46 | end 47 | 48 | end 49 | 50 | --look for the section 51 | local nSectionOpenTagStart, nSectionOpenTagEnd = sSnippetsFile:find(sSectionOpenTag, 1, true); 52 | 53 | --if the section already exists, prepare to overwrite it 54 | if (nSectionOpenTagStart ~= nil and nSectionOpenTagEnd ~= nil) then 55 | local nSectionCloseTagStart, nSectionCloseTagEnd = sSnippetsFile:find(sSectionCloseTag, nSectionOpenTagEnd + 1, true); 56 | 57 | if (nSectionCloseTagStart ~= nil and nSectionCloseTagEnd ~= nil) then 58 | sPreAppend = sSnippetsFile:sub(1, nSectionOpenTagStart - 1); 59 | sPostAppend = sSnippetsFile:sub(nSectionCloseTagEnd + 1); 60 | end 61 | 62 | end 63 | 64 | --close the file for reading 65 | hSnippets:close(); 66 | 67 | for nIndex, sModule in pairs(tMeta.ProcessOrder) do 68 | local tModule = tModules[sModule]; 69 | 70 | for _, nBlockID in pairs(tModule.ProcessOrder) do 71 | local tBlock = tModule.Blocks[nBlockID]; 72 | local sSnippet = "\n '"..tBlock.Function.."':"; 73 | local sParameters = ""; 74 | local sParamterDescriptions = ""; 75 | 76 | --get the function's parameters (if present) 77 | local nMaxParameters = #tBlock.Parameters; 78 | 79 | for nParamIndex, sLine in pairs(tBlock.Parameters) do 80 | 81 | if sLine:gsub("%s", ' ') ~= "" then 82 | local sComma = ", "; 83 | 84 | --add this paramter (in its entirety) to the descriptions section 85 | sParamterDescriptions = sParamterDescriptions.."\n arg# "..tostring(nParamIndex)..": "..sLine; 86 | 87 | --remove the comma if not needed 88 | if (nParamIndex == 1) then 89 | sComma = ""; 90 | end 91 | 92 | --TODO redo all these to use ANY space character(%s) rather than only a specific space character 93 | local nTypeStart, nTypeEnd = sLine:find(" ", 1, true); 94 | 95 | if (nTypeStart ~= nil and nTypeEnd ~= nil) then 96 | sParameters = sParameters..sComma..sLine:sub(1, nTypeStart - 1); 97 | end 98 | 99 | end 100 | 101 | end 102 | 103 | --note if the scope is local 104 | local sScope = ""; 105 | 106 | if (tBlock.Scope:lower() == "local") then 107 | sScope = "\nlocal"; 108 | end 109 | 110 | --get the return value (if any) 111 | local sReturn = ""; 112 | local sReturnType = "nil"; 113 | 114 | for nIndex, sReturnValue in pairs(tBlock.Return) do 115 | 116 | if (sReturnValue:gsub("%s", '') ~= "") then 117 | local nReturnTypeStart, _ = sReturnValue:find(" ", 1, true); 118 | 119 | if (nReturnTypeStart) then 120 | local nReturnTypeEnd, _ = sReturnValue:find(" ", nReturnTypeStart + 1, true); 121 | 122 | if (nReturnTypeEnd) then 123 | local sType = sReturnValue:sub(nReturnTypeStart + 1, nReturnTypeEnd - 1); 124 | sReturn = "\n Returns: <"..sType.."> "..sReturnValue:sub(nReturnTypeEnd + 1); 125 | sReturnType = sType; 126 | end 127 | 128 | end 129 | 130 | end 131 | 132 | end 133 | 134 | --check for an example 135 | local sExample = ""; 136 | if (tBlock.Example:gsub("%s", '') ~= "") then 137 | sExample = "\n "..tBlock.Example; 138 | end 139 | 140 | --concat the snippet string 141 | sSnippet = sSnippet.."\n 'description': '''"..sScope..tBlock.Description..sParamterDescriptions..sExample..sReturn.."'''"; 142 | sSnippet = sSnippet.."\n 'prefix': '"..tBlock.Function.."'"; 143 | sSnippet = sSnippet.."\n 'body': '''"..tBlock.Function.."("..sParameters..");'''"; 144 | sSnippet = sSnippet.."\n 'leftLabelHTML': 'f'"; 145 | sSnippet = sSnippet.."\n 'rightLabelHTML': '"..sReturnType.."'"; 146 | 147 | --TODO add the 'More' tag for linking to dox-generated documentation 148 | 149 | --TODO complete the other desired sections 150 | --[[ 151 | File = getDefaultValue("Example"), 152 | Module = getDefaultValue("Module"), 153 | Usage = getDefaultValue("Usage"), 154 | ]] 155 | 156 | sAppend = sAppend..sSnippet; 157 | end 158 | 159 | end 160 | 161 | --TODO this is appending cumulative new lines...check for a new line before adding one afger the sPreAppend; also check for multiplt end-file new lines 162 | --assemble the full file text 163 | local sFileText = sPreAppend.."\n"..sSectionOpenTag.."\n"..sSourceLuaPrefix..sAppend.."\n"..sSectionCloseTag.."\n"..sPostAppend; 164 | 165 | --open the file for writing 166 | local hSnippets = io.open(pPulsarSnippetsFile, "w"); 167 | 168 | if (hSnippets) then 169 | hSnippets:write(sFileText); 170 | hSnippets:close(); 171 | 172 | end 173 | 174 | end 175 | 176 | end 177 | 178 | end 179 | -------------------------------------------------------------------------------- /dox/settings.lua: -------------------------------------------------------------------------------- 1 | --the 'iterateChar()', 'tab()' and all other util functions are available here. 2 | 3 | --DO NOT ALTER THESE OR THE OUTPUT WILL NOT WORK CORRECTLY 4 | dox.CriticalFolders = { 5 | "dox", 6 | "modules", 7 | }; 8 | --_THIS MAY NEED TO BE DELETED SINCE WE"RE NOW ALLOWING HTML 9 | dox.EscapeChars = { 10 | [1] = { --& must come first in the sequence to prevent unwelcome, interative replacement 11 | Old = "&", 12 | New = "&", 13 | }, 14 | [2] = { 15 | Old = "\\>", 16 | New = ">", 17 | }, 18 | [3] = { 19 | Old = "\\<", 20 | New = "<", 21 | }, 22 | }; 23 | 24 | --the 'IGNORE' text is removed at the end of this file. 25 | dox.Markers = { 26 | Block = { 27 | Start = "--IGNORE[[!", 28 | End = "IGNORE!]]", 29 | }, 30 | Line = { 31 | Start = "<", 32 | End = ">", 33 | }, 34 | Module = { 35 | Start = "--[[IGNORE*", 36 | End = "*IGNORE]]", 37 | }, 38 | Snippet = { 39 | Start = "##### START DOX SNIPPETS -->>> ID: ", 40 | End = "##### <<<-- END DOX SNIPPETS ID: ", 41 | }, 42 | }; 43 | 44 | -- the module info id/name delimiters 45 | dox.ModuleDelimiter = ","; 46 | dox.ModuleInfoNameDelimiter = "|"; 47 | 48 | dox.ModuleItems = { 49 | authors = { 50 | Display = "", 51 | IsListItem = false, 52 | }, 53 | copyright = { 54 | Display = "Copyright", 55 | IsListItem = true, 56 | }, 57 | displayname = { --not input by user using this tag. The text for this is found in the moduleid tag. 58 | Display = "", 59 | IsListItem = false, 60 | }, 61 | dependencies = { 62 | Display = "Dependencies", 63 | IsListItem = true, 64 | }, 65 | description = { 66 | Display = "Description", 67 | IsListItem = true, 68 | }, 69 | features = { 70 | Display = "Features", 71 | IsListItem = true, 72 | }, 73 | email = { 74 | Display = "Email", 75 | IsListItem = true, 76 | }, 77 | license = { 78 | Display = "License", 79 | IsListItem = true, 80 | }, 81 | moduleid = { --IGNORED 82 | Display = "IGNORED", 83 | IsListItem = false, --IGNORED 84 | }, 85 | plannedfeatures = { 86 | Display = "Planned Features", 87 | IsListItem = true, 88 | }, 89 | todo = { 90 | Display = "Todo", 91 | IsListItem = true, 92 | }, 93 | usage = { 94 | Display = "Usage", 95 | IsListItem = true, 96 | }, 97 | version = { 98 | Display = "Current Version", 99 | IsListItem = false, 100 | }, 101 | versionhistory = { 102 | Display = "Version History", 103 | IsListItem = true, 104 | }, 105 | website = { 106 | Display = "Website", 107 | IsListItem = false, 108 | }, 109 | }; 110 | 111 | --this is where all the html-ready blocks of code wait to be processed 112 | dox.Modules = {}; 113 | 114 | dox.PageVars = { 115 | Author = "Centauri Soldier https://github.com/CentauriSoldier", 116 | Body = "", 117 | CSS = "",--must be blank if 'CSSPathAndVersion' is not 118 | CSSPathAndVersion = "",--must be blank if 'CSS' is not 119 | Description = "Lua Module Viewer", 120 | Title = "Dox Lua Code Viewer", 121 | }; 122 | 123 | dox.SpecialChars = { 124 | [1] = { --this is always the line character for blocks of any type(function, module, etc.). 125 | Intended = "@", 126 | Escaped = "\\@", 127 | Temp = " __!!DOXAT!!__ ", 128 | }, 129 | [2] = { 130 | Intended = "<", 131 | Escaped = "\\<", 132 | Temp = " __!!DOXLT!!__ ", 133 | }, 134 | [3] = { 135 | Intended = ">", 136 | Escaped = "\\>", 137 | Temp = " __!!DOXGT!!__ ", 138 | }, 139 | }; 140 | 141 | --[[TODO ADD THIS TO THE USAGE POTION OF THE MODULE INFO SECTION UNDER 'Customization'. 142 | How To Add A Type. 143 | 1. Add here and set table variables to those desired. 144 | 2. add the value to the 'tRet' table in the 'dox.parse.processBlock()' function in the 'parse.lua' file. 145 | 3. Edit the 'dox.html.buildModule()' function in the 'html.dox' file to include the new Type 146 | Note: if no default value is set and there is no value given by the end-user (for a specific function), it will be a blank string 147 | ]] 148 | 149 | dox.Types = { 150 | Description = { 151 | Variations = { 152 | "des", 153 | "desc", 154 | "description", 155 | }, 156 | }, 157 | Example = { 158 | Variations = { 159 | "ex", 160 | "example", 161 | "examples", 162 | }, 163 | }, 164 | File = { 165 | Variations = { 166 | "file", 167 | }, 168 | }, 169 | Function = { 170 | --MustHaveChars = true, Assumed to be true by 'RequiredType == true' 171 | RequiredType = true, 172 | Variations = { 173 | "fun", 174 | "func", 175 | "function", 176 | }, 177 | }, 178 | Module = { 179 | DefaultValue = "Unknown", 180 | MustHaveChars = true, 181 | Variations = { 182 | "module", 183 | "mod", 184 | }, 185 | }, 186 | Parameters = { 187 | AllowMultiple = true, 188 | Parser = { 189 | [1] = { --variable name example 190 | StartTag = '', 191 | EndTag = "", 192 | }, 193 | [2] = { --variable type 194 | StartTag = '', 195 | EndTag = "", 196 | }, 197 | [3] = { --description/notes 198 | StartTag = '', 199 | EndTag = "", 200 | }, 201 | }, 202 | ParserCSS = '\t\t\t.parameterinput{\n\t\t\t\tfont-weight: bold;\n\t\t\t\tfont-size: 90%;\n\t\t\t}\n\n\t\t\t\t.parametertype{\n\t\t\tfont-style: italic;\n\t\t\t\tfont-size: 90%;\n\t\t\t}\n\n\t\t\t.parameterdesc{\n\t\t\t\tfont-size: 90%;\n\t\t\t}\n\n'; 203 | ParserSeparator = " | ", 204 | Variations = { 205 | "parameter", 206 | "param", 207 | }, 208 | }, 209 | Return = { 210 | AllowMultiple = true, 211 | Parser = { 212 | [1] = { --variable name example 213 | StartTag = '', 214 | EndTag = "", 215 | }, 216 | [2] = { --variable type 217 | StartTag = '', 218 | EndTag = "", 219 | }, 220 | [3] = { --description/notes 221 | StartTag = '', 222 | EndTag = "", 223 | }, 224 | }, 225 | ParserCSS = '\t\t\t.returnvariable{\n\t\t\t}'; 226 | ParserSeparator = " | ", 227 | Variations = { 228 | "return", 229 | "ret", 230 | }, 231 | }, 232 | Scope = { 233 | AllowedValues = { -- if using this table, the 'DefaultValue' attribute must also be present (although ,the inverse is NOT true) 234 | "global", 235 | "local", 236 | }, 237 | DefaultValue = "global", --this method of forcing values cannot currently be used in conjunction with the 'Parser' attribute, it only works with single items at the moment. 238 | Variations = { 239 | "scope", 240 | }, 241 | }, 242 | Usage = { 243 | Variations = { 244 | "usage", 245 | "use", 246 | }, 247 | }, 248 | }; 249 | 250 | dox.Version = "0.1.0"; 251 | 252 | --this has to be done to prevent the script from incorrectly looking at the marker code above 253 | for sIndex, tItem in pairs(dox.Markers) do 254 | 255 | for sSubIndex, vItem in pairs(tItem) do 256 | 257 | --global markers 258 | if tItem.Start and tItem.End then 259 | dox.Markers[sIndex][sSubIndex] = dox.Markers[sIndex][sSubIndex]:gsub("IGNORE", ""); 260 | end 261 | 262 | end 263 | 264 | end -------------------------------------------------------------------------------- /dox/theme.lua: -------------------------------------------------------------------------------- 1 | --Note: 'dox.Theme' contains settings whereas 'dox.theme' contains functions 2 | dox.theme = {}; 3 | dox.Theme = { 4 | ActiveTheme = "Plain", 5 | DefaultTheme = "Plain", 6 | Themes = { 7 | ["Custom"] = {}, 8 | ["Insta Hip"] = { 9 | Colors = { 10 | --[[ 11 | instahip 12 | #3b1f2b 13 | #db162f 14 | #dbdfac 15 | #5f758e 16 | #383961 17 | ]] 18 | ParagraphText = "#000",--common text 19 | BackgroundContent = "#db162f", 20 | BackgroundSurround = "#db162f", 21 | BackgroundOutline = "#aaa", 22 | LinkText = "#dce6ee", 23 | LinkHover = "#9fecf4", 24 | MenuNormal = "#373737", 25 | MenuNormalText = "#f0f0f0", 26 | MenuHighlight = "#595959", 27 | ParagraphText = "#000", 28 | PageHeader = "#728190", 29 | SectionTitle = "#5f758e", 30 | }, 31 | ImageCode = 'background-image: url("images/pastel.jpg");', 32 | ImageRepeatCode = "repeat;", 33 | }, 34 | ["Plain"] = { 35 | Colors = { 36 | --[[1984 37 | #bfb48f 38 | #564e58 39 | #904e55 40 | #f2efe9 41 | #252627 42 | ]] 43 | BackgroundContent = "#ddd", 44 | BackgroundSurround = "#ccc", 45 | BackgroundOutline = "#aaa", 46 | LinkText = "#8fa7b6", 47 | LinkHover = "#b5ddff", 48 | MenuNormal = "#373737", 49 | MenuNormalText = "#f0f0f0", 50 | MenuHighlight = "#595959", 51 | ParagraphText = "#000", 52 | PageHeader = "#728190", 53 | SectionTitle = "#495867", 54 | Special_1 = "a0a0ff", --used on '#scope' atm 55 | Special_2 = "000077", --used on variable type 56 | Special_3 = "", 57 | Special_4 = "", 58 | Special_5 = "", 59 | }, 60 | ImageCode = '', 61 | ImageRepeatCode = "", 62 | }, 63 | }, 64 | }; 65 | 66 | 67 | function dox.theme.setActive(sTheme) 68 | 69 | if dox.Theme.Themes[sTheme] then 70 | dox.Theme.ActiveTheme = sTheme; 71 | end 72 | 73 | end 74 | 75 | function dox.theme.getBGImage() 76 | local sImage = ""; 77 | local sActiveTheme = dox.Theme.ActiveTheme; 78 | local sDefaultTheme = dox.Theme.DefaultTheme; 79 | local tThemes = dox.Theme.Themes; 80 | 81 | --try to get the color from the active theme 82 | if tThemes[sActiveTheme] then 83 | 84 | if tThemes[sActiveTheme].ImageCode then 85 | return tThemes[sActiveTheme].ImageCode 86 | end 87 | 88 | end 89 | 90 | 91 | --if something goes wrong, try the default theme 92 | if tThemes[sDefaultTheme] then 93 | 94 | if tThemes[sDefaultTheme].ImageCode then 95 | return tThemes[sDefaultTheme].ImageCode 96 | end 97 | 98 | end 99 | 100 | return sImage 101 | end 102 | 103 | 104 | --[[! 105 | DEPRECATED - DELETE THIS AND THE RELATED TABLES INDICES 106 | !]] 107 | function dox.theme.getBGImageRepeat() 108 | local sImageRepeatCode = ""; 109 | local sActiveTheme = dox.Theme.ActiveTheme; 110 | local sDefaultTheme = dox.Theme.DefaultTheme; 111 | local tThemes = dox.Theme.Themes; 112 | 113 | --try to get the color from the active theme 114 | if tThemes[sActiveTheme] then 115 | 116 | if tThemes[sActiveTheme].ImageRepeatCode then 117 | return tThemes[sActiveTheme].ImageRepeatCode 118 | end 119 | 120 | end 121 | 122 | 123 | --if something goes wrong, try the default theme 124 | if tThemes[sDefaultTheme] then 125 | 126 | if tThemes[sDefaultTheme].ImageRepeatCode then 127 | return tThemes[sDefaultTheme].ImageRepeatCode 128 | end 129 | 130 | end 131 | 132 | return sImageRepeatCode 133 | end 134 | 135 | 136 | --[[! 137 | @module dox.theme 138 | @func dox.theme.getColor 139 | @desc Gets a color of the selected type from the currently-active theme. 140 | @param sType string The index of the color item to get. 141 | @ret sColor returns the hex color or an error color is the index input does not exist in the theme. 142 | !]] 143 | function dox.theme.getColor(sApplication) 144 | local sColor = "#ff00ff"; --error color 145 | local sActiveTheme = dox.Theme.ActiveTheme; 146 | local sDefaultTheme = dox.Theme.DefaultTheme; 147 | local tThemes = dox.Theme.Themes; 148 | 149 | --try to get the color from the active theme 150 | if tThemes[sActiveTheme] then 151 | 152 | if tThemes[sActiveTheme].Colors[sApplication] then 153 | return tThemes[sActiveTheme].Colors[sApplication] 154 | end 155 | 156 | end 157 | 158 | 159 | --if something goes wrong, try the default theme 160 | if tThemes[sDefaultTheme] then 161 | 162 | if tThemes[sDefaultTheme].Colors[sApplication] then 163 | return tThemes[sDefaultTheme].Colors[sApplication] 164 | end 165 | 166 | end 167 | 168 | return sColor 169 | end 170 | 171 | --[[colors 172 | autumn 173 | #3f2d3b 174 | #743042 175 | #9c1f2d 176 | #dd800b 177 | #fab509 178 | 179 | wheat 180 | #7b3800 181 | #df9659 182 | #efd3c4 183 | #ddd6d6 184 | #c7b8b2 185 | 186 | watermelon 187 | #262b06 188 | #628519 189 | #98c543 190 | #c6e17e 191 | #92290b 192 | 193 | winter evening 194 | #0f1225 195 | #1f4b8e 196 | #adbccd 197 | #f1ece6 198 | #eadbd4 199 | 200 | 201 | 202 | winding down 203 | #c5ebc3 204 | #b7c8b5 205 | #a790a5 206 | #875c74 207 | #54414e 208 | 209 | instahip 210 | #3b1f2b 211 | #db162f 212 | #dbdfac 213 | #5f758e 214 | #383961 215 | ]] -------------------------------------------------------------------------------- /dox/util.lua: -------------------------------------------------------------------------------- 1 | dox.util = {}; 2 | 3 | --ignore files cause dox to ignore files/folders where the files are found 4 | local sDoxIgnoreFile = ".doxignore"; --ignores all files in current directory 5 | local sDoxIgnoreSubFile = ".doxignoresub"; --ignores all files in sub directories 6 | local sDoxIgnoreAllFile = ".doxignoreall"; --ignores all files current and subdirectories 7 | 8 | local nMinFileLength = 5; --some character plus a dot then the file extension (e.g., t.lua) 9 | 10 | --get directory spacer 11 | local _ = package.config:sub(1,1); 12 | --get the os type 13 | local sOSType = _ == "\\" and "windows" or (_ == "/" and "unix" or "unknown"); 14 | 15 | local tFileFindMethods = { 16 | ["unix"] = { 17 | fileFind = function(sDir, sFile, bRecursive) 18 | local sRecurs = bRecursive and "" or " -maxdepth 1 "; 19 | return 'find "'..sDir..'"'..sRecurs..'-name "'..sFile..'"' 20 | end, 21 | }, 22 | ["windows"] = { 23 | fileFind = function(sDir, sFile, bRecursive) 24 | local sRecurs = bRecursive and " /s" or ""; 25 | return 'dir "'..sDir.."\\"..sFile..'" /b'..sRecurs; 26 | end, 27 | }, 28 | }; 29 | 30 | 31 | --[[! 32 | @module dox.util 33 | @func dox.util.getOSType 34 | @desc Determines the operating system type the end-user if running. 35 | @ret sOSType string returns 'windows' if it is a Windows systems and 'unix' if it a unix-based system. 36 | !]] 37 | function dox.util.getOSType() 38 | return sOSType; 39 | end 40 | 41 | 42 | function dox.util.getProcessList(sDir, bRecurse, tFiles) 43 | local tRet = type(tFiles) == "table" and tFiles or {}; 44 | --TODO finish the unix commands 45 | --setup the commands 46 | local sGetFilesCommand = (_ == "\\") and ('dir "'..sDir..'\\*.*" /b /a-d'):gsub("\\\\", "\\") or ('find '..sDir.."/"..'-maxdepth 1 ! –type d'):gsub("//", "/"); 47 | local sGetDirsCommand = (_ == "\\") and ('dir "'..sDir..'\\*.*" /b /d'):gsub("\\\\", "\\") or ("ls -a -d /*"):gsub("//", "/"); 48 | 49 | local hFiles = io.popen(sGetFilesCommand); 50 | 51 | --process files and folders 52 | if (hFiles) then 53 | local bIgnore = false; 54 | local bIgnoreSub = false; 55 | local bIgnoreAll = false; 56 | local tFiles = {}; 57 | 58 | --look for ignore files 59 | for sFile in hFiles:lines() do 60 | 61 | if (sFile == sDoxIgnoreAllFile) then 62 | bIgnoreAll = true; 63 | break; --no need to continue at this point 64 | end 65 | 66 | if (sFile == sDoxIgnoreSubFile) then 67 | bIgnoreSub = true; 68 | end 69 | 70 | if (sFile == sDoxIgnoreFile) then 71 | bIgnore = true; 72 | end 73 | 74 | if not (bIgnoreAll or bIgnore) then 75 | tFiles[#tFiles + 1] = sFile; 76 | end 77 | 78 | end 79 | 80 | --only process items if the .doxignoreall file was NOT found 81 | if not (bIgnoreAll) then 82 | 83 | --add (any) files that exist to the return table 84 | for nIndex, sFile in pairs(tFiles) do 85 | 86 | --check that the file type is valid 87 | if (sFile:len() >= nMinFileLength and sFile:reverse():sub(1, 4):lower() == "aul.") then 88 | --add the file to the list 89 | tRet[#tRet + 1] = sDir.._..sFile; 90 | end 91 | 92 | end 93 | 94 | --process subdirectories 95 | if not (bIgnoreSub) then 96 | local hDirs = io.popen(sGetDirsCommand); 97 | 98 | if (hDirs) then 99 | 100 | for sDirectory in hDirs:lines() do 101 | dox.util.getProcessList(sDir.._..sDirectory, bRecurse, tRet); 102 | end 103 | 104 | end 105 | 106 | end 107 | 108 | end 109 | 110 | end 111 | 112 | return tRet; 113 | end 114 | 115 | 116 | --[[! 117 | @module dox.util 118 | @func dox.util.fileFind 119 | @desc Searches for file(s) based on the input. 120 | @param sDir string The directory which to search. The type of path formatting is irrelevant. I.e., Both "C:\\MyDirectory" and "/MyDirectory" are valid formatting methods for this input. 121 | @param sFile string The file or file pattern to find. 122 | @param bRecursive boolean,nil If true, the function will search for the file/pattern recursively. 123 | @ret tFiles table A numerically-indexed table whose values are the paths of the found item(s). If no items are found, an empty table is returned. 124 | !]] 125 | function dox.util.fileFind(sDir, sFile, bRecursive) 126 | local tRet = {}; 127 | local nIndex = 0; 128 | 129 | if type(sDir) == "string" and type(sFile) == "string" then 130 | 131 | --ensure the slashes are correct (for systems that use a unix separator '/' on Windows and vice versa) 132 | if sOSType == "windows" then 133 | sDir = sDir:gsub("/", "\\"); 134 | 135 | elseif sOSType == "unix" then 136 | sDir = sDir:gsub("\\", "/"); 137 | 138 | end 139 | 140 | --create the command 141 | local sCommand = tFileFindMethods[sOSType].fileFind(sDir, sFile, bRecursive) 142 | 143 | --read the dir 144 | local hFiles = io.popen(sCommand); 145 | 146 | if hFiles then 147 | 148 | --add each file to the list 149 | for sFile in hFiles:lines() do 150 | nIndex = nIndex + 1; 151 | tRet[nIndex] = sFile; 152 | end 153 | 154 | --add the path names to the files (if needed) 155 | if sOSType == "windows" then 156 | 157 | if not bRecursive then 158 | 159 | for nIndex, sFile in pairs(tRet) do 160 | tRet[nIndex] = sDir.._..sFile; 161 | tRet[nIndex] = tRet[nIndex]:gsub("/", "\\"); 162 | end 163 | 164 | end 165 | 166 | end 167 | 168 | --if the table has no files, return nil 169 | if not tRet[1] then 170 | return nil --TODO this does not allow hFIle to close! 171 | end 172 | 173 | hFiles:close(); 174 | end 175 | 176 | end 177 | 178 | return tRet 179 | end 180 | 181 | --TODO isn't this a native lua function? check and, if so, replace 182 | --[[! 183 | @module dox.util 184 | @func dox.util.interateChar 185 | @desc Creates a string where the 'sString' input is concatenated n times where n = 'nCount' input. 186 | @param sString string The string to be concatenated. 187 | @param nCount number The number of times to concatenate the string. 188 | @ret sString string Returns the concatenated string. If 'nCount' is nil or not a valid number then a blank string is returned. 189 | !]] 190 | function dox.util.interateChar(sChar, nCount) 191 | local sRet = ""; 192 | 193 | if type(sChar) == "string" and type(nCount) == "number" then 194 | 195 | for x = 1, nCount do 196 | sRet = sRet..sChar; 197 | end 198 | 199 | end 200 | 201 | return sRet 202 | end 203 | 204 | 205 | --[[! 206 | @module dox.util 207 | @func dox.util.isEven 208 | @desc Determines whether or not a number is even (or odd, implicitly). 209 | @param nNumber number The number to evaluate. 210 | @ret bEven boolean Returns true if the number is even and false if it is not. 211 | !]] 212 | function dox.util.isEven(nNumber) 213 | local nAbsNumber = math.abs(nNumber) / 2; 214 | 215 | if nAbsNumber - math.floor(nAbsNumber) == 0 then 216 | return true 217 | end 218 | 219 | return false 220 | end 221 | 222 | 223 | --[[! 224 | @module dox.util 225 | @func dox.util.tab 226 | @desc Creates x number of tab strings. 227 | @param nTabs number The number of tabs to stack together. 228 | @param bNewLineFirst boolean,nil If true, this creates a new line before concatenating the tabs. 229 | @ret sTabs string The concatenated string or a blank string is 'nTabs' is not a valid number. 230 | !]] 231 | function dox.util.tab(nTabs, bNewLineFirst) 232 | local sRet = ""; 233 | 234 | if bNewLineFirst then 235 | sRet = sRet.."\n"; 236 | end 237 | 238 | if type(nTabs) == "number" then 239 | 240 | for x = 1, nTabs do 241 | sRet = sRet.."\t"; 242 | end 243 | 244 | end 245 | 246 | return sRet 247 | end 248 | 249 | 250 | --[[! 251 | @module dox.util 252 | @func dox.util.trim 253 | @desc Trims the trailing and leading whitespace from a string. This function not by Centauri Soldier (http://en.wikipedia.org/wiki/Trim_(8programming)) 254 | @param sString string The string to be trimmed. 255 | @ret sTrimmedString string The trimmed string. 256 | !]] 257 | function dox.util.trim(s) 258 | -- from PiL2 20.4 259 | return (s:gsub("^%s*(.-)%s*$", "%1")) 260 | end 261 | -------------------------------------------------------------------------------- /favicon_io/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentauriSoldier/Dox/efb46913f905cdcba503c137fb164a02841d2173/favicon_io/android-chrome-192x192.png -------------------------------------------------------------------------------- /favicon_io/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentauriSoldier/Dox/efb46913f905cdcba503c137fb164a02841d2173/favicon_io/android-chrome-512x512.png -------------------------------------------------------------------------------- /favicon_io/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentauriSoldier/Dox/efb46913f905cdcba503c137fb164a02841d2173/favicon_io/apple-touch-icon.png -------------------------------------------------------------------------------- /favicon_io/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentauriSoldier/Dox/efb46913f905cdcba503c137fb164a02841d2173/favicon_io/favicon-16x16.png -------------------------------------------------------------------------------- /favicon_io/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentauriSoldier/Dox/efb46913f905cdcba503c137fb164a02841d2173/favicon_io/favicon-32x32.png -------------------------------------------------------------------------------- /favicon_io/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CentauriSoldier/Dox/efb46913f905cdcba503c137fb164a02841d2173/favicon_io/favicon.ico -------------------------------------------------------------------------------- /favicon_io/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} -------------------------------------------------------------------------------- /help/dox/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Welcome 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /help/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Dox Lua Code Viewer 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |

Dox Lua Code Viewer

21 |
22 |
23 |
24 |
25 | 26 |
27 |
28 | 114 | 116 |
117 | 118 | 119 | -------------------------------------------------------------------------------- /help/modules/dox.base64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Dox Lua Code Viewer 8 | 9 | 10 | 11 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |
33 |
34 |

Dox.Base64 35 | v0.0.8 36 | 37 |

38 |

by Centauri Soldier 39 |

40 |

https://github.com/CentauriSoldier/Dox 42 |

43 |
44 |
    45 |
  • 46 | 47 |
    48 | Copyright 49 |
    50 |
    51 | Copyright © 2016 Centauri Soldier 52 | 53 |
    54 |
    55 |
  • 56 |
  • 57 | 58 |
    59 | Description 60 |
    61 |
    62 |

    Dox

    63 |

    The Simple Lua Documentation Generator

    64 |

    Dox is a light-weight script designed to parse crafted lua comments regarding modules and functions and output them to readable, sorted and linked HTML. Dox enables you to quickly and simply create documentation for your lua code without the need to install programs or to run anything other than the Dox script. In fact, it's so simple, you can have documentation in as few as 2 lines of code.

    65 | 66 |
    67 |
    68 |
  • 69 |
  • 70 | 71 |
    72 | Features 73 |
    74 |
    75 |

    Multi-platform

    76 |

    Dox works with all major versions of Windows and Linux.

    77 |

    Dox can be used on unix based systems or Windows without having to convert directory or file paths. Dox will auto-detect and convert paths as needed.

    78 |

    No Dependencies

    79 |

    Dox needs nothing but itself and your lua files in order to run correctly. No installing, no configuring, no mess.

    80 |

    Dox is Robust

    81 |

    Dox is fine with you mixing up your code. Functions from different modules may be in one single file or you may even have a single module spread around different files. Dox is very forgiving in how you organize your modules. You could even have all your dox comments for multiple modules in a single file (although such a practice is not likely to be desired or cenvenient, just meant as demonstration). Simply put, Dox loves your code no matter where it's at and how it's organized (or unorganized, for that matter). Dox will sort it all out for you when it's processed. There's no need for you go out of your way to organize functions or modules a certain way. Organize them how you please and Dox will do the rest.

    82 | 83 |
    84 |
    85 |
  • 86 |
  • 87 | 88 |
    89 | License 90 |
    91 |
    92 |

    The MIT License (MIT)
    93 |
    94 | Copyright (c) 2016 Centauri Soldier
    95 |
    96 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    97 |
    98 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    99 |
    100 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 101 |

    102 | 103 |
    104 |
    105 |
  • 106 |
  • 107 | 108 |
    109 | Planned Features 110 |
    111 |
    112 |
      113 |
    • Allow themes to set images
    • 114 |
    • Set return section in the html to show no return if none are listed.
    • 115 |
    • Finish and port the new util filesystem function to 'os.lua' in the luax module
    • 116 |
    • Allow Table Input for themes
    • 117 |
    • Responsive CSS for menus
    • 118 |
    • Force all menu items into the top menu if there only one module in the output
    • 119 |
    • Dox menu item with home, usage and other useful pages
    • 120 |
    • Add project info function (for all compiled modules);
    • 121 |
    • ADD the ability to get HTML string only without needing to write a file
    • 122 |
    • TODO - AddSupport for custom, external css ===>>> PUT INTO HTML HEAD
    • 123 |
    • Add a 'Custom' line type
    • 124 |
    • Add support for new lines after certain tags in the function block
    • 125 |
    • Add Support for TODO, Current Features and Planned Feature
    • 126 |
    • Add auto-css assignment if css tag is not present in file (using lua debug library to get directory of this file)
    • 127 |
    • More theme support.
    • 128 |
    129 | 130 |
    131 |
    132 |
  • 133 |
  • 134 | 135 |
    136 | Todo 137 |
    138 |
    139 |
      140 |
    • Add Mac Support
    • 141 |
    • Test wrapping block items in '<pre>' html tags
    • 142 |
    • Auto-remove parantheses in function name before processing
    • 143 |
    • Return the paramters/return as a table instead of a string (convert blockToTable to work for the html)
    • 144 |
    • More awareness in function sorting
    • 145 |
    • Put question marks where version info goes when the info is not available
    • 146 |
    • Redo Block layout to be simpler
    • 147 |
    • Fix HTML bug that occurs when module info is not present
    • 148 |
    • Create css for inner--module html classes such as 'parameter'.
    • 149 |
    • Create code glossary for the terms used within the dox code such as 'module', 'block', etc.
    • 150 |
    • Allow multiple types in parameters for functions
    • 151 |
    • Clean up css and html (get some help from someone who knows html/css well)
    • 152 |
    • Fix the space-finding (%s) pattern matching attempt in gsub
    • 153 |
    • Fix the top-right contentwrapper corner, it's cutting off part of the scroll bar
    • 154 |
    • CONSIDER AUTO-CHECKING FOR LINKS AND ADDING THEM FOR THE 'getAccordionList()' method in dox.html
    • 155 |
    • Deal with module name conflicts
    • 156 |
    • Add CSS/HTML validation tags to the footer, update the footer with real data back to the github
    • 157 |
    • Fix the width issue in the css #contentwrapper (it's currently using a hack)
    • 158 |
    • Write a short guide showing how to add tags to the different block types (HIGH)
    • 159 |
    • Create a LOVE-based GUI for making these blocks (LOW)
    • 160 |
    • Find out why 'funct' triggers an error (as it should) but 'function' does not when looking for an extra character on the 'func' tag LOW PRIORITY
    • 161 | 162 |
    163 | 164 |
    165 |
    166 |
  • 167 |
  • 168 | 169 |
    170 | Usage 171 |
    172 |
    173 |

    Take a breath...

    174 | Now, I know this is a new way to document your code, but I've made it as painless as possible. Once you read this section, you'll be ready to start documenting and you'll see how simple Dox is to use. 175 |

    Function Info Block

    176 |

    177 | This is primary element of Dox that makes it work. In fact, without at least one function info block, Dox will not process the target module since there would be no information to process. 178 |

    179 | The function info block is wrapped in a multi-line lua comment whose start tag is --[[! and end tag is !]]. 180 |

    181 |

    Function Info Block Block Tags

    182 |

    183 | Elements inside the function info block are designated by an "@" symbol directly followed by the desired tag and tag information. 184 |
    185 | Below is a list of currently usable tags for this block as well as their formatting and usage details. 186 |

    187 |
      188 |
    • Description
    • 189 |
    • Example
    • 190 |
    • Function
    • 191 |
    • Module
    • 192 |
    • Parameter
    • 193 |
    • Return
    • 194 |
    • Scope
    • 195 |
    • Usage
    • 196 |
    197 |

    Module Info Block

    198 |

    199 | The module information is wrapped in a multiline lua comment whose start tag is --[[* and end tag is *]]. The content of this block is displayed at the top of the module page within and accordion menu (the one you're using right now). 200 |

    201 | Note: Unlike (at least one) function info block, the module info block is not required. Dox will function just fine with or without the module info block; you may omit the entire thing if you wish. Additionaly, if you do choose to use the module info block, only one of the tags (listed below) are required: the 'module' tag is required if using the module info block although you may use one, all or none of the remaining tags (or anything in between). 202 |

    203 | Unlike the function info block, the module info block has no tags that are sensitive to spaces and new lines. This feature makes it very easy to use html with your module info block. As you can see, you're reading text right now that has been formatted within the comment block of the dox.lua file. 204 |

    205 | Within the block are tags. These tags start and end just like html tags do, with <tagname> as the start tag and </tagname> as the end tag where tagname is the name of the tag. Below is a complete list of supported tags. 206 |

    207 |
      208 |
    • authors
    • 209 |
    • copyright
    • 210 |
    • dependencies
    • 211 |
    • description
    • 212 |
    • features
    • 213 |
    • email
    • 214 |
    • license
    • 215 |
    • moduleid(required)
    • 216 |
    • plannedfeatures
    • 217 |
    • todo
    • 218 |
    • usage
    • 219 |
    • version
    • 220 |
    • versionhistory
    • 221 |
    • website
    • 222 |
    223 |

    The moduleid Tag

    224 |

    You may enter one to many items for the 'moduleid' tag. For example, if your module name is myClass then you'd enter it exactly as the class name since the 'moduleid' tag is case sensitive.; however, you can control how it's displayed at the top of the page. To include a display name, simply use a pipe (|) and type the display next like this myClass|MyClass. 225 |

    226 | If you have sub modules such as myClass.otherStuff and you'd like the module block for myClass to display on the myClass.otherStuff page, use a comma to indicate another module and simlpy add it the 'moduleid' tag like so: myClass|MyClass,myClass.otherStuff and if you'd like a differnt display name for that module too, just add it in: myClass|MyClass,myClass.otherStuff|MyClass.otherStuff. It's that easy. 227 |

    228 |

    Special Characters

    229 |

    The '@' symbol cannot be used in your text without escaping it since it is a special character that tells Dox where to start a line; however, you can escape it in your text using a backslash (\) and the '@' will be put there by Dox when processing is complete: E.g., @. Additionaly, any text inside free-format items (like authors, website, description, etc. as opposed to items like param, function, etc. that are more restricted) is treated like html including any html tags you may want to use. Of course, this means that you'll need to escape the '<' and '>' symbols in your text if you want them to be presented as-is. 230 |

    231 | Below is a complete list of special characters that need escaped to be displayed as themselves. 232 |

    233 |
    234 |
      235 |
    • @
    • 236 |
    • >
    • 237 |
    • <
    • 238 |
    239 | 240 |
    241 |
    242 |
  • 243 |
  • 244 | 245 |
    246 | Version History 247 |
    248 |
    249 |
      250 |
    • 251 | 0.0.9 252 |
      253 |

      Added support for linux.

      254 |
    • 255 |
    • 256 | 0.0.8 257 |
      258 |

      Fixed a bug in the local 'import()' function.

      259 |
    • 260 |
    • 261 | 0.0.7 262 |
      263 |

      Added the ability to allow a module block to be displayed for multiple modules as desired

      264 |

      Module names can now be displayed differently as desired.

      265 |
    • 266 |
    • 267 | 0.0.6 268 |
      269 |

      Fixed a bug that was omitting the last entry of blocks.

      270 |

      Added the ability for dox to normally and recursively scan directories and process all files at once.

      271 |
    • 272 |
    • 273 | 0.0.5 274 |
      275 |

      Fixed a bug that allowed empty modules and empty blocks.

      276 |

      Reconfigured Start and End tags to be easier to use.

      277 |

      Reconfigured function blocks tags to be easier to use.

      278 |
    • 279 |
    • 280 | 0.0.4 281 |
      282 |

      Added the binary module and included embeded images for the output.

      283 |

      Added the Welcome.html page.

      284 |
    • 285 |
    • 286 | 0.0.3 287 |
      288 |

      Moved from a single-page output to a multi-page one.

      289 |

      Added the Module Info panel for each module.

      290 |

      Output CSS to and external file (style.css).

      291 |
    • 292 |
    • 293 | 0.0.2 294 |
      295 |

      Refactored the code and ported all logical functions to modules.

      296 |
    • 297 |
    • 298 | 0.0.1 299 |
      300 |

      Created Dox in all its wonder...and despair.

      301 |
    • 302 |
    303 | 304 |
    305 |
    306 |
  • 307 |
308 |
309 |
310 |

311 |

dox.base64.getData()

global 312 | 313 |

Parameters

314 |

[sDataIndex | string | The name of the table index that contains the base64 data string.]

315 |

Description

316 |

Returns the base64 data string for encoded files.

317 | 318 |
319 |
320 |
321 |
322 | 323 | 324 | -------------------------------------------------------------------------------- /help/modules/dox.css.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Dox Lua Code Viewer 8 | 9 | 10 | 11 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |
33 |
34 |

Dox.CSS 35 | v0.0.8 36 | 37 |

38 |

by Centauri Soldier 39 |

40 |

https://github.com/CentauriSoldier/Dox 42 |

43 |
44 |
    45 |
  • 46 | 47 |
    48 | Copyright 49 |
    50 |
    51 | Copyright © 2016 Centauri Soldier 52 | 53 |
    54 |
    55 |
  • 56 |
  • 57 | 58 |
    59 | Description 60 |
    61 |
    62 |

    Dox

    63 |

    The Simple Lua Documentation Generator

    64 |

    Dox is a light-weight script designed to parse crafted lua comments regarding modules and functions and output them to readable, sorted and linked HTML. Dox enables you to quickly and simply create documentation for your lua code without the need to install programs or to run anything other than the Dox script. In fact, it's so simple, you can have documentation in as few as 2 lines of code.

    65 | 66 |
    67 |
    68 |
  • 69 |
  • 70 | 71 |
    72 | Features 73 |
    74 |
    75 |

    Multi-platform

    76 |

    Dox works with all major versions of Windows and Linux.

    77 |

    Dox can be used on unix based systems or Windows without having to convert directory or file paths. Dox will auto-detect and convert paths as needed.

    78 |

    No Dependencies

    79 |

    Dox needs nothing but itself and your lua files in order to run correctly. No installing, no configuring, no mess.

    80 |

    Dox is Robust

    81 |

    Dox is fine with you mixing up your code. Functions from different modules may be in one single file or you may even have a single module spread around different files. Dox is very forgiving in how you organize your modules. You could even have all your dox comments for multiple modules in a single file (although such a practice is not likely to be desired or cenvenient, just meant as demonstration). Simply put, Dox loves your code no matter where it's at and how it's organized (or unorganized, for that matter). Dox will sort it all out for you when it's processed. There's no need for you go out of your way to organize functions or modules a certain way. Organize them how you please and Dox will do the rest.

    82 | 83 |
    84 |
    85 |
  • 86 |
  • 87 | 88 |
    89 | License 90 |
    91 |
    92 |

    The MIT License (MIT)
    93 |
    94 | Copyright (c) 2016 Centauri Soldier
    95 |
    96 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    97 |
    98 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    99 |
    100 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 101 |

    102 | 103 |
    104 |
    105 |
  • 106 |
  • 107 | 108 |
    109 | Planned Features 110 |
    111 |
    112 |
      113 |
    • Allow themes to set images
    • 114 |
    • Set return section in the html to show no return if none are listed.
    • 115 |
    • Finish and port the new util filesystem function to 'os.lua' in the luax module
    • 116 |
    • Allow Table Input for themes
    • 117 |
    • Responsive CSS for menus
    • 118 |
    • Force all menu items into the top menu if there only one module in the output
    • 119 |
    • Dox menu item with home, usage and other useful pages
    • 120 |
    • Add project info function (for all compiled modules);
    • 121 |
    • ADD the ability to get HTML string only without needing to write a file
    • 122 |
    • TODO - AddSupport for custom, external css ===>>> PUT INTO HTML HEAD
    • 123 |
    • Add a 'Custom' line type
    • 124 |
    • Add support for new lines after certain tags in the function block
    • 125 |
    • Add Support for TODO, Current Features and Planned Feature
    • 126 |
    • Add auto-css assignment if css tag is not present in file (using lua debug library to get directory of this file)
    • 127 |
    • More theme support.
    • 128 |
    129 | 130 |
    131 |
    132 |
  • 133 |
  • 134 | 135 |
    136 | Todo 137 |
    138 |
    139 |
      140 |
    • Add Mac Support
    • 141 |
    • Test wrapping block items in '<pre>' html tags
    • 142 |
    • Auto-remove parantheses in function name before processing
    • 143 |
    • Return the paramters/return as a table instead of a string (convert blockToTable to work for the html)
    • 144 |
    • More awareness in function sorting
    • 145 |
    • Put question marks where version info goes when the info is not available
    • 146 |
    • Redo Block layout to be simpler
    • 147 |
    • Fix HTML bug that occurs when module info is not present
    • 148 |
    • Create css for inner--module html classes such as 'parameter'.
    • 149 |
    • Create code glossary for the terms used within the dox code such as 'module', 'block', etc.
    • 150 |
    • Allow multiple types in parameters for functions
    • 151 |
    • Clean up css and html (get some help from someone who knows html/css well)
    • 152 |
    • Fix the space-finding (%s) pattern matching attempt in gsub
    • 153 |
    • Fix the top-right contentwrapper corner, it's cutting off part of the scroll bar
    • 154 |
    • CONSIDER AUTO-CHECKING FOR LINKS AND ADDING THEM FOR THE 'getAccordionList()' method in dox.html
    • 155 |
    • Deal with module name conflicts
    • 156 |
    • Add CSS/HTML validation tags to the footer, update the footer with real data back to the github
    • 157 |
    • Fix the width issue in the css #contentwrapper (it's currently using a hack)
    • 158 |
    • Write a short guide showing how to add tags to the different block types (HIGH)
    • 159 |
    • Create a LOVE-based GUI for making these blocks (LOW)
    • 160 |
    • Find out why 'funct' triggers an error (as it should) but 'function' does not when looking for an extra character on the 'func' tag LOW PRIORITY
    • 161 | 162 |
    163 | 164 |
    165 |
    166 |
  • 167 |
  • 168 | 169 |
    170 | Usage 171 |
    172 |
    173 |

    Take a breath...

    174 | Now, I know this is a new way to document your code, but I've made it as painless as possible. Once you read this section, you'll be ready to start documenting and you'll see how simple Dox is to use. 175 |

    Function Info Block

    176 |

    177 | This is primary element of Dox that makes it work. In fact, without at least one function info block, Dox will not process the target module since there would be no information to process. 178 |

    179 | The function info block is wrapped in a multi-line lua comment whose start tag is --[[! and end tag is !]]. 180 |

    181 |

    Function Info Block Block Tags

    182 |

    183 | Elements inside the function info block are designated by an "@" symbol directly followed by the desired tag and tag information. 184 |
    185 | Below is a list of currently usable tags for this block as well as their formatting and usage details. 186 |

    187 |
      188 |
    • Description
    • 189 |
    • Example
    • 190 |
    • Function
    • 191 |
    • Module
    • 192 |
    • Parameter
    • 193 |
    • Return
    • 194 |
    • Scope
    • 195 |
    • Usage
    • 196 |
    197 |

    Module Info Block

    198 |

    199 | The module information is wrapped in a multiline lua comment whose start tag is --[[* and end tag is *]]. The content of this block is displayed at the top of the module page within and accordion menu (the one you're using right now). 200 |

    201 | Note: Unlike (at least one) function info block, the module info block is not required. Dox will function just fine with or without the module info block; you may omit the entire thing if you wish. Additionaly, if you do choose to use the module info block, only one of the tags (listed below) are required: the 'module' tag is required if using the module info block although you may use one, all or none of the remaining tags (or anything in between). 202 |

    203 | Unlike the function info block, the module info block has no tags that are sensitive to spaces and new lines. This feature makes it very easy to use html with your module info block. As you can see, you're reading text right now that has been formatted within the comment block of the dox.lua file. 204 |

    205 | Within the block are tags. These tags start and end just like html tags do, with <tagname> as the start tag and </tagname> as the end tag where tagname is the name of the tag. Below is a complete list of supported tags. 206 |

    207 |
      208 |
    • authors
    • 209 |
    • copyright
    • 210 |
    • dependencies
    • 211 |
    • description
    • 212 |
    • features
    • 213 |
    • email
    • 214 |
    • license
    • 215 |
    • moduleid(required)
    • 216 |
    • plannedfeatures
    • 217 |
    • todo
    • 218 |
    • usage
    • 219 |
    • version
    • 220 |
    • versionhistory
    • 221 |
    • website
    • 222 |
    223 |

    The moduleid Tag

    224 |

    You may enter one to many items for the 'moduleid' tag. For example, if your module name is myClass then you'd enter it exactly as the class name since the 'moduleid' tag is case sensitive.; however, you can control how it's displayed at the top of the page. To include a display name, simply use a pipe (|) and type the display next like this myClass|MyClass. 225 |

    226 | If you have sub modules such as myClass.otherStuff and you'd like the module block for myClass to display on the myClass.otherStuff page, use a comma to indicate another module and simlpy add it the 'moduleid' tag like so: myClass|MyClass,myClass.otherStuff and if you'd like a differnt display name for that module too, just add it in: myClass|MyClass,myClass.otherStuff|MyClass.otherStuff. It's that easy. 227 |

    228 |

    Special Characters

    229 |

    The '@' symbol cannot be used in your text without escaping it since it is a special character that tells Dox where to start a line; however, you can escape it in your text using a backslash (\) and the '@' will be put there by Dox when processing is complete: E.g., @. Additionaly, any text inside free-format items (like authors, website, description, etc. as opposed to items like param, function, etc. that are more restricted) is treated like html including any html tags you may want to use. Of course, this means that you'll need to escape the '<' and '>' symbols in your text if you want them to be presented as-is. 230 |

    231 | Below is a complete list of special characters that need escaped to be displayed as themselves. 232 |

    233 |
    234 |
      235 |
    • @
    • 236 |
    • >
    • 237 |
    • <
    • 238 |
    239 | 240 |
    241 |
    242 |
  • 243 |
  • 244 | 245 |
    246 | Version History 247 |
    248 |
    249 |
      250 |
    • 251 | 0.0.9 252 |
      253 |

      Added support for linux.

      254 |
    • 255 |
    • 256 | 0.0.8 257 |
      258 |

      Fixed a bug in the local 'import()' function.

      259 |
    • 260 |
    • 261 | 0.0.7 262 |
      263 |

      Added the ability to allow a module block to be displayed for multiple modules as desired

      264 |

      Module names can now be displayed differently as desired.

      265 |
    • 266 |
    • 267 | 0.0.6 268 |
      269 |

      Fixed a bug that was omitting the last entry of blocks.

      270 |

      Added the ability for dox to normally and recursively scan directories and process all files at once.

      271 |
    • 272 |
    • 273 | 0.0.5 274 |
      275 |

      Fixed a bug that allowed empty modules and empty blocks.

      276 |

      Reconfigured Start and End tags to be easier to use.

      277 |

      Reconfigured function blocks tags to be easier to use.

      278 |
    • 279 |
    • 280 | 0.0.4 281 |
      282 |

      Added the binary module and included embeded images for the output.

      283 |

      Added the Welcome.html page.

      284 |
    • 285 |
    • 286 | 0.0.3 287 |
      288 |

      Moved from a single-page output to a multi-page one.

      289 |

      Added the Module Info panel for each module.

      290 |

      Output CSS to and external file (style.css).

      291 |
    • 292 |
    • 293 | 0.0.2 294 |
      295 |

      Refactored the code and ported all logical functions to modules.

      296 |
    • 297 |
    • 298 | 0.0.1 299 |
      300 |

      Created Dox in all its wonder...and despair.

      301 |
    • 302 |
    303 | 304 |
    305 |
    306 |
  • 307 |
308 |
309 |
310 |

311 |

getParserCSS()

local 312 | 313 |

Description

314 |

Concatenates the Parser strings from the 'dox.Types' table. This is used in 'dox.css.update()'.

315 | 316 |
317 |
318 |
319 |
320 | 321 | 322 | -------------------------------------------------------------------------------- /help/modules/dox.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Dox Lua Code Viewer 8 | 9 | 10 | 11 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |
33 |
34 |

Dox 35 | v0.0.8 36 | 37 |

38 |

by Centauri Soldier 39 |

40 |

https://github.com/CentauriSoldier/Dox 42 |

43 |
44 |
    45 |
  • 46 | 47 |
    48 | Copyright 49 |
    50 |
    51 | Copyright © 2016 Centauri Soldier 52 | 53 |
    54 |
    55 |
  • 56 |
  • 57 | 58 |
    59 | Description 60 |
    61 |
    62 |

    Dox

    63 |

    The Simple Lua Documentation Generator

    64 |

    Dox is a light-weight script designed to parse crafted lua comments regarding modules and functions and output them to readable, sorted and linked HTML. Dox enables you to quickly and simply create documentation for your lua code without the need to install programs or to run anything other than the Dox script. In fact, it's so simple, you can have documentation in as few as 2 lines of code.

    65 | 66 |
    67 |
    68 |
  • 69 |
  • 70 | 71 |
    72 | Features 73 |
    74 |
    75 |

    Multi-platform

    76 |

    Dox works with all major versions of Windows and Linux.

    77 |

    Dox can be used on unix based systems or Windows without having to convert directory or file paths. Dox will auto-detect and convert paths as needed.

    78 |

    No Dependencies

    79 |

    Dox needs nothing but itself and your lua files in order to run correctly. No installing, no configuring, no mess.

    80 |

    Dox is Robust

    81 |

    Dox is fine with you mixing up your code. Functions from different modules may be in one single file or you may even have a single module spread around different files. Dox is very forgiving in how you organize your modules. You could even have all your dox comments for multiple modules in a single file (although such a practice is not likely to be desired or cenvenient, just meant as demonstration). Simply put, Dox loves your code no matter where it's at and how it's organized (or unorganized, for that matter). Dox will sort it all out for you when it's processed. There's no need for you go out of your way to organize functions or modules a certain way. Organize them how you please and Dox will do the rest.

    82 | 83 |
    84 |
    85 |
  • 86 |
  • 87 | 88 |
    89 | License 90 |
    91 |
    92 |

    The MIT License (MIT)
    93 |
    94 | Copyright (c) 2016 Centauri Soldier
    95 |
    96 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    97 |
    98 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    99 |
    100 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 101 |

    102 | 103 |
    104 |
    105 |
  • 106 |
  • 107 | 108 |
    109 | Planned Features 110 |
    111 |
    112 |
      113 |
    • Allow themes to set images
    • 114 |
    • Set return section in the html to show no return if none are listed.
    • 115 |
    • Finish and port the new util filesystem function to 'os.lua' in the luax module
    • 116 |
    • Allow Table Input for themes
    • 117 |
    • Responsive CSS for menus
    • 118 |
    • Force all menu items into the top menu if there only one module in the output
    • 119 |
    • Dox menu item with home, usage and other useful pages
    • 120 |
    • Add project info function (for all compiled modules);
    • 121 |
    • ADD the ability to get HTML string only without needing to write a file
    • 122 |
    • TODO - AddSupport for custom, external css ===>>> PUT INTO HTML HEAD
    • 123 |
    • Add a 'Custom' line type
    • 124 |
    • Add support for new lines after certain tags in the function block
    • 125 |
    • Add Support for TODO, Current Features and Planned Feature
    • 126 |
    • Add auto-css assignment if css tag is not present in file (using lua debug library to get directory of this file)
    • 127 |
    • More theme support.
    • 128 |
    129 | 130 |
    131 |
    132 |
  • 133 |
  • 134 | 135 |
    136 | Todo 137 |
    138 |
    139 |
      140 |
    • Add Mac Support
    • 141 |
    • Test wrapping block items in '<pre>' html tags
    • 142 |
    • Auto-remove parantheses in function name before processing
    • 143 |
    • Return the paramters/return as a table instead of a string (convert blockToTable to work for the html)
    • 144 |
    • More awareness in function sorting
    • 145 |
    • Put question marks where version info goes when the info is not available
    • 146 |
    • Redo Block layout to be simpler
    • 147 |
    • Fix HTML bug that occurs when module info is not present
    • 148 |
    • Create css for inner--module html classes such as 'parameter'.
    • 149 |
    • Create code glossary for the terms used within the dox code such as 'module', 'block', etc.
    • 150 |
    • Allow multiple types in parameters for functions
    • 151 |
    • Clean up css and html (get some help from someone who knows html/css well)
    • 152 |
    • Fix the space-finding (%s) pattern matching attempt in gsub
    • 153 |
    • Fix the top-right contentwrapper corner, it's cutting off part of the scroll bar
    • 154 |
    • CONSIDER AUTO-CHECKING FOR LINKS AND ADDING THEM FOR THE 'getAccordionList()' method in dox.html
    • 155 |
    • Deal with module name conflicts
    • 156 |
    • Add CSS/HTML validation tags to the footer, update the footer with real data back to the github
    • 157 |
    • Fix the width issue in the css #contentwrapper (it's currently using a hack)
    • 158 |
    • Write a short guide showing how to add tags to the different block types (HIGH)
    • 159 |
    • Create a LOVE-based GUI for making these blocks (LOW)
    • 160 |
    • Find out why 'funct' triggers an error (as it should) but 'function' does not when looking for an extra character on the 'func' tag LOW PRIORITY
    • 161 | 162 |
    163 | 164 |
    165 |
    166 |
  • 167 |
  • 168 | 169 |
    170 | Usage 171 |
    172 |
    173 |

    Take a breath...

    174 | Now, I know this is a new way to document your code, but I've made it as painless as possible. Once you read this section, you'll be ready to start documenting and you'll see how simple Dox is to use. 175 |

    Function Info Block

    176 |

    177 | This is primary element of Dox that makes it work. In fact, without at least one function info block, Dox will not process the target module since there would be no information to process. 178 |

    179 | The function info block is wrapped in a multi-line lua comment whose start tag is --[[! and end tag is !]]. 180 |

    181 |

    Function Info Block Block Tags

    182 |

    183 | Elements inside the function info block are designated by an "@" symbol directly followed by the desired tag and tag information. 184 |
    185 | Below is a list of currently usable tags for this block as well as their formatting and usage details. 186 |

    187 |
      188 |
    • Description
    • 189 |
    • Example
    • 190 |
    • Function
    • 191 |
    • Module
    • 192 |
    • Parameter
    • 193 |
    • Return
    • 194 |
    • Scope
    • 195 |
    • Usage
    • 196 |
    197 |

    Module Info Block

    198 |

    199 | The module information is wrapped in a multiline lua comment whose start tag is --[[* and end tag is *]]. The content of this block is displayed at the top of the module page within and accordion menu (the one you're using right now). 200 |

    201 | Note: Unlike (at least one) function info block, the module info block is not required. Dox will function just fine with or without the module info block; you may omit the entire thing if you wish. Additionaly, if you do choose to use the module info block, only one of the tags (listed below) are required: the 'module' tag is required if using the module info block although you may use one, all or none of the remaining tags (or anything in between). 202 |

    203 | Unlike the function info block, the module info block has no tags that are sensitive to spaces and new lines. This feature makes it very easy to use html with your module info block. As you can see, you're reading text right now that has been formatted within the comment block of the dox.lua file. 204 |

    205 | Within the block are tags. These tags start and end just like html tags do, with <tagname> as the start tag and </tagname> as the end tag where tagname is the name of the tag. Below is a complete list of supported tags. 206 |

    207 |
      208 |
    • authors
    • 209 |
    • copyright
    • 210 |
    • dependencies
    • 211 |
    • description
    • 212 |
    • features
    • 213 |
    • email
    • 214 |
    • license
    • 215 |
    • moduleid(required)
    • 216 |
    • plannedfeatures
    • 217 |
    • todo
    • 218 |
    • usage
    • 219 |
    • version
    • 220 |
    • versionhistory
    • 221 |
    • website
    • 222 |
    223 |

    The moduleid Tag

    224 |

    You may enter one to many items for the 'moduleid' tag. For example, if your module name is myClass then you'd enter it exactly as the class name since the 'moduleid' tag is case sensitive.; however, you can control how it's displayed at the top of the page. To include a display name, simply use a pipe (|) and type the display next like this myClass|MyClass. 225 |

    226 | If you have sub modules such as myClass.otherStuff and you'd like the module block for myClass to display on the myClass.otherStuff page, use a comma to indicate another module and simlpy add it the 'moduleid' tag like so: myClass|MyClass,myClass.otherStuff and if you'd like a differnt display name for that module too, just add it in: myClass|MyClass,myClass.otherStuff|MyClass.otherStuff. It's that easy. 227 |

    228 |

    Special Characters

    229 |

    The '@' symbol cannot be used in your text without escaping it since it is a special character that tells Dox where to start a line; however, you can escape it in your text using a backslash (\) and the '@' will be put there by Dox when processing is complete: E.g., @. Additionaly, any text inside free-format items (like authors, website, description, etc. as opposed to items like param, function, etc. that are more restricted) is treated like html including any html tags you may want to use. Of course, this means that you'll need to escape the '<' and '>' symbols in your text if you want them to be presented as-is. 230 |

    231 | Below is a complete list of special characters that need escaped to be displayed as themselves. 232 |

    233 |
    234 |
      235 |
    • @
    • 236 |
    • >
    • 237 |
    • <
    • 238 |
    239 | 240 |
    241 |
    242 |
  • 243 |
  • 244 | 245 |
    246 | Version History 247 |
    248 |
    249 |
      250 |
    • 251 | 0.0.9 252 |
      253 |

      Added support for linux.

      254 |
    • 255 |
    • 256 | 0.0.8 257 |
      258 |

      Fixed a bug in the local 'import()' function.

      259 |
    • 260 |
    • 261 | 0.0.7 262 |
      263 |

      Added the ability to allow a module block to be displayed for multiple modules as desired

      264 |

      Module names can now be displayed differently as desired.

      265 |
    • 266 |
    • 267 | 0.0.6 268 |
      269 |

      Fixed a bug that was omitting the last entry of blocks.

      270 |

      Added the ability for dox to normally and recursively scan directories and process all files at once.

      271 |
    • 272 |
    • 273 | 0.0.5 274 |
      275 |

      Fixed a bug that allowed empty modules and empty blocks.

      276 |

      Reconfigured Start and End tags to be easier to use.

      277 |

      Reconfigured function blocks tags to be easier to use.

      278 |
    • 279 |
    • 280 | 0.0.4 281 |
      282 |

      Added the binary module and included embeded images for the output.

      283 |

      Added the Welcome.html page.

      284 |
    • 285 |
    • 286 | 0.0.3 287 |
      288 |

      Moved from a single-page output to a multi-page one.

      289 |

      Added the Module Info panel for each module.

      290 |

      Output CSS to and external file (style.css).

      291 |
    • 292 |
    • 293 | 0.0.2 294 |
      295 |

      Refactored the code and ported all logical functions to modules.

      296 |
    • 297 |
    • 298 | 0.0.1 299 |
      300 |

      Created Dox in all its wonder...and despair.

      301 |
    • 302 |
    303 | 304 |
    305 |
    306 |
  • 307 |
308 |
309 |
310 |

311 |

dox.css.update()

global 312 | 313 |

Description

314 |

This informs the css of theme changes that may have occurred.

315 | 316 |
317 |
318 |

dox.parse.importBlockToModules()

global 319 | 320 |

Description

321 |

Pushes a block into the 'dox.Modules' table to await processing. Used in 'dox.processFile()'.

322 | 323 |
324 |
325 |

dox.processDir()

global 326 | 327 |

Parameters

328 |

[sDir | string | The full path to the directory.]

329 |

[pOutDir | string | The full path to the directory that will store the output.]

330 |

[sTheme | string,nil | The name of the color scheme to use in the out HTML. If nil, Dox will use the default theme.]

331 |

[bRecursive | bool,nil | If true, Dox will search all subdirectories of the given path as well in search of lua files.]

332 |

Description

333 |

Does the same as dox.processFile() but for an entire directory.

334 | 335 |
336 |
337 |

dox.processFile()

global 338 | 339 |

Parameters

340 |

[pInputFile | string | The path to the file dox reads.]

341 |

[pOutputFile | string | The path to the directory in which Dox writes the output file.]

342 |

[sTheme | string,nil | The name of the color scheme to use in the out HTML. If nil, Dox will use the default theme.]

343 |

Description

344 |

Processes a Lua file for use with Dox and readies it for output. This is one of two functions, including 'dox.processDir' that are used by the end-user. Use either of these two functions to create HTML output. While 'dox.processDir' is used for an entire directory, this funcitons will process only one file.

345 |

Example

346 | dox.processFile("C:\\Files\\myModule.lua", "C:\\Files\\Dox Output"); 347 | 348 |
349 |
350 |

getLocalPath()

local 351 | 352 |

Description

353 |

Determines the relative path from which the script is called.

354 | 355 |

Return

356 |

[sPath | string | The local path from which dox is run.]

357 |
358 |
359 |

import()

local 360 | 361 |

Description

362 |

A version of the 'require()' function that uses the local path. Used to require the other local modules the 'dox.lua' file needs.

363 | 364 |
365 |
366 |

writeOutput()

local 367 | 368 |

Parameters

369 |

[sDirectory | string | The desired output directory.]

370 |

Description

371 |

Write the index file, welcome files, modules files and CSS as well as any other files required for a complete output. Used in 'dox.processFile()' and 'dox.processDir'

372 | 373 |
374 |
375 |
376 |
377 | 378 | 379 | -------------------------------------------------------------------------------- /help/modules/dox.html.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Dox Lua Code Viewer 8 | 9 | 10 | 11 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |
33 |
34 |

Dox.HTML 35 | v0.0.8 36 | 37 |

38 |

by Centauri Soldier 39 |

40 |

https://github.com/CentauriSoldier/Dox 42 |

43 |
44 |
    45 |
  • 46 | 47 |
    48 | Copyright 49 |
    50 |
    51 | Copyright © 2016 Centauri Soldier 52 | 53 |
    54 |
    55 |
  • 56 |
  • 57 | 58 |
    59 | Description 60 |
    61 |
    62 |

    Dox

    63 |

    The Simple Lua Documentation Generator

    64 |

    Dox is a light-weight script designed to parse crafted lua comments regarding modules and functions and output them to readable, sorted and linked HTML. Dox enables you to quickly and simply create documentation for your lua code without the need to install programs or to run anything other than the Dox script. In fact, it's so simple, you can have documentation in as few as 2 lines of code.

    65 | 66 |
    67 |
    68 |
  • 69 |
  • 70 | 71 |
    72 | Features 73 |
    74 |
    75 |

    Multi-platform

    76 |

    Dox works with all major versions of Windows and Linux.

    77 |

    Dox can be used on unix based systems or Windows without having to convert directory or file paths. Dox will auto-detect and convert paths as needed.

    78 |

    No Dependencies

    79 |

    Dox needs nothing but itself and your lua files in order to run correctly. No installing, no configuring, no mess.

    80 |

    Dox is Robust

    81 |

    Dox is fine with you mixing up your code. Functions from different modules may be in one single file or you may even have a single module spread around different files. Dox is very forgiving in how you organize your modules. You could even have all your dox comments for multiple modules in a single file (although such a practice is not likely to be desired or cenvenient, just meant as demonstration). Simply put, Dox loves your code no matter where it's at and how it's organized (or unorganized, for that matter). Dox will sort it all out for you when it's processed. There's no need for you go out of your way to organize functions or modules a certain way. Organize them how you please and Dox will do the rest.

    82 | 83 |
    84 |
    85 |
  • 86 |
  • 87 | 88 |
    89 | License 90 |
    91 |
    92 |

    The MIT License (MIT)
    93 |
    94 | Copyright (c) 2016 Centauri Soldier
    95 |
    96 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    97 |
    98 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    99 |
    100 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 101 |

    102 | 103 |
    104 |
    105 |
  • 106 |
  • 107 | 108 |
    109 | Planned Features 110 |
    111 |
    112 |
      113 |
    • Allow themes to set images
    • 114 |
    • Set return section in the html to show no return if none are listed.
    • 115 |
    • Finish and port the new util filesystem function to 'os.lua' in the luax module
    • 116 |
    • Allow Table Input for themes
    • 117 |
    • Responsive CSS for menus
    • 118 |
    • Force all menu items into the top menu if there only one module in the output
    • 119 |
    • Dox menu item with home, usage and other useful pages
    • 120 |
    • Add project info function (for all compiled modules);
    • 121 |
    • ADD the ability to get HTML string only without needing to write a file
    • 122 |
    • TODO - AddSupport for custom, external css ===>>> PUT INTO HTML HEAD
    • 123 |
    • Add a 'Custom' line type
    • 124 |
    • Add support for new lines after certain tags in the function block
    • 125 |
    • Add Support for TODO, Current Features and Planned Feature
    • 126 |
    • Add auto-css assignment if css tag is not present in file (using lua debug library to get directory of this file)
    • 127 |
    • More theme support.
    • 128 |
    129 | 130 |
    131 |
    132 |
  • 133 |
  • 134 | 135 |
    136 | Todo 137 |
    138 |
    139 |
      140 |
    • Add Mac Support
    • 141 |
    • Test wrapping block items in '<pre>' html tags
    • 142 |
    • Auto-remove parantheses in function name before processing
    • 143 |
    • Return the paramters/return as a table instead of a string (convert blockToTable to work for the html)
    • 144 |
    • More awareness in function sorting
    • 145 |
    • Put question marks where version info goes when the info is not available
    • 146 |
    • Redo Block layout to be simpler
    • 147 |
    • Fix HTML bug that occurs when module info is not present
    • 148 |
    • Create css for inner--module html classes such as 'parameter'.
    • 149 |
    • Create code glossary for the terms used within the dox code such as 'module', 'block', etc.
    • 150 |
    • Allow multiple types in parameters for functions
    • 151 |
    • Clean up css and html (get some help from someone who knows html/css well)
    • 152 |
    • Fix the space-finding (%s) pattern matching attempt in gsub
    • 153 |
    • Fix the top-right contentwrapper corner, it's cutting off part of the scroll bar
    • 154 |
    • CONSIDER AUTO-CHECKING FOR LINKS AND ADDING THEM FOR THE 'getAccordionList()' method in dox.html
    • 155 |
    • Deal with module name conflicts
    • 156 |
    • Add CSS/HTML validation tags to the footer, update the footer with real data back to the github
    • 157 |
    • Fix the width issue in the css #contentwrapper (it's currently using a hack)
    • 158 |
    • Write a short guide showing how to add tags to the different block types (HIGH)
    • 159 |
    • Create a LOVE-based GUI for making these blocks (LOW)
    • 160 |
    • Find out why 'funct' triggers an error (as it should) but 'function' does not when looking for an extra character on the 'func' tag LOW PRIORITY
    • 161 | 162 |
    163 | 164 |
    165 |
    166 |
  • 167 |
  • 168 | 169 |
    170 | Usage 171 |
    172 |
    173 |

    Take a breath...

    174 | Now, I know this is a new way to document your code, but I've made it as painless as possible. Once you read this section, you'll be ready to start documenting and you'll see how simple Dox is to use. 175 |

    Function Info Block

    176 |

    177 | This is primary element of Dox that makes it work. In fact, without at least one function info block, Dox will not process the target module since there would be no information to process. 178 |

    179 | The function info block is wrapped in a multi-line lua comment whose start tag is --[[! and end tag is !]]. 180 |

    181 |

    Function Info Block Block Tags

    182 |

    183 | Elements inside the function info block are designated by an "@" symbol directly followed by the desired tag and tag information. 184 |
    185 | Below is a list of currently usable tags for this block as well as their formatting and usage details. 186 |

    187 |
      188 |
    • Description
    • 189 |
    • Example
    • 190 |
    • Function
    • 191 |
    • Module
    • 192 |
    • Parameter
    • 193 |
    • Return
    • 194 |
    • Scope
    • 195 |
    • Usage
    • 196 |
    197 |

    Module Info Block

    198 |

    199 | The module information is wrapped in a multiline lua comment whose start tag is --[[* and end tag is *]]. The content of this block is displayed at the top of the module page within and accordion menu (the one you're using right now). 200 |

    201 | Note: Unlike (at least one) function info block, the module info block is not required. Dox will function just fine with or without the module info block; you may omit the entire thing if you wish. Additionaly, if you do choose to use the module info block, only one of the tags (listed below) are required: the 'module' tag is required if using the module info block although you may use one, all or none of the remaining tags (or anything in between). 202 |

    203 | Unlike the function info block, the module info block has no tags that are sensitive to spaces and new lines. This feature makes it very easy to use html with your module info block. As you can see, you're reading text right now that has been formatted within the comment block of the dox.lua file. 204 |

    205 | Within the block are tags. These tags start and end just like html tags do, with <tagname> as the start tag and </tagname> as the end tag where tagname is the name of the tag. Below is a complete list of supported tags. 206 |

    207 |
      208 |
    • authors
    • 209 |
    • copyright
    • 210 |
    • dependencies
    • 211 |
    • description
    • 212 |
    • features
    • 213 |
    • email
    • 214 |
    • license
    • 215 |
    • moduleid(required)
    • 216 |
    • plannedfeatures
    • 217 |
    • todo
    • 218 |
    • usage
    • 219 |
    • version
    • 220 |
    • versionhistory
    • 221 |
    • website
    • 222 |
    223 |

    The moduleid Tag

    224 |

    You may enter one to many items for the 'moduleid' tag. For example, if your module name is myClass then you'd enter it exactly as the class name since the 'moduleid' tag is case sensitive.; however, you can control how it's displayed at the top of the page. To include a display name, simply use a pipe (|) and type the display next like this myClass|MyClass. 225 |

    226 | If you have sub modules such as myClass.otherStuff and you'd like the module block for myClass to display on the myClass.otherStuff page, use a comma to indicate another module and simlpy add it the 'moduleid' tag like so: myClass|MyClass,myClass.otherStuff and if you'd like a differnt display name for that module too, just add it in: myClass|MyClass,myClass.otherStuff|MyClass.otherStuff. It's that easy. 227 |

    228 |

    Special Characters

    229 |

    The '@' symbol cannot be used in your text without escaping it since it is a special character that tells Dox where to start a line; however, you can escape it in your text using a backslash (\) and the '@' will be put there by Dox when processing is complete: E.g., @. Additionaly, any text inside free-format items (like authors, website, description, etc. as opposed to items like param, function, etc. that are more restricted) is treated like html including any html tags you may want to use. Of course, this means that you'll need to escape the '<' and '>' symbols in your text if you want them to be presented as-is. 230 |

    231 | Below is a complete list of special characters that need escaped to be displayed as themselves. 232 |

    233 |
    234 |
      235 |
    • @
    • 236 |
    • >
    • 237 |
    • <
    • 238 |
    239 | 240 |
    241 |
    242 |
  • 243 |
  • 244 | 245 |
    246 | Version History 247 |
    248 |
    249 |
      250 |
    • 251 | 0.0.9 252 |
      253 |

      Added support for linux.

      254 |
    • 255 |
    • 256 | 0.0.8 257 |
      258 |

      Fixed a bug in the local 'import()' function.

      259 |
    • 260 |
    • 261 | 0.0.7 262 |
      263 |

      Added the ability to allow a module block to be displayed for multiple modules as desired

      264 |

      Module names can now be displayed differently as desired.

      265 |
    • 266 |
    • 267 | 0.0.6 268 |
      269 |

      Fixed a bug that was omitting the last entry of blocks.

      270 |

      Added the ability for dox to normally and recursively scan directories and process all files at once.

      271 |
    • 272 |
    • 273 | 0.0.5 274 |
      275 |

      Fixed a bug that allowed empty modules and empty blocks.

      276 |

      Reconfigured Start and End tags to be easier to use.

      277 |

      Reconfigured function blocks tags to be easier to use.

      278 |
    • 279 |
    • 280 | 0.0.4 281 |
      282 |

      Added the binary module and included embeded images for the output.

      283 |

      Added the Welcome.html page.

      284 |
    • 285 |
    • 286 | 0.0.3 287 |
      288 |

      Moved from a single-page output to a multi-page one.

      289 |

      Added the Module Info panel for each module.

      290 |

      Output CSS to and external file (style.css).

      291 |
    • 292 |
    • 293 | 0.0.2 294 |
      295 |

      Refactored the code and ported all logical functions to modules.

      296 |
    • 297 |
    • 298 | 0.0.1 299 |
      300 |

      Created Dox in all its wonder...and despair.

      301 |
    • 302 |
    303 | 304 |
    305 |
    306 |
  • 307 |
308 |
309 |
310 |

311 |

appendBody()

global 312 | 313 |

Parameters

314 |

[sInput | string | The string to append to the body of the HTML.]

315 |

Description

316 |

Adds the input string to the dox.PageVars.Body variable.

317 | 318 |
319 |
320 |

dox.html.buildIndex()

global 321 | 322 |

Description

323 |

Called from the Dox file contructor functions for each module in the 'dox.Modules' table. It is responsible for building and returning the html used in the 'index.html' page.

324 | 325 |

Return

326 |

[sHTML | string | The complete html string saved in the 'index.html' file.]

327 |
328 |
329 |

dox.html.buildModule()

global 330 | 331 |

Parameters

332 |

[sModule | string | The name of the module that is to be processed.]

333 |

Description

334 |

Called from the Dox file contructor functions for each module in the 'dox.Modules' table. It is responsible for building and returning the html used in each module file.

335 | 336 |

Return

337 |

[sHTML | string | The complete html string saved in the module's html file.]

338 |
339 |
340 |

dox.html.buildWelcome()

global 341 | 342 |

Description

343 |

Called from the Dox file constructor functions. Builds and returns the HTML used to build the 'welcome.html' page shown in the main frame when the 'index.html' page first loads.

344 | 345 |

Return

346 |

[sHTML | string | The complete html string saved in the 'welcome.html' file.]

347 |
348 |
349 |

getAccordionList()

local 350 | 351 |

Parameters

352 |

[tModule | table | The module table to be processed.]

353 |

[nTabStart | number | A number that represents how many tabs to indent the returned menu.]

354 |

Description

355 |

Used by 'dox.html.buildModule()' to insert mod info detail list items.

356 | 357 |

Return

358 |

[string | The | HTML of the accordion menu for the module]

359 |
360 |
361 |

parseLine()

local 362 | 363 |

Parameters

364 |

[sLine | string | The line to be processed.]

365 |

[sType | The | tyoe if line it is (Function, Description. etc.)]

366 |

Description

367 |

Used for processing values that are stored in tables such as Return or Parameter line types. Used in 'buildHTML()'.

368 | 369 |

Return

370 |

[sLine | string | A string that contains the concatenated line.]

371 |
372 |
373 |

tryString()

local 374 | 375 |

Parameters

376 |

[sInput | string | The string to test.]

377 |

[sAlt | string | The string to return is the sInput string is blank or nil.]

378 |

Description

379 |

Tests to see if a string is blank or nil and if so, returns the second argument. If it is not blank or nil, it returns the original string.

380 | 381 |

Return

382 |

[sRet | string | Either the original string (sInput) or the Alternate string (sAlt) if the sInput is blank or nil.]

383 |
384 |
385 |
386 |
387 | 388 | 389 | -------------------------------------------------------------------------------- /help/modules/dox.theme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Dox Lua Code Viewer 8 | 9 | 10 | 11 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |
33 |
34 |

Dox.Theme 35 | v0.0.8 36 | 37 |

38 |

by Centauri Soldier 39 |

40 |

https://github.com/CentauriSoldier/Dox 42 |

43 |
44 |
    45 |
  • 46 | 47 |
    48 | Copyright 49 |
    50 |
    51 | Copyright © 2016 Centauri Soldier 52 | 53 |
    54 |
    55 |
  • 56 |
  • 57 | 58 |
    59 | Description 60 |
    61 |
    62 |

    Dox

    63 |

    The Simple Lua Documentation Generator

    64 |

    Dox is a light-weight script designed to parse crafted lua comments regarding modules and functions and output them to readable, sorted and linked HTML. Dox enables you to quickly and simply create documentation for your lua code without the need to install programs or to run anything other than the Dox script. In fact, it's so simple, you can have documentation in as few as 2 lines of code.

    65 | 66 |
    67 |
    68 |
  • 69 |
  • 70 | 71 |
    72 | Features 73 |
    74 |
    75 |

    Multi-platform

    76 |

    Dox works with all major versions of Windows and Linux.

    77 |

    Dox can be used on unix based systems or Windows without having to convert directory or file paths. Dox will auto-detect and convert paths as needed.

    78 |

    No Dependencies

    79 |

    Dox needs nothing but itself and your lua files in order to run correctly. No installing, no configuring, no mess.

    80 |

    Dox is Robust

    81 |

    Dox is fine with you mixing up your code. Functions from different modules may be in one single file or you may even have a single module spread around different files. Dox is very forgiving in how you organize your modules. You could even have all your dox comments for multiple modules in a single file (although such a practice is not likely to be desired or cenvenient, just meant as demonstration). Simply put, Dox loves your code no matter where it's at and how it's organized (or unorganized, for that matter). Dox will sort it all out for you when it's processed. There's no need for you go out of your way to organize functions or modules a certain way. Organize them how you please and Dox will do the rest.

    82 | 83 |
    84 |
    85 |
  • 86 |
  • 87 | 88 |
    89 | License 90 |
    91 |
    92 |

    The MIT License (MIT)
    93 |
    94 | Copyright (c) 2016 Centauri Soldier
    95 |
    96 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    97 |
    98 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    99 |
    100 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 101 |

    102 | 103 |
    104 |
    105 |
  • 106 |
  • 107 | 108 |
    109 | Planned Features 110 |
    111 |
    112 |
      113 |
    • Allow themes to set images
    • 114 |
    • Set return section in the html to show no return if none are listed.
    • 115 |
    • Finish and port the new util filesystem function to 'os.lua' in the luax module
    • 116 |
    • Allow Table Input for themes
    • 117 |
    • Responsive CSS for menus
    • 118 |
    • Force all menu items into the top menu if there only one module in the output
    • 119 |
    • Dox menu item with home, usage and other useful pages
    • 120 |
    • Add project info function (for all compiled modules);
    • 121 |
    • ADD the ability to get HTML string only without needing to write a file
    • 122 |
    • TODO - AddSupport for custom, external css ===>>> PUT INTO HTML HEAD
    • 123 |
    • Add a 'Custom' line type
    • 124 |
    • Add support for new lines after certain tags in the function block
    • 125 |
    • Add Support for TODO, Current Features and Planned Feature
    • 126 |
    • Add auto-css assignment if css tag is not present in file (using lua debug library to get directory of this file)
    • 127 |
    • More theme support.
    • 128 |
    129 | 130 |
    131 |
    132 |
  • 133 |
  • 134 | 135 |
    136 | Todo 137 |
    138 |
    139 |
      140 |
    • Add Mac Support
    • 141 |
    • Test wrapping block items in '<pre>' html tags
    • 142 |
    • Auto-remove parantheses in function name before processing
    • 143 |
    • Return the paramters/return as a table instead of a string (convert blockToTable to work for the html)
    • 144 |
    • More awareness in function sorting
    • 145 |
    • Put question marks where version info goes when the info is not available
    • 146 |
    • Redo Block layout to be simpler
    • 147 |
    • Fix HTML bug that occurs when module info is not present
    • 148 |
    • Create css for inner--module html classes such as 'parameter'.
    • 149 |
    • Create code glossary for the terms used within the dox code such as 'module', 'block', etc.
    • 150 |
    • Allow multiple types in parameters for functions
    • 151 |
    • Clean up css and html (get some help from someone who knows html/css well)
    • 152 |
    • Fix the space-finding (%s) pattern matching attempt in gsub
    • 153 |
    • Fix the top-right contentwrapper corner, it's cutting off part of the scroll bar
    • 154 |
    • CONSIDER AUTO-CHECKING FOR LINKS AND ADDING THEM FOR THE 'getAccordionList()' method in dox.html
    • 155 |
    • Deal with module name conflicts
    • 156 |
    • Add CSS/HTML validation tags to the footer, update the footer with real data back to the github
    • 157 |
    • Fix the width issue in the css #contentwrapper (it's currently using a hack)
    • 158 |
    • Write a short guide showing how to add tags to the different block types (HIGH)
    • 159 |
    • Create a LOVE-based GUI for making these blocks (LOW)
    • 160 |
    • Find out why 'funct' triggers an error (as it should) but 'function' does not when looking for an extra character on the 'func' tag LOW PRIORITY
    • 161 | 162 |
    163 | 164 |
    165 |
    166 |
  • 167 |
  • 168 | 169 |
    170 | Usage 171 |
    172 |
    173 |

    Take a breath...

    174 | Now, I know this is a new way to document your code, but I've made it as painless as possible. Once you read this section, you'll be ready to start documenting and you'll see how simple Dox is to use. 175 |

    Function Info Block

    176 |

    177 | This is primary element of Dox that makes it work. In fact, without at least one function info block, Dox will not process the target module since there would be no information to process. 178 |

    179 | The function info block is wrapped in a multi-line lua comment whose start tag is --[[! and end tag is !]]. 180 |

    181 |

    Function Info Block Block Tags

    182 |

    183 | Elements inside the function info block are designated by an "@" symbol directly followed by the desired tag and tag information. 184 |
    185 | Below is a list of currently usable tags for this block as well as their formatting and usage details. 186 |

    187 |
      188 |
    • Description
    • 189 |
    • Example
    • 190 |
    • Function
    • 191 |
    • Module
    • 192 |
    • Parameter
    • 193 |
    • Return
    • 194 |
    • Scope
    • 195 |
    • Usage
    • 196 |
    197 |

    Module Info Block

    198 |

    199 | The module information is wrapped in a multiline lua comment whose start tag is --[[* and end tag is *]]. The content of this block is displayed at the top of the module page within and accordion menu (the one you're using right now). 200 |

    201 | Note: Unlike (at least one) function info block, the module info block is not required. Dox will function just fine with or without the module info block; you may omit the entire thing if you wish. Additionaly, if you do choose to use the module info block, only one of the tags (listed below) are required: the 'module' tag is required if using the module info block although you may use one, all or none of the remaining tags (or anything in between). 202 |

    203 | Unlike the function info block, the module info block has no tags that are sensitive to spaces and new lines. This feature makes it very easy to use html with your module info block. As you can see, you're reading text right now that has been formatted within the comment block of the dox.lua file. 204 |

    205 | Within the block are tags. These tags start and end just like html tags do, with <tagname> as the start tag and </tagname> as the end tag where tagname is the name of the tag. Below is a complete list of supported tags. 206 |

    207 |
      208 |
    • authors
    • 209 |
    • copyright
    • 210 |
    • dependencies
    • 211 |
    • description
    • 212 |
    • features
    • 213 |
    • email
    • 214 |
    • license
    • 215 |
    • moduleid(required)
    • 216 |
    • plannedfeatures
    • 217 |
    • todo
    • 218 |
    • usage
    • 219 |
    • version
    • 220 |
    • versionhistory
    • 221 |
    • website
    • 222 |
    223 |

    The moduleid Tag

    224 |

    You may enter one to many items for the 'moduleid' tag. For example, if your module name is myClass then you'd enter it exactly as the class name since the 'moduleid' tag is case sensitive.; however, you can control how it's displayed at the top of the page. To include a display name, simply use a pipe (|) and type the display next like this myClass|MyClass. 225 |

    226 | If you have sub modules such as myClass.otherStuff and you'd like the module block for myClass to display on the myClass.otherStuff page, use a comma to indicate another module and simlpy add it the 'moduleid' tag like so: myClass|MyClass,myClass.otherStuff and if you'd like a differnt display name for that module too, just add it in: myClass|MyClass,myClass.otherStuff|MyClass.otherStuff. It's that easy. 227 |

    228 |

    Special Characters

    229 |

    The '@' symbol cannot be used in your text without escaping it since it is a special character that tells Dox where to start a line; however, you can escape it in your text using a backslash (\) and the '@' will be put there by Dox when processing is complete: E.g., @. Additionaly, any text inside free-format items (like authors, website, description, etc. as opposed to items like param, function, etc. that are more restricted) is treated like html including any html tags you may want to use. Of course, this means that you'll need to escape the '<' and '>' symbols in your text if you want them to be presented as-is. 230 |

    231 | Below is a complete list of special characters that need escaped to be displayed as themselves. 232 |

    233 |
    234 |
      235 |
    • @
    • 236 |
    • >
    • 237 |
    • <
    • 238 |
    239 | 240 |
    241 |
    242 |
  • 243 |
  • 244 | 245 |
    246 | Version History 247 |
    248 |
    249 |
      250 |
    • 251 | 0.0.9 252 |
      253 |

      Added support for linux.

      254 |
    • 255 |
    • 256 | 0.0.8 257 |
      258 |

      Fixed a bug in the local 'import()' function.

      259 |
    • 260 |
    • 261 | 0.0.7 262 |
      263 |

      Added the ability to allow a module block to be displayed for multiple modules as desired

      264 |

      Module names can now be displayed differently as desired.

      265 |
    • 266 |
    • 267 | 0.0.6 268 |
      269 |

      Fixed a bug that was omitting the last entry of blocks.

      270 |

      Added the ability for dox to normally and recursively scan directories and process all files at once.

      271 |
    • 272 |
    • 273 | 0.0.5 274 |
      275 |

      Fixed a bug that allowed empty modules and empty blocks.

      276 |

      Reconfigured Start and End tags to be easier to use.

      277 |

      Reconfigured function blocks tags to be easier to use.

      278 |
    • 279 |
    • 280 | 0.0.4 281 |
      282 |

      Added the binary module and included embeded images for the output.

      283 |

      Added the Welcome.html page.

      284 |
    • 285 |
    • 286 | 0.0.3 287 |
      288 |

      Moved from a single-page output to a multi-page one.

      289 |

      Added the Module Info panel for each module.

      290 |

      Output CSS to and external file (style.css).

      291 |
    • 292 |
    • 293 | 0.0.2 294 |
      295 |

      Refactored the code and ported all logical functions to modules.

      296 |
    • 297 |
    • 298 | 0.0.1 299 |
      300 |

      Created Dox in all its wonder...and despair.

      301 |
    • 302 |
    303 | 304 |
    305 |
    306 |
  • 307 |
308 |
309 |
310 |

311 |

dox.theme.getColor()

global 312 | 313 |

Parameters

314 |

[sType | string | The index of the color item to get.]

315 |

Description

316 |

Gets a color of the selected type from the currently-active theme.

317 | 318 |

Return

319 |

[sColor | returns | the hex color or an error color is the index input does not exist in the theme.]

320 |
321 |
322 |
323 |
324 | 325 | 326 | -------------------------------------------------------------------------------- /help/modules/dox.util.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Dox Lua Code Viewer 8 | 9 | 10 | 11 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |
33 |
34 |

Dox.Util 35 | v0.0.8 36 | 37 |

38 |

by Centauri Soldier 39 |

40 |

https://github.com/CentauriSoldier/Dox 42 |

43 |
44 |
    45 |
  • 46 | 47 |
    48 | Copyright 49 |
    50 |
    51 | Copyright © 2016 Centauri Soldier 52 | 53 |
    54 |
    55 |
  • 56 |
  • 57 | 58 |
    59 | Description 60 |
    61 |
    62 |

    Dox

    63 |

    The Simple Lua Documentation Generator

    64 |

    Dox is a light-weight script designed to parse crafted lua comments regarding modules and functions and output them to readable, sorted and linked HTML. Dox enables you to quickly and simply create documentation for your lua code without the need to install programs or to run anything other than the Dox script. In fact, it's so simple, you can have documentation in as few as 2 lines of code.

    65 | 66 |
    67 |
    68 |
  • 69 |
  • 70 | 71 |
    72 | Features 73 |
    74 |
    75 |

    Multi-platform

    76 |

    Dox works with all major versions of Windows and Linux.

    77 |

    Dox can be used on unix based systems or Windows without having to convert directory or file paths. Dox will auto-detect and convert paths as needed.

    78 |

    No Dependencies

    79 |

    Dox needs nothing but itself and your lua files in order to run correctly. No installing, no configuring, no mess.

    80 |

    Dox is Robust

    81 |

    Dox is fine with you mixing up your code. Functions from different modules may be in one single file or you may even have a single module spread around different files. Dox is very forgiving in how you organize your modules. You could even have all your dox comments for multiple modules in a single file (although such a practice is not likely to be desired or cenvenient, just meant as demonstration). Simply put, Dox loves your code no matter where it's at and how it's organized (or unorganized, for that matter). Dox will sort it all out for you when it's processed. There's no need for you go out of your way to organize functions or modules a certain way. Organize them how you please and Dox will do the rest.

    82 | 83 |
    84 |
    85 |
  • 86 |
  • 87 | 88 |
    89 | License 90 |
    91 |
    92 |

    The MIT License (MIT)
    93 |
    94 | Copyright (c) 2016 Centauri Soldier
    95 |
    96 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    97 |
    98 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    99 |
    100 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 101 |

    102 | 103 |
    104 |
    105 |
  • 106 |
  • 107 | 108 |
    109 | Planned Features 110 |
    111 |
    112 |
      113 |
    • Allow themes to set images
    • 114 |
    • Set return section in the html to show no return if none are listed.
    • 115 |
    • Finish and port the new util filesystem function to 'os.lua' in the luax module
    • 116 |
    • Allow Table Input for themes
    • 117 |
    • Responsive CSS for menus
    • 118 |
    • Force all menu items into the top menu if there only one module in the output
    • 119 |
    • Dox menu item with home, usage and other useful pages
    • 120 |
    • Add project info function (for all compiled modules);
    • 121 |
    • ADD the ability to get HTML string only without needing to write a file
    • 122 |
    • TODO - AddSupport for custom, external css ===>>> PUT INTO HTML HEAD
    • 123 |
    • Add a 'Custom' line type
    • 124 |
    • Add support for new lines after certain tags in the function block
    • 125 |
    • Add Support for TODO, Current Features and Planned Feature
    • 126 |
    • Add auto-css assignment if css tag is not present in file (using lua debug library to get directory of this file)
    • 127 |
    • More theme support.
    • 128 |
    129 | 130 |
    131 |
    132 |
  • 133 |
  • 134 | 135 |
    136 | Todo 137 |
    138 |
    139 |
      140 |
    • Add Mac Support
    • 141 |
    • Test wrapping block items in '<pre>' html tags
    • 142 |
    • Auto-remove parantheses in function name before processing
    • 143 |
    • Return the paramters/return as a table instead of a string (convert blockToTable to work for the html)
    • 144 |
    • More awareness in function sorting
    • 145 |
    • Put question marks where version info goes when the info is not available
    • 146 |
    • Redo Block layout to be simpler
    • 147 |
    • Fix HTML bug that occurs when module info is not present
    • 148 |
    • Create css for inner--module html classes such as 'parameter'.
    • 149 |
    • Create code glossary for the terms used within the dox code such as 'module', 'block', etc.
    • 150 |
    • Allow multiple types in parameters for functions
    • 151 |
    • Clean up css and html (get some help from someone who knows html/css well)
    • 152 |
    • Fix the space-finding (%s) pattern matching attempt in gsub
    • 153 |
    • Fix the top-right contentwrapper corner, it's cutting off part of the scroll bar
    • 154 |
    • CONSIDER AUTO-CHECKING FOR LINKS AND ADDING THEM FOR THE 'getAccordionList()' method in dox.html
    • 155 |
    • Deal with module name conflicts
    • 156 |
    • Add CSS/HTML validation tags to the footer, update the footer with real data back to the github
    • 157 |
    • Fix the width issue in the css #contentwrapper (it's currently using a hack)
    • 158 |
    • Write a short guide showing how to add tags to the different block types (HIGH)
    • 159 |
    • Create a LOVE-based GUI for making these blocks (LOW)
    • 160 |
    • Find out why 'funct' triggers an error (as it should) but 'function' does not when looking for an extra character on the 'func' tag LOW PRIORITY
    • 161 | 162 |
    163 | 164 |
    165 |
    166 |
  • 167 |
  • 168 | 169 |
    170 | Usage 171 |
    172 |
    173 |

    Take a breath...

    174 | Now, I know this is a new way to document your code, but I've made it as painless as possible. Once you read this section, you'll be ready to start documenting and you'll see how simple Dox is to use. 175 |

    Function Info Block

    176 |

    177 | This is primary element of Dox that makes it work. In fact, without at least one function info block, Dox will not process the target module since there would be no information to process. 178 |

    179 | The function info block is wrapped in a multi-line lua comment whose start tag is --[[! and end tag is !]]. 180 |

    181 |

    Function Info Block Block Tags

    182 |

    183 | Elements inside the function info block are designated by an "@" symbol directly followed by the desired tag and tag information. 184 |
    185 | Below is a list of currently usable tags for this block as well as their formatting and usage details. 186 |

    187 |
      188 |
    • Description
    • 189 |
    • Example
    • 190 |
    • Function
    • 191 |
    • Module
    • 192 |
    • Parameter
    • 193 |
    • Return
    • 194 |
    • Scope
    • 195 |
    • Usage
    • 196 |
    197 |

    Module Info Block

    198 |

    199 | The module information is wrapped in a multiline lua comment whose start tag is --[[* and end tag is *]]. The content of this block is displayed at the top of the module page within and accordion menu (the one you're using right now). 200 |

    201 | Note: Unlike (at least one) function info block, the module info block is not required. Dox will function just fine with or without the module info block; you may omit the entire thing if you wish. Additionaly, if you do choose to use the module info block, only one of the tags (listed below) are required: the 'module' tag is required if using the module info block although you may use one, all or none of the remaining tags (or anything in between). 202 |

    203 | Unlike the function info block, the module info block has no tags that are sensitive to spaces and new lines. This feature makes it very easy to use html with your module info block. As you can see, you're reading text right now that has been formatted within the comment block of the dox.lua file. 204 |

    205 | Within the block are tags. These tags start and end just like html tags do, with <tagname> as the start tag and </tagname> as the end tag where tagname is the name of the tag. Below is a complete list of supported tags. 206 |

    207 |
      208 |
    • authors
    • 209 |
    • copyright
    • 210 |
    • dependencies
    • 211 |
    • description
    • 212 |
    • features
    • 213 |
    • email
    • 214 |
    • license
    • 215 |
    • moduleid(required)
    • 216 |
    • plannedfeatures
    • 217 |
    • todo
    • 218 |
    • usage
    • 219 |
    • version
    • 220 |
    • versionhistory
    • 221 |
    • website
    • 222 |
    223 |

    The moduleid Tag

    224 |

    You may enter one to many items for the 'moduleid' tag. For example, if your module name is myClass then you'd enter it exactly as the class name since the 'moduleid' tag is case sensitive.; however, you can control how it's displayed at the top of the page. To include a display name, simply use a pipe (|) and type the display next like this myClass|MyClass. 225 |

    226 | If you have sub modules such as myClass.otherStuff and you'd like the module block for myClass to display on the myClass.otherStuff page, use a comma to indicate another module and simlpy add it the 'moduleid' tag like so: myClass|MyClass,myClass.otherStuff and if you'd like a differnt display name for that module too, just add it in: myClass|MyClass,myClass.otherStuff|MyClass.otherStuff. It's that easy. 227 |

    228 |

    Special Characters

    229 |

    The '@' symbol cannot be used in your text without escaping it since it is a special character that tells Dox where to start a line; however, you can escape it in your text using a backslash (\) and the '@' will be put there by Dox when processing is complete: E.g., @. Additionaly, any text inside free-format items (like authors, website, description, etc. as opposed to items like param, function, etc. that are more restricted) is treated like html including any html tags you may want to use. Of course, this means that you'll need to escape the '<' and '>' symbols in your text if you want them to be presented as-is. 230 |

    231 | Below is a complete list of special characters that need escaped to be displayed as themselves. 232 |

    233 |
    234 |
      235 |
    • @
    • 236 |
    • >
    • 237 |
    • <
    • 238 |
    239 | 240 |
    241 |
    242 |
  • 243 |
  • 244 | 245 |
    246 | Version History 247 |
    248 |
    249 |
      250 |
    • 251 | 0.0.9 252 |
      253 |

      Added support for linux.

      254 |
    • 255 |
    • 256 | 0.0.8 257 |
      258 |

      Fixed a bug in the local 'import()' function.

      259 |
    • 260 |
    • 261 | 0.0.7 262 |
      263 |

      Added the ability to allow a module block to be displayed for multiple modules as desired

      264 |

      Module names can now be displayed differently as desired.

      265 |
    • 266 |
    • 267 | 0.0.6 268 |
      269 |

      Fixed a bug that was omitting the last entry of blocks.

      270 |

      Added the ability for dox to normally and recursively scan directories and process all files at once.

      271 |
    • 272 |
    • 273 | 0.0.5 274 |
      275 |

      Fixed a bug that allowed empty modules and empty blocks.

      276 |

      Reconfigured Start and End tags to be easier to use.

      277 |

      Reconfigured function blocks tags to be easier to use.

      278 |
    • 279 |
    • 280 | 0.0.4 281 |
      282 |

      Added the binary module and included embeded images for the output.

      283 |

      Added the Welcome.html page.

      284 |
    • 285 |
    • 286 | 0.0.3 287 |
      288 |

      Moved from a single-page output to a multi-page one.

      289 |

      Added the Module Info panel for each module.

      290 |

      Output CSS to and external file (style.css).

      291 |
    • 292 |
    • 293 | 0.0.2 294 |
      295 |

      Refactored the code and ported all logical functions to modules.

      296 |
    • 297 |
    • 298 | 0.0.1 299 |
      300 |

      Created Dox in all its wonder...and despair.

      301 |
    • 302 |
    303 | 304 |
    305 |
    306 |
  • 307 |
308 |
309 |
310 |

311 |

dox.util.fileFind()

global 312 | 313 |

Parameters

314 |

[sDir | string | The directory in which to search. The type of path formatting is irrelevant. I.e., Both "C:\\MyDirectory" and "/MyDirectory" are valid formatting methods for this input.]

315 |

[sFile | string | The file or file pattern to find.]

316 |

[bRecursive | boolean,nil | If true, the function will search for the file/pattern recursively.]

317 |

Description

318 |

Searches for file(s) based on the input.

319 | 320 |

Return

321 |

[tFiles | table | A numerically-indexed table whose values are the paths of the found item(s). If no items are found, an empty table is returned.]

322 |
323 |
324 |

dox.util.getOSType()

global 325 | 326 |

Description

327 |

Determines the operating system type the end-user if running.

328 | 329 |

Return

330 |

[sOSType | string | returns 'windows' if it is a Windows systems and 'linux' if it a unix-based system.]

331 |
332 |
333 |

dox.util.interateChar()

global 334 | 335 |

Parameters

336 |

[sString | string | The string to be concatenated.]

337 |

[nCount | number | The number of times to concatenate the string.]

338 |

Description

339 |

Creates a string where the 'sString' input is concatenated n times where n = 'nCount' input.

340 | 341 |

Return

342 |

[sString | string | Returns the concatenated string. If 'nCount' is nil or not a valid number then a blank string is returned.]

343 |
344 |
345 |

dox.util.isEven()

global 346 | 347 |

Parameters

348 |

[nNumber | number | The number to evaluate.]

349 |

Description

350 |

Determines whether or not a number is even (or odd, implicitly).

351 | 352 |

Return

353 |

[bEven | boolean | Returns true if the number is even and false if it is not.]

354 |
355 |
356 |

dox.util.tab()

global 357 | 358 |

Parameters

359 |

[nTabs | number | The number of tabs to stack together.]

360 |

[bNewLineFirst | boolean,nil | If true, this creates a new line before concatenating the tabs.]

361 |

Description

362 |

Creates x number of tab strings.

363 | 364 |

Return

365 |

[sTabs | string | The concatenated string or a blank string is 'nTabs' is not a valid number.]

366 |
367 |
368 |

dox.util.trim()

global 369 | 370 |

Parameters

371 |

[sString | string | The string to be trimmed.]

372 |

Description

373 |

Trims the trailing and leading whitespace from a string. This function not by Centauri Soldier (http://en.wikipedia.org/wiki/Trim_(8programming))

374 | 375 |

Return

376 |

[sTrimmedString | string | The trimmed string.]

377 |
378 |
379 |
380 |
381 | 382 | 383 | --------------------------------------------------------------------------------