Skip to content
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ff4j/ff4j-docs-champions
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Description

<!-- Description about this pull request -->

Closes : <!-- refer the github issue. Ex: #084-->

# Checklist:

- [ ] I have performed a self-review of my documentation changes
- [ ] I have checked the preview site of PR and confirm the changes
- [ ] My commits follow [conventional commit message guidelines](https://www.conventionalcommits.org/en/v1.0.0/)
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: uv
schedule:
interval: daily
time: "23:30"
open-pull-requests-limit: 10
commit-message:
prefix: "build: "
labels:
- dependencies
- automated
- package-ecosystem: github-actions
directory: "/.github/"
schedule:
interval: weekly
open-pull-requests-limit: 5
commit-message:
prefix: "ci: "
labels:
- ci
- automated
33 changes: 0 additions & 33 deletions .github/workflows/main.yml

This file was deleted.

99 changes: 99 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: PR Preview & GitHub Pages Publish
on:
pull_request:
types: [opened, synchronize, reopened, closed]
push:
branches:
- main
permissions:
contents: write # gh-pages + cleanup
pull-requests: write # PR comments
pages: write # deploy-pages
id-token: write # required by deploy-pages
jobs:
build:
if: github.event.action != 'closed'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"

Comment on lines +22 to +26
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-python is configured with python-version-file: "pyproject.toml", but this repo also adds a .python-version file. If setup-python can't parse pyproject.toml for the version, CI will fail; it’s safer to point python-version-file at .python-version (or set python-version explicitly).

Copilot uses AI. Check for mistakes.
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Sync dependencies
run: uv sync

- name: Build site
run: uv run zensical build --clean

- name: Deploy PR preview
if: github.event_name == 'pull_request'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site
destination_dir: pr-${{ github.event.pull_request.number }}

- name: Comment PR with preview URL
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request.number;
const { owner, repo } = context.repo;

const url = `https://ff4j.github.io/docs/pr-${pr}/`;

await github.rest.issues.createComment({
owner,
repo,
issue_number: pr,
body: `📘 **Site preview available**:\n\n${url}`
});

Comment on lines +44 to +60
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow posts a new PR comment on every synchronize event, which will spam the PR thread on iterative pushes. Consider making the comment idempotent (search for an existing comment containing a unique marker and update it) or use a dedicated "sticky comment" approach.

Copilot uses AI. Check for mistakes.
- name: Upload Pages artifact
if: github.event_name == 'push'
uses: actions/upload-pages-artifact@v3
with:
path: site

publish:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: https://paulwilliams.dev
steps:
Comment on lines +71 to +74
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GitHub Pages environment URL is set to https://paulwilliams.dev, which doesn’t match the project’s configured docs URL (https://ff4j.github.io/docs/). This will show an incorrect deployment link in GitHub’s UI; update it to the actual GitHub Pages (or custom) domain for this site.

Copilot uses AI. Check for mistakes.
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4

cleanup:
if: github.event_name == 'pull_request' &&
github.event.action == 'closed' &&
github.event.pull_request.merged == false
runs-on: ubuntu-latest
Comment on lines +79 to +82
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preview cleanup job only runs when a PR is closed and not merged, which leaves the pr-<number>/ preview folder behind for merged PRs. If previews should be ephemeral, adjust the condition to also clean up after merges (or document why merged previews should be retained).

Copilot uses AI. Check for mistakes.

steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages

- name: Remove PR preview folder
run: |
rm -rf pr-${{ github.event.pull_request.number }}

- name: Commit cleanup
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git commit -am "chore: remove preview for PR #${{ github.event.pull_request.number }}" || exit 0
git push
24 changes: 19 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# IntelliJ files
.idea

# Virtual environment files
venv
# VSCode
.vscode/
*.code-workspace

# IntelliJ
.idea/
*.iml

# MacOS
.DS_Store

# UV
.venv/
__pycache__/
*.pyc
.cache/

# mkdocs
/site/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14.2
59 changes: 9 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,18 @@
# FF4j Documentation

[![Awesome](https://awesome.re/badge-flat.svg)](https://awesome.re)
This is the documentation of FF4j, a Java library to manage feature toggles in your application.

Static site is generated on branch `gh-pages` using a github actions.
## Prerequisites

## Run the website locally
- [zensical](https://zensical.org/docs/get-started/)

### 1. Installation
## Run locally

```bash
python3 -m pip install --upgrade pip # install pip
python3 -m pip install mkdocs # install mkdocs
python3 -m pip install mkdocs-material # install material theme
#python3 -m pip install https://github.com/bmcorser/fontawesome-markdown/archive/master.zip # install font-awesome
python3 -m pip install mkdocs-git-revision-date-plugin # install git revision date
python3 -m pip install mkdocs-video # install git revision date
```shell
sh ./serve.sh
```
Comment on lines +5 to 13
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Prerequisites" section only mentions Zensical, but serve.sh relies on uv being installed (and a compatible Python version). Consider updating the README to include installing uv (and running uv sync once) so the local run instructions are complete.

Copilot uses AI. Check for mistakes.

Or use this one-liner :)
## Contributing

```
python3 -m pip install --upgrade pip && python3 -m pip install mkdocs mkdocs-material https://github.com/bmcorser/fontawesome-markdown/archive/master.zip mkdocs-git-revision-date-plugin
```

### 2. Run

```
mkdocs serve
```

You should be able to access it on http://localhost:8000

**Known Issue:**

If you get an `mkdocs not found error`, launch it this way:

```
python3 -m mkdocs serve
```

### 3. Instructions

#### Images

**Caution**: when running locally, the site is served at `http://127.0.0.1:8000/pages/[...]`
while when deployed, it is at `https://ff4j.github.io/docs/pages/[...]`.

This means that if you use "absolute" image URLs such as `/img/ETC ETC` one will work
and the other won't. Unfortunately you have to always use relative paths and climb up
the ladder with `../../../../img/ETC ETC` !

In other words, **if you use `"/img/tile-java.png"` it will render OK locally and
then screw up once deployed**.

Also, when calculating the number of `..` to insert, count ONE LESS for `index.md` files as opposed to all other `md` files:
`index.md` renders as the page for the path containing it (`a/b/c/index.md` renders the URL `a/b/c`).

For company logo files, SVG format is preferred to PNG.
If you want to contribute to the documentation, please fork the repository and create a pull request
with your changes. We will review your changes and merge them if they are appropriate.
Loading