Skip to content

Commit 6d2a9c2

Browse files
authored
Merge pull request #101 from arokem/new_docs
Overhaul documentation
2 parents 7f36ef7 + e0f89d8 commit 6d2a9c2

20 files changed

+460
-971
lines changed

.github/workflows/docbuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242
with:
4343
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
4444
BRANCH: gh-pages # The branch the action should deploy to.
45-
FOLDER: docs/_build/html # The folder the action should deploy.
45+
FOLDER: docs/_build/html # The folder the action should deploy.

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
max-parallel: 4
1111
matrix:
12-
python-version: [3.6, 3.7]
12+
python-version: [3.7, 3.8]
1313

1414
steps:
1515
- uses: actions/checkout@v1

docs/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ clean:
5151
-rm -rf auto_examples/
5252
-rm -rf generated/*
5353
-rm -rf modules/generated/*
54-
-rm -rf reference/*
5554

5655
html:
5756
# These two lines make the build a bit more lengthy, and the
@@ -93,17 +92,17 @@ qthelp:
9392
@echo
9493
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
9594
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
96-
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/project-template.qhcp"
95+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/fracridge.qhcp"
9796
@echo "To view the help file:"
98-
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/project-template.qhc"
97+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/fracridge.qhc"
9998

10099
devhelp:
101100
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
102101
@echo
103102
@echo "Build finished."
104103
@echo "To view the help file:"
105-
@echo "# mkdir -p $$HOME/.local/share/devhelp/project-template"
106-
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/project-template"
104+
@echo "# mkdir -p $$HOME/.local/share/devhelp/fracridge"
105+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/fracridge"
107106
@echo "# devhelp"
108107

109108
epub:

docs/_static/css/project-template.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@import url("theme.css");
2+
3+
.highlight a {
4+
text-decoration: underline;
5+
}
6+
7+
.deprecated p {
8+
padding: 10px 7px 10px 10px;
9+
color: #b94a48;
10+
background-color: #F3E5E5;
11+
border: 1px solid #eed3d7;
12+
}
13+
14+
.deprecated p span.versionmodified {
15+
font-weight: bold;
16+
}

docs/_static/js/copybutton.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
$(document).ready(function() {
2+
/* Add a [>>>] button on the top-right corner of code samples to hide
3+
* the >>> and ... prompts and the output and thus make the code
4+
* copyable. */
5+
var div = $('.highlight-python .highlight,' +
6+
'.highlight-python3 .highlight,' +
7+
'.highlight-pycon .highlight,' +
8+
'.highlight-default .highlight')
9+
var pre = div.find('pre');
10+
11+
// get the styles from the current theme
12+
pre.parent().parent().css('position', 'relative');
13+
var hide_text = 'Hide the prompts and output';
14+
var show_text = 'Show the prompts and output';
15+
var border_width = pre.css('border-top-width');
16+
var border_style = pre.css('border-top-style');
17+
var border_color = pre.css('border-top-color');
18+
var button_styles = {
19+
'cursor':'pointer', 'position': 'absolute', 'top': '0', 'right': '0',
20+
'border-color': border_color, 'border-style': border_style,
21+
'border-width': border_width, 'color': border_color, 'text-size': '75%',
22+
'font-family': 'monospace', 'padding-left': '0.2em', 'padding-right': '0.2em',
23+
'border-radius': '0 3px 0 0'
24+
}
25+
26+
// create and add the button to all the code blocks that contain >>>
27+
div.each(function(index) {
28+
var jthis = $(this);
29+
if (jthis.find('.gp').length > 0) {
30+
var button = $('<span class="copybutton">&gt;&gt;&gt;</span>');
31+
button.css(button_styles)
32+
button.attr('title', hide_text);
33+
button.data('hidden', 'false');
34+
jthis.prepend(button);
35+
}
36+
// tracebacks (.gt) contain bare text elements that need to be
37+
// wrapped in a span to work with .nextUntil() (see later)
38+
jthis.find('pre:has(.gt)').contents().filter(function() {
39+
return ((this.nodeType == 3) && (this.data.trim().length > 0));
40+
}).wrap('<span>');
41+
});
42+
43+
// define the behavior of the button when it's clicked
44+
$('.copybutton').click(function(e){
45+
e.preventDefault();
46+
var button = $(this);
47+
if (button.data('hidden') === 'false') {
48+
// hide the code output
49+
button.parent().find('.go, .gp, .gt').hide();
50+
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden');
51+
button.css('text-decoration', 'line-through');
52+
button.attr('title', show_text);
53+
button.data('hidden', 'true');
54+
} else {
55+
// show the code output
56+
button.parent().find('.go, .gp, .gt').show();
57+
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible');
58+
button.css('text-decoration', 'none');
59+
button.attr('title', hide_text);
60+
button.data('hidden', 'false');
61+
}
62+
});
63+
});

docs/_templates/class.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
:mod:`{{module}}`.{{objname}}
2+
{{ underline }}==============
3+
4+
.. currentmodule:: {{ module }}
5+
6+
.. autoclass:: {{ objname }}
7+
8+
{% block methods %}
9+
.. automethod:: __init__
10+
{% endblock %}
11+
12+
.. include:: {{module}}.{{objname}}.examples
13+
14+
.. raw:: html
15+
16+
<div style='clear:both'></div>

docs/_templates/function.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:mod:`{{module}}`.{{objname}}
2+
{{ underline }}====================
3+
4+
.. currentmodule:: {{ module }}
5+
6+
.. autofunction:: {{ objname }}
7+
8+
.. include:: {{module}}.{{objname}}.examples
9+
10+
.. raw:: html
11+
12+
<div style='clear:both'></div>

docs/_templates/numpydoc_docstring.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{index}}
2+
{{summary}}
3+
{{extended_summary}}
4+
{{parameters}}
5+
{{returns}}
6+
{{yields}}
7+
{{other_parameters}}
8+
{{attributes}}
9+
{{raises}}
10+
{{warns}}
11+
{{warnings}}
12+
{{see_also}}
13+
{{notes}}
14+
{{references}}
15+
{{examples}}
16+
{{methods}}

docs/api.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
API Documentation
2-
=================
1+
####################
2+
``forestci`` API
3+
####################
34

4-
* :doc:`forestci`
5+
6+
.. autosummary::
7+
:toctree: generated/
8+
:template: function.rst
9+
10+
forestci.random_forest_error

0 commit comments

Comments
 (0)