Skip to content

Commit

Permalink
README and build security (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
goodroot authored Nov 21, 2024
1 parent f1457fd commit 4874bf4
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 49 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@ name: Preview trigger
on:
pull_request:
types: ["opened", "edited", "synchronize"]
pull_request_target:
types: [labeled]

jobs:
pr-preview:
if: |
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'pull_request_target' && github.event.label.name == 'preview')
name: "PR preview"
runs-on: ubuntu-latest

steps:
- name: Checkout questdb.io repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -50,5 +57,4 @@ jobs:
Commit SHA: ${{ github.event.pull_request.head.sha }}
> :package: Build generates a preview & updates link on each commit.
comment_tag: execution
comment_tag: preview
147 changes: 100 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,134 @@
[![Netlify Status](https://api.netlify.com/api/v1/badges/8bf4638d-8f79-4cc4-9970-b47359eb1a35/deploy-status)](https://app.netlify.com/sites/unruffled-blackwell-31bfb2/deploys)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)
[![Code Style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-green.svg)](https://conventionalcommits.org)

# questdb.io
# QuestDB Documentation

Uses [Docusaurus](https://docusaurus.io/).

Pages & components are written in
TypeScript, the styles in vanilla CSS with variables using
[CSS Modules](https://github.com/css-modules/css-modules).
## Quick start

First, clone & enter the repo directory:

```shell
git clone [email protected]:questdb/documentation.git
cd documentation
```

## Installation
Next, install dependencies:

```script
yarn
```

Note. On Linux you may have to install `autoconf` package to have a successful
installation. On Ubuntu it should be enough to run
`sudo apt-get install autoconf` command to install the package.
```script
yarn start
```

This command starts a local development server and open up a browser window.

Most changes are reflected live without having to restart the server.

## Documentation submodule
## Contributing

Documentation is [hosted in a public repo](https://github.com/questdb/documentation/).
You'll need to sign a quick CLA.

It is pulled in via a submodule.
Pretty standard, [check it out](https://cla-assistant.io/questdb/documentation).

If writing documentation, clone the repo, enter the submodule, then:
This is done on PR creation.

```shell
git submodule init
git submodule update --remote --merge
```
### Creating PRs

This will get you up-to-date!
First create a new branch.

Changes made within this documentation submodule are committed to the public repo.
Locally, ensure your changes look good.

Recommended flow is then:
Then push your branch to GitHub and create a PR.

1. Enter the submodule & update it as per the above command.
2. Create a new branch within it
3. Make your changes, commit to that branch
4. Create PR for that branch in documentation repo
5. Confirm PR preview is OK when ready
6. Get approval & merge :tada:
We'll review the PR and generate a preview build.

Prod deploys & PR previews will update from `main` automatically.
A QuestDB member must add the `preview` label to your PR to deploy a preview build.

## Local development
Once it looks good, we'll merge!

```script
yarn start
### Enhancements, bugs, typos

We'd love your help!

Raise a [GH issue](https://github.com/questdb/documentation/issues/new/choose) or tackle a PR.

## Syntax

### Math Expressions

Use LaTeX-style math between `$` for inline or `$$` for block equations:

```
$$
text
Inline equation: $f(x) = x^2$
Block equation:
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$
```

This command starts a local development server and open up a browser window.
Most changes are reflected live without having to restart the server.
### Mermaid Diagrams

## Build for production
Create diagrams using Mermaid syntax in code blocks:

```script
yarn build
```mermaid
graph TD
A[Start] --> B{Is it?}
B -- Yes --> C[OK]
C --> D[Rethink]
D --> B
B -- No --> E[End]
```

This command generates static content into the `build` directory and can be
served using any static contents hosting service. For that purpose,
use:
### Syntax

```script
yarn serve
Syntax highlighting for many languages, including QuestDB SQL:

```questdb-sql
questdb-sql
SELECT
FROM trades
WHERE timestamp > dateadd('d', -1, now())
SAMPLE BY 1h;
```

## Bugs and features
### Admonitions

Use special callouts for important information:

```
:::note
This is a note
:::
:::tip
This is a tip
:::
:::info
This is info
:::
:::warning
This is a warning
:::
:::danger
This is a danger warning
:::
```

### Components

Special React components available:

- `<RemoteRepoExample />`: Include code examples from other QuestDB repos
- `<TabItem />`: Create tabbed content sections
- `<Tabs />`: Container for tab items

Raise a [GH issue](https://github.com/questdb/questdb.io/issues/new/choose) for
bug report, update request, or tutorial proposal using the respective template.
See examples in the documentation source files.

## Linting

Expand Down

0 comments on commit 4874bf4

Please sign in to comment.