|
1 | 1 | # Generating documentation from source code
|
2 | 2 |
|
3 | 3 | A [script in our docs repo](https://github.com/ClickHouse/clickhouse-docs/blob/main/scripts/settings/autogenerate-settings.sh)
|
4 |
| -extracts setting names, descriptions, default values, etc. from ClickHouse's source code. |
| 4 | +is used to run SQL queries which generate markdown documentation from the system tables in ClickHouse and insert it |
| 5 | +into the appropriate pages before build time of the docs. |
5 | 6 |
|
6 | 7 | ## Session settings
|
7 | 8 |
|
8 | 9 | Documentation for session settings is autogenerated from source file [`src/Core/Settings.cpp`](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).
|
| 10 | +[SQL](../scripts/settings/session-settings.sql) |
9 | 11 |
|
10 | 12 | ## Format settings
|
11 | 13 |
|
12 | 14 | Documentation for session settings is autogenerated from source file [`src/Core/FormatFactorySettings.h`](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/FormatFactorySettings.h).
|
| 15 | +[SQL](../scripts/settings/format-settings.sql) |
13 | 16 |
|
14 | 17 | ## Server settings
|
15 | 18 |
|
@@ -43,14 +46,33 @@ If it is, then please edit the setting description in the source code documentat
|
43 | 46 | in [`ServerSettings.cpp`](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/ServerSettings.cpp)
|
44 | 47 | or else edit `_server_settings_outside_source.md`.**
|
45 | 48 |
|
| 49 | +[SQL](../scripts/settings/global-server-settings.sql) |
| 50 | + |
46 | 51 | ## MergeTree settings
|
47 | 52 |
|
48 | 53 | Documentation for MergeTree settings is autogenerated from [MergeTreeSettings.cpp](https://github.com/ClickHouse/ClickHouse/blob/master/src/Storages/MergeTree/MergeTreeSettings.cpp)
|
49 | 54 |
|
| 55 | +[SQL](../scripts/settings/mergetree-settings.sql) |
| 56 | + |
50 | 57 | ## System tables
|
51 | 58 |
|
52 |
| -TO DO. ETA April. |
| 59 | +TO DO |
53 | 60 |
|
54 | 61 | ## Functions
|
55 | 62 |
|
56 |
| -TO DO. ETA April/May. |
| 63 | +Documentation for functions is autogenerated from the documentation in system tables (`system.functions`) which is |
| 64 | +registered along with the function registration in the C++ code. |
| 65 | + |
| 66 | +To add a new page: |
| 67 | +- add SQL to generate the markdown from system tables |
| 68 | +- update `autogenerate-settings.sh` in the section which specifies which markdown file contents to |
| 69 | + copy to which file in between the `<!--AUTOGENERATED_START-->` and `<!--AUTOGENERATED_END-->` |
| 70 | + |
| 71 | +The following pages are autogenerated from the source code for functions: |
| 72 | +- [Arithmetic](/sql-reference/functions/arithmetic-functions) ([SQL](../scripts/settings/arithmetic-functions.sql)) |
| 73 | +- [Arrays](/sql-reference/functions/array-functions) ([SQL](../scripts/settings/array-functions.sql)) |
| 74 | +- [Bit](/sql-reference/functions/bit-functions) ([SQL](../scripts/settings/bit-functions.sql)) |
| 75 | +- [Bitmap](/sql-reference/functions/bitmap-functions) ([SQL](../scripts/settings/bitmap-functions.sql)) |
| 76 | +- [Comparison](/sql-reference/functions/comparison-functions) ([SQL](../scripts/settings/comparison-functions.sql)) |
| 77 | +- [Conditional](/sql-reference/functions/conditional-functions) ([SQL](../scripts/settings/conditional-functions.sql)) |
| 78 | + |
0 commit comments