Skip to content

Commit

Permalink
apply changes
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdittrich92 committed Mar 16, 2022
1 parent 2e20827 commit 31a8b25
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,25 @@
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']

# Add googleanalytics id
# ref: https://github.com/sphinx-contrib/googleanalytics/blob/master/sphinxcontrib/googleanalytics.py
def add_ga_javascript(app, pagename, templatename, context, doctree):

metatags = context.get('metatags', '')
metatags += """<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '%s']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>""" % 'G-40DVRMX8T4'
context['metatags'] = metatags


def setup(app):
app.add_css_file('css/mindee.css')
app.add_js_file('js/custom.js')
app.connect('html-page-context', add_ga_javascript)
3 changes: 2 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
********************************
docTR: Document Text Recognition
================================
********************************

State-of-the-art Optical Character Recognition made seamless & accessible to anyone, powered by TensorFlow 2 & PyTorch

Expand Down

0 comments on commit 31a8b25

Please sign in to comment.