Skip to content

Commit

Permalink
Merge pull request #695 from PrimozGodec/change-doc-theme
Browse files Browse the repository at this point in the history
Change documentation theme to sphinx_rtd_theme
  • Loading branch information
ajdapretnar committed Sep 13, 2021
2 parents 947c352 + 043f363 commit b70b6d2
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 49 deletions.
13 changes: 13 additions & 0 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* This CSS snippet makes that the navbar collapse on medium screen already */
@media screen and (max-width: 950px){
.wy-nav-top{display:block}
.wy-nav-side{left:-300px}
.wy-nav-side.shift{width:85%;left:0}
.wy-side-scroll{width:auto}
.wy-side-nav-search{width:auto}
.wy-menu.wy-menu-vertical{width:auto}
.wy-nav-content-wrap{margin-left:0}
.wy-nav-content-wrap
.wy-nav-content{padding:1.618em}
.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}
}
37 changes: 0 additions & 37 deletions doc/_static/style.css

This file was deleted.

6 changes: 4 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -136,7 +136,9 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
html_static_path = ['_static']

html_css_files = ['custom.css']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Widgets
widgets/statistics
widgets/corpustonetwork
widgets/keywords
widgets/score-documents

Scripting
---------
Expand Down
2 changes: 1 addition & 1 deletion doc/scripting/wikipedia.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Wikipedia
=========

.. autoclass:: orangecontrib.text.wikipedia.WikipediaAPI
.. autoclass:: orangecontrib.text.wikipedia_api.WikipediaAPI
:members:
:special-members: __init__
16 changes: 10 additions & 6 deletions orangecontrib/text/widgets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Category metadata.
import sysconfig

# Category icon show in the menu
ICON = "icons/category.svg"
Expand All @@ -8,18 +9,21 @@
BACKGROUND = "light-blue"



# Location of widget help files.
WIDGET_HELP_PATH = (
# Used for development.
# You still need to build help pages using
# make htmlhelp
# inside doc folder
("{DEVELOP_ROOT}/doc/_build/htmlhelp/index.html", None),
# `make html` inside doc folder
("{DEVELOP_ROOT}/doc/_build/html/index.html", None),

# Documentation included in wheel
# Correct DATA_FILES entry is needed in setup.py and documentation has to be built
# before the wheel is created.
("{}/help/orange3-text/index.html".format(sysconfig.get_path("data")), None),

# Online documentation url, used when the local documentation is available.
# Url should point to a page with a section Widgets. This section should
# includes links to documentation pages of each widget. Matching is
# performed by comparing link caption to widget name.
("https://orange3-text.readthedocs.io/en/latest/", "")
)
("https://orange3-text.readthedocs.io/en/latest/", ""),
)
26 changes: 23 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,25 @@ def temp_test_suite():
return TestSuite([])


if __name__ == '__main__':
DATA_FILES = []


def include_documentation(local_dir, install_dir):
global DATA_FILES

doc_files = []
for dirpath, _, files in os.walk(local_dir):
doc_files.append(
(
dirpath.replace(local_dir, install_dir),
[os.path.join(dirpath, f) for f in files],
)
)
DATA_FILES.extend(doc_files)


if __name__ == "__main__":
include_documentation("doc/_build/html", "help/orange3-text")
write_version_py()
setup(
name=NAME,
Expand All @@ -163,12 +181,14 @@ def temp_test_suite():
packages=find_packages(),
include_package_data=True,
install_requires=INSTALL_REQUIRES,
data_files=DATA_FILES,
entry_points=ENTRY_POINTS,
keywords=KEYWORDS,
namespace_packages=['orangecontrib'],
zip_safe=False,
test_suite="setup.temp_test_suite",
extras_require={
'test': ['coverage']
},
'test': ['coverage'],
'doc': ['sphinx', 'recommonmark', 'sphinx_rtd_theme'],
},
)

0 comments on commit b70b6d2

Please sign in to comment.