Skip to content

Commit

Permalink
Add --include-private flag to show private fields and types (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzBrueckner authored Mar 6, 2020
1 parent d2cb38e commit 302a655
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Binary file modified run.n
Binary file not shown.
2 changes: 2 additions & 0 deletions src/dox/Config.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Config {
public var rootPath:String;
public var toplevelPackage:String;
public var useMarkdown:Bool;
public var includePrivate:Bool;
public var date:Date;
public var outputPath(default, set):String = "pages";
public var xmlPath(default, set):String = "xml";
Expand All @@ -34,6 +35,7 @@ class Config {
resourcePaths = [];
toplevelPackage = "";
useMarkdown = true;
includePrivate = false;
defines = new Map();
pathFilters = new GenericStack<Filter>();
templatePaths = new GenericStack<String>();
Expand Down
3 changes: 3 additions & 0 deletions src/dox/Dox.hx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class Dox {
@doc("Disable markdown rendering")
["--no-markdown"] => function() cfg.useMarkdown = false,

@doc("Include private fields and types")
["--include-private"] => function() cfg.includePrivate = true,

@doc("Set the theme name or path")
["-theme"] => function(name:String) cfg.loadTheme(owd, name),

Expand Down
4 changes: 2 additions & 2 deletions src/dox/Processor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Processor {
var show = Infos.hasDoxMetadata(cf.meta, "show");
var compilerGenerated = cf.meta.exists(function(struct) return struct.name == ":compilerGenerated");

return (cf.isPublic && !hide && !compilerGenerated) || show;
return ((cf.isPublic || config.includePrivate) && !hide && !compilerGenerated) || show;
});
}

Expand Down Expand Up @@ -310,7 +310,7 @@ class Processor {
if (Infos.hasDoxMetadata(type.meta, "hide"))
return true;
if (type.isPrivate)
return true;
return !config.includePrivate;
return isPathFiltered(type.path);
}

Expand Down

0 comments on commit 302a655

Please sign in to comment.