Skip to content

Commit 62ed51a

Browse files
authored
feat: add initial documentation website (#237)
1 parent 9fa0d15 commit 62ed51a

File tree

12 files changed

+583
-3
lines changed

12 files changed

+583
-3
lines changed

.asf.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222

2323
github:
2424
description: "Apache Iceberg C++"
25-
homepage: https://iceberg.apache.org/
25+
homepage: https://cpp.iceberg.apache.org/
2626
labels:
2727
- iceberg
2828
- apache
29+
- cpp
2930
enabled_merge_buttons:
3031
merge: false
3132
squash: true
@@ -47,6 +48,8 @@ github:
4748
- raulcd
4849
- wgtmac
4950
- zhjwpku
51+
ghp_branch: gh-pages
52+
ghp_path: /
5053

5154
notifications:
5255

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Release Docs"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'mkdocs/**'
9+
- 'src/**'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: false
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
docs:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v5
24+
with:
25+
fetch-depth: 1
26+
27+
- uses: actions/setup-python@v6
28+
with:
29+
python-version: '3.x'
30+
31+
- name: Install dependencies
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y doxygen
35+
make install-deps
36+
37+
- name: Build API documentation with Doxygen
38+
run: make build-api-docs
39+
40+
- name: Build docs
41+
run:
42+
make build-docs
43+
mkdir -p /tmp/site
44+
cp -r ./mkdocs/site/* /tmp/site/
45+
46+
- name: Deploy to gh-pages
47+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
48+
run: |
49+
git config --global user.name 'GitHub Actions'
50+
git config --global user.email '[email protected]'
51+
52+
git checkout --orphan gh-pages-tmp
53+
git rm --quiet -rf .
54+
cp -r /tmp/site/* .
55+
echo "cpp.iceberg.apache.org" > CNAME
56+
git add --all
57+
git commit -m "Publish docs from commit ${{ github.sha }}"
58+
git push -f origin gh-pages-tmp:gh-pages

Makefile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
.PHONY: help install-deps build-api-docs build-docs clean-docs serve-docs
19+
20+
help:
21+
@echo "Available targets:"
22+
@echo " install-deps - Install Python dependencies"
23+
@echo " build-api-docs - Build API documentation with Doxygen"
24+
@echo " build-docs - Build MkDocs documentation"
25+
@echo " clean-docs - Clean documentation build artifacts"
26+
@echo " serve-docs - Serve documentation locally for development"
27+
@echo " all - Build all documentation"
28+
29+
install-deps:
30+
python -m pip install --upgrade pip
31+
pip install -r requirements.txt
32+
33+
build-api-docs:
34+
cd mkdocs && \
35+
mkdir -p docs/api && \
36+
doxygen Doxyfile && \
37+
echo "Doxygen output created in docs/api/"
38+
39+
build-docs:
40+
cd mkdocs && \
41+
mkdocs build --clean && \
42+
echo "MkDocs site built in site/"
43+
44+
clean-docs:
45+
rm -rf mkdocs/site
46+
rm -rf mkdocs/docs/api
47+
48+
serve-docs:
49+
cd mkdocs && mkdocs serve
50+
51+
all: build-api-docs build-docs

mkdocs/CNAME

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
cpp.iceberg.apache.org

docs/Doxyfile renamed to mkdocs/Doxyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ PROJECT_ICON =
9191
# entered, it will be relative to the location where doxygen was started. If
9292
# left blank the current directory will be used.
9393

94-
OUTPUT_DIRECTORY = build
94+
OUTPUT_DIRECTORY = docs/api
9595

9696
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
9797
# sub-directories (in 2 levels) under the output directory of each output format
@@ -1315,7 +1315,7 @@ GENERATE_HTML = YES
13151315
# The default directory is: html.
13161316
# This tag requires that the tag GENERATE_HTML is set to YES.
13171317

1318-
HTML_OUTPUT = html
1318+
HTML_OUTPUT = .
13191319

13201320
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
13211321
# generated HTML page (for example: .htm, .php, .asp).
File renamed without changes.

mkdocs/build-docs.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
set -e
21+
22+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
23+
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
24+
25+
cd "$PROJECT_ROOT"
26+
27+
echo "Building Iceberg C++ documentation..."
28+
echo "Working directory: $(pwd)"
29+
30+
if ! command -v mkdocs &> /dev/null; then
31+
echo "Error: mkdocs is not installed"
32+
exit 1
33+
fi
34+
35+
echo "Installing dependencies..."
36+
pip install mkdocs-material
37+
38+
# Check if doxygen is available
39+
if ! command -v doxygen &> /dev/null; then
40+
echo "Warning: doxygen is not installed, skipping API documentation generation"
41+
else
42+
echo "Building API documentation with Doxygen..."
43+
cd mkdocs
44+
mkdir -p docs/api
45+
doxygen Doxyfile
46+
cd ..
47+
fi
48+
49+
echo "Building MkDocs documentation..."
50+
cd mkdocs
51+
mkdocs build --clean
52+
53+
echo "Documentation build completed successfully!"
54+
echo "MkDocs site: docs/site/"
17.2 KB
Loading

0 commit comments

Comments
 (0)