Skip to content

Commit 1d94898

Browse files
committed
Initial version on web site
1 parent f75e345 commit 1d94898

10 files changed

Lines changed: 324 additions & 1 deletion

File tree

‎.github/dependabot.yml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
target-branch: "main"
8+
9+
# Zensical is pinned in requirements.txt. It is pre-1.0 and releases every few days, so a
10+
# bump arrives as a pull request that the strict build has to pass before it is merged.
11+
- package-ecosystem: "pip"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
target-branch: "main"

‎.github/workflows/docs.yml‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Documentation
2+
3+
# Adapted from the workflow `zensical new` generates (https://zensical.org/docs/publish-your-site/):
4+
# split into build and deploy so that pull requests are built too, with actions pinned by SHA.
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: docs-${{ github.ref }}
16+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
17+
18+
jobs:
19+
build:
20+
name: build
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
24+
25+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
26+
with:
27+
python-version: "3.14"
28+
29+
- name: Install Zensical
30+
run: pip install -r requirements.txt
31+
32+
# Strict mode fails the build on a broken link or anchor. That check is what makes a pull
33+
# request opened from the "Edit this page" button safe to merge from the browser.
34+
- name: Build the site
35+
run: zensical build --clean --strict
36+
37+
- name: Upload the Pages artifact
38+
if: github.event_name == 'push'
39+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
40+
with:
41+
path: site
42+
43+
deploy:
44+
name: deploy
45+
if: github.event_name == 'push'
46+
needs: build
47+
runs-on: ubuntu-latest
48+
permissions:
49+
pages: write
50+
id-token: write
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
steps:
55+
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
56+
57+
- id: deployment
58+
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1

‎.gitignore‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Zensical build output and cache
2+
/site/
3+
/.cache/
4+
5+
# Local Python environment
6+
/.venv/
7+
8+
.DS_Store

‎README.md‎

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,53 @@
1-
# docs
1+
# openjavaformat.dev
2+
3+
Sources of <https://openjavaformat.dev>, the website of
4+
[open-java-format](https://github.com/openjavaformat/open-java-format).
5+
6+
The site is built with [Zensical](https://zensical.org) and published on GitHub Pages. Pages live
7+
in `docs/` as Markdown, and the whole configuration is `zensical.toml`.
8+
9+
## Editing a page
10+
11+
Every page has an **Edit this page** button. It opens the Markdown file of this repository in
12+
GitHub's editor, and GitHub turns the change into a pull request, forking the repository first if
13+
needed. The pull request is built in strict mode, so a broken link fails the check instead of
14+
reaching the site.
15+
16+
The repository link in the site header deliberately points at the formatter, not here.
17+
18+
## Previewing locally
19+
20+
With [mise](https://mise.jdx.dev):
21+
22+
```bash
23+
mise run serve
24+
```
25+
26+
Without it:
27+
28+
```bash
29+
python3 -m venv .venv
30+
source .venv/bin/activate
31+
pip install -r requirements.txt
32+
zensical serve
33+
```
34+
35+
The preview runs on <http://localhost:8000> and reloads on save. `mise run build` runs the same
36+
clean, strict build as CI.
37+
38+
## Publishing
39+
40+
A push to `main` runs `.github/workflows/docs.yml`, which builds the site and deploys it to GitHub
41+
Pages. There is nothing to do by hand.
42+
43+
The custom domain is set in the repository's Pages settings. There is deliberately no `CNAME` file:
44+
GitHub ignores it when a site is deployed by a workflow.
45+
46+
## Upgrading Zensical
47+
48+
The version is pinned in `requirements.txt`, and Dependabot proposes upgrades. Zensical is still
49+
pre-1.0, so read the [changelog](https://zensical.org/docs/changelog/) before merging one.
50+
51+
## License
52+
53+
[Apache License 2.0](LICENSE), the same as open-java-format.

‎docs/assets/favicon.svg‎

Lines changed: 19 additions & 0 deletions
Loading

‎docs/index.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# open-java-format
2+
3+
A modern, lambda-friendly, 120-character Java formatter, built in the open.
4+
5+
This site is being set up. Until the documentation lands here, everything lives in the
6+
[project README](https://github.com/openjavaformat/open-java-format#readme).

‎mise.toml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Development tooling for the openjavaformat.dev site (repository openjavaformat/docs).
2+
#
3+
[tools]
4+
python = "3.14"
5+
6+
# mise creates .venv on first use and activates it, so the tasks below see the pinned Zensical.
7+
[env]
8+
_.python.venv = { path = ".venv", create = true }
9+
10+
[tasks.install]
11+
description = "Install the Zensical version pinned in requirements.txt into .venv"
12+
run = "pip install --quiet --disable-pip-version-check -r requirements.txt"
13+
14+
[tasks.serve]
15+
description = "Preview the site on http://localhost:8000 with live reload"
16+
depends = ["install"]
17+
run = "zensical serve"
18+
19+
[tasks.build]
20+
description = "Build the site into site/ the same way CI does: clean and strict"
21+
depends = ["install"]
22+
run = "zensical build --clean --strict"

‎overrides/.icons/ojf/logo.svg‎

Lines changed: 19 additions & 0 deletions
Loading

‎requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
zensical==0.0.63

‎zensical.toml‎

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Generated by `zensical new` 0.0.63, then adapted. Reference: https://zensical.org/docs/setup/basics/
2+
[project]
3+
site_url = "https://openjavaformat.dev/"
4+
site_name = "open-java-format"
5+
site_description = "A modern, lambda-friendly, 120-character Java formatter, built in the open."
6+
# site_author = "Your name"
7+
8+
# copyright = "Copyright &copy; 2026 Your name"
9+
10+
# The header links to the formatter, while "Edit this page" must open this site's own sources.
11+
# An absolute edit_uri is the documented way to split the two:
12+
# https://zensical.org/docs/setup/repository/#edit_uri
13+
repo_url = "https://github.com/openjavaformat/open-java-format"
14+
repo_name = "openjavaformat/open-java-format"
15+
edit_uri = "https://github.com/openjavaformat/docs/edit/main/docs/"
16+
17+
nav = [
18+
{ "Home" = "index.md" },
19+
]
20+
21+
# extra_css = ["stylesheets/extra.css"]
22+
# extra_javascript = ["javascripts/extra.js"]
23+
24+
[project.theme]
25+
# variant = "classic"
26+
custom_dir = "overrides"
27+
favicon = "assets/favicon.svg"
28+
language = "en"
29+
# System fonts only, so that a page view makes no request to Google Fonts.
30+
# https://zensical.org/docs/setup/fonts/#autoloading
31+
font = false
32+
features = [
33+
"announce.dismiss",
34+
"content.action.edit",
35+
"content.action.view",
36+
"content.code.annotate",
37+
"content.code.copy",
38+
"content.code.select",
39+
"content.footnote.tooltips",
40+
"content.tabs.link",
41+
"content.tooltips",
42+
# "header.autohide",
43+
# "navigation.expand",
44+
"navigation.footer",
45+
"navigation.indexes",
46+
"navigation.instant",
47+
"navigation.instant.prefetch",
48+
# "navigation.instant.progress",
49+
"navigation.path",
50+
# "navigation.prune",
51+
"navigation.sections",
52+
# "navigation.tabs",
53+
# "navigation.tabs.sticky",
54+
"navigation.top",
55+
"navigation.tracking",
56+
"search.highlight",
57+
# "toc.follow",
58+
# "toc.integrate",
59+
]
60+
61+
# logo = "assets/logo.png"
62+
63+
# The project mark, inlined from overrides/.icons so it inherits the header colour in both schemes.
64+
# https://zensical.org/docs/setup/logo-and-icons/#additional-icons
65+
[project.theme.icon]
66+
logo = "ojf/logo"
67+
repo = "fontawesome/brands/github"
68+
69+
[[project.theme.palette]]
70+
media = "(prefers-color-scheme)"
71+
toggle.icon = "lucide/sun-moon"
72+
toggle.name = "Switch to light mode"
73+
74+
[[project.theme.palette]]
75+
media = "(prefers-color-scheme: light)"
76+
scheme = "default"
77+
toggle.icon = "lucide/sun"
78+
toggle.name = "Switch to dark mode"
79+
80+
[[project.theme.palette]]
81+
media = "(prefers-color-scheme: dark)"
82+
scheme = "slate"
83+
toggle.icon = "lucide/moon"
84+
toggle.name = "Switch to system preference"
85+
86+
# [[project.extra.social]]
87+
# icon = "fontawesome/brands/github"
88+
# link = "https://github.com/user/repo"
89+
90+
# [[project.extra.social]]
91+
# icon = "fontawesome/brands/mastodon"
92+
# link = "https://fosstodon.org/@user"
93+
94+
[project.markdown_extensions]
95+
abbr = {}
96+
admonition = {}
97+
attr_list = {}
98+
def_list = {}
99+
footnotes = {}
100+
md_in_html = {}
101+
toc.permalink = true
102+
pymdownx.arithmatex.generic = true
103+
pymdownx.betterem = {}
104+
pymdownx.caret = {}
105+
pymdownx.details = {}
106+
pymdownx.emoji.emoji_generator = "zensical.extensions.emoji.to_svg"
107+
pymdownx.emoji.emoji_index = "zensical.extensions.emoji.twemoji"
108+
pymdownx.highlight.anchor_linenums = true
109+
pymdownx.highlight.line_spans = "__span"
110+
pymdownx.highlight.pygments_lang_class = true
111+
pymdownx.inlinehilite = {}
112+
pymdownx.keys = {}
113+
pymdownx.magiclink = {}
114+
pymdownx.mark = {}
115+
pymdownx.smartsymbols = {}
116+
# pymdownx.snippets.base_path = "includes"
117+
pymdownx.superfences.custom_fences = [
118+
{ name = "mermaid", class = "mermaid", format = "pymdownx.superfences.fence_code_format" },
119+
]
120+
pymdownx.tabbed.alternate_style = true
121+
pymdownx.tabbed.combine_header_slug = true
122+
pymdownx.tasklist.custom_checkbox = true
123+
pymdownx.tilde = {}

0 commit comments

Comments
 (0)