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

Initial documentation site/skeleton #7

Merged
merged 4 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,5 @@ venv.bak/
# Visual Studio Code
.vscode/

html/
usort/version.py
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ venv:
source .venv/bin/activate && make setup
@echo 'run `source .venv/bin/activate` to use virtualenv'

.PHONY: clean
clean:
rm -rf dist html

# The rest of these are intended to be run within the venv, where python points
# to whatever was used to set up the venv.

Expand All @@ -15,6 +19,9 @@ setup:
python -m pip install -Ur requirements-dev.txt
python -m pip install -Ur requirements.txt

html: usort/*.py docs/* docs/*/* *.md
amyreese marked this conversation as resolved.
Show resolved Hide resolved
sphinx-build -b html docs html

.PHONY: test
test:
python -m coverage run -m usort.tests $(TESTOPTS)
Expand Down
20 changes: 20 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
div.facebook {
margin-top: 24px;
}

div.facebook-badges {
margin-top: 12px;
margin-bottom: 10px;
}

div.facebook-badges a {
color: #bbb;
text-decoration: none;
font-size: 24px;
border: none;
}

div.facebook-badges a:hover {
color: #777;
border: none;
}
Binary file added docs/_static/fbopensource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/_templates/badges.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="facebook-badges">
<a class="github-button" href="https://github.com/{{theme_github_user}}/{{theme_github_repo}}" data-size="large"
data-show-count="true" aria-label="Star {{ theme_github_user }}/{{ theme_github_repo }} on GitHub">Star</a>
</div>

<script async defer src="https://buttons.github.io/buttons.js"></script>
18 changes: 18 additions & 0 deletions docs/_templates/facebook.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div class="facebook">
<span>
<a href="https://opensource.facebook.com"><img src="_static/fbopensource.png" alt="Facebook Open Source" /></a>
Empowering community through open source technology.
</span>
</div>
<div class="facebook-badges">
<a href="https://twitter.com/fbOpenSource" alt="Facebook Open Source on Twitter">
<i class="fab fa-twitter"></i>
</a>
&nbsp;
<a href="https://github.com/{{theme_github_user}}/{{theme_github_repo}}" alt="View site source">
<i class="far fa-code"></i>
</a>

</div>

<script src="https://kit.fontawesome.com/7b536acf49.js" crossorigin="anonymous"></script>
4 changes: 4 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Changelog
=========

.. mdinclude:: ../CHANGELOG.md
5 changes: 5 additions & 0 deletions docs/code-of-conduct.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Code of Conduct
===============

.. mdinclude:: ../CODE_OF_CONDUCT.md
:start-line: 2
91 changes: 91 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

import datetime

project = "µsort"
copyright = f"{datetime.date.today().year}, Facebook Inc."
author = "Tim Hatch"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"m2r",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

autodoc_default_options = {
"show-inheritance": True,
"members": True,
"undoc-members": True,
}
autodoc_member_order = "groupwise"

highlight_language = "python3"
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
master_doc = "index"

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "alabaster"
html_theme_options = {
"description": "Safe Python import sorting",
"fixed_sidebar": True,
"badge_branch": "master",
"github_button": False,
"github_user": "facebookexperimental",
"github_repo": "usort",
"show_powered_by": False,
"sidebar_collapse": False,
"extra_nav_links": {
"Report Issues": "https://github.com/facebookexperimental/usort/issues",
},
}

html_sidebars = {
"**": [
"about.html",
"badges.html",
"navigation.html",
"relations.html",
"searchbox.html",
"facebook.html",
],
}

# 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"]
5 changes: 5 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Contributing
============

.. mdinclude:: ../CONTRIBUTING.md
:start-line: 1
10 changes: 10 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. mdinclude:: ../README.md


.. toctree::
:hidden:
:maxdepth: 1

changelog
contributing
code-of-conduct
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ coverage==4.5.4
flake8==3.7.9
isort==4.3.21
mypy==0.750
sphinx==3.0.3
tox==3.14.1
twine==3.1.1
volatile==2.1.0
wheel==0.33.6
git+https://github.com/miyakogi/m2r
amyreese marked this conversation as resolved.
Show resolved Hide resolved