Skip to content

Commit a93ca11

Browse files
committed
Add Giscus widget to documentation
Might help with feedback
1 parent 15b5eda commit a93ca11

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,5 +556,8 @@
556556
"python.testing.pytestEnabled": true,
557557
"[python]": {
558558
"editor.defaultFormatter": "charliermarsh.ruff"
559+
},
560+
"[html]": {
561+
"editor.formatOnSave": false
559562
}
560563
}

docs/_templates/page.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% extends "!page.html" %}
2+
{% block content %}
3+
{{ super() }}
4+
5+
<script src="https://giscus.app/client.js"
6+
data-repo="libtcod/python-tcod"
7+
data-repo-id="MDEwOlJlcG9zaXRvcnkzMjE5MjIzOA=="
8+
data-category="Docs"
9+
data-category-id="DIC_kwDOAes27s4C1Ynw"
10+
data-mapping="specific"
11+
data-term="{{ pagename }} - python-tcod docs"
12+
data-strict="0"
13+
data-reactions-enabled="0"
14+
data-emit-metadata="0"
15+
data-input-position="bottom"
16+
data-theme="preferred_color_scheme"
17+
data-lang="en"
18+
crossorigin="anonymous"
19+
async>
20+
</script>
21+
{% endblock %}

docs/conf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Sphinx config file.""" # noqa: INP001
2-
# tdl documentation build configuration file, created by
2+
# python-tcod documentation build configuration file, created by
33
# sphinx-quickstart on Fri Nov 25 12:49:46 2016.
44
#
55
# This file is execfile()d with the current directory set to its
@@ -73,20 +73,20 @@
7373
# built documents.
7474
#
7575
# The full version, including alpha/beta/rc tags.
76-
git_describe = subprocess.run(
76+
release = subprocess.run(
7777
["git", "describe", "--abbrev=0"], # noqa: S607
7878
stdout=subprocess.PIPE,
7979
text=True,
8080
check=True,
81-
)
82-
release = git_describe.stdout.strip()
81+
).stdout.strip()
8382
assert release
8483
print(f"release version: {release!r}")
8584

8685
# The short X.Y version.
8786
match_version = re.match(r"([0-9]+\.[0-9]+).*?", release)
8887
assert match_version
8988
version = match_version.group()
89+
print(f"short version: {version!r}")
9090

9191
# The language for content autogenerated by Sphinx. Refer to documentation
9292
# for a list of supported languages.
@@ -167,9 +167,9 @@
167167
# html_theme_path = []
168168

169169
# The name for this set of Sphinx documents.
170-
# "<project> v<release> documentation" by default.
170+
# "<project> <release> documentation" by default.
171171
#
172-
# html_title = u'tdl v1'
172+
html_title = f"{project} {release} documentation"
173173

174174
# A shorter title for the navigation bar. Default is the same as html_title.
175175
#

0 commit comments

Comments
 (0)