-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/FNF-CNE-Devs/FNF-CNE-Devs.g…
- Loading branch information
Showing
474 changed files
with
20,616 additions
and
15,166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export/* | ||
node_modules/* | ||
node_modules/* | ||
.vscode/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pages/* | ||
bin/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import haxe.io.Path; | ||
import haxe.macro.Expr; | ||
import sys.FileSystem; | ||
import sys.io.Process; | ||
|
||
using StringTools; | ||
|
||
class Macro { | ||
// meh... | ||
public macro static function getDoxPath():Expr { | ||
var output = getProcessOutput('haxelib', ['--global', 'path', 'dox']); | ||
for (line in output.split("\n")) { | ||
var path = Path.normalize(line.trim()); | ||
if (FileSystem.exists(path)) { | ||
var path = Path.directory(Path.removeTrailingSlashes(path.trim())); | ||
return macro $v{path}; | ||
} | ||
} | ||
throw "dox path not found"; | ||
} | ||
|
||
static function getProcessOutput(cmd:String, ?args:Array<String>):String { | ||
try { | ||
var process = new Process(cmd, args); | ||
var output = ""; | ||
|
||
try { | ||
output = process.stdout.readAll().toString(); | ||
} catch (_:Dynamic) {} | ||
|
||
process.close(); | ||
return output; | ||
} catch (_:Dynamic) { | ||
return ""; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package; | ||
|
||
import dox.Api; | ||
import dox.Config; | ||
import dox.Dox; | ||
import haxe.rtti.CType.TypeInfos; | ||
import sys.io.File; | ||
|
||
using StringTools; | ||
|
||
class Main { | ||
public static var defines:Map<String, String>; | ||
|
||
static function main() { | ||
/*defines = [ | ||
for (line in File.getContent("../xml/bin/defines.txt").split("\n")) { | ||
var parts = ~/ /.split(line); | ||
parts[0] => parts[1]; | ||
} | ||
];*/ | ||
|
||
// Generate doc-filter.xml if it exists | ||
if(sys.FileSystem.exists("api/doc.xml")) { | ||
var cwd = Sys.getCwd(); | ||
Sys.setCwd(cwd + "/api"); | ||
Sys.command("python3 filter.py"); | ||
Sys.setCwd(cwd); | ||
sys.FileSystem.rename("api/doc.xml", "api/doc-old.xml"); // so it doesnt convert it again | ||
} | ||
|
||
// otherwise, check if cached doc-filter.xml exists | ||
if(!sys.FileSystem.exists("api/doc-filter.xml")) { | ||
trace("Couldn't find doc-filter.xml"); | ||
Sys.exit(1); | ||
} | ||
|
||
var config = new Config(Macro.getDoxPath()); | ||
config.inputPath = "api/doc-filter.xml"; | ||
config.outputPath = "../export/api-docs"; | ||
config.rootPath = "./"; | ||
config.loadTheme("./theme"); | ||
config.pageTitle = "Codename Engine API"; | ||
config.toplevelPackage = "funkin"; | ||
//config.defines = [Version => defines["flixel"]]; | ||
config.addFilter("(__ASSET__|ApplicationMain|DocumentClass|DefaultAssetLibrary|Main|NMEPreloader|zpp_nape)", false); | ||
config.addFilter("funkin|scripting", true); | ||
//config.rootPath = ""; | ||
|
||
Dox.run(config, CodenameApi.new); | ||
} | ||
} | ||
|
||
class CodenameApi extends Api { | ||
override function getSourceLink(type:TypeInfos):Null<String> { | ||
var module = type.module != null ? type.module : type.path; | ||
var ending = ".hx"; | ||
var url = "https://github.com/FNF-CNE-Devs/CodenameEngine/blob/main/source/"; | ||
|
||
return haxe.io.Path.join([url, module.replace(".", "/") + ending]); | ||
} | ||
|
||
public function getSourceLinkWithLine(type:TypeInfos, line:Int):Null<String> { | ||
var module = type.module != null ? type.module : type.path; | ||
var ending = ".hx"; | ||
var url = "https://github.com/FNF-CNE-Devs/CodenameEngine/blob/main/source/"; | ||
|
||
return haxe.io.Path.join([url, module.replace(".", "/") + ending + "#L" + line]); | ||
} | ||
|
||
function isOneOf(module:String, classes:Array<String>):Bool { | ||
for (cl in classes) { | ||
if (module.indexOf(cl) >= 0) | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
override function hasSourceLink(type:TypeInfos):Bool { | ||
return type.file != null && type.file.endsWith(".hx"); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.