-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
143 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
make-api-doc/cache | ||
make-api-doc/*out.txt | ||
make-api-doc/*.dump | ||
|
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,66 @@ | ||
<# | ||
This script builds the api-doc html page by using phpdocumentor 3 | ||
#> | ||
|
||
# CONFIG ------------------------------------------------------------------------------------------------------- | ||
cd $PSScriptRoot; | ||
|
||
#Source directory of crudkit | ||
$srcDir = "..\src"; | ||
|
||
#Config files for phpdoc (needs to be an absolute path) | ||
$userConfig = $PSScriptRoot + "\phpdoc.user.config.xml"; | ||
$devConfig = $PSScriptRoot + "\phpdoc.dev.config.xml"; | ||
|
||
#phpdoc log log (stdout and errout) | ||
$userErrOut = ".\phpdoc-user-errout.txt"; | ||
$userStdOut = ".\phpdoc-user-stdout.txt"; | ||
$devErrOut = ".\phpdoc-dev-errout.txt"; | ||
$devStdOut = ".\phpdoc-dev-stdout.txt"; | ||
|
||
#Path to the the output directores (note that these need to be the same as in the config files) | ||
$userDir = "..\api-doc\user"; | ||
$devDir = "..\api-doc\dev"; | ||
|
||
#PREPARE ------------------------------------------------------------------------------------------------------- | ||
|
||
Remove-Item -LiteralPath $userDir -Recurse -Force -ErrorAction SilentlyContinue; | ||
Remove-Item -LiteralPath $devDir -Recurse -Force -ErrorAction SilentlyContinue; | ||
$userDocOk = $false; | ||
$devDockOk = $false; | ||
|
||
#BUILD USER DOC ------------------------------------------------------------------------------------------------------- | ||
#phpDocumentor.phar (v3.3.1) is not included in this git repo, because its big and ppl. dont need to download that. | ||
#Get it from github: https://github.com/phpDocumentor/phpDocumentor | ||
php phpDocumentor.phar --config $userConfig > $userStdOut 2> $userErrOut; | ||
|
||
if(Test-Path -LiteralPath ($userDir + '\index.html')) | ||
{ | ||
#teplate.color from phpdoc does not work, so fuck you: | ||
$css = ":root{--primary-color-hue: 202; --primary-color-saturation: 68%;} .phpdocumentor-table-of-contents__entry::before{background: none !important; background-color: hsl(202,68%,60%) !important;} "; | ||
Out-File -LiteralPath ($userDir + "\css\base.css") -InputObject $css -Append -Encoding utf8 -ErrorAction SilentlyContinue; | ||
|
||
$userDocOk = $true; | ||
Write-Host "api-doc [user] successfully created!" -ForegroundColor Green; | ||
} | ||
else | ||
{ | ||
Write-Host "error while creating api-doc [user]. check phpdoc logs." -ForegroundColor Red; | ||
} | ||
|
||
|
||
#BUILD DEV DOC ------------------------------------------------------------------------------------------------------- | ||
php phpDocumentor.phar --config $devConfig > $devStdOut 2> $devErrOut; | ||
|
||
if(Test-Path -LiteralPath ($devDir + '\index.html')) | ||
{ | ||
$css = ":root{--primary-color-hue: 320; --primary-color-saturation: 68%;} .phpdocumentor-table-of-contents__entry::before{background: none !important; background-color: hsl(320,68%,60%) !important;} "; | ||
Out-File -LiteralPath ($devDir + "\css\base.css") -InputObject $css -Append -Encoding utf8 -ErrorAction SilentlyContinue; | ||
|
||
$devDockOk = $true; | ||
Write-Host "api-doc [dev] successfully created!" -ForegroundColor Green; | ||
} | ||
else | ||
{ | ||
Write-Host "error while creating api-doc [dev]. check phpdoc logs." -ForegroundColor Red; | ||
} |
Binary file not shown.
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,31 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- DEV --> | ||
<phpdocumentor configVersion="3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.phpdoc.org" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/phpDocumentor/phpDocumentor/master/data/xsd/phpdoc.xsd"> | ||
<title>CRUDKit api-doc [Developer]</title> | ||
<paths> | ||
<output>../api-doc/dev</output> | ||
<cache>./cache/dev</cache> | ||
</paths> | ||
<version number="1.0.0"> | ||
<api format="php"> | ||
<default-package-name>CRUDKit</default-package-name> | ||
<visibility>internal</visibility> <!-- also includes Classes and Methods marked with @internal --> | ||
<include-source>true</include-source> | ||
<source dsn="../src"> | ||
<path>./</path> | ||
</source> | ||
<ignore> | ||
<path>examples/</path> | ||
<path>views/</path> | ||
<path>config/</path> | ||
<path>Classes/XmlSerializer.php</path> | ||
</ignore> | ||
</api> | ||
</version> | ||
<!-- Following shit doesnt work, might do in the future: --> | ||
<setting name="template.color" value="red"/> | ||
<template name="default"> | ||
<parameter name="color" value="red"/> | ||
</template> | ||
</phpdocumentor> | ||
<!-- DEV --> |
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 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- USER --> | ||
<phpdocumentor configVersion="3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.phpdoc.org" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/phpDocumentor/phpDocumentor/master/data/xsd/phpdoc.xsd"> | ||
<title>CRUDKit api-doc [User]</title> | ||
<paths> | ||
<output>../api-doc/user</output> | ||
<cache>./cache/user</cache> | ||
</paths> | ||
<version number="1.0.0"> | ||
<api format="php"> | ||
<default-package-name>CRUDKit</default-package-name> | ||
<source dsn="../src"> | ||
<path>./</path> | ||
</source> | ||
<ignore> | ||
<path>examples/</path> | ||
<path>views/</path> | ||
<path>config/</path> | ||
<path>Classes/SQLColumn.php</path> | ||
<path>Classes/SQLManyToOneColumn.php</path> | ||
<path>Classes/SQLOneToManyColumn.php</path> | ||
<path>Classes/EnumType.php</path> | ||
<path>Classes/ExceptionHandler.php</path> | ||
<path>Classes/Filter.php</path> | ||
<path>Classes/XmlSerializer.php</path> | ||
<path>Classes/Section.php</path> | ||
<path>Controllers/CrudkitController.php</path> | ||
</ignore> | ||
</api> | ||
</version> | ||
<!-- Following shit doesnt work, might do in the future: --> | ||
<setting name="template.color" value="red"/> | ||
<template name="default"> | ||
<parameter name="color" value="red"/> | ||
</template> | ||
</phpdocumentor> | ||
<!-- USER --> |
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,5 @@ | ||
Files in this directory are only used for building the api doc. | ||
|
||
Note for me: | ||
phpDocumentor.phar (v3.3.1) is not included in this git repo, because its big and ppl. dont need to download that. | ||
Get it from github: https://github.com/phpDocumentor/phpDocumentor |