Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ColdDoc.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<cffunction name="generate" hint="generates the documentation" access="public" returntype="void" output="false">
<cfargument name="inputSource" hint="either, the string directory source, OR an array of structs containing inputDir and inputMapping key" type="any" required="yes">
<cfargument name="inputMapping" hint="the base mapping for the folder. Only required if the inputSource is a string." type="string" required="false" default="">
<cfargument name="recursive" hint="the indicator to search within directories recursively. Only required if the inputSource is a string." type="string" required="false" default="false">
<cfscript>
var qMetaData = 0;
var source = 0;
Expand All @@ -25,7 +26,7 @@

if(isSimpleValue(arguments.inputSource))
{
source = [{ inputDir=arguments.inputSource, inputMapping=arguments.inputMapping }];
source = [{ inputDir=arguments.inputSource, inputMapping=arguments.inputMapping, recursive=arguments.recursive }];
}
else
{
Expand Down Expand Up @@ -75,7 +76,7 @@

<cfloop index="i" from="1" to="#ArrayLen(arguments.inputSource)#">

<cfdirectory action="list" directory="#arguments.inputSource[i].inputDir#" recurse="true" name="qFiles" filter="*.cfc">
<cfdirectory action="list" directory="#arguments.inputSource[i].inputDir#" recurse="#arguments.inputSource[i].recursive" name="qFiles" filter="*.cfc">

<cfloop query="qFiles">
<cfscript>
Expand Down
12 changes: 11 additions & 1 deletion run.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ Let's generate our default HTML documentation on myself:
strategy = createObject("component", "colddoc.strategy.api.HTMLAPIStrategy").init(expandPath("./docs"), "ColdDoc 1.0");
colddoc.setStrategy(strategy);

colddoc.generate(expandPath("/colddoc"), "colddoc");
// Let's give flexibility to user to make choice of the folders within application which need to be documented
rootFolder = expandPath("/");
path_mapping = [
, {inputDir="#rootFolder#", inputMapping="colddoc", recursive="false"}
, {inputDir="#rootFolder#\strategy\api", inputMapping="colddoc.strategy.api", recursive="true"}
];

colddoc.generate(path_mapping);

// Or diretly specify path and mapping to generate function
//colddoc.generate(expandPath("/colddoc"), "colddoc");
</cfscript>

<h1>Done!</h1>
Expand Down