Skip to content
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

Docusaurus: README update #33849

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Changes from 1 commit
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
74 changes: 58 additions & 16 deletions docusaurus/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Documentation and Docusaurus

We use [docusaurus](https://docusaurus.io) for consistent process, in `Airbyte` **no website is generated**.
Functionally this is a very fancy **linter**

Running the build process will **check for broken links**, please read the output and address
any broken links that you are able to do.
We use [Docusaurus](https://docusaurus.io) to build Airbyte
natikgadzhi marked this conversation as resolved.
Show resolved Hide resolved
[documentation site](https://docs.airbyte.io) from documentation source files in Markdown, and lint
the source files. We host the resulting docs site on Vercel. It deploys automatically when any
changes get merged to `master`.

## Installation

For consistency across other Airbyte projects we use yarn (A Javascript based software package manager)
For consistency across other Airbyte projects we use yarn (A Javascript based software package
manager).

```bash
brew install yarn
Expand All @@ -18,26 +18,63 @@ yarn install
yarn build
```

At this point you will see any broken links that docusaurus was able to find.
`yarn build` will build Docusaurus site in `docusaurus/build` directory.

## Developing Locally

If you want to make changes to the documentation, you can run docusaurus locally in a way that would
listen to any source docs changes and live-reload them:

```bash
yarn start # any changes will automatically be reflected in your browser!
```

## Making Changes
All the content for docs.airbyte.com lives in the `/docs` directory in this repo. All files are
markdown. Make changes or add new files, and you should see them in your browser!
Copy link
Contributor

Choose a reason for hiding this comment

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

Caveat: adding new files and seeing them requires changing the sidebar (thanks for separating out the next section to make it clearer!), so you can't see this with yarn start. I believe if you need to change the sidebar, you have to run build again (unconfirmed)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mmmm, I'll double check!


## Changing Navigation Structure

If you have created any new files, be sure to add them manually to the table of contents found here
in [`sidebars.js`](https://github.com/airbytehq/airbyte/blob/master/docusaurus/sidebars.js)

## Contributing

We welcome documentation updates! If you'd like to contribute a change, please make sure to:

All the content for docs.airbyte.com lives in the `/docs` directory in this repo. All files are markdown. Make changes or add new files, and you should see them in your browser!
- Run `yarn build` and check that all build steps are successful.
- Push your changes into a pull request, and follow the PR template instructions.

If you have created any new files, be sure to add them manually to the table of contents found here in this [file](https://github.com/airbytehq/airbyte/blob/master/docusaurus/sidebars.js)
When you make a pull request, Vercel will automatically build a test instance of the full docs site
and link it in the pull request for review.

## Plugin Client Redirects
### Checking for broken links

Airbyte docs site checks link with Docusaurus at build time, and with an additional GitHub action
natikgadzhi marked this conversation as resolved.
Show resolved Hide resolved
periodically:

- Running the build process will **check for broken links**, please read the output and address any
broken links that you are able to do.
- [This GitHub Action](https://github.com/airbytehq/airbyte/blob/master/.github/workflows/doc-link-check.yml)
checks all links on Airbyte production docs site, and tells us if any of them are broken.

> [!NOTE] Docusaurus links checker only checks _relative_ links, and assumes that absolute links are
> fine. For that reason, if you're linking to another Airbyte documentation page, make it a relative
> link. I.e. `[link](/connector-development/overview.md)` instead of
> `[link](https://docs.airbyte.com/connector-development/)`. That way, if your link breaks in the
> future, it will be caught with `yarn build`.
natikgadzhi marked this conversation as resolved.
Show resolved Hide resolved

## Docusaurus Plusings We Use
natikgadzhi marked this conversation as resolved.
Show resolved Hide resolved

### Plugin Client Redirects

A silly name, but a useful plugin that adds redirect functionality to docusaurus
[Official documentation here](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-client-redirects)

You will need to edit [this docusaurus file](https://github.com/airbytehq/airbyte/blob/master/docusaurus/docusaurus.config.js#L22)
If you're proposing to move an existing documentation file or change it's name, please setup a
natikgadzhi marked this conversation as resolved.
Show resolved Hide resolved
redirect rule.

You will need to edit
[this docusaurus file](https://github.com/airbytehq/airbyte/blob/master/docusaurus/docusaurus.config.js#L22)

You will see a commented section the reads something like this

Expand All @@ -48,13 +85,18 @@ You will see a commented section the reads something like this
// },
```

Copy this section, replace the values, and [test it locally](locally_testing_docusaurus.md) by going to the
path you created a redirect for and checked to see that the address changes to your new one.
Copy this section, replace the values, and [test it locally](locally_testing_docusaurus.md) by going
to the path you created a redirect for and checked to see that the address changes to your new one.

_Note:_ Your path \*_needs_ a leading slash `/` to work

## Deploying Docs

We use Github Pages for hosting this docs website, and [Docusaurus](https://docusaurus.io/) as the docs framework. Any change to the `/docs` directory you make is deployed when you merge to your PR to the master branch automagically!
Airbyte docs live on Vercel. Any change to the `/docs` directory you make is deployed when you merge
to your PR to the master branch automagically!

The source code for the docs lives in the [airbyte monorepo's `docs/` directory](https://github.com/airbytehq/airbyte/tree/master/docs). Any changes to the `/docs` directory will be tested automatically in your PR. Be sure that you wait for the tests to pass before merging! If there are CI problems publishing your docs, you can run `tools/bin/deploy_docusaurus` locally - this is the publish script that CI runs.
The source code for the docs lives in the
[airbyte monorepo's `docs/` directory](https://github.com/airbytehq/airbyte/tree/master/docs). Any
changes to the `/docs` directory will be tested automatically in your PR. Be sure that you wait for
the tests to pass before merging! If there are CI problems publishing your docs, you can run
`tools/bin/deploy_docusaurus` locally - this is the publish script that CI runs.
Loading