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

✨ introduce docs #3458

Merged
merged 25 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
726fc39
implement landing
renardeinside Dec 19, 2024
8f68963
remove unused
renardeinside Dec 19, 2024
68bcc91
minor fixes
renardeinside Dec 19, 2024
ab55df3
remove unused imports
renardeinside Dec 20, 2024
bd41a3a
remove redundant doc
renardeinside Dec 20, 2024
b9fa477
add placeholder
renardeinside Dec 20, 2024
6d39f4f
Merge remote-tracking branch 'origin/main' into feat/add-docs
renardeinside Jan 13, 2025
dde2508
re-impl docs in docusaurus
renardeinside Jan 13, 2025
69fd794
fix readme
renardeinside Jan 13, 2025
5e91fda
minor fixes
renardeinside Jan 13, 2025
c596a38
merge commands into a single file
renardeinside Jan 13, 2025
3fee28e
improv links
renardeinside Jan 13, 2025
49b5ffb
add GH deploy pipeline
renardeinside Jan 16, 2025
fbe61e7
finalize new docs
renardeinside Jan 16, 2025
33305df
Merge remote-tracking branch 'origin/main' into feat/add-docs
renardeinside Jan 16, 2025
cfa0690
Update README.md
renardeinside Jan 20, 2025
42aee47
address comments
renardeinside Jan 20, 2025
083d35f
Merge remote-tracking branch 'origin/main' into feat/add-docs
renardeinside Jan 20, 2025
8dfaa1e
minor fixes in styling
renardeinside Jan 20, 2025
9b6b9e7
Merge remote-tracking branch 'origin/main' into feat/add-docs
renardeinside Jan 20, 2025
417fb21
Merge branch 'main' into feat/add-docs
gueniai Jan 21, 2025
a77d0e2
fix deployment process
renardeinside Jan 21, 2025
315d73b
add docs deployment instructions
renardeinside Jan 21, 2025
ec8b948
Merge remote-tracking branch 'origin/main' into feat/add-docs
renardeinside Jan 24, 2025
4544f9e
add search capability
renardeinside Jan 24, 2025
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
49 changes: 49 additions & 0 deletions .github/workflows/docs-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docs Release

on:
push:
tags:
- 'v*'

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
renardeinside marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ solacc:
hatch run python tests/integration/source_code/solacc.py

.PHONY: all clean dev lint fmt test integration coverage known solacc

docs-install:
yarn --cwd docs/ucx install

docs-serve:
yarn --cwd docs/ucx start

docs-build:
yarn --cwd docs/ucx build
2,365 changes: 19 additions & 2,346 deletions README.md

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions docs/ucx/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
20 changes: 14 additions & 6 deletions CONTRIBUTING.md → docs/ucx/docs/dev/contributing.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Contributing

import Admonition from '@theme/Admonition';

# Developer Guide

## First Principles

Expand Down Expand Up @@ -27,7 +30,7 @@ or specialized functionality unavailable in standard libraries.

## Adding entries to `known.json` file

When adding a new entry to the [`known.json` file](src/databricks/labs/ucx/source_code/known.json), ensure that the entry is unique and follows the correct format. The `known.json` file
When adding a new entry to the [`known.json` file](https://github.com/databrickslabs/ucx/blob/main/src/databricks/labs/ucx/source_code/known.json), ensure that the entry is unique and follows the correct format. The `known.json` file
stores information about known (in)compatibilities with Unity Catalog. The file speeds up static code analysis and prevents false positives.

1. load into virtual environment
Expand Down Expand Up @@ -214,7 +217,7 @@ with the [Python plugin (Community Edition)](https://plugins.jetbrains.com/plugi
IntelliJ CE, then it would work in PyCharm. Debugging capabilities are essential for troubleshooting and diagnosing issues during
development. Please make sure that your test setup allows for easy debugging by following best practices.

![debugging tests](docs/debugging-tests.gif)
![debugging tests](/img/debugging-tests.gif)

Adhering to these guidelines ensures that our integration tests are robust, efficient, and easily maintainable. This,
in turn, contributes to the overall reliability and quality of our software.
Expand Down Expand Up @@ -263,7 +266,7 @@ HATCH_PYTHON="$(which python3.10)" make clean dev test
```

Configure your IDE to use `.venv/bin/python` from the virtual environment when developing the project:
![IDE Setup](docs/hatch-intellij.gif)
![IDE Setup](/img/hatch-intellij.gif)


Verify installation with
Expand Down Expand Up @@ -403,6 +406,11 @@ $ python3.10 -m pip install hatch
$ make dev
$ make test
```
Note: Before performing a clean installation, deactivate the virtual environment and follow the commands given above.

Note: The initial `hatch env show` is just to list the environments managed by Hatch and is not needed.
<Admonition type="info" title="Deactivating the Virtual Environment">
Before performing a clean installation, deactivate the virtual environment and follow the commands given above.
</Admonition>

<Admonition type="note" title="Env command">
The initial `hatch env show` is just to list the environments managed by Hatch and is not needed.
</Admonition>
116 changes: 116 additions & 0 deletions docs/ucx/docs/dev/docs_authoring.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import Admonition from '@theme/Admonition';

# Authoring Documentation

This document provides guidelines for writing documentation for the UCX project.


## Tech Stack

The UCX documentation is built using [Docusaurus](https://docusaurus.io/), a modern static site generator. Docusaurus is a project of Facebook Open Source and is used by many open-source projects to build their documentation websites.
We also use [MDX](https://mdxjs.com/) to write markdown files that include JSX components. This allows us to write markdown files with embedded React components.
For styling, we use [Tailwind CSS](https://tailwindcss.com/), a utility-first CSS framework for rapidly building custom designs.

## Writing Documentation

Most of the documentation is written in markdown files with the `.mdx` extension.
The markdown files are located in the `docs` directory of the UCX project.

## Prerequisites

Before you start writing documentation, make sure you have the following tools installed on your machine:
- [Node.js](https://nodejs.org/en/)
- [Yarn](https://yarnpkg.com/)

On macOS, you can install Node.js and Yarn using [Homebrew](https://brew.sh/):

```bash
brew install node
npm install --global yarn
```


## Setup

To set up the documentation locally, follow these steps:

1. Clone the UCX repository
2. Run:

```bash
make docs-install
```

## Running the Documentation Locally

To run the documentation locally, use the following command:

```bash
make docs-serve
```

## Adding images

To add images to your documentation, place the image files in the `static/img` directory.

To include an image in your markdown file, use the following syntax:

```markdown
![Alt text](/img/image-name.png)
```

<Admonition type="tip" title="Tip" emoji="💡">
Images support zooming features out of the box.
</Admonition>

## Linking pages

It is **strongly** recommended to make all links absolute.
By doing so we ensure that it's easy to move files without losing links inside them.

To add an absolute link, use this syntax:

```md
[link text](/docs/folder/file_name)
```

Always start with `/docs`. The file extension `.md` or `.mdx` can be omitted.

To add an anchor to a specific heading, use this syntax:

```md
[link with anchor](/docs/folder/file_name#anchor)
```

After writing docs, run this command:

```
make docs-build
```

It will throw an error on any unresolved link.


## Content alignment and structure of folders

When writing documentation, make sure to align the content with the existing documentation.

The rule of thumb is:

<div className="text-red-700 p-4 dark:text-red-400 flex justify-center items-center">
<div className='max-w-screen-sm text-center text-balance'>
<div className="text-2xl font-bold font-mono text-balance">
Do not put any technical details in the main documentation.
</div>
<div className="text-lg font-mono">
All technical details should be kept in <code>/docs/dev/</code> section.
</div>
</div>
</div>

No need for:
- Source code links
- Deep technical details
- Implementation details

Or any other details that are not necessary for the **end-user**.
7 changes: 7 additions & 0 deletions docs/ucx/docs/dev/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
sidebar_position: 4
---

# Contributing to UCX

This section is for contributors to the UCX toolkit. It contains information on how to contribute to the toolkit, including how to submit issues, pull requests, and how to contribute to the documentation.
Loading
Loading