update index page

This commit is contained in:
Roman Trapeznikov 2022-02-23 17:39:12 +03:00
parent 04a7479c59
commit ff3f8a8c35
No known key found for this signature in database
GPG Key ID: 89BED52F1E290F8D
3 changed files with 26 additions and 11 deletions

View File

@ -18,7 +18,7 @@ from _ba import (
newnode, playsound, printnodes, printobjects, pushcall, quit, rowwidget,
safecolor, screenmessage, scrollwidget, set_analytics_screen, charstr,
textwidget, time, timer, open_url, widget, clipboard_is_supported,
clipboard_has_text, clipboard_get_text, clipboard_set_text)
clipboard_has_text, clipboard_get_text, clipboard_set_text, getdata)
from ba._activity import Activity
from ba._plugin import PotentialPlugin, Plugin, PluginSubsystem
from ba._actor import Actor

View File

@ -9,19 +9,29 @@
</a>
{% endblock %}
{% if search %}
<input type="search" placeholder="Search Ballistica Python API Documentation..." aria-label="search box">
<input type="search"
placeholder="Search Python API Documentation..."
aria-label="search box">
{% endif %}
</header>
<main class="pdoc">
<h1>header woo-hoo</h1>
Welcome to blah blah blah, some <b>bold</b> text, create an
<a href="https://github.com/efroemling/ballistica/issues/">issue</a>
if something in this docs feels incorrect or can be improved blah blah
<code>
some code hooray
</code>
<br/>
TODO: add some normal text here.
<h1>Welcome to Ballistica Documentations!</h1>
<i>Last updated for Ballistica {{ ba_version }}
(build {{ ba_build }})</i>
<hr/>
<p>
Here you can find information about Python classes/functions
used by Ballistica.
Fell free to create an
<a href="https://github.com/efroemling/ballistica/issues/">
issue</a>
or send a
<a href="https://github.com/efroemling/ballistica/pulls/">PR</a>
if something in this docs feels incorrect or can be improved.
Note that <code>bastd</code>'s docs may look a little terrible
right
now, hope that's temporary. :)
</p>
</main>
{% if search %}
{% include "search.html.jinja2" %}

View File

@ -75,6 +75,7 @@ def parse_docs_attrs(attrs: list[AttributeInfo], docs: str) -> str:
def generate(projroot: str) -> None:
"""Main entry point."""
from batools.version import get_current_version
import pdoc
# Make sure we're running from the dir above this script.
@ -87,7 +88,11 @@ def generate(projroot: str) -> None:
outdirname = (Path(projroot) / 'build' / 'docs_html').absolute()
sys.path.append(str(pythondir))
version, build_number = get_current_version()
try:
pdoc.render.env.globals['ba_version'] = version
pdoc.render.env.globals['ba_build'] = build_number
pdoc.render.configure(search=True,
show_source=True,
template_directory=templatesdir)