Skip to content

Commit c65cca5

Browse files
Merge pull request #189 from supertokens/fix-multiple-h1-issue
docs: fixes issue of multiple h1 present in python docs
2 parents 4cffd73 + 93b0aed commit c65cca5

File tree

281 files changed

+1735
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+1735
-269
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [unreleased]
88

9+
### Documentation:
10+
- Added `pdoc` template files to project inside `docs-templates` directory
11+
- Updated `build-docs` in Makefile to use `docs-templates` as the template directory while generating docs using `pdoc`
12+
- Updated `html.mako` template to have a single `h1` tag
13+
914
## [0.10.0] - 2022-07-04
1015

1116
- Update tests to cover `resend_code` feature in `passwordless` and `thirdpartypasswordless` recipe.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ with-flask:
4141
pip3 install -e .[flask]
4242

4343
build-docs:
44-
rm -rf html && pdoc --html supertokens_python
44+
rm -rf html && pdoc --html supertokens_python --template-dir docs-templates

docs-templates/_lunr_search.inc.mako

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<form>
2+
<input id="lunr-search" name="q" placeholder="🔎 Search ..." aria-label="Search"
3+
disabled minlength="2">
4+
</form>
5+
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/tingle/0.15.3/tingle.min.css" integrity="sha512-j1u8eUJ4f23xPPxwOrLUPQaCD2dwzNqqmDDcWS4deWsMv2ohLqmXXuP3hU7g8TyzbMSakP/mMqoNBYWj8AEIFg==" crossorigin>
6+
<script src="https://cdnjs.cloudflare.com/ajax/libs/tingle/0.15.3/tingle.min.js" integrity="sha512-plGUER9JkeEWPPqQBE4sdLqBoQug5Ap+BCGMc7bJ8BXkm+VVj6QzkpBz5Yv2yPkkq+cqg9IpkBaGCas6uDbW8g==" crossorigin></script>
7+
<style>
8+
.modal-dialog iframe {
9+
width: 100vw;
10+
height: calc(100vh - 80px);
11+
}
12+
@media screen and (min-width: 700px) {
13+
.modal-dialog iframe {
14+
width: 70vw;
15+
height: 80vh;
16+
}
17+
}
18+
.modal-dialog .tingle-modal-box {width: auto;}
19+
.modal-dialog .tingle-modal-box__content {padding: 0;}
20+
</style>
21+
<script>
22+
const input = document.getElementById('lunr-search');
23+
input.disabled = false;
24+
25+
input.form.addEventListener('submit', (ev) => {
26+
ev.preventDefault();
27+
const url = new URL(window.location);
28+
url.searchParams.set('q', input.value);
29+
history.replaceState({}, null, url.toString());
30+
search(input.value);
31+
});
32+
33+
## On page load
34+
const query = new URL(window.location).searchParams.get('q');
35+
if (query)
36+
search(query);
37+
38+
function search(query) {
39+
const url = '${'../' * module.url().count('/')}doc-search.html#' + encodeURIComponent(query);
40+
new tingle.modal({
41+
cssClass: ['modal-dialog'],
42+
onClose: () => {
43+
const url = new URL(window.location);
44+
url.searchParams.delete('q');
45+
history.replaceState({}, null, url.toString());
46+
setTimeout(() => input.focus(), 100);
47+
}
48+
}).setContent('<iframe src="' + url + '"></iframe>').open();
49+
}
50+
</script>

docs-templates/config.mako

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<%!
2+
# Template configuration. Copy over in your template directory
3+
# (used with `--template-dir`) and adapt as necessary.
4+
# Note, defaults are loaded from this distribution file, so your
5+
# config.mako only needs to contain values you want overridden.
6+
# You can also run pdoc with `--config KEY=VALUE` to override
7+
# individual values.
8+
9+
html_lang = 'en'
10+
show_inherited_members = False
11+
extract_module_toc_into_sidebar = True
12+
list_class_variables_in_index = True
13+
sort_identifiers = True
14+
show_type_annotations = True
15+
16+
# Show collapsed source code block next to each item.
17+
# Disabling this can improve rendering speed of large modules.
18+
show_source_code = True
19+
20+
# If set, format links to objects in online source code repository
21+
# according to this template. Supported keywords for interpolation
22+
# are: commit, path, start_line, end_line.
23+
#git_link_template = 'https://github.com/USER/PROJECT/blob/{commit}/{path}#L{start_line}-L{end_line}'
24+
#git_link_template = 'https://gitlab.com/USER/PROJECT/blob/{commit}/{path}#L{start_line}-L{end_line}'
25+
#git_link_template = 'https://bitbucket.org/USER/PROJECT/src/{commit}/{path}#lines-{start_line}:{end_line}'
26+
#git_link_template = 'https://CGIT_HOSTNAME/PROJECT/tree/{path}?id={commit}#n{start-line}'
27+
git_link_template = None
28+
29+
# A prefix to use for every HTML hyperlink in the generated documentation.
30+
# No prefix results in all links being relative.
31+
link_prefix = ''
32+
33+
# Enable syntax highlighting for code/source blocks by including Highlight.js
34+
syntax_highlighting = True
35+
36+
# Set the style keyword such as 'atom-one-light' or 'github-gist'
37+
# Options: https://github.com/highlightjs/highlight.js/tree/master/src/styles
38+
# Demo: https://highlightjs.org/static/demo/
39+
hljs_style = 'github'
40+
41+
# If set, insert Google Analytics tracking code. Value is GA
42+
# tracking id (UA-XXXXXX-Y).
43+
google_analytics = ''
44+
45+
# If set, insert Google Custom Search search bar widget above the sidebar index.
46+
# The whitespace-separated tokens represent arbitrary extra queries (at least one
47+
# must match) passed to regular Google search. Example:
48+
#google_search_query = 'inurl:github.com/USER/PROJECT site:PROJECT.github.io site:PROJECT.website'
49+
google_search_query = ''
50+
51+
# Enable offline search using Lunr.js. For explanation of 'fuzziness' parameter, which is
52+
# added to every query word, see: https://lunrjs.com/guides/searching.html#fuzzy-matches
53+
# If 'index_docstrings' is False, a shorter index is built, indexing only
54+
# the full object reference names.
55+
#lunr_search = {'fuzziness': 1, 'index_docstrings': True}
56+
lunr_search = None
57+
58+
# If set, render LaTeX math syntax within \(...\) (inline equations),
59+
# or within \[...\] or $$...$$ or `.. math::` (block equations)
60+
# as nicely-formatted math formulas using MathJax.
61+
# Note: in Python docstrings, either all backslashes need to be escaped (\\)
62+
# or you need to use raw r-strings.
63+
latex_math = False
64+
%>

docs-templates/credits.mako

Whitespace-only changes.

0 commit comments

Comments
 (0)