Skip to content

Commit

Permalink
add the script guide to the contributor guide
Browse files Browse the repository at this point in the history
  • Loading branch information
nicecui committed Jul 10, 2024
1 parent 5be7a0a commit 99d47d2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
33 changes: 23 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to GreptimeDB Docs

## File Structure
## File structure

This project uses markdown files to generate a documentation website.
All markdown files are located in the `docs` directory.
Expand All @@ -11,27 +11,40 @@ For example, `/docs/v0.4` contains the documentation for GreptimeDB v0.4.
It should match the current document structure.
You need to use `-` and lowercase letters in markdown file names so that `summary.yml` can recognize these file names.

### Document Localization
### Document localization

- The localized documentation is located in the `/docs/xx` directory, where `xx` is the language code.
- The `summary-i18n.yml` file in the `/docs/xx` directory defines the navigation of the localized documentation website.
The content in `summary-i18n.yml` should be the localized name of the relative directory.
If you add a new directory in `/docs/xx`, remember to update `summary-i18n.yml`.

## Links
### Links

- Use relative paths for internal links whenever possible.
- Reference files placed in `public` using root absolute path - for example, `public/icon.png` should always be referenced in source code as `/icon.png`.

## Style Guide
## Write documentation

### Update `df-functions.md`

Use the following command to generate `/en/reference/sql/functions/df-functions.md`:

```shell
ruby misc/update_functions.rb [nightly | v0.x]
```

Then copy the English content to the corresponding localized file and translate it.

## Style guide

### Image style

Please use [`example.drawio.svg`](docs/example.drawio.svg) as a template for drawing diagrams.
You can install the Draw.io Integration for VS Code and create a new diagram from the template.

If there is no suitable graphics, you can use other graphics,
but the colors should be consistent with the template.

## Markdown Lint
### Markdown lint

We use [markdownlint-cli](https://github.com/DavidAnson/markdownlint) to check
format of markdown files. You can do it locally with:
Expand All @@ -55,7 +68,7 @@ pnpm run dev

You can also use `pnpm run build` to check dead links.

### Preview the Localized documentation
### Preview the localized documentation

To preview the documentation in a specific language,
add a new file called `.env` to the root directory and include the `VITE_LANG=xx` environment variable,
Expand All @@ -68,7 +81,7 @@ VITE_LANG=zh

Then start a local server with `pnpm run dev`.

## PR Title Check
## PR title check

We use [action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) to ensure that PR titles follow the [Conventional Commits](https://www.conventionalcommits.org/) specification.

We require pull request title to start with [these
keywords](https://github.com/GreptimeTeam/docs/blob/main/.github/pr-title-checker-config.json#L7C1-L7C1)
6 changes: 3 additions & 3 deletions docs/misc/update_functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def fix_links(line)


File.open("temp.md", "w") do |f|
f.puts("# DataFusion Functions")
f.puts("# DataFusion Functions\n\n")
f.puts("This page is generated from the Apache DataFusion project's documents:")

for doc in datafusion_functions
Expand Down Expand Up @@ -75,6 +75,6 @@ def fix_links(line)

target = ARGV[0] || "nightly"

File.rename "temp.md", "#{target}/en/reference/sql/df-functions.md"
File.rename "temp.md", "#{target}/en/reference/sql/functions/df-functions.md"

puts "#{target}/en/reference/sql/df-functions.md updated!"
puts "#{target}/en/reference/sql/functions/df-functions.md updated!"
1 change: 1 addition & 0 deletions docs/nightly/en/reference/sql/functions/df-functions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# DataFusion Functions

This page is generated from the Apache DataFusion project's documents:
* [DataFusion Scalar Functions](https://raw.githubusercontent.com/apache/datafusion/main/docs/source/user-guide/sql/scalar_functions.md)
* [DataFusion Aggregate Functions](https://raw.githubusercontent.com/apache/datafusion/main/docs/source/user-guide/sql/aggregate_functions.md)
Expand Down

0 comments on commit 99d47d2

Please sign in to comment.