-
Notifications
You must be signed in to change notification settings - Fork 20
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
19 changed files
with
434 additions
and
135 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
# Development |
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 @@ | ||
# User Guide |
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 @@ | ||
# Installation |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Reference | ||
|
||
- [Python API Reference](/reference/python/) |
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 @@ | ||
<!-- @content --> |
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,51 @@ | ||
import * as fs from "node:fs"; | ||
import * as path from "node:path"; | ||
|
||
const SPHINX_BUILD_OUTPUT = path.join( | ||
__dirname, | ||
"../../../python/pysail/docs/_build", | ||
); | ||
|
||
export default { | ||
async paths() { | ||
const entries = await fs.promises.readdir(SPHINX_BUILD_OUTPUT, { | ||
withFileTypes: true, | ||
recursive: true, | ||
}); | ||
const files = entries.filter( | ||
(entry) => entry.isFile() && entry.name.endsWith(".fjson"), | ||
); | ||
|
||
const paths = await Promise.all( | ||
files.map(async (entry) => { | ||
if (entry.name === "search.fjson" || entry.name === "genindex.fjson") { | ||
return null; | ||
} | ||
const file = path.join(entry.parentPath, entry.name); | ||
const content = await fs.promises.readFile(file, "utf-8"); | ||
const data = JSON.parse(content); | ||
const page = path | ||
.relative(SPHINX_BUILD_OUTPUT, file) | ||
.replace(/^index\.fjson$/, "/index") | ||
.replace(/[/\\]index\.fjson$/, "/index") | ||
// We must turn non-index pages into directories, since Sphinx handles URL in this way | ||
// in `JSONHTMLBuilder`, which may generate relative URLs containing `../` may appear in the HTML. | ||
.replace(/\.fjson$/, "/index"); | ||
return { | ||
params: { | ||
sphinx: true, | ||
page, | ||
prev: data.prev | ||
? { link: data.prev.link, text: data.prev.title } | ||
: false, | ||
next: data.next | ||
? { link: data.next.link, text: data.next.title } | ||
: false, | ||
}, | ||
content: data.body, | ||
}; | ||
}), | ||
); | ||
return paths.filter((path) => path !== null); | ||
}, | ||
}; |
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.