Skip to content

Commit b531ad2

Browse files
committed
more docs
1 parent b52efa1 commit b531ad2

File tree

14 files changed

+583
-373
lines changed

14 files changed

+583
-373
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ target/
6666
.python-version*
6767

6868
temp*
69+
70+
# env file
71+
.env

deepdiff/delta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
NUMPY_TO_LIST = 'NUMPY_TO_LIST'
3636
NOT_VALID_NUMPY_TYPE = "{} is not a valid numpy type."
3737

38-
doc = get_doc('delta_doc.rst')
38+
doc = get_doc('delta.rst')
3939

4040

4141
class DeltaError(ValueError):

docs/_static/custom.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* latin-ext */
2+
@font-face {
3+
font-family: 'Open Sans';
4+
font-style: normal;
5+
font-weight: 400;
6+
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFW50bbck.woff2) format('woff2');
7+
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;
8+
}
9+
/* latin */
10+
@font-face {
11+
font-family: 'Open Sans';
12+
font-style: normal;
13+
font-weight: 400;
14+
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFVZ0b.woff2) format('woff2');
15+
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;
16+
}

docs/_static/favicon.ico

14.7 KB
Binary file not shown.

docs/_static/logo.svg

Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 42 additions & 0 deletions
Loading

docs/_templates/about.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{% if theme_logo %}
2+
<p class="logo">
3+
<a href="/">
4+
<img class="logo" src="{{ pathto('_static/' ~ theme_logo, 1) }}" alt="Logo"/>
5+
{% if theme_logo_name|lower == 'true' %}
6+
<h1 class="logo logo-name">{{ project }}</h1>
7+
{% endif %}
8+
</a>
9+
</p>
10+
{% else %}
11+
<h1 class="logo"><a href="{{ pathto(master_doc) }}">{{ project }}</a></h1>
12+
{% endif %}
13+
14+
{% if theme_description %}
15+
<p class="blurb">{{ theme_description }}</p>
16+
{% endif %}
17+
18+
{% if theme_github_user and theme_github_repo %}
19+
{% if theme_github_button|lower == 'true' %}
20+
<p>
21+
<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"
22+
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
23+
</p>
24+
{% endif %}
25+
{% endif %}
26+
27+
{% if theme_travis_button|lower != 'false' %}
28+
{% if theme_travis_button|lower == 'true' %}
29+
{% set path = theme_github_user + '/' + theme_github_repo %}
30+
{% else %}
31+
{% set path = theme_travis_button %}
32+
{% endif %}
33+
<p>
34+
<a class="badge" href="https://travis-ci.org/{{ path }}">
35+
<img
36+
alt="https://secure.travis-ci.org/{{ path }}.svg?branch={{ theme_badge_branch }}"
37+
src="https://secure.travis-ci.org/{{ path }}.svg?branch={{ theme_badge_branch }}"
38+
/>
39+
</a>
40+
</p>
41+
{% endif %}
42+
43+
{% if theme_codecov_button|lower != 'false' %}
44+
{% if theme_codecov_button|lower == 'true' %}
45+
{% set path = theme_github_user + '/' + theme_github_repo %}
46+
{% else %}
47+
{% set path = theme_codecov_button %}
48+
{% endif %}
49+
<p>
50+
<a class="badge" href="https://codecov.io/github/{{ path }}">
51+
<img
52+
alt="https://codecov.io/github/{{ path }}/coverage.svg?branch={{ theme_badge_branch }}"
53+
src="https://codecov.io/github/{{ path }}/coverage.svg?branch={{ theme_badge_branch }}"
54+
/>
55+
</a>
56+
</p>
57+
{% endif %}

docs/_templates/navigation.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<h3 class="logo"><a href="{{ pathto(master_doc) }}">{{ project }} {{ version }}</a></h3>
2+
{{ toctree(includehidden=theme_sidebar_includehidden, collapse=theme_sidebar_collapse) }}
3+
{% if theme_extra_nav_links %}
4+
<hr />
5+
<ul>
6+
{% for text, uri in theme_extra_nav_links.items() %}
7+
<li class="toctree-l1"><a href="{{ uri }}">{{ text }}</a></li>
8+
{% endfor %}
9+
</ul>
10+
{% endif %}

docs/buildme.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env python
2+
"""
3+
Create a .env file in this folder that has BUILD_PATH defined, otherwise the _build will be used.
4+
Then run ./buildme.py
5+
It will remove the contents of the BUILD_PATH folder and recreate it.
6+
"""
7+
import os
8+
import time
9+
import datetime
10+
import shutil
11+
from dotenv import load_dotenv
12+
from watchdog.observers import Observer
13+
from watchdog.events import FileSystemEventHandler
14+
from sphinx.cmd.build import main as sphinx_main
15+
16+
17+
def ensure_dir(file_path):
18+
directory = os.path.dirname(file_path)
19+
if not os.path.exists(directory):
20+
os.makedirs(directory)
21+
22+
23+
def delete_dir_contents(directory):
24+
if os.path.exists(directory):
25+
shutil.rmtree(directory)
26+
27+
28+
class MyHandler(FileSystemEventHandler):
29+
30+
def __init__(self):
31+
self.last_modified = datetime.datetime.now()
32+
33+
def on_any_event(self, event):
34+
load_dotenv(override=True)
35+
build_path = os.environ.get('BUILD_PATH', '_build')
36+
if event is None:
37+
print('initial build')
38+
else:
39+
print(f'event type: {event.event_type} path : {event.src_path}')
40+
if event is not None and (
41+
datetime.datetime.now() - self.last_modified < datetime.timedelta(seconds=2)):
42+
return
43+
else:
44+
self.last_modified = datetime.datetime.now()
45+
argv = ['-b', 'html', '.', build_path]
46+
ensure_dir(build_path)
47+
delete_dir_contents(build_path)
48+
# argv = ['-b', 'html', '-d', f'{build_path}/doctrees', '.', f'{build_path}/html']
49+
sphinx_main(argv)
50+
print('waiting for file changes. Press Ctrl+c to cancel.')
51+
52+
53+
if __name__ == "__main__":
54+
event_handler = MyHandler()
55+
event_handler.on_any_event(event=None)
56+
observer = Observer()
57+
observer.schedule(event_handler, path='.', recursive=True)
58+
observer.start()
59+
60+
try:
61+
while True:
62+
time.sleep(1)
63+
except KeyboardInterrupt:
64+
observer.stop()
65+
observer.join()

docs/conf.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import sys
1616
import os
17-
import shlex
1817

1918
# If extensions (or modules to document with autodoc) are in another directory,
2019
# add these directories to sys.path here. If the directory is relative to the
@@ -117,7 +116,24 @@
117116
# Theme options are theme-specific and customize the look and feel of a theme
118117
# further. For a list of options available for each theme, see the
119118
# documentation.
120-
#html_theme_options = {}
119+
html_theme_options = {
120+
'description': 'Get the deep difference of any Python objects',
121+
'show_powered_by': False,
122+
'logo': 'logo_long_B1_black.svg',
123+
'logo_name': 'Zepworks DeepDiff',
124+
'analytics_id': 'UA-59104908-2',
125+
'fixed_sidebar': True,
126+
'extra_nav_links': {
127+
'Zepworks': 'https://zepworks.com', 'Github': 'https://github.com/seperman/deepdiff'},
128+
'show_relbars': True,
129+
'github_repo': 'deepdiff',
130+
'anchor': '#DDD',
131+
'touch_icon': 'logo.svg',
132+
'github_button': True,
133+
'github_user': 'seperman',
134+
'github_count': True,
135+
'font_family': 'Open Sans',
136+
}
121137

122138
# Add any paths that contain custom themes here, relative to this directory.
123139
#html_theme_path = []
@@ -131,12 +147,12 @@
131147

132148
# The name of an image file (relative to this directory) to place at the top
133149
# of the sidebar.
134-
#html_logo = None
150+
html_logo = None
135151

136152
# The name of an image file (within the static path) to use as favicon of the
137153
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
138154
# pixels large.
139-
#html_favicon = None
155+
html_favicon = "./_static/favicon.ico"
140156

141157
# Add any paths that contain custom static files (such as style sheets) here,
142158
# relative to this directory. They are copied after the builtin static files,

0 commit comments

Comments
 (0)