Skip to content

Commit 4874bf4

Browse files
authored
README and build security (#77)
1 parent f1457fd commit 4874bf4

File tree

2 files changed

+108
-49
lines changed

2 files changed

+108
-49
lines changed

.github/workflows/preview.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,22 @@ name: Preview trigger
33
on:
44
pull_request:
55
types: ["opened", "edited", "synchronize"]
6+
pull_request_target:
7+
types: [labeled]
68

79
jobs:
810
pr-preview:
11+
if: |
12+
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
13+
(github.event_name == 'pull_request_target' && github.event.label.name == 'preview')
914
name: "PR preview"
1015
runs-on: ubuntu-latest
1116

1217
steps:
1318
- name: Checkout questdb.io repository
1419
uses: actions/checkout@v3
20+
with:
21+
ref: ${{ github.event.pull_request.head.sha }}
1522

1623
- name: Setup Node.js
1724
uses: actions/setup-node@v3
@@ -50,5 +57,4 @@ jobs:
5057
Commit SHA: ${{ github.event.pull_request.head.sha }}
5158
5259
> :package: Build generates a preview & updates link on each commit.
53-
54-
comment_tag: execution
60+
comment_tag: preview

README.md

Lines changed: 100 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,134 @@
1-
[![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)
2-
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)
3-
[![Code Style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
4-
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-green.svg)](https://conventionalcommits.org)
5-
6-
# questdb.io
1+
# QuestDB Documentation
72

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

10-
Pages & components are written in
11-
TypeScript, the styles in vanilla CSS with variables using
12-
[CSS Modules](https://github.com/css-modules/css-modules).
5+
## Quick start
6+
7+
First, clone & enter the repo directory:
8+
9+
```shell
10+
git clone [email protected]:questdb/documentation.git
11+
cd documentation
12+
```
1313

14-
## Installation
14+
Next, install dependencies:
1515

1616
```script
1717
yarn
1818
```
1919

20-
Note. On Linux you may have to install `autoconf` package to have a successful
21-
installation. On Ubuntu it should be enough to run
22-
`sudo apt-get install autoconf` command to install the package.
20+
```script
21+
yarn start
22+
```
23+
24+
This command starts a local development server and open up a browser window.
25+
26+
Most changes are reflected live without having to restart the server.
2327

24-
## Documentation submodule
28+
## Contributing
2529

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

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

30-
If writing documentation, clone the repo, enter the submodule, then:
34+
This is done on PR creation.
3135

32-
```shell
33-
git submodule init
34-
git submodule update --remote --merge
35-
```
36+
### Creating PRs
3637

37-
This will get you up-to-date!
38+
First create a new branch.
3839

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

41-
Recommended flow is then:
42+
Then push your branch to GitHub and create a PR.
4243

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

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

52-
## Local development
48+
Once it looks good, we'll merge!
5349

54-
```script
55-
yarn start
50+
### Enhancements, bugs, typos
51+
52+
We'd love your help!
53+
54+
Raise a [GH issue](https://github.com/questdb/documentation/issues/new/choose) or tackle a PR.
55+
56+
## Syntax
57+
58+
### Math Expressions
59+
60+
Use LaTeX-style math between `$` for inline or `$$` for block equations:
61+
62+
```
63+
$$
64+
text
65+
Inline equation: $f(x) = x^2$
66+
Block equation:
67+
$$
68+
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
69+
$$
5670
```
5771

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

61-
## Build for production
74+
Create diagrams using Mermaid syntax in code blocks:
6275

63-
```script
64-
yarn build
76+
```mermaid
77+
graph TD
78+
A[Start] --> B{Is it?}
79+
B -- Yes --> C[OK]
80+
C --> D[Rethink]
81+
D --> B
82+
B -- No --> E[End]
6583
```
6684

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

71-
```script
72-
yarn serve
87+
Syntax highlighting for many languages, including QuestDB SQL:
88+
89+
```questdb-sql
90+
questdb-sql
91+
SELECT
92+
FROM trades
93+
WHERE timestamp > dateadd('d', -1, now())
94+
SAMPLE BY 1h;
7395
```
7496

75-
## Bugs and features
97+
### Admonitions
98+
99+
Use special callouts for important information:
100+
101+
```
102+
:::note
103+
This is a note
104+
:::
105+
106+
:::tip
107+
This is a tip
108+
:::
109+
110+
:::info
111+
This is info
112+
:::
113+
114+
:::warning
115+
This is a warning
116+
:::
117+
118+
:::danger
119+
This is a danger warning
120+
:::
121+
```
122+
123+
### Components
124+
125+
Special React components available:
126+
127+
- `<RemoteRepoExample />`: Include code examples from other QuestDB repos
128+
- `<TabItem />`: Create tabbed content sections
129+
- `<Tabs />`: Container for tab items
76130

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

80133
## Linting
81134

0 commit comments

Comments
 (0)