Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
23 changes: 23 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Makefile for Sphinx documentation

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -m sphinx
SOURCEDIR = source
BUILDDIR = build

.PHONY: help clean html

help:
@echo "Please use 'make <target>' where <target> is one of"
@echo " clean to clear all built documentation files"
@echo " html to make all standalone HTML files"

clean:
-rm -rf $(BUILDDIR)/*

html: clean
sphinx-multiversion $(SOURCEDIR) $(BUILDDIR)/html
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
39 changes: 39 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. clean to clear all built documentation files
echo. html to make all standalone HTML files

goto end
)

if "%1" == "clean" (
rmdir %BUILDDIR% /s /q
goto end
)

if "%1" == "html" (
sphinx-multiversion %SOURCEDIR% %BUILDDIR%\html
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)

:end
1 change: 1 addition & 0 deletions docs/source/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_autosummary/
96 changes: 96 additions & 0 deletions docs/source/_static/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
Logo
====
*/

.logo {
max-height: 200px;
}

/*
Header
======
*/

#navbar-main {
background-color: #F1F1F1!important;
border-bottom: 3px solid #16255F;
height: 70px;
}

.navbar-brand {
padding: 0.25rem;
}


/*
Body
====
*/

body {
background-color: #FAFAFA!important;
color: #353D46!important;
}


/*
Left side bar
=============
*/

.form-control {
background-color: #FAFAFA!important;
}

[type=search] {
background-color: #FAFAFA;
}


/*
Headings
========
*/

h1,
h2,
h3,
h4,
h5,
h6 {
color: #062161!important;
}

/*
Releases dropdown
========
*/

li.dropdown {
margin-right: auto;
}

.dropdown {
list-style: none;
}

.dropdown > a:hover {
COLOR: #00194f;
TEXT-DECORATION: none;
font-weight: none;
}

div.rst-versions {
overflow: hidden!important;
}

.deprecated-warning {
font-family: sans-serif;
font-weight:bold;
text-align: center;
background-color: pink;
color: firebrick;
right:0em;
z-index:1000000000000;
}
Binary file added docs/source/_static/img/favicon.ico
Binary file not shown.
Binary file added docs/source/_static/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_static/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions docs/source/_templates/docs-navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<div class="container-xl">


{% if logo %}
{% if not theme_logo_link %}
<a class="navbar-brand" href="{{ pathto(master_doc) }}">
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="logo">
</a>
{% elif theme_logo_link[:4] == 'http' %}
<a class="navbar-brand" href="{{ theme_logo_link }}">
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="logo">
</a>
{% else %}
<a class="navbar-brand" href="{{ pathto(theme_logo_link) }}">
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="logo">
</a>
{% endif %}
{% else %}
<a class="navbar-brand" href="{{ pathto(master_doc) }}">
<p class="title">{{ project }}</p>
</a>
{% endif %}
<li class="nav-item dropdown show">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Versions
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown" id="version-menu">
{% for release in releases %}
<a class="dropdown-item" href="{{ release[1] }}">{{ release[0] }}</a>
{% endfor %}
</div>
</li>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-menu" aria-controls="navbar-menu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

{% set navbar_class, navbar_align = navbar_align_class() %}
<div id="navbar-menu" class="{{ navbar_class }} collapse navbar-collapse">
<ul id="navbar-main-elements" class="navbar-nav {{ navbar_align }}">
{{ generate_nav_html("navbar", maxdepth=1, collapse=True, includehidden=True, titles_only=True) }}
{% for external_link in theme_external_links %}
<li class="nav-item">
<a class="nav-link nav-external" href="{{ external_link.url }}">{{ external_link.name }}<i class="fas fa-external-link-alt"></i></a>
</li>
{% endfor %}
</ul>

{% if theme_search_bar_position == 'navbar' %}
{%- include "search-field.html" %}
{% endif %}

{%- block icon_links -%}
{%- include "icon-links.html" with context -%}
{%- endblock %}
</div>
</div>
92 changes: 92 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# 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 json
import sys
sys.path.insert(0, os.path.abspath('../..'))


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

project = 'mapshader'
copyright = '2021, makepath'
author = 'makepath'


# -- 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 = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx_multiversion',
]

# 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 = []


# -- 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 = 'pydata_sphinx_theme'

html_logo = '_static/img/logo.svg'

html_favicon = '_static/img/favicon.ico'

# sphinx-multiversion config
smv_branch_whitelist = 'master'

smv_tag_whitelist = r'^v([0-9]\.[1]\.[3-9]|[1-9]\.[0-9]\.[0-9])'

# Load releases
with open('releases.json') as f:
releases = json.load(f)

# 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
# documentation.
#
html_theme_options = {
'external_links': [],
'github_url': 'https://github.com/makepath/mapshader',
}

html_context = {
'css_files': ['_static/css/styles.css'],
'releases': [(release, url) for release, url in releases.items()],
}

autosummary_generate = True

exclude_patterns = ['_build', '_templates']

# 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']

# autodoc config
autodoc_mock_imports = ['mapshader.colors']
11 changes: 11 additions & 0 deletions docs/source/getting_started/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _getting_started:

***************
Getting started
***************

.. toctree::
:maxdepth: 2

installation
usage
22 changes: 22 additions & 0 deletions docs/source/getting_started/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. _getting_started.installation:

************
Installation
************

.. code-block:: bash

# via pip
pip install mapshader


Setup Mapshader Conda Environment
=================================

.. code-block:: bash

conda create -n mapshader python=3.8
conda activate mapshader
git clone git@github.com:makepath/mapshader.git
cd mapshader
pip install -e .
Loading