Skip to content

Commit

Permalink
Add pronto.warnings module to API reference section of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Oct 22, 2019
1 parent 5ae0f4e commit 886f7c6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
18 changes: 17 additions & 1 deletion docs/source/_static/js/apitoc.js
@@ -1,6 +1,6 @@
$(document).ready(function() {
(function ($) {
if (window.location.href.match("/api/*") !== null) {
if (window.location.href.match("/api/pronto.*") !== null) {
$(".nav-list")
.children()
.filter("li")
Expand All @@ -18,6 +18,22 @@ $(document).ready(function() {
);
$("#apitoc").append(html);
});
} else if (window.location.href.match("/api/warnings*") !== null) {
$(".nav-list")
.children()
.filter("li")
.append("<ul id='apitoc' class='nav nav-list'></ul>");
$( "dt" )
.each(function( index ) {
var html = (
"<li><a href='#"
+ $( this ).attr("id")
+ "'><code>"
+ $( this ).find(".sig-name").text()
+ "</code></a></li>"
);
$("#apitoc").append(html);
});
}
})(window.$jqTheme || window.jQuery);
})
17 changes: 17 additions & 0 deletions docs/source/api.rst
Expand Up @@ -78,3 +78,20 @@ exception of custom parser implementations.
pronto.RelationshipData
pronto.SynonymData
pronto.TermData


Warnings
--------

.. toctree::
:hidden:

warnings <api/warnings>

.. autosummary::
:nosignatures:

pronto.warnings.ProntoWarning
pronto.warnings.NotImplementedWarning
pronto.warnings.SyntaxWarning
pronto.warnings.UnstableWarning
12 changes: 12 additions & 0 deletions docs/source/api/warnings.rst
@@ -0,0 +1,12 @@
Warnings
========

.. currentmodule:: pronto.warnings

.. autoexception:: ProntoWarning

.. autoexception:: NotImplementedWarning

.. autoexception:: SyntaxWarning

.. autoexception:: UnstableWarning
3 changes: 0 additions & 3 deletions docs/source/conf.py
Expand Up @@ -28,9 +28,6 @@
# -- Sphinx Setup ------------------------------------------------------------

def setup(app):
# Force regenerating autosummary
if os.path.exists(os.path.join(docssrc_dir, "api")):
shutil.rmtree(os.path.join(docssrc_dir, "api"))
# Add custom stylesheet
app.add_css_file("css/main.css")
app.add_js_file("js/apitoc.js")
Expand Down

0 comments on commit 886f7c6

Please sign in to comment.