-
Notifications
You must be signed in to change notification settings - Fork 77
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
53 changed files
with
2,527 additions
and
3,292 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 |
---|---|---|
|
@@ -29,33 +29,13 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.workflow_run.head_branch }} | ||
- name: Download artifact | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: context.payload.workflow_run.id, | ||
}); | ||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "Simba-Win32.exe" | ||
})[0]; | ||
let download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
let fs = require('fs'); | ||
fs.writeFileSync('Simba-Win32.zip', Buffer.from(download.data)); | ||
|
||
- name: Build files | ||
shell: bash | ||
run: | | ||
pip3 install sphinx furo myst-parser | ||
unzip Simba-Win32.zip | ||
./Simba-Win32.exe --run "DocGen/docgen.simba" | ||
cd DocGen | ||
python3 docgen.py | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v1 | ||
|
This file was deleted.
Oops, something went wrong.
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,45 @@ | ||
# pip3 install sphinx furo myst-parser | ||
# Theme is https://pradyunsg.me/furo/quickstart/ | ||
|
||
import os | ||
import glob | ||
import re | ||
import subprocess | ||
|
||
SRC_DIR = '../Source/script/imports/' | ||
BUILD_DIR = 'source/api/' | ||
|
||
# remove old build files, all but index | ||
for file in glob.glob(f"{BUILD_DIR}*.md"): | ||
os.remove(file) | ||
|
||
# extract all comments | ||
comments = [] | ||
for source in glob.glob(f"{SRC_DIR}*.pas"): | ||
with open(source, 'r') as f: | ||
comments.extend(re.findall(r'\(\*(.*?)\*\)', f.read(), re.DOTALL)) | ||
|
||
# write comments, changing the file when a header is found | ||
# header being a === line rather than --- | ||
currentfile = None | ||
for comment in comments: | ||
comment = comment.strip() | ||
if (comment.splitlines()[1][0] == '='): | ||
if currentfile: | ||
currentfile.close() | ||
currentfile = open(f"{BUILD_DIR}/{comment.splitlines()[0]}.md", 'a') | ||
currentfile.write(comment) | ||
else: | ||
currentfile.write('\n\n' + '-----' + '\n\n' + comment) | ||
if currentfile: | ||
currentfile.close() | ||
|
||
# build it | ||
subprocess.run(["sphinx-build", "-q", "-E", "source", "build"]) | ||
|
||
# smaller text looks better for api declarations | ||
for source in glob.glob("build/api/*.html"): | ||
with open(source, 'r', encoding='utf-8') as f: | ||
contents = f.read().replace("h2", "h3") | ||
with open(source, 'w', encoding='utf-8') as f: | ||
f.write(contents) |
This file was deleted.
Oops, something went wrong.
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,4 +1,3 @@ | ||
|
||
API | ||
=== | ||
|
||
|
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
Oops, something went wrong.