Skip to content

Commit

Permalink
Merge branch '6.0' into components
Browse files Browse the repository at this point in the history
  • Loading branch information
stevepiercy authored Apr 2, 2024
2 parents fd3d464 + f2f7d3c commit 6be5b1c
Show file tree
Hide file tree
Showing 198 changed files with 20,310 additions and 1,642 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
See our [contributing guidelines](https://6.dev-docs.plone.org/contributing/index.html).
See our [contributing guidelines](https://6.docs.plone.org/contributing/index.html).
15 changes: 8 additions & 7 deletions .github/ISSUE_TEMPLATE/new-issue-form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ body:
attributes:
value: |
Thanks for taking the time to fill out this issue report!
- type: checkboxes
id: plone-versions
- type: textarea
id: documentation-url
attributes:
label: Plone Documentation versions affected
options:
- label: 5.x
- label: 6.x
label: Links of affected pages in Plone Documentation, if any.
value: |
- Link_1
- Link_2
- ...
- type: textarea
id: description
attributes:
label: Description
description: If relevant, please include links to the affected resources, screenshots, and any other helpful information.
description: Include screenshots and any other helpful information.
validations:
required: true
18 changes: 0 additions & 18 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md

This file was deleted.

27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## First-time contributors

You **must** read and follow our [First-time contributors](https://6.docs.plone.org/contributing/first-time.html).

---

## Submit a pull request

Thank you for your contribution to the Plone Documentation.

Before submitting this pull request, please make sure you follow our guides:

- [Contributing to Plone documentation](https://6.docs.plone.org/contributing/index.html)
- [Building and checking the quality of documentation](https://6.docs.plone.org/contributing/setup-build.html)
- [Authors guide](https://6.docs.plone.org/contributing/authors.html)
- [MyST reference](https://6.docs.plone.org/contributing/myst-reference.html)

## Issue number

- Fixes #

## Description

_Write a description of the fixes or improvements._

## Add screenshots or links to a preview of the changes

71 changes: 41 additions & 30 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,81 @@
name: Build and deploy Plone 6 documentation to 6.dev-docs.plone.org
name: Build and deploy Plone 6 documentation to 6.docs.plone.org

on:
push:
branches:
- "6-dev"
- "6.0"

env:
node-version: 20.x

jobs:
build_deploy:
runs-on: ubuntu-latest
environment:
name: docs.plone.org
url: https://docs.plone.org
steps:
- uses: actions/checkout@v1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"

python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -q -r requirements-initial.txt
pip install -q -r requirements.txt
pip freeze
# - name: Run spellcheck
# run: make spellcheck
# - name: Run Vale
# run: make vale

# - name: Run linkcheck
# run: make linkcheck

- name: Prepare deploy
run: make deploy

# node setup
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ env.node-version }}

# node cache
- name: Get yarn cache directory path
id: yarn-cache-dir-path
working-directory: submodules/volto
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: StoryBook build
run: cd submodules/volto && yarn && yarn build-storybook -o ../../_build/html/storybook
run: make storybook

- name: Deploy to server
id: deploy
uses: Pendect/action-rsyncer@v1.1.0
uses: Pendect/action-rsyncer@v2.0.0
env:
DEPLOY_KEY: ${{secrets.DEPLOY_KEY_DOCS}}
with:
flags: '-avzr --delete'
options: ''
ssh_options: '-p ${{secrets.DEPLOY_PORT}}'
ssh_options: '-p ${{vars.DEPLOY_PORT}}'
src: '_build/html/'
dest: '${{secrets.DEPLOY_USER_DOCS}}@${{secrets.DEPLOY_SERVER_DOCS}}:${{secrets.DEPLOY_PATH_DOCS}}'
dest: '${{vars.DEPLOY_USER_DOCS}}@${{vars.DEPLOY_SERVER_DOCS}}:${{vars.DEPLOY_PATH_DOCS}}'

- name: Display status from deploy
run: echo "${{ steps.deploy.outputs.status }}"
23 changes: 14 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
name: Test Plone 6 documentation

on:
push:
branches-ignore:
- "master"

on: [push, pull_request]
jobs:
test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -q -r requirements-initial.txt
pip install -q -r requirements.txt
sudo snap install --edge vale
- name: Run tests with make test
run: make test

- name: Run vale
run: |
git clone https://github.com/errata-ai/Microsoft.git
cp -r ./Microsoft/Microsoft ./styles
VALEFILES=$(find -L ./docs/ -type d \( -path "./docs/plone.restapi/lib/*" -o -path "./docs/plone.restapi/performance/*" \) -prune -false -o -type f -name "*.md" -print)
vale --no-exit $VALEFILES
9 changes: 5 additions & 4 deletions .github/workflows/update_submodule.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Get latest version of submodules and push back to 6-dev branch
# See https://github.com/plone/documentation/issues/1214 for current status
name: Get latest version of submodules and push back to 6.0 branch

on:
workflow_dispatch:
Expand All @@ -9,8 +10,8 @@ jobs:
steps:
# Checkout
- uses: actions/checkout@v3
with:
ref: 6-dev
with:
ref: 6.0
submodules: true

- name: Submodule update
Expand All @@ -26,5 +27,5 @@ jobs:
git status
git config user.name github-actions
git config user.email [email protected]
git commit -m "Update submo0dules tip" || echo "No changes to commit"
git commit -m "Update submodules tip" || echo "No changes to commit"
git push
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
# Generated files
pyvenv.cfg
/_build
/styles/Microsoft
/share

# symlinked from submodule
docs/volto
docs/plone.restapi
docs/plone.api

# editor files
.vscode
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[submodule "submodules/volto"]
path = submodules/volto
url = https://github.com/plone/volto.git
branch = master
branch = main
[submodule "submodules/plone.restapi"]
path = submodules/plone.restapi
url = https://github.com/plone/plone.restapi.git
branch = master
branch = main
[submodule "submodules/plone.api"]
path = submodules/plone.api
url = https://github.com/plone/plone.api.git
Expand Down
12 changes: 12 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
StylesPath = styles

MinAlertLevel = suggestion

Vocab = Base,Plone

Packages = Microsoft

[*]
BasedOnStyles = Vale, Microsoft
Microsoft.Contractions = suggestion
Microsoft.Units = suggestion
35 changes: 18 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ SPHINXOPTS ?=
PAPER ?=

# Internal variables.
SPHINXBUILD = $(realpath bin/sphinx-build)
SPHINXAUTOBUILD = $(realpath bin/sphinx-autobuild)
SPHINXBUILD = "$(realpath bin/sphinx-build)"
SPHINXAUTOBUILD = "$(realpath bin/sphinx-autobuild)"
DOCS_DIR = ./docs/
BUILDDIR = ../_build/
BUILDDIR = ../_build
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

VALEFILES := $(shell find -L $(DOCS_DIR) -type d \( -path $(DOCS_DIR)/plone.restapi/lib/* -o -path $(DOCS_DIR)"/plone.restapi/performance/*" \) -prune -false -o -type f -name "*.md" -print)

# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
Expand All @@ -35,8 +35,8 @@ distclean: ## Clean docs build directory and Python virtual environment


bin/python:
python3 -m venv . || virtualenv --clear --python=python3 .
bin/python -m pip install --upgrade pip
python3 -m venv .
bin/pip install -r requirements-initial.txt
bin/pip install -r requirements.txt

docs/plone.api:
Expand All @@ -62,7 +62,7 @@ docs/volto:
@echo "Documentation of volto initialized."

.PHONY: deps
deps: bin/python docs/volto docs/plone.restapi docs/plone.api ## Create Python virtual environment, install requirements, initialize or update the volto, plone.restapi, and plone.api submodules, and finally create symlinks to the source files.
deps: bin/python docs/volto docs/plone.restapi docs/plone.api ## Create Python virtual environment, install requirements, initialize or update the volto, plone.restapi, and plone.api submodules, and finally create symlinks to the source files.


.PHONY: html
Expand Down Expand Up @@ -189,17 +189,17 @@ linkcheck: deps ## Run linkcheck

.PHONY: linkcheckbroken
linkcheckbroken: deps ## Run linkcheck and show only broken links
cd $(DOCS_DIR) && $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | GREP_COLORS='0;31' grep -wi "broken\|redirect" --color=auto || test $$? = 1
cd $(DOCS_DIR) && $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | GREP_COLORS='0;31' grep -wi "broken\|redirect" --color=always | GREP_COLORS='0;31' grep -vi "https://github.com/plone/volto/issues/" --color=always && if test $$? = 0; then exit 1; fi || test $$? = 1
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/ ."

.PHONY: spellcheck
spellcheck: deps ## Run spellcheck
cd $(DOCS_DIR) && LANGUAGE=$* $(SPHINXBUILD) -b spelling -j 4 $(ALLSPHINXOPTS) $(BUILDDIR)/spellcheck/$*
.PHONY: vale
vale: deps ## Run Vale style, grammar, and spell checks
bin/vale sync
bin/vale --no-wrap $(VALEFILES)
@echo
@echo "Spellcheck is finished; look for any errors in the above output " \
" or in $(BUILDDIR)/spellcheck/ ."
@echo "Vale is finished; look for any errors in the above output."

.PHONY: html_meta
html_meta: deps ## Add meta data headers to all Markdown pages
Expand All @@ -212,7 +212,7 @@ doctest: deps
"results in $(BUILDDIR)/doctest/output.txt."

.PHONY: test
test: clean linkcheckbroken spellcheck ## Clean docs build, then run linkcheckbroken, spellcheck
test: clean linkcheckbroken ## Clean docs build, then run linkcheckbroken

.PHONY: deploy
deploy: clean html
Expand All @@ -226,6 +226,7 @@ livehtml: deps ## Rebuild Sphinx documentation on changes, with live-reload in

.PHONY: netlify
netlify:
pip install -r requirements-initial.txt
pip install -r requirements.txt
pip install -r requirements-netlify.txt
git submodule init; \
Expand All @@ -234,11 +235,11 @@ netlify:
ln -s ../submodules/volto/docs/source ./docs/volto
ln -s ../submodules/plone.restapi ./docs/plone.restapi
ln -s ../submodules/plone.api/docs ./docs/plone.api
cd $(DOCS_DIR) && sphinx-build -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
cd $(DOCS_DIR) && sphinx-build -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html && cp ./netlify_robots.txt $(BUILDDIR)/html/robots.txt

.PHONY: storybook
storybook:
cd submodules/volto && yarn && yarn build-storybook -o ../../_build/html/storybook
cd submodules/volto && pnpm i && pnpm build:registry && pnpm --filter @plone/volto build-storybook -o ../../../../_build/html/storybook

.PHONY: all
all: clean spellcheck linkcheck html ## Clean docs build, then run linkcheck and spellcheck, and build html
all: clean vale linkcheck html ## Clean docs build, then run vale and linkcheck, and build html
Loading

0 comments on commit 6be5b1c

Please sign in to comment.