|
1 |
| -[](https://app.netlify.com/sites/unruffled-blackwell-31bfb2/deploys) |
2 |
| -[](http://standardjs.com) |
3 |
| -[](https://github.com/prettier/prettier) |
4 |
| -[](https://conventionalcommits.org) |
5 |
| - |
6 |
| -# questdb.io |
| 1 | +# QuestDB Documentation |
7 | 2 |
|
8 | 3 | Uses [Docusaurus](https://docusaurus.io/).
|
9 | 4 |
|
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 | +``` |
13 | 13 |
|
14 |
| -## Installation |
| 14 | +Next, install dependencies: |
15 | 15 |
|
16 | 16 | ```script
|
17 | 17 | yarn
|
18 | 18 | ```
|
19 | 19 |
|
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. |
23 | 27 |
|
24 |
| -## Documentation submodule |
| 28 | +## Contributing |
25 | 29 |
|
26 |
| -Documentation is [hosted in a public repo](https://github.com/questdb/documentation/). |
| 30 | +You'll need to sign a quick CLA. |
27 | 31 |
|
28 |
| -It is pulled in via a submodule. |
| 32 | +Pretty standard, [check it out](https://cla-assistant.io/questdb/documentation). |
29 | 33 |
|
30 |
| -If writing documentation, clone the repo, enter the submodule, then: |
| 34 | +This is done on PR creation. |
31 | 35 |
|
32 |
| -```shell |
33 |
| -git submodule init |
34 |
| -git submodule update --remote --merge |
35 |
| -``` |
| 36 | +### Creating PRs |
36 | 37 |
|
37 |
| -This will get you up-to-date! |
| 38 | +First create a new branch. |
38 | 39 |
|
39 |
| -Changes made within this documentation submodule are committed to the public repo. |
| 40 | +Locally, ensure your changes look good. |
40 | 41 |
|
41 |
| -Recommended flow is then: |
| 42 | +Then push your branch to GitHub and create a PR. |
42 | 43 |
|
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. |
49 | 45 |
|
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. |
51 | 47 |
|
52 |
| -## Local development |
| 48 | +Once it looks good, we'll merge! |
53 | 49 |
|
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 | +$$ |
56 | 70 | ```
|
57 | 71 |
|
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 |
60 | 73 |
|
61 |
| -## Build for production |
| 74 | +Create diagrams using Mermaid syntax in code blocks: |
62 | 75 |
|
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] |
65 | 83 | ```
|
66 | 84 |
|
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 |
70 | 86 |
|
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; |
73 | 95 | ```
|
74 | 96 |
|
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 |
76 | 130 |
|
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. |
79 | 132 |
|
80 | 133 | ## Linting
|
81 | 134 |
|
|
0 commit comments