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
67 changes: 48 additions & 19 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,57 @@
# How to Contribute
# Contributing to Java Operator SDK Documentation

We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.
Thank you for your interest in improving the Java Operator SDK documentation! We welcome contributions from the community and appreciate your help in making our documentation better.

## Contributor License Agreement
## How to Contribute

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.
### Getting Started

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.
1. **Fork the repository** and clone your fork locally
2. **Create a new branch** for your changes
3. **Make your improvements** to the documentation
4. **Test your changes** locally using `hugo server`
5. **Submit a pull request** with a clear description of your changes

## Code reviews
### Types of Contributions

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.
We welcome various types of contributions:

- **Content improvements**: Fix typos, clarify explanations, add examples
- **New documentation**: Add missing sections or entirely new guides
- **Structural improvements**: Better organization, navigation, or formatting
- **Translation**: Help translate documentation to other languages

## Guidelines

### Writing Style

- Use clear, concise language
- Write in active voice when possible
- Define technical terms when first used
- Include practical examples where helpful
- Keep sentences and paragraphs reasonably short

### Technical Requirements

- Test all code examples to ensure they work
- Use proper markdown formatting
- Follow existing documentation structure and conventions
- Ensure links work and point to current resources

## Legal Requirements

### Contributor License Agreement

All contributions must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; the CLA simply gives us permission to use and redistribute your contributions as part of the project.

Visit <https://cla.developers.google.com/> to see your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one (even for a different project), you probably don't need to do it again.

### Code Review Process

All submissions, including those by project members, require review. We use GitHub pull requests for this purpose. Please consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using pull requests.

## Community Guidelines

This project follows
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
This project follows [Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
196 changes: 44 additions & 152 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,190 +1,82 @@
# JOSDK comments:
# Java Operator SDK Documentation

see: sample github action: https://gohugo.io/hosting-and-deployment/hosting-on-github/
This repository contains the documentation website for the Java Operator SDK (JOSDK), built using Hugo and the Docsy theme.

currently use hugo version v0.125.7
## About Java Operator SDK

# Docsy Example
Java Operator SDK is a framework that makes it easy to build Kubernetes operators in Java. It provides APIs designed to feel natural to Java developers and handles common operator challenges automatically, allowing you to focus on your business logic.

[Docsy][] is a [Hugo theme module][] for technical documentation sites, providing easy
site navigation, structure, and more. This **Docsy Example Project** uses the Docsy
theme component as a hugo module and provides a skeleton documentation structure for you to use.
You can clone/copy this project and edit it with your own content, or use it as an example.
## Development Setup

In this project, the Docsy theme is pulled in as a Hugo module, together with
its dependencies:
This documentation site uses Hugo v0.125.7 with the Docsy theme.

```console
$ hugo mod graph
...
```

For Docsy documentation, see [Docsy user guide][].

This Docsy Example Project is hosted on [Netlify][] at [example.docsy.dev][].
You can view deploy logs from the [deploy section of the project's Netlify
dashboard][deploys], or this [alternate dashboard][].

This is not an officially supported Google product. This project is currently maintained.

## Using the Docsy Example Project as a template

A simple way to get started is to use this project as a template, which gives you a site project that is set up and ready to use. To do this:

1. Use the dropdown for switching branches/tags to change to the **latest** released tag.

2. Click **Use this template**.

3. Select a name for your new project and click **Create repository from template**.

4. Make your own local working copy of your new repo using git clone, replacing https://github.com/me/example.git with your repo’s web URL:

```bash
git clone --depth 1 https://github.com/me/example.git
```
## Prerequisites

You can now edit your own versions of the site’s source files.
- Hugo v0.125.7 or later (extended version required)
- Node.js and npm (for PostCSS processing)
- Git

If you want to do SCSS edits and want to publish these, you need to install `PostCSS`
## Local Development

```bash
npm install
```

## Running the website locally

Building and running the site locally requires a recent `extended` version of [Hugo](https://gohugo.io).
You can find out more about how to install Hugo for your environment in our
[Getting started](https://www.docsy.dev/docs/getting-started/#prerequisites-and-installation) guide.

Once you've made your working copy of the site repo, from the repo root folder, run:

```bash
hugo server
```
### Quick Start

## Running a container locally
1. Clone this repository
2. Install dependencies:
```bash
npm install
```
3. Start the development server:
```bash
hugo server
```
4. Open your browser to `http://localhost:1313`

You can run docsy-example inside a [Docker](https://docs.docker.com/)
container, the container runs with a volume bound to the `docsy-example`
folder. This approach doesn't require you to install any dependencies other
than [Docker Desktop](https://www.docker.com/products/docker-desktop) on
Windows and Mac, and [Docker Compose](https://docs.docker.com/compose/install/)
on Linux.
### Using Docker

1. Build the docker image
You can also run the documentation site using Docker:

1. Build the container:
```bash
docker-compose build
```

1. Run the built image

2. Run the container:
```bash
docker-compose up
```
> **Note**: You can combine both commands with `docker-compose up --build`

> NOTE: You can run both commands at once with `docker-compose up --build`.
3. Access the site at `http://localhost:1313`

1. Verify that the service is working.

Open your web browser and type `http://localhost:1313` in your navigation bar,
This opens a local instance of the docsy-example homepage. You can now make
changes to the docsy example and those changes will immediately show up in your
browser after you save.

### Cleanup

To stop Docker Compose, on your terminal window, press **Ctrl + C**.

To remove the produced images run:
To stop the container, press **Ctrl + C** in your terminal.

To clean up Docker resources:
```bash
docker-compose rm
```
For more information see the [Docker Compose documentation][].

## Using a local Docsy clone

Make sure your installed go version is `1.18` or higher.

Clone the latest version of the docsy theme into the parent folder of your project. The newly created repo should now reside in a sibling folder of your site's root folder.

```shell
cd root-of-your-site
git clone --branch v0.7.2 https://github.com/google/docsy.git ../docsy
```

Now run:

```shell
HUGO_MODULE_WORKSPACE=docsy.work hugo server --ignoreVendorPaths "**"
```

or, when using npm, prepend `local` to the script you want to invoke, e.g.:

```shell
npm run local serve
```

By using the `HUGO_MODULE_WORKSPACE` directive (either directly or via prefix `local` when using npm), the server now watches all files and directories inside the sibling directory `../docsy` , too. Any changes inside the local `docsy` theme clone are now immediately picked up (hot reload), you can instantly see the effect of your local edits.

In the command above, we used the environment variable `HUGO_MODULE_WORKSPACE` to tell hugo about the local workspace file `docsy.work`. Alternatively, you can declare the workspace file inside your settings file `hugo.toml`:

```toml
[module]
workspace = "docsy.work"
```
## Contributing

Your project's `hugo.toml` file already contains these lines, the directive for workspace assignment is commented out, however. Remove the two trailing comment characters '//' so that this line takes effect.
We welcome contributions to improve the documentation! Please see our [contribution guidelines](CONTRIBUTING.md) for details on how to get started.

## Troubleshooting

As you run the website locally, you may run into the following error:

```console
$ hugo server
WARN 2023/06/27 16:59:06 Module "project" is not compatible with this Hugo version; run "hugo mod graph" for more information.
Start building sites …
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
Error: Error building site: "C:\Users\foo\path\to\docsy-example\content\en\_index.md:5:1": failed to extract shortcode: template for shortcode "blocks/cover" not found
Built in 27 ms
```

This error occurs if you are running an outdated version of Hugo. As of docsy theme version `v0.7.0`, hugo version `0.110.0` or higher is required.
See this [section](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-hugo) of the user guide for instructions on how to install Hugo.

Or you may be confronted with the following error:

### Module Compatibility Error
If you see an error about module compatibility, ensure you're using Hugo v0.110.0 or higher:
```console
$ hugo server

INFO 2021/01/21 21:07:55 Using config file:
Building sites … INFO 2021/01/21 21:07:55 syncing static files to /
Built in 288 ms
Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): resource "scss/scss/main.scss_9fadf33d895a46083cdd64396b57ef68" not found in file cache
Error: Error building site: failed to extract shortcode: template for shortcode "blocks/cover" not found
```

This error occurs if you have not installed the extended version of Hugo.
See this [section](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-hugo) of the user guide for instructions on how to install Hugo.

Or you may encounter the following error:

### SCSS Processing Error
If you encounter SCSS-related errors, make sure you have the extended version of Hugo installed:
```console
$ hugo server

Error: failed to download modules: binary with name "go" not found
Error: TOCSS: failed to transform "scss/main.scss"
```

This error occurs if you have not installed the `go` programming language on your system.
See this [section](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-go-language) of the user guide for instructions on how to install `go`.
### Go Binary Not Found
If you see "binary with name 'go' not found", install the Go programming language from [golang.org](https://golang.org).

## Links

[alternate dashboard]: https://app.netlify.com/sites/goldydocs/deploys
[deploys]: https://app.netlify.com/sites/docsy-example/deploys
[Docsy user guide]: https://docsy.dev/docs
[Docsy]: https://github.com/google/docsy
[example.docsy.dev]: https://example.docsy.dev
[Hugo theme module]: https://gohugo.io/hugo-modules/use-modules/#use-a-module-for-a-theme
[Netlify]: https://netlify.com
[Docker Compose documentation]: https://docs.docker.com/compose/gettingstarted/
- [Hugo Documentation](https://gohugo.io/documentation/)
- [Docsy Theme Documentation](https://www.docsy.dev/docs/)
- [Java Operator SDK GitHub Repository](https://github.com/operator-framework/java-operator-sdk)
2 changes: 0 additions & 2 deletions docs/content/en/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ linkTitle: Docs
menu: {main: {weight: 1}}
weight: 1
---


Loading