-
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
583 additions
and
373 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,3 +66,6 @@ target/ | |
.python-version* | ||
|
||
temp* | ||
|
||
# env file | ||
.env |
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,16 @@ | ||
/* latin-ext */ | ||
@font-face { | ||
font-family: 'Open Sans'; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFW50bbck.woff2) format('woff2'); | ||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; | ||
} | ||
/* latin */ | ||
@font-face { | ||
font-family: 'Open Sans'; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFVZ0b.woff2) format('woff2'); | ||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,57 @@ | ||
{% if theme_logo %} | ||
<p class="logo"> | ||
<a href="/"> | ||
<img class="logo" src="{{ pathto('_static/' ~ theme_logo, 1) }}" alt="Logo"/> | ||
{% if theme_logo_name|lower == 'true' %} | ||
<h1 class="logo logo-name">{{ project }}</h1> | ||
{% endif %} | ||
</a> | ||
</p> | ||
{% else %} | ||
<h1 class="logo"><a href="{{ pathto(master_doc) }}">{{ project }}</a></h1> | ||
{% endif %} | ||
|
||
{% if theme_description %} | ||
<p class="blurb">{{ theme_description }}</p> | ||
{% endif %} | ||
|
||
{% if theme_github_user and theme_github_repo %} | ||
{% if theme_github_button|lower == 'true' %} | ||
<p> | ||
<iframe src="https://ghbtns.com/github-btn.html?user={{ theme_github_user }}&repo={{ theme_github_repo }}&type={{ theme_github_type }}&count={{ theme_github_count }}&size=large&v=2" | ||
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe> | ||
</p> | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% if theme_travis_button|lower != 'false' %} | ||
{% if theme_travis_button|lower == 'true' %} | ||
{% set path = theme_github_user + '/' + theme_github_repo %} | ||
{% else %} | ||
{% set path = theme_travis_button %} | ||
{% endif %} | ||
<p> | ||
<a class="badge" href="https://travis-ci.org/{{ path }}"> | ||
<img | ||
alt="https://secure.travis-ci.org/{{ path }}.svg?branch={{ theme_badge_branch }}" | ||
src="https://secure.travis-ci.org/{{ path }}.svg?branch={{ theme_badge_branch }}" | ||
/> | ||
</a> | ||
</p> | ||
{% endif %} | ||
|
||
{% if theme_codecov_button|lower != 'false' %} | ||
{% if theme_codecov_button|lower == 'true' %} | ||
{% set path = theme_github_user + '/' + theme_github_repo %} | ||
{% else %} | ||
{% set path = theme_codecov_button %} | ||
{% endif %} | ||
<p> | ||
<a class="badge" href="https://codecov.io/github/{{ path }}"> | ||
<img | ||
alt="https://codecov.io/github/{{ path }}/coverage.svg?branch={{ theme_badge_branch }}" | ||
src="https://codecov.io/github/{{ path }}/coverage.svg?branch={{ theme_badge_branch }}" | ||
/> | ||
</a> | ||
</p> | ||
{% endif %} |
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,10 @@ | ||
<h3 class="logo"><a href="{{ pathto(master_doc) }}">{{ project }} {{ version }}</a></h3> | ||
{{ toctree(includehidden=theme_sidebar_includehidden, collapse=theme_sidebar_collapse) }} | ||
{% if theme_extra_nav_links %} | ||
<hr /> | ||
<ul> | ||
{% for text, uri in theme_extra_nav_links.items() %} | ||
<li class="toctree-l1"><a href="{{ uri }}">{{ text }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} |
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,65 @@ | ||
#!/usr/bin/env python | ||
""" | ||
Create a .env file in this folder that has BUILD_PATH defined, otherwise the _build will be used. | ||
Then run ./buildme.py | ||
It will remove the contents of the BUILD_PATH folder and recreate it. | ||
""" | ||
import os | ||
import time | ||
import datetime | ||
import shutil | ||
from dotenv import load_dotenv | ||
from watchdog.observers import Observer | ||
from watchdog.events import FileSystemEventHandler | ||
from sphinx.cmd.build import main as sphinx_main | ||
|
||
|
||
def ensure_dir(file_path): | ||
directory = os.path.dirname(file_path) | ||
if not os.path.exists(directory): | ||
os.makedirs(directory) | ||
|
||
|
||
def delete_dir_contents(directory): | ||
if os.path.exists(directory): | ||
shutil.rmtree(directory) | ||
|
||
|
||
class MyHandler(FileSystemEventHandler): | ||
|
||
def __init__(self): | ||
self.last_modified = datetime.datetime.now() | ||
|
||
def on_any_event(self, event): | ||
load_dotenv(override=True) | ||
build_path = os.environ.get('BUILD_PATH', '_build') | ||
if event is None: | ||
print('initial build') | ||
else: | ||
print(f'event type: {event.event_type} path : {event.src_path}') | ||
if event is not None and ( | ||
datetime.datetime.now() - self.last_modified < datetime.timedelta(seconds=2)): | ||
return | ||
else: | ||
self.last_modified = datetime.datetime.now() | ||
argv = ['-b', 'html', '.', build_path] | ||
ensure_dir(build_path) | ||
delete_dir_contents(build_path) | ||
# argv = ['-b', 'html', '-d', f'{build_path}/doctrees', '.', f'{build_path}/html'] | ||
sphinx_main(argv) | ||
print('waiting for file changes. Press Ctrl+c to cancel.') | ||
|
||
|
||
if __name__ == "__main__": | ||
event_handler = MyHandler() | ||
event_handler.on_any_event(event=None) | ||
observer = Observer() | ||
observer.schedule(event_handler, path='.', recursive=True) | ||
observer.start() | ||
|
||
try: | ||
while True: | ||
time.sleep(1) | ||
except KeyboardInterrupt: | ||
observer.stop() | ||
observer.join() |
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
Oops, something went wrong.