Skip to content

Commit 8e4fdbc

Browse files
committed
docs: initial files for static site on GitHub Pages
Extension has rich functionality, so it should have a good documentation so users can understand how to use it. For this documentation will be updated and stored in 'docs' directory. Also, there will be a static web-site in 'Read-the-docs' format hosted on GitHub Pages. This commit adds first pages with configuration file explaining.
1 parent 31f7bb8 commit 8e4fdbc

11 files changed

+60
-209
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,10 @@ dist
131131

132132
# Folder with test pg installation
133133
pgsrc/
134-
cache/
134+
cache/
135+
136+
# mkdocs site files
137+
site
138+
139+
# python
140+
.venv

docs/config_file.md renamed to docs/configuration.md

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
1-
# Configuration file
1+
# Configuration
22

3-
Extension has config file with custom settings - `.vscode/pgsql_hacker_helper.json`.
3+
Extension has multiple settings to customize different aspects.
4+
5+
## VS Code settings
6+
7+
There are 3 settings:
8+
9+
- `postgresql-hacker-helper.logLevel` - minimum log level (for old VS Code up to 1.74.0).
10+
11+
Minimum level of log messages. By default - `INFO`.
12+
If using VS Code 1.74.0 ang greater use `Output` channel logger settings.
413

5-
> For convenience, file [`properties.schema.json`](../properties.schema.json) contains JSON schema for configuration file.
14+
- `postgresql-hacker-helper.srcPath` - Path to source code directory
15+
16+
*Relative* path to custom PostgreSQL source code directory. Use it, if source
17+
code files are not in your workspace root (i.e. in `${workspaceFolder}/postgresql`).
18+
Used for searching files (node tag files, `pg_bsd_indent` and so on).
19+
If not specified search starts from workspace root.
20+
21+
- `postgresql-hacker-helper.pg_bsd_indentPath` - Path to `pg_bsd_indent`
22+
23+
Path to `pg_bsd_indent` tool. Required for formatting support. Use it if you have `pg_bsd_indent` installed globally or want to use specific version.
24+
25+
- If not specified, it will be searched in `*srcPath*/src/tools` directory.
26+
- If specified, and failed to run extension will try to build it.
27+
28+
## Configuration file
29+
30+
Extension has config file with custom settings - `.vscode/pgsql_hacker_helper.json`.
631

732
You can create file manually or using command `PgSQL: Open or create configuration file`. Json schema will assist you while editing.
833

934
Extension tracks changes in the file and rereads it, when necessary. Also, you can run `PgSQL: Refresh configuration file` command.
1035

1136
> NOTE: after debug session have started changes in configuration file will not be reflected.
1237
13-
## Arrays
38+
### Arrays
1439

1540
```json
1641
{
@@ -78,7 +103,7 @@ NOTES:
78103
1. You can refer to parent object using `{}`, i.e. `!{}->member1 + {}->member2` or the same in member form `member1 + {}->member2`.
79104
2. Expression can contain any other entries, i.e. for `PlannerInfo->simple_rel_array` expression is `simple_rel_array_size + 1`.
80105

81-
## Aliases (`typedef`)
106+
### Aliases (`typedef`)
82107

83108
```json
84109
{
@@ -113,7 +138,7 @@ For it you can use this entry:
113138
}
114139
```
115140

116-
## Custom `List *` pointer types
141+
### Custom `List *` pointer types
117142

118143
```json
119144
{
@@ -185,9 +210,9 @@ void do_work()
185210

186211
> As you can mention, configuration is generalized, because it's clear from context how to handle `parent`
187212
188-
## HashTable entries
213+
### HashTable entries
189214
190-
### `HTAB`
215+
#### `HTAB`
191216
192217
```json
193218
{
@@ -250,7 +275,7 @@ void do_work()
250275

251276
> You can notice that configuration entry schema is the same as for custom `List *` type.
252277
253-
### `_hash` - simplehash
278+
#### `_hash` - simplehash
254279

255280
```json
256281
{
@@ -298,7 +323,7 @@ Identifiers of structures and functions are derived from `prefix` and generated
298323
> NOTE: compiler can apply unused symbol stripping, so after compilation there can be no structures/functions for iteration.
299324
> In such situation, you should add some code that uses `PREFIX_iterator`, `PREFIX_start_iterate` and `PREFIX_iterate` (i.e. wrap such code with debug macros).
300325
301-
## Integer enum fields
326+
### Integer enum fields
302327

303328
```json
304329
{
@@ -372,7 +397,7 @@ void some_function(ParentType *parent)
372397
> NOTE: macro definitions are added to debug symbols only when using `-g3` level during compilation, otherwise debugger can not use macro names.
373398
> If debugger can not use macros it will switch to numeric values - that because numeric values are required.
374399
375-
## NodeTags
400+
### NodeTags
376401

377402
```json
378403
{
@@ -389,7 +414,7 @@ NodeTag values are required to find Node types. Extension ships with set of buil
389414
390415
Also, when debug session starts, extension will parse `nodetags.h` file to find new NodeTags. If it will find some, then extension will automatically add them to this list.
391416

392-
## Custom `typedefs.list`
417+
### Custom `typedefs.list`
393418

394419
```json
395420
{
@@ -404,7 +429,7 @@ For formatting `src/tools/pgindent` is used. It requires `typedefs.list` file fo
404429
`typedefs` setting contains list of `typedefs.list` files - each string is a path which can be in 2 forms:
405430

406431
- Absolute - specified file is used
407-
- Relative - file with base folder as [postgresql-hacker-helper.srcPath](../README.md#extension-settings) is used
432+
- Relative - file with base folder as [postgresql-hacker-helper.srcPath](#vs-code-settings) is used
408433

409434
Example:
410435

@@ -417,6 +442,6 @@ Example:
417442
}
418443
```
419444

420-
For convenience, if you will try to format file in contrib's directory, extension will try to detect `typedefs.list` in it without specifying it explicitly in configuration file.
445+
For convenience, if you will try to format file in contrib's directory, extension will try to detect `typedefs.list` in it without specifying it explicitly in configuration file. I.e. if you are formatting file `contrib/my_ext/my_ext.c`, then extension will probe `contrib/my_ext/typedefs.list`.
421446

422447
> There is handy command `PgSQL: Find custom typedefs.list in repository` that will execute shell command to find all `*typedefs.list` files in repository.

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# PostgreSQL Hacker Helper
2+
3+
This is a VS Code extension to assist PostgreSQL Hackers - source code developers.
4+
5+
## Table of contents
6+
7+
- [Configuration](./configuration.md)

docs/pg_variables.md

Lines changed: 0 additions & 194 deletions
This file was deleted.

mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
site_name: PostgreSQL Hacker Helper
2+
site_url: https://ashenBlade.github.io/postgres-dev-helper
3+
theme: readthedocs
4+
5+
nav:
6+
- Home: index.md
7+
- Configuration: configuration.md

resources/tutorial_array_sm.png

-65.4 KB
Binary file not shown.
-46.2 KB
Binary file not shown.
-59.9 KB
Binary file not shown.

resources/tutorial_oid_list.png

-50.8 KB
Binary file not shown.
-54 KB
Binary file not shown.

0 commit comments

Comments
 (0)