Skip to content

Commit 7122b47

Browse files
neflytecwarnermmmattermost-buildemdecrasaadmahmood
authored
Documentation site redux (mattermost#6751)
* Apply changes from redux proof-of-concept; Update tests; Add workaround for furo template rendering; Update README * Re-add importlib-metadata dependency for Sphinx on Python 3.9 * Removed ..contents:: & deleted archived files * Build warnings & error fixes * Fix build warnings/errors & formatting * Applied note formatting * Port jQuery version of feedback widget to using the JS DOM; Override furo's page layout to add feedback widget; Remove feedback widget code from myscript-v1.js * Update Pipfile.lock after re-locking * Upgrade sphinx-tabs to 3.4.4 * Fix visibility of confirmation popup after submitting feedback * Replaced sphinx-tabs with sphinx_inline_tabs * Comment-out sphinx-tabs reference and re-generate lock file to fix dependency issue * Move redirects section of conf.py higher up in the file to mitigate merge conflicts with master * Re-add commented-out version settings to help mitigate merge conflicts with master * Update commented-out version to help mitigate merge conflicts with master * Initial incomplete pass at migrating custom search to Sphinx 7 * Remove stock Sphinx searchtols script; Remove v1 searchtools script; Finish refactoring v4 searchtools to v7 * Remove unused templates * Load search indexes when DOM has finished loading * Update awscli dependency; Add exceptiongroup dependency for python older than 3.11; Add docutils-stubs to dev dependencies; Update default pipenv version to latest; Update CI pipeline script to run tests before building and to fix a Python TZ issue * Start new styles setup * Start scaffolding for redesign project * Rename redsign files. Add conditional for index css. * UX UI Updates * Updating css * Updating css * Updating badges * Updating css * Updating css * Updating docs * Updating docs site * Update nav structure and adjust homepage css * Delete old css and js files * Update styles when notification banner is active * Update notification banner content * Added :class: theme-icon to all Compass Icon SVG refs * Removed legacy .. tabs:: and .. contents:: directives * Fixed build warnings/errors * Various UI Fixes * Release readiness & build fixes * Modify redirects extension to use html_baseurl instead of hardcoded docs.mattermost.com and to remove the use of mm_url_path_prefix in favour of using Sphinx's html_baseurl; Update tests; Update Makefile to use custom html_baseurl when running livehtml target; Update GitHub workflows to use html_baseurl for preview environments * Add script for one-time conversion of rST links to doc and ref directives * Small fixes to one-time link conversion script * Move one-time conversion script into root so it can access conf.py easily; Exclude orphan files and urls with particular characteristics * Use furo's built-in base.html template * Remove extraneous templates; Add comment to page and custom-index template regarding furo base templates * More robust ignoring of directories; Resolve redirects fully before constructing a directive * [REFACTOR] Rewrite rST links into inline doc and ref directives where possible to allow html_baseurl to work correctly * Temporary workaround to allow preview environments to use the correct html_baseurl * Table formatting fixes * Converting internal HTML links > Sphinx directives * Converting internal HTML links > Sphinx directives * Converting internal HTML links > Sphinx directives * Replaced ambiguous deploy badges * Updating UI * Updated Cloud signup URL * Broken link fix * Extract Mattermost theme modifications into new page.html, leaving the previous page-v1.html around temporarily; Enable Edit in GitHub functionality in conf.py; Remove old RTD theme config for Edit in GitHub * Hid legacy changelogs & gencert from search results to improve results * Converting internal HTML links > Sphinx directives * Process hardcoded docs.mattermost.com links and exclude links that cross line boundaries * [REFACTOR] Migrate hardcoded docs.mattermost.com rST links to doc and ref roles * Updating thermotoer to allow multiple feedback * Table syntax fixes & Converting internal HTML links > Sphinx directives * Add Google Tag Manager functionality; Remove commented-out search v1 div from custom-nav.html * Add GTM to custom index * Update notification bar with webinar deets * Fixed broken link * Fix notification banner details --------- Co-authored-by: Carrie Warner (Mattermost) <[email protected]> Co-authored-by: Mattermost Build <[email protected]> Co-authored-by: emdecr <[email protected]> Co-authored-by: Asaad Mahmood <[email protected]>
1 parent c2a5e41 commit 7122b47

File tree

678 files changed

+10626
-37714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

678 files changed

+10626
-37714
lines changed

.github/workflows/ci.yml

+23-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
---
12
name: CI
2-
on:
3+
'on':
34
push:
45
branches:
56
- master
@@ -10,22 +11,24 @@ jobs:
1011
build:
1112
runs-on: ubuntu-latest
1213
steps:
13-
- name: ci/Checkout code
14-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
15-
- uses: actions/setup-python@db9987b4c1f10f0404fa60ee629f675fafbd6763 # v4.6.0
16-
with:
17-
python-version: '3.9'
18-
- name: ci/Build
19-
run: |
20-
make python-deps
21-
make html
22-
- name: ci/Persist docs artifacts
23-
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05 # v3.1.2
24-
with:
25-
name: docs
26-
path: build/html
27-
- name: ci/Persist doc logs artifacts
28-
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05 # v3.1.2
29-
with:
30-
name: doc-logs
31-
path: build/*.log
14+
- name: ci/Checkout code
15+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
16+
- uses: actions/setup-python@db9987b4c1f10f0404fa60ee629f675fafbd6763 # v4.6.0
17+
with:
18+
python-version: 3.9
19+
- name: ci/Install dependencies
20+
run: make python-deps
21+
- name: ci/Run tests
22+
run: TZ=UTC make test
23+
- name: ci/Build docs
24+
run: TZ=UTC make html
25+
- name: ci/Persist docs artifacts
26+
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05 # v3.1.2
27+
with:
28+
name: docs
29+
path: build/html
30+
- name: ci/Persist doc logs artifacts
31+
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05 # v3.1.2
32+
with:
33+
name: doc-logs
34+
path: build/*.log

.github/workflows/preview-env-fork.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: Build
8080
if: ${{ steps.label-checker.outputs.result == 'true' }}
81-
run: make SPHINXOPTS="-j auto -D mm_url_path_prefix=/${{ steps.pr.outputs.id }}" html
81+
run: make SPHINXOPTS="-j auto -D html_baseurl=http://mattermost-docs-preview-pulls.s3-website-us-east-1.amazonaws.com/${{ steps.pr.outputs.id }}" html
8282

8383
- uses: shallwefootball/s3-upload-action@4350529f410221787ccf424e50133cbc1b52704e # v1.3.3
8484
name: Upload Preview Env

.github/workflows/preview-env.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
- name: Build
3232
if: github.event.pull_request.head.repo.full_name == github.repository
33-
run: make SPHINXOPTS="-j auto -D mm_url_path_prefix=/${{ steps.pr.outputs.id }}" html
33+
run: make SPHINXOPTS="-j auto -D html_baseurl=http://mattermost-docs-preview-pulls.s3-website-us-east-1.amazonaws.com/${{ github.event.number }}" html
3434

3535
- uses: shallwefootball/s3-upload-action@4350529f410221787ccf424e50133cbc1b52704e # v1.3.3
3636
name: Upload Preview Env

Makefile

+17-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ WARNINGSFILE = $(BUILDDIR)/warnings.log
1010
SPHINXOPTS ?= -j auto
1111
SPHINXBUILD ?= pipenv run sphinx-build
1212
SPHINXAUTOBUILD ?= pipenv run sphinx-autobuild
13+
AUTOBUILDOPTS ?= -D=html_baseurl=http://127.0.0.1:8000
14+
15+
# If we're not on Windows, check to see if 'mm_url_path_prefix' is included in SPHINXOPTS.
16+
# If it is included, extract the PR ID from the prefix and set the html_baseurl config
17+
# option to the preview environment.
18+
ifneq ($(OS),Windows_NT)
19+
ifeq ($(findstring mm_url_path_prefix,$(SPHINXOPTS)),mm_url_path_prefix)
20+
PATH_PREFIX = $(shell echo "$(SPHINXOPTS)" | grep -Eo 'mm_url_path_prefix=\/([0-9]+)' | cut -d / -f 2)
21+
SPHINXOPTS2 = $(SPHINXOPTS) -D html_baseurl=http://mattermost-docs-preview-pulls.s3-website-us-east-1.amazonaws.com/$(PATH_PREFIX)
22+
else
23+
SPHINXOPTS2 = $(SPHINXOPTS)
24+
endif
25+
endif
1326

1427
# Put it first so that "make" without argument is like "make help".
1528
help:
@@ -22,7 +35,7 @@ endif
2235
# Install necessary dependencies for the CI build pipeline.
2336
# NOTE: if the version of Python used to build the docs changes, update the `pipenv` command below accordingly.
2437
python-deps:
25-
pip install pipenv==2022.12.19
38+
pip install pipenv==2023.11.15
2639
pipenv install --dev --clear --deploy --python 3.9
2740

2841
test:
@@ -32,10 +45,10 @@ test:
3245
livehtml:
3346
ifeq ($(OS),Windows_NT)
3447
@CMD /C IF NOT EXIST $(BUILDDIR) MD $(BUILDDIR)
35-
@CMD /C $(SPHINXAUTOBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html" -d "$(BUILDDIR)/doctrees" $(SPHINXOPTS) $(O)
48+
@CMD /C $(SPHINXAUTOBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html" -d "$(BUILDDIR)/doctrees" $(SPHINXOPTS) $(AUTOBUILDOPTS) $(O)
3649
else
3750
@mkdir -p "$(BUILDDIR)"
38-
@$(SPHINXAUTOBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html" -d "$(BUILDDIR)/doctrees" $(SPHINXOPTS) $(O)
51+
@$(SPHINXAUTOBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html" -d "$(BUILDDIR)/doctrees" $(SPHINXOPTS) $(AUTOBUILDOPTS) $(O)
3952
endif
4053

4154
# Run `make linkcheck` to check external links
@@ -71,5 +84,5 @@ ifeq ($(OS),Windows_NT)
7184
@CMD /C $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -w "$(WARNINGSFILE)" 2>NUL
7285
else
7386
@mkdir -p "$(BUILDDIR)"
74-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 2>>"$(WARNINGSFILE)"
87+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS2) $(O) 2>>"$(WARNINGSFILE)"
7588
endif

Pipfile

+21-11
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,54 @@ name = "pypi"
88
# Amazon AWS Universal CLI environment (https://aws.amazon.com/cli/)
99
# Release notes: https://github.com/aws/aws-cli/blob/develop/CHANGELOG.rst
1010
# Repo: https://github.com/aws/aws-cli
11-
awscli = "==1.29.38"
11+
awscli = "==1.32.8"
1212
#
13-
# PyTest testing framework (https://docs.pytest.org/en/7.2.x/)
14-
pytest = "==7.2.0"
13+
# PyTest testing framework (https://docs.pytest.org/en/7.4.x/)
14+
pytest = "==7.4.2"
15+
#
16+
# exceptiongroup: Backport of PEP-654 Exception groups to Python <3.11
17+
exceptiongroup = {version = "*", markers = "python_version < '3.11'"}
18+
#
19+
# Black: A Python source formatter
20+
black = "==23.10.1"
21+
#
22+
# Docutils Stubs
23+
docutils-stubs = "==0.0.22"
1524

1625
[packages]
1726
#
1827
# Sphinx (https://www.sphinx-doc.org)
1928
# Release notes: https://www.sphinx-doc.org/en/master/changes.html
2029
# Repo: https://github.com/sphinx-doc/sphinx
21-
sphinx = "==4.4.0"
30+
sphinx = "==7.2.6"
2231
#
23-
# ReadTheDocs Theme (https://sphinx-rtd-theme.readthedocs.io/)
24-
# Release notes: https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst
25-
# Repo: https://github.com/readthedocs/sphinx_rtd_theme
26-
sphinx-rtd-theme = "==1.0.0"
32+
# Furo Theme (https://github.com/pradyunsg/furo)
33+
furo = "==2023.9.10"
2734
#
2835
# MyST Parser (https://myst-parser.readthedocs.io/en/latest/)
2936
# Release notes: https://myst-parser.readthedocs.io/en/latest/develop/_changelog.html
3037
# Repo: https://github.com/executablebooks/myst-parser
31-
myst-parser = "==0.15.1"
38+
myst-parser = "==2.0.0"
3239
#
3340
# Sphinx Autobuild (https://github.com/executablebooks/sphinx-autobuild)
3441
# Repo: https://github.com/executablebooks/sphinx-autobuild
3542
sphinx-autobuild = "==2021.3.14"
3643
#
3744
# Tabbed views for Sphinx (https://sphinx-tabs.readthedocs.io/)
3845
# Repo: https://github.com/executablebooks/sphinx-tabs
39-
sphinx-tabs = "==3.4.0"
46+
#sphinx-tabs = "==3.4.0"
4047
#
4148
# Setuptools; used by sphinx-tabs
4249
# Repo: https://github.com/pypa/setuptools
4350
setuptools = "==68.2.2"
4451
#
4552
# Add a "copy" button to code blocks in Sphinx (https://sphinx-copybutton.readthedocs.io/en/latest/)
4653
# Repo: https://github.com/executablebooks/sphinx-copybutton
47-
sphinx-copybutton = "0.5.0"
54+
sphinx-copybutton = "==0.5.2"
4855
#
4956
# Python importlib metadata library; used by Sphinx
5057
# Repo: https://github.com/python/importlib_metadata
5158
importlib-metadata = "==4.12.0"
59+
#
60+
# Tabbed views for Sphinx (https://github.com/pradyunsg/sphinx-inline-tabs)
61+
sphinx-inline-tabs = "==2023.04.21"

0 commit comments

Comments
 (0)