-
Notifications
You must be signed in to change notification settings - Fork 0
feat: migrate documentation to zensical #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ddf7c74
6204a8d
56d75c0
6faad74
41a7b87
79f8899
bfcfa62
3d59cb0
4b45cc1
060f567
6752de2
bb42746
c12676a
a3c22a2
06092e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * @ff4j/ff4j-docs-champions |
| 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/) |
| 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 |
This file was deleted.
| 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" | ||
|
|
||
| - 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
|
||
| - 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
|
||
| - 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
|
||
|
|
||
| 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 | ||
| 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/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.14.2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,59 +1,18 @@ | ||
| # FF4j Documentation | ||
|
|
||
| [](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
|
||
|
|
||
| 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. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions/setup-pythonis configured withpython-version-file: "pyproject.toml", but this repo also adds a.python-versionfile. Ifsetup-pythoncan't parsepyproject.tomlfor the version, CI will fail; it’s safer to pointpython-version-fileat.python-version(or setpython-versionexplicitly).