Skip to content
Closed
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
41 changes: 41 additions & 0 deletions .github/workflows/docs-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Documentation linter

on:
pull_request:
push:
branches:
- master

jobs:
run_tests:
name: Quality Others
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
python-version:
- "3.11"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install system requirements
run: sudo apt update && sudo apt install -y libxmlsec1-dev

- name: Install pip
run: python -m pip install -r requirements/pip.txt

- name: Install Required Python Dependencies
run: |
pip install -r requirements/edx/doc.txt

- name: Run lint check
run: |
make docs-lint
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ SWAGGER = docs/lms-openapi.yaml
docs: swagger guides technical-docs ## build the documentation for this repository
$(MAKE) -C docs html

docs-lint: swagger guides technical-docs ## build the documentation for this repository
$(MAKE) -C docs lint

swagger: ## generate the swagger.yaml file
DJANGO_SETTINGS_MODULE=docs.docs_settings python manage.py lms generate_swagger --generator-class=edx_api_doc_tools.ApiSchemaGenerator -o $(SWAGGER)

Expand Down
6 changes: 5 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXLINT = sphinx-lint
SOURCEDIR = .
BUILDDIR = _build

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

.PHONY: help clean Makefile
.PHONY: help clean lint Makefile

clean:
rm -rf _build cms common lms openedx
Expand All @@ -21,6 +22,9 @@ clean:
%: Makefile
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

lint:
$(SPHINXLINT) "$(SOURCEDIR)"

update_redirects:
# This updates redirects.txt, creating redirects for any files that have moved (relative to master).
sphinx-build -b rediraffewritediff "$(SOURCEDIR)" "$(BUILDDIR)"
Expand Down
4 changes: 4 additions & 0 deletions requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,7 @@ polib==1.2.0
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
# edx-i18n-tools
# sphinx-lint
prompt-toolkit==3.0.48
# via
# -r requirements/edx/doc.txt
Expand Down Expand Up @@ -1820,6 +1821,7 @@ regex==2024.9.11
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
# nltk
# sphinx-lint
requests==2.32.3
# via
# -r requirements/edx/doc.txt
Expand Down Expand Up @@ -2005,6 +2007,8 @@ sphinx-book-theme==1.1.3
# via -r requirements/edx/doc.txt
sphinx-design==0.6.1
# via -r requirements/edx/doc.txt
sphinx-lint==1.0.0
# via -r requirements/edx/doc.txt
sphinx-mdinclude==0.6.2
# via
# -r requirements/edx/doc.txt
Expand Down
1 change: 1 addition & 0 deletions requirements/edx/doc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sphinx-book-theme # Common theme for all Open edX projects
gitpython # fetch git repo information
Sphinx # Documentation builder
sphinx-design # provides various responsive web-components
sphinx-lint # documentation lint checker
sphinxcontrib-openapi[markdown] # Be able to render openapi schema in a sphinx project
sphinxext-rediraffe # Quickly and easily redirect when we move pages around.
sphinx-reredirects # Redirect from a sphinx project out to other places on the web including other sphinx projects
4 changes: 4 additions & 0 deletions requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,7 @@ polib==1.2.0
# via
# -r requirements/edx/base.txt
# edx-i18n-tools
# sphinx-lint
prompt-toolkit==3.0.48
# via
# -r requirements/edx/base.txt
Expand Down Expand Up @@ -1262,6 +1263,7 @@ regex==2024.9.11
# via
# -r requirements/edx/base.txt
# nltk
# sphinx-lint
requests==2.32.3
# via
# -r requirements/edx/base.txt
Expand Down Expand Up @@ -1412,6 +1414,8 @@ sphinx-book-theme==1.1.3
# via -r requirements/edx/doc.in
sphinx-design==0.6.1
# via -r requirements/edx/doc.in
sphinx-lint==1.0.0
# via -r requirements/edx/doc.in
sphinx-mdinclude==0.6.2
# via sphinxcontrib-openapi
sphinx-reredirects==0.1.5
Expand Down