-
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.
Add sphinx apidoc and return includes for conan
- Loading branch information
Joel Lefkowitz
committed
Apr 24, 2024
1 parent
79dc551
commit bf6f7f8
Showing
11 changed files
with
213 additions
and
2,833 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,75 @@ | ||
import re | ||
import shutil | ||
from cgitb import html | ||
from datetime import date | ||
from glob import glob | ||
from walkmate import tree | ||
|
||
project = "Miniscons" | ||
version = "0.9.0" | ||
|
||
package = "miniscons" | ||
primary = "#4165FF" | ||
secondary = "#914FF5" | ||
|
||
project_copyright = f"{date.today().year} Joel Lefkowitz" | ||
|
||
extensions = [ | ||
"autoapi.extension", | ||
"myst_parser", | ||
"sphinxext.opengraph", | ||
] | ||
|
||
autoapi_dirs = ["../../src"] | ||
autoapi_options = [ | ||
"members", | ||
"undoc-members", | ||
"private-members", | ||
"show-inheritance", | ||
] | ||
|
||
myst_all_links_external = True | ||
|
||
html_theme = "furo" | ||
html_title = project | ||
html_static_path = [""] | ||
html_js_files = ["scripts.js"] | ||
html_css_files = ["styles.css"] | ||
html_theme_options = { | ||
"font-stack": "Space Grotesk, sans-serif", | ||
"font-stack--monospace": "CQ Mono, monospace", | ||
"light_css_variables": { | ||
"color-brand-content": primary, | ||
"color-problematic": primary, | ||
"color-brand-primary": secondary, | ||
"color-highlight-on-target": "#E0E0E0", | ||
}, | ||
"dark_css_variables": { | ||
"color-problematic": primary, | ||
"color-brand-content": primary, | ||
"color-brand-primary": secondary, | ||
"color-highlight-on-target": "#202020", | ||
}, | ||
} | ||
|
||
|
||
def build(app, build): | ||
|
||
shutil.copytree("docs/images", "docs/dist/docs/images", dirs_exist_ok=True) | ||
shutil.move("docs/dist/autoapi/src", f"docs/dist/autoapi/{package}") | ||
|
||
pattern = re.compile(r"src(?!\=)") | ||
|
||
for file in tree("docs/dist", r"\.html") + ["docs/dist/searchindex.js"]: | ||
with open(file, "r") as stream: | ||
text = pattern.sub(package, stream.read()) | ||
|
||
with open(file, "w") as stream: | ||
stream.write(text) | ||
|
||
for path in glob(f"*.md"): | ||
shutil.copyfile(path, f"docs/dist/{path}") | ||
|
||
|
||
def setup(app): | ||
app.connect("build-finished", build) |
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,7 @@ | ||
.. include:: ../../README.md | ||
:parser: myst_parser.sphinx_ | ||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
.. autosummary:: |
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,13 @@ | ||
Array.from(document.querySelectorAll("img")) | ||
.filter((img) => img.hasAttribute("height")) | ||
.forEach((img) => { | ||
img.style.height = img.getAttribute("height").concat("px"); | ||
}); | ||
|
||
Array.from(document.querySelectorAll(".toctree-checkbox")).forEach( | ||
(section) => { | ||
if (!section.checked) { | ||
section.click(); | ||
} | ||
}, | ||
); |
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,50 @@ | ||
.content { | ||
width: 100%; | ||
padding: 0 40px; | ||
} | ||
|
||
.toc-drawer { | ||
width: 400px; | ||
} | ||
|
||
.sidebar-brand-text { | ||
text-align: center; | ||
} | ||
|
||
.sidebar-drawer { | ||
width: 300px; | ||
} | ||
|
||
.sidebar-container { | ||
width: 300px; | ||
} | ||
|
||
section#documentation { | ||
display: none; | ||
} | ||
|
||
@media (max-width: 67em) { | ||
.content { | ||
padding: 0 20px; | ||
} | ||
|
||
.icon { | ||
margin: 0 10px; | ||
|
||
svg { | ||
width: 20px; | ||
height: 20px; | ||
} | ||
} | ||
|
||
.sidebar-drawer { | ||
left: -300px; | ||
} | ||
} | ||
|
||
@media (max-width: 82em) { | ||
.toc-drawer { | ||
max-width: 300px; | ||
right: -400px; | ||
} | ||
} |
Oops, something went wrong.