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, newnode, playsound, printnodes, printobjects, pushcall, quit, rowwidget,
safecolor, screenmessage, scrollwidget, set_analytics_screen, charstr, safecolor, screenmessage, scrollwidget, set_analytics_screen, charstr,
textwidget, time, timer, open_url, widget, clipboard_is_supported, 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._activity import Activity
from ba._plugin import PotentialPlugin, Plugin, PluginSubsystem from ba._plugin import PotentialPlugin, Plugin, PluginSubsystem
from ba._actor import Actor from ba._actor import Actor

View File

@ -9,19 +9,29 @@
</a> </a>
{% endblock %} {% endblock %}
{% if search %} {% 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 %} {% endif %}
</header> </header>
<main class="pdoc"> <main class="pdoc">
<h1>header woo-hoo</h1> <h1>Welcome to Ballistica Documentations!</h1>
Welcome to blah blah blah, some <b>bold</b> text, create an <i>Last updated for Ballistica {{ ba_version }}
<a href="https://github.com/efroemling/ballistica/issues/">issue</a> (build {{ ba_build }})</i>
if something in this docs feels incorrect or can be improved blah blah <hr/>
<code> <p>
some code hooray Here you can find information about Python classes/functions
</code> used by Ballistica.
<br/> Fell free to create an
TODO: add some normal text here. <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> </main>
{% if search %} {% if search %}
{% include "search.html.jinja2" %} {% 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: def generate(projroot: str) -> None:
"""Main entry point.""" """Main entry point."""
from batools.version import get_current_version
import pdoc import pdoc
# Make sure we're running from the dir above this script. # 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() outdirname = (Path(projroot) / 'build' / 'docs_html').absolute()
sys.path.append(str(pythondir)) sys.path.append(str(pythondir))
version, build_number = get_current_version()
try: try:
pdoc.render.env.globals['ba_version'] = version
pdoc.render.env.globals['ba_build'] = build_number
pdoc.render.configure(search=True, pdoc.render.configure(search=True,
show_source=True, show_source=True,
template_directory=templatesdir) template_directory=templatesdir)