Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new API-reference page, automated generation of .rst files, enable sphinx-gallery. Fix #1808 #1809

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c46cddf
Reformat apiref.rst
anotherbugmaster Dec 20, 2017
b7e882c
Walkaround reference bug
anotherbugmaster Dec 20, 2017
0092c16
Merge upstream
anotherbugmaster Dec 20, 2017
3ff14b8
Merge upstream
anotherbugmaster Jan 8, 2018
1d9c13f
Workaround link bug
anotherbugmaster Jan 8, 2018
fe6b60e
Add 'The'
anotherbugmaster Jan 8, 2018
0b9a135
Rearrange modules
anotherbugmaster Jan 9, 2018
af1551b
Merge upstream
anotherbugmaster Jan 22, 2018
8fa1691
Remove redundant "This package..."
anotherbugmaster Jan 23, 2018
74dcb42
Move docs/src/* -> docs/*
anotherbugmaster Feb 6, 2018
4695125
Add legacy apiref
anotherbugmaster Feb 19, 2018
4e5d176
Merge remote-tracking branch 'upstream/develop' into fix_1808
anotherbugmaster Feb 19, 2018
15e418d
Fix fasttext references
anotherbugmaster Feb 19, 2018
6c29149
Merge remote-tracking branch 'upstream/develop' into fix_1808
anotherbugmaster Feb 19, 2018
9dfcb68
Restore static files
anotherbugmaster Feb 19, 2018
6e9d372
Add js
anotherbugmaster Feb 19, 2018
9d7c3a8
Restore .html
anotherbugmaster Feb 19, 2018
695b452
Make an exception for _static/js in .gitignore
anotherbugmaster Feb 19, 2018
c9dcfac
Document certain special members
anotherbugmaster Feb 19, 2018
15c2ef7
Add downloader's userguide
anotherbugmaster Feb 19, 2018
034137b
Fix circleci config
anotherbugmaster Feb 19, 2018
2b07283
Fix gensim_theme static
anotherbugmaster Feb 20, 2018
3e7519d
Fix some issues
anotherbugmaster Feb 23, 2018
003d038
Merge upstream
anotherbugmaster Feb 23, 2018
7b15419
Fix some more issues
anotherbugmaster Feb 23, 2018
97c8ba3
Make link to legacy version of apiref
anotherbugmaster Feb 23, 2018
6a29c91
Fix cyclic import
anotherbugmaster Feb 23, 2018
58a46ae
They're back!
anotherbugmaster Feb 23, 2018
3b3fbb8
Merge upstream
anotherbugmaster Feb 23, 2018
63d296c
C Matutils
anotherbugmaster Feb 24, 2018
7b4e100
Fix circleci path
anotherbugmaster Feb 24, 2018
52c39e9
Remove redundant examples
anotherbugmaster Feb 24, 2018
357a468
Convert tabs to spaces
anotherbugmaster Feb 24, 2018
b100d86
Change line endings
anotherbugmaster Feb 24, 2018
dec5338
Merge remote-tracking branch 'upstream/develop' into fix_1808
anotherbugmaster Feb 24, 2018
57c5dd3
Revert "Change line endings"
anotherbugmaster Feb 24, 2018
be0917e
Fix line endings (probably)
anotherbugmaster Feb 24, 2018
541378e
Fix
anotherbugmaster Feb 24, 2018
b16c392
Fix awkward docstring
anotherbugmaster Feb 24, 2018
7313d2a
Fix references
anotherbugmaster Feb 24, 2018
a08fac9
Fix redundant copying of .html
anotherbugmaster Feb 25, 2018
c610958
Fix flake8
anotherbugmaster Feb 25, 2018
f1f37d8
Merge remote-tracking branch 'upstream/develop' into fix_1808
anotherbugmaster Feb 25, 2018
7313808
Add arrows and unify Workers and Dispatchers
anotherbugmaster Feb 27, 2018
18b8b15
Add example example :)
anotherbugmaster Feb 27, 2018
f058879
Add soft cosine similarity
anotherbugmaster Feb 27, 2018
05e9979
Fix models docstring
anotherbugmaster Feb 27, 2018
2a98a19
Fix backticks bug
anotherbugmaster Mar 2, 2018
4763459
Add C Matutils
anotherbugmaster Mar 2, 2018
7369597
Refine scripts reference|
anotherbugmaster Mar 2, 2018
7a781b2
Merge branch 'develop' into fix_1808
menshikh-iv Mar 15, 2018
0c63dbb
Merge
anotherbugmaster Jun 27, 2018
beccb35
Merge
anotherbugmaster Jun 27, 2018
aff50e9
Remove redundant rsts
anotherbugmaster Jun 27, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ Thumbs.db
.eggs
cython_debug
docs/src/_build/
docs/_static
docs/src/generated/
docs/src/modules/generated/
docs/src/auto_examples/
docs/notebooks/.ipynb_checkpoints
dedan_gensim.tmproj
gensim*.egg-info
Expand All @@ -70,7 +72,10 @@ data
*.model
*~
*_out.txt
*.html
docs/src/*.html
docs/src/modules/*.html
*.inv
*.js
docs/_images/
!docs/src/_static/js/*.js
!docs/src/gensim_theme/static/*.js
docs/src/_images/
12 changes: 12 additions & 0 deletions docs/examples/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _examples-index:

Gallery of Examples
===================


.. _general_examples:

General examples
----------------

General-purpose and introductory examples from the gensim
36 changes: 36 additions & 0 deletions docs/examples/plot_downloader_api_tutorial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
"""
EXAMPLE EXAMPLE
===============

TO BE REPLACED WITH A REAL EXAMPLE
"""

###########################################################################
# Here's our imports:

import numpy as np
import matplotlib.pyplot as plt

###########################################################################
# Here's the first graph:

x = np.linspace(-1, 2, 100)
y = np.exp(x)

plt.figure()
plt.plot(x, y)
plt.xlabel('$x$')
plt.ylabel('$\exp(x)$')

plt.show()

###########################################################################
# And here's the second one:

plt.figure()
plt.plot(x, -np.exp(-x))
plt.xlabel('$x$')
plt.ylabel('$-\exp(-x)$')

plt.show()
17 changes: 9 additions & 8 deletions docs/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ help:

clean:
-rm -rf $(BUILDDIR)/*
-rm -rf generated/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How related $(BUILDDIR) and generated/ ?

Copy link
Contributor Author

@anotherbugmaster anotherbugmaster Dec 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In no way!

generated is the folder which contains new auto-generated .rst files. It ought to be purged every time documentation builds, otherwise autosummary will not update reference page.

-rm -rf modules/generated/
-rm -rf auto_examples/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
rm -r $(BUILDDIR)/html/_sources
cp -r $(BUILDDIR)/html/* ../
@echo
@echo "Build finished. The HTML pages are in ../"
@echo "Build finished. The HTML pages are in /docs/src/_build/html"

upload:
scp -r _build/html/* rr:public_html/gensim/
Expand All @@ -62,13 +63,13 @@ htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/gensim.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/gensim.qhc"
Expand All @@ -78,7 +79,7 @@ latex:
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
"run these through (pdf)latex."
"run these through (pdf)latex."
cd $(BUILDDIR)/latex && make all-pdf
cp $(BUILDDIR)/latex/gensim.pdf ../gensim_manual.pdf

Expand All @@ -91,9 +92,9 @@ linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
"results in $(BUILDDIR)/doctest/output.txt."
9 changes: 0 additions & 9 deletions docs/src/_matutils.rst

This file was deleted.

13 changes: 13 additions & 0 deletions docs/src/_templates/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
:mod:`{{module}}`.{{objname}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a link in answer, how to "form" this templates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

{{ underline }}==============

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:special-members:
:exclude-members: __init__

.. raw:: html

<div class="clearer"></div>
10 changes: 10 additions & 0 deletions docs/src/_templates/function.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
:mod:`{{module}}`.{{objname}}
{{ underline }}====================

.. currentmodule:: {{ module }}

.. autofunction:: {{ objname }}

.. raw:: html

<div class="clearer"></div>
11 changes: 11 additions & 0 deletions docs/src/_templates/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:mod:`{{module}}`.{{objname}}
{{ underline }}==============

.. currentmodule:: {{ module }}

.. automodule:: {{module}}.{{objname}}
:members:

.. raw:: html

<div class="clearer"></div>
Loading