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
13 changes: 12 additions & 1 deletion site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ The static Iceberg site pages are Markdown files that live at `/site/docs/*.md`.
```
### Building the versioned docs

The Iceberg versioned docs are committed in the [orphan `docs` branch](https://github.com/apache/iceberg/tree/docs) and mounted using [git worktree](https://git-scm.com/docs/git-worktree) at build time. The `docs` branch contains the versioned documenation source files at the root. These versions are mounted at the `/site/docs/docs/<version>` directory at build time. The `latest` version, is a soft link to the most recent [semver version](https://semver.org/) in the `docs` branch. There is also an [orphan `javadoc` branch](https://github.com/apache/iceberg/tree/javadoc) that contains prior staticly generated versions of the javadocs mounted at `/site/docs/javadoc/<version>` during build time.
The Iceberg versioned docs are committed in two [orphan](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeforphanaorphan) branches and mounted using [git worktree](https://git-scm.com/docs/git-worktree) at build time:

1. [`docs`](https://github.com/apache/iceberg/tree/docs) - contains the state of the documenation source files (`/docs`) during release. These versions are mounted at the `/site/docs/docs/<version>` directory at build time.
1. [`javadoc`](https://github.com/apache/iceberg/tree/javadoc) - contains prior statically generated versions of the javadocs mounted at `/site/docs/javadoc/<version>` directory at build time.
Copy link
Member

Choose a reason for hiding this comment

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

1 -> 2

Copy link
Member

Choose a reason for hiding this comment

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

nit: extra space before build time

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

1 -> 2

I prefer the markdown convention of using 1 all the time. This still renders ascending numbers in the output, and doesn't require updates to numbered lists to be of concern during reviews and when updating the docs.


The `latest` version, is a soft link to the most recent [semver version](https://semver.org/) in the `docs` branch. The `nightly` version, is a soft link to the current local state of the `/docs` markdown files.

The docs are built, run, and released using [make](https://www.gnu.org/software/make/manual/make.html). The [Makefile](Makefile) and the [common shell script](dev/common.sh) support the following command:

Expand All @@ -84,11 +89,13 @@ This step will generate the staged source code which blends into the original so
./site/
└── docs
   ├── docs
   │ ├── nightly (symlink to /docs/)
   │ ├── latest (symlink to /site/docs/1.4.0/)
   │ ├── 1.4.0
   │ ├── 1.3.1
   │   └── ...
├── javadoc
   │ ├── nightly (currently points to latest)
   │ ├── latest
   │ ├── 1.4.0
   │ ├── 1.3.1
Expand Down Expand Up @@ -143,13 +150,17 @@ As mentioned in the MkDocs section, when you build MkDocs `mkdocs build`, MkDocs
./site/
├── docs
│   ├── docs
│   │   ├── nightly
│   │   │ ├── docs
│   │   │ └── mkdocs.yml
│   │   ├── latest
│   │   │ ├── docs
│   │   │ └── mkdocs.yml
│   │   └── 1.4.0
│   │   ├── docs
│   │ └── mkdocs.yml
│   └─ javadoc
│   ├── nightly
│   ├── latest
│   └── 1.4.0
└── mkdocs.yml
Expand Down
26 changes: 25 additions & 1 deletion site/dev/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,26 @@ assert_not_empty () {
fi
}

# Creates a 'nightly' version of the documentation that points to the current versioned docs
# located at the root-level `/docs` directory.
create_nightly () {
echo " --> create nightly"

# Remove any existing 'nightly' directory and recreate it
rm -rf docs/docs/nightly/
Copy link
Member

Choose a reason for hiding this comment

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

Why is nightly not a symlink?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Both nightly and latest both symlink the relevant docs directory, and copy the mkdocs.yml to update 1.5.0 to latest and similar with nightly.

/site/docs/docs/
            |
            |_nightly 
            |   |
            |   |_docs --symlink-->  /docs/docs/
            |   |_mkdocs.yaml (cp from /docs/docs/mkdocs.yaml & updated to "nightly")
            |
            |_latest
            |   |
            |   |_docs --symlink-->  ../1.5.0/docs/
            |   |_mkdocs.yaml (cp from ../1.5.0/mkdocs.yaml & updated to "latest")
            |
            |_1.5.0
            |
            |_<older_versions>

mkdir docs/docs/nightly/

# Create symbolic links and copy configuration files for the 'nightly' documentation
ln -s "../../../../docs/docs/" docs/docs/nightly/docs
Copy link
Contributor

Choose a reason for hiding this comment

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

I verified that this works locally, but will this work on the docs branch?

cp "../docs/mkdocs.yml" docs/docs/nightly/
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make this a symlink as well? Otherwise you won't see changes made to the navigation


cd docs/docs/

# Update version information within the 'nightly' documentation
update_version "nightly"
cd -
}

# Finds and retrieves the latest version of the documentation based on the directory structure.
# Assumes the documentation versions are numeric folders within 'docs/docs/'.
get_latest_version () {
Expand Down Expand Up @@ -189,6 +209,9 @@ pull_versioned_docs () {

# Create the 'latest' version of documentation
create_latest "${latest_version}"

# Create the 'nightly' version of documentation
create_nightly
}

# Cleans up artifacts and temporary files generated during documentation management.
Expand All @@ -198,8 +221,9 @@ clean () {
# Temporarily disable script exit on errors to ensure cleanup continues
set +e

# Remove 'latest' directories and related Git worktrees
# Remove temp directories and related Git worktrees
rm -rf docs/docs/latest &> /dev/null
rm -rf docs/docs/nightly &> /dev/null

git worktree remove docs/docs &> /dev/null
git worktree remove docs/javadoc &> /dev/null
Expand Down
1 change: 1 addition & 0 deletions site/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ nav:
- Spark: spark-quickstart.md
- Hive: hive-quickstart.md
- Docs:
- nightly: '!include docs/docs/nightly/mkdocs.yml'
Copy link
Member

Choose a reason for hiding this comment

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

nightly and latest look similar and a bit confusing. I think we can merge latest and 1.5.0 to 1.5.0 (latest) or 1.5.0 (stable).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm open to it, I think this was what we went with in the last discussion, but happy to bring this up. See here: #9943 (comment)

CC: @danielcweeks @RussellSpitzer any thoughts here?

Copy link
Contributor

Choose a reason for hiding this comment

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

The label isn't what matters the most. What we care about are docs under docs/latest/... URLs. We can't really combine those with, for example, the 1.5.0 docs because we want to have the ability to permalink to a specific version if that's what you're viewing.

- latest: '!include docs/docs/latest/mkdocs.yml'
- 1.5.0: '!include docs/docs/1.5.0/mkdocs.yml'
- 1.4.3: '!include docs/docs/1.4.3/mkdocs.yml'
Expand Down