From dc2eb64b44208ca8f42f3031c0ca9d558dd9890d Mon Sep 17 00:00:00 2001 From: Maria Fernanda Magallanes Zubillaga Date: Tue, 22 Aug 2023 21:45:09 -0400 Subject: [PATCH 1/2] docs: prepare the sphinx requirements for docs --- Makefile | 40 +++++++++++++++ requirements/constraints.txt | 12 +++++ requirements/docs.in | 9 ++++ requirements/docs.txt | 97 ++++++++++++++++++++++++++++++++++++ requirements/pip-tools.in | 4 ++ requirements/pip-tools.txt | 27 ++++++++++ requirements/pip.in | 5 ++ requirements/pip.txt | 14 ++++++ 8 files changed, 208 insertions(+) create mode 100644 Makefile create mode 100644 requirements/constraints.txt create mode 100644 requirements/docs.in create mode 100644 requirements/docs.txt create mode 100644 requirements/pip-tools.in create mode 100644 requirements/pip-tools.txt create mode 100644 requirements/pip.in create mode 100644 requirements/pip.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8fc92be --- /dev/null +++ b/Makefile @@ -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) diff --git a/requirements/constraints.txt b/requirements/constraints.txt new file mode 100644 index 0000000..d91704b --- /dev/null +++ b/requirements/constraints.txt @@ -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 diff --git a/requirements/docs.in b/requirements/docs.in new file mode 100644 index 0000000..c343d8e --- /dev/null +++ b/requirements/docs.in @@ -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 diff --git a/requirements/docs.txt b/requirements/docs.txt new file mode 100644 index 0000000..d098b2b --- /dev/null +++ b/requirements/docs.txt @@ -0,0 +1,97 @@ +# +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: +# +# make upgrade +# +accessible-pygments==0.0.4 + # via pydata-sphinx-theme +alabaster==0.7.13 + # via sphinx +babel==2.12.1 + # via + # pydata-sphinx-theme + # sphinx +beautifulsoup4==4.12.2 + # via pydata-sphinx-theme +certifi==2023.7.22 + # via requests +charset-normalizer==3.2.0 + # via requests +colorama==0.4.6 + # via sphinx-autobuild +docutils==0.19 + # via + # pydata-sphinx-theme + # sphinx +idna==3.4 + # via requests +imagesize==1.4.1 + # via sphinx +importlib-metadata==6.8.0 + # via sphinx +jinja2==3.1.2 + # via sphinx +livereload==2.6.3 + # via sphinx-autobuild +markupsafe==2.1.3 + # via jinja2 +packaging==23.1 + # via + # pydata-sphinx-theme + # sphinx +pydata-sphinx-theme==0.13.3 + # via sphinx-book-theme +pygments==2.16.1 + # via + # accessible-pygments + # pydata-sphinx-theme + # sphinx +pytz==2023.3 + # via babel +requests==2.31.0 + # via sphinx +six==1.16.0 + # via livereload +snowballstemmer==2.2.0 + # via sphinx +soupsieve==2.4.1 + # via beautifulsoup4 +sphinx==6.2.1 + # via + # -r requirements/docs.in + # pydata-sphinx-theme + # sphinx-autobuild + # sphinx-book-theme + # sphinx-copybutton + # sphinxcontrib-contentui +sphinx-autobuild==2021.3.14 + # via -r requirements/docs.in +sphinx-book-theme==1.0.1 + # via -r requirements/docs.in +sphinx-copybutton==0.5.2 + # via -r requirements/docs.in +sphinxcontrib-applehelp==1.0.4 + # via sphinx +sphinxcontrib-contentui==0.2.5 + # via -r requirements/docs.in +sphinxcontrib-devhelp==1.0.2 + # via sphinx +sphinxcontrib-htmlhelp==2.0.1 + # via sphinx +sphinxcontrib-jsmath==1.0.1 + # via sphinx +sphinxcontrib-mermaid==0.9.2 + # via -r requirements/docs.in +sphinxcontrib-qthelp==1.0.3 + # via sphinx +sphinxcontrib-serializinghtml==1.1.5 + # via sphinx +tornado==6.3.3 + # via livereload +typing-extensions==4.7.1 + # via pydata-sphinx-theme +urllib3==2.0.4 + # via requests +zipp==3.16.2 + # via importlib-metadata diff --git a/requirements/pip-tools.in b/requirements/pip-tools.in new file mode 100644 index 0000000..3f1b64a --- /dev/null +++ b/requirements/pip-tools.in @@ -0,0 +1,4 @@ +# Just the dependencies to run pip-tools, mainly for the "upgrade" make target +-c constraints.txt + +pip-tools # Contains pip-compile, used to generate pip requirements files diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt new file mode 100644 index 0000000..007ed38 --- /dev/null +++ b/requirements/pip-tools.txt @@ -0,0 +1,27 @@ +# +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: +# +# make upgrade +# +build==0.10.0 + # via pip-tools +click==8.1.7 + # via pip-tools +packaging==23.1 + # via build +pip-tools==7.3.0 + # via -r requirements/pip-tools.in +pyproject-hooks==1.0.0 + # via build +tomli==2.0.1 + # via + # build + # pip-tools + # pyproject-hooks +wheel==0.41.2 + # via pip-tools + +# The following packages are considered to be unsafe in a requirements file: +# pip +# setuptools diff --git a/requirements/pip.in b/requirements/pip.in new file mode 100644 index 0000000..21ce8e9 --- /dev/null +++ b/requirements/pip.in @@ -0,0 +1,5 @@ +# Core dependencies for installing other packages + +pip +setuptools +wheel diff --git a/requirements/pip.txt b/requirements/pip.txt new file mode 100644 index 0000000..13c7e84 --- /dev/null +++ b/requirements/pip.txt @@ -0,0 +1,14 @@ +# +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: +# +# make upgrade +# +wheel==0.41.2 + # via -r requirements/pip.in + +# The following packages are considered to be unsafe in a requirements file: +pip==23.2.1 + # via -r requirements/pip.in +setuptools==68.1.2 + # via -r requirements/pip.in From f819b948a1228ef372726a8f9b46551c9c045f46 Mon Sep 17 00:00:00 2001 From: Maria Fernanda Magallanes Zubillaga Date: Tue, 22 Aug 2023 21:47:19 -0400 Subject: [PATCH 2/2] docs: add the base for the documentation --- .gitignore | 5 + docs/Makefile | 20 ++++ docs/make.bat | 35 ++++++ docs/source/conf.py | 109 ++++++++++++++++++ .../decisions/0001-purpose-of-this-repo.rst | 2 + docs/source/decisions/index.rst | 8 ++ .../create_enrollment_requests_manually.rst | 2 + docs/source/how-tos/index.rst | 8 ++ docs/source/index.rst | 52 +++++++++ docs/source/quickstart.rst | 2 + 10 files changed, 243 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 docs/source/conf.py create mode 100644 docs/source/decisions/0001-purpose-of-this-repo.rst create mode 100644 docs/source/decisions/index.rst create mode 100644 docs/source/how-tos/create_enrollment_requests_manually.rst create mode 100644 docs/source/how-tos/index.rst create mode 100644 docs/source/index.rst create mode 100644 docs/source/quickstart.rst diff --git a/.gitignore b/.gitignore index 8991294..28adfa8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ ### Composer ### composer.phar /vendor/ + +### Sphinx ### +build +.DS_Store +source/.DS_Store diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -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) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..747ffb7 --- /dev/null +++ b/docs/make.bat @@ -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 diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..fa21054 --- /dev/null +++ b/docs/source/conf.py @@ -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": """ + + Creative Commons License + +
+ These works by + The Center for Reimagining Learning + are licensed under a + Creative Commons Attribution-ShareAlike 4.0 International License. + """ +} + +# 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 ------------------------------------------------- diff --git a/docs/source/decisions/0001-purpose-of-this-repo.rst b/docs/source/decisions/0001-purpose-of-this-repo.rst new file mode 100644 index 0000000..58367be --- /dev/null +++ b/docs/source/decisions/0001-purpose-of-this-repo.rst @@ -0,0 +1,2 @@ +1. Purpose of this Repo +======================= diff --git a/docs/source/decisions/index.rst b/docs/source/decisions/index.rst new file mode 100644 index 0000000..b17f1cd --- /dev/null +++ b/docs/source/decisions/index.rst @@ -0,0 +1,8 @@ +Decisions +========== + +.. toctree:: + :maxdepth: 1 + :caption: Contents: + + 0001-purpose-of-this-repo diff --git a/docs/source/how-tos/create_enrollment_requests_manually.rst b/docs/source/how-tos/create_enrollment_requests_manually.rst new file mode 100644 index 0000000..c3cddfb --- /dev/null +++ b/docs/source/how-tos/create_enrollment_requests_manually.rst @@ -0,0 +1,2 @@ +Create enrollment requests manually +==================================== diff --git a/docs/source/how-tos/index.rst b/docs/source/how-tos/index.rst new file mode 100644 index 0000000..6e580c5 --- /dev/null +++ b/docs/source/how-tos/index.rst @@ -0,0 +1,8 @@ +How-tos +======== + +.. toctree:: + :maxdepth: 1 + :caption: Contents: + + create_enrollment_requests_manually diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..28108bd --- /dev/null +++ b/docs/source/index.rst @@ -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 `_. And all notable changes to this project are documented in the `CHANGELOG `_ 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 `_. + +Contributing +------------- + +Contributions are very welcome. Please read `How To Contribute `_ 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 `_ file for details. + +Other +------ + +* :ref:`search` diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst new file mode 100644 index 0000000..49774f4 --- /dev/null +++ b/docs/source/quickstart.rst @@ -0,0 +1,2 @@ +Quickstart +###########