Skip to content

Commit 5da79c6

Browse files
authored
Merge pull request #4555 from ClickHouse/Blargian-patch-776906
Update autogenerated-documentation-from-source.md
2 parents c31d64b + 80e7332 commit 5da79c6

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

contribute/autogenerated-documentation-from-source.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,16 @@ TO DO
6161
## Functions
6262

6363
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.
64+
registered along with the function registration in the C++ code. ([Example](https://github.com/ClickHouse/ClickHouse/blob/a0216c8120f00479f50237e41c897c2bf244e1ef/src/Functions/FunctionChar.cpp#L116-L158))
6565

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-->`
66+
This [script](https://github.com/ClickHouse/clickhouse-docs/blob/main/scripts/settings/autogenerate-settings.sh) is used to generate
67+
the markdown docs for functions.
7068

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))
69+
Adding a new page can be done by:
7870

71+
1. Adding the function [category](https://github.com/ClickHouse/ClickHouse/blob/85700c135ccad89d3651a7a92ca63bb989743ba6/src/Common/FunctionDocumentation.cpp#L222-L273) to the [list of function categories to generate](https://github.com/ClickHouse/clickhouse-docs/blob/c31d64bc5d71c6c3afc5b520dbb73386e303447b/scripts/settings/autogenerate-settings.sh#L253-L278).
72+
2. The docs are automatically generated for the categories defined above by [this SQL code](https://github.com/ClickHouse/clickhouse-docs/blob/main/scripts/settings/generate-functions.sql). It produces a temporary markdown file with convention: `category-functions.md`. If the category name contains spaces, e.g. "String Splitting" then the temporary file will be `string_splitting-functions.md`.
73+
3. Register the temporary file name [here](https://github.com/ClickHouse/clickhouse-docs/blob/c31d64bc5d71c6c3afc5b520dbb73386e303447b/scripts/settings/autogenerate-settings.sh#L372)
74+
4. Register the destination file you want to insert the markdown into [here](https://github.com/ClickHouse/clickhouse-docs/blob/c31d64bc5d71c6c3afc5b520dbb73386e303447b/scripts/settings/autogenerate-settings.sh#L399)
75+
76+
The script takes the content of the temporary markdown file and inserts it into the destination file between tags `<!--AUTOGENERATED_START-->` and `<!--AUTOGENERATED_END-->`. If those tags do not exist you will get a warning.

0 commit comments

Comments
 (0)