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

docs: add the base for the documentation #24

Merged
merged 2 commits into from
Aug 28, 2023
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### Composer ###
composer.phar
/vendor/

### Sphinx ###
build
.DS_Store
source/.DS_Store
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -W
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@awk -F ':.*?## ' '/^[a-zA-Z]/ && NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort

.PHONY: help Makefile upgrade requirements

# Define PIP_COMPILE_OPTS=-v to get more information during make upgrade.
PIP_COMPILE = pip-compile --upgrade $(PIP_COMPILE_OPTS)

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -r requirements/pip-tools.txt
# Make sure to compile files after any other files they include!
$(PIP_COMPILE) --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
$(PIP_COMPILE) -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -r requirements/pip-tools.txt
$(PIP_COMPILE) -o requirements/docs.txt requirements/docs.in

requirements:
pip install -r requirements/pip-tools.txt
pip-sync requirements/docs.txt

serve_docs: ## serve the built docs locally to preview the site in the browser
sphinx-autobuild docs $(BUILDDIR)/html

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

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

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
109 changes: 109 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# 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 -----------------------------------------------------
from datetime import datetime

project = 'Open edX Filters'
current_year = datetime.utcnow().year
copyright = f"{current_year}, Open edX Community"
author = 'Open edX Community'

# The full version, including alpha/beta/rc tags
release = 'latest'


# -- 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 = [
'sphinxcontrib.contentui',
'sphinx_copybutton',
'sphinx.ext.graphviz',
'sphinxcontrib.mermaid',
]

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

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'

# 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 = ['_build', 'Thumbs.db', '.DS_Store']


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

html_theme_options = {

"repository_url": "https://github.com/eduNEXT/openedx-woocommerce-plugin",
"repository_branch": "main",
"path_to_docs": "docs/source",
"use_repository_button": True,
"use_issues_button": True,
"use_edit_page_button": True,
"extra_footer": """
<a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">
<img
alt="Creative Commons License"
style="border-width:0"
src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png">
</a>
<br>
These works by
<a
xmlns:cc="https://creativecommons.org/ns#"
href="https://openedx.org"
property="cc:attributionName"
rel="cc:attributionURL"
>The Center for Reimagining Learning</a>
are licensed under a
<a
rel="license"
href="https://creativecommons.org/licenses/by-sa/4.0/"
>Creative Commons Attribution-ShareAlike 4.0 International License</a>.
"""
}

# Note the logo won't show up properly yet because there is an upstream
# bug in the theme that needs to be fixed first.
# If you'd like you can temporarily copy the logo file to your `_static`
# directory.
html_logo = "https://logos.openedx.org/open-edx-logo-color.png"
html_favicon = "https://logos.openedx.org/open-edx-favicon.ico"

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


# -- Extension configuration -------------------------------------------------
2 changes: 2 additions & 0 deletions docs/source/decisions/0001-purpose-of-this-repo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. Purpose of this Repo
=======================
8 changes: 8 additions & 0 deletions docs/source/decisions/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Decisions
==========

.. toctree::
:maxdepth: 1
:caption: Contents:

0001-purpose-of-this-repo
2 changes: 2 additions & 0 deletions docs/source/how-tos/create_enrollment_requests_manually.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Create enrollment requests manually
====================================
8 changes: 8 additions & 0 deletions docs/source/how-tos/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
How-tos
========

.. toctree::
:maxdepth: 1
:caption: Contents:

create_enrollment_requests_manually
52 changes: 52 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. Open edX WooCommerce Plugin documentation master file, created by
sphinx-quickstart on Tue Aug 22 21:21:50 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Open edX WooCommerce Plugin
============================

The Open edX WooCommerce Plugin is a free, open-source WordPress plugin that aims to integrate third-party e-commerce, WooCommerce, with your Open edX platform.


User Guide
-----------

.. toctree::

quickstart
decisions/index
how-tos/index


Releases
---------

The Releases are listed on the `Github release page <https://github.com/eduNEXT/openedx-woocommerce-plugin/releases>`_. And all notable changes to this project are documented in the `CHANGELOG <https://github.com/eduNEXT/openedx-woocommerce-plugin/blob/main/CHANGELOG.md>`_ file.

Source code
-----------

The complete source code for Open edX WooCommerce Plugin is available on Github: https://github.com/eduNEXT/openedx-woocommerce-plugin

Support
--------

To report a bug or request a feature, visit `issues <https://github.com/eduNEXT/openedx-woocommerce-plugin/issues>`_.

Contributing
-------------

Contributions are very welcome. Please read `How To Contribute <https://openedx.atlassian.net/wiki/spaces/COMM/pages/941457737/How+to+Start+Contributing+Code>`_ for details.

This project accepts all contributions, bug fixes, security fixes, maintenance work, or new features. However, please discuss your new feature idea with the maintainers before beginning development to maximize the chances of accepting your change. You can start a conversation by creating a new issue on this repo summarizing your idea.

License
--------

The code in this repository is licensed under version 2 of the GNU General Public License. Please see the `LICENSE <https://github.com/eduNEXT/openedx-woocommerce-plugin/blob/main/LICENSE.txt>`_ file for details.

Other
------

* :ref:`search`
2 changes: 2 additions & 0 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Quickstart
###########
12 changes: 12 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Version constraints for pip-installation.
#
# This file doesn't install any packages. It specifies version constraints
# that will be applied if a package is needed.
#
# When pinning something here, please provide an explanation of why. Ideally,
# link to other information that will help people in the future to remove the
# pin when possible. Writing an issue against the offending project and
# linking to it here is good.

# Common constraints for edx repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
9 changes: 9 additions & 0 deletions requirements/docs.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Core requirements for using this application
-c constraints.txt

sphinx
sphinx-book-theme
sphinx-autobuild
sphinx-copybutton
sphinxcontrib-mermaid
sphinxcontrib-contentui
Loading