62 lines
1.3 KiB
Python
62 lines
1.3 KiB
Python
import datetime
|
|
from sphinx.util import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
extensions = [
|
|
'sphinx.ext.intersphinx',
|
|
'sphinx.ext.todo',
|
|
'sphinx_last_updated_by_git',
|
|
'sphinx_markdown_builder',
|
|
]
|
|
|
|
|
|
templates_path = ["_templates"]
|
|
|
|
project = "MIME TODO"
|
|
copyright = "2026, Tiara Rodney"
|
|
|
|
html_title = project
|
|
html_theme = 'bizstyle'
|
|
html_sidebars = {}
|
|
html_show_sphinx = False
|
|
html_show_sourcelink = False
|
|
|
|
html_context = {
|
|
"bitbucket_url": "https://bitbucket.org",
|
|
"bitbucket_user": "byteb4rb1e",
|
|
"bitbucket_repo": "ai-mime-todo",
|
|
"bitbucket_version": "master",
|
|
"doc_path": "src/"
|
|
}
|
|
|
|
|
|
|
|
language = 'en'
|
|
|
|
todo_include_todos = True
|
|
|
|
rst_prolog = f"""
|
|
.. |build-time| replace:: {datetime.datetime.now().strftime("%d %B %Y, %H:%M")}
|
|
"""
|
|
|
|
html_last_updated_fmt = "%d %B %Y, %H:%M"
|
|
|
|
root_doc = "README"
|
|
|
|
from pathlib import Path
|
|
import shutil
|
|
|
|
def on_build_finished(app, exception):
|
|
if exception is not None:
|
|
return # skip on build failure
|
|
|
|
ilicense = Path(app.confdir) / '..' / 'LICENSE'
|
|
olicense = Path(app.outdir) / 'LICENSE'
|
|
|
|
if ilicense.exists():
|
|
shutil.copyfile(ilicense, olicense)
|
|
logger.info(f"copied {ilicense} → {olicense}")
|
|
|
|
def setup(app):
|
|
app.connect("build-finished", on_build_finished)
|