From edcc081565453ce602c722fcb36cacc3104f464a Mon Sep 17 00:00:00 2001 From: Shaun Struwig <41984034+Blargian@users.noreply.github.com> Date: Fri, 10 Oct 2025 11:51:47 +0200 Subject: [PATCH 1/2] Update autogenerated-documentation-from-source.md --- ...autogenerated-documentation-from-source.md | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/contribute/autogenerated-documentation-from-source.md b/contribute/autogenerated-documentation-from-source.md index 846f10734b2..7d2b2a48a77 100644 --- a/contribute/autogenerated-documentation-from-source.md +++ b/contribute/autogenerated-documentation-from-source.md @@ -61,18 +61,21 @@ TO DO ## Functions Documentation for functions is autogenerated from the documentation in system tables (`system.functions`) which is -registered along with the function registration in the C++ code. - -To add a new page: -- add SQL to generate the markdown from system tables -- update `autogenerate-settings.sh` in the section which specifies which markdown file contents to - copy to which file in between the `` and `` - -The following pages are autogenerated from the source code for functions: -- [Arithmetic](/sql-reference/functions/arithmetic-functions) ([SQL](../scripts/settings/arithmetic-functions.sql)) -- [Arrays](/sql-reference/functions/array-functions) ([SQL](../scripts/settings/array-functions.sql)) -- [Bit](/sql-reference/functions/bit-functions) ([SQL](../scripts/settings/bit-functions.sql)) -- [Bitmap](/sql-reference/functions/bitmap-functions) ([SQL](../scripts/settings/bitmap-functions.sql)) -- [Comparison](/sql-reference/functions/comparison-functions) ([SQL](../scripts/settings/comparison-functions.sql)) -- [Conditional](/sql-reference/functions/conditional-functions) ([SQL](../scripts/settings/conditional-functions.sql)) +registered along with the function registration in the C++ code. ([Example](https://github.com/ClickHouse/ClickHouse/blob/a0216c8120f00479f50237e41c897c2bf244e1ef/src/Functions/FunctionChar.cpp#L116-L158)) + +This [script](https://github.com/ClickHouse/clickhouse-docs/blob/main/scripts/settings/autogenerate-settings.sh) is used to generate +the markdown docs for functions. + +Adding a new page can be done by: + +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). +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`. +3. Register the temporary file name [here](https://github.com/ClickHouse/clickhouse-docs/blob/c31d64bc5d71c6c3afc5b520dbb73386e303447b/scripts/settings/autogenerate-settings.sh#L372) +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) + +The script takes the content of the temporary markdown file and inserts it into the destination file between tags `` and ``. If those tags do not exist you will get a warning. + + + + From 80e7332593bc9260411ac46fc143bf9ff123cf9a Mon Sep 17 00:00:00 2001 From: Shaun Struwig <41984034+Blargian@users.noreply.github.com> Date: Fri, 10 Oct 2025 11:59:50 +0200 Subject: [PATCH 2/2] Update autogenerated-documentation-from-source.md --- contribute/autogenerated-documentation-from-source.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/contribute/autogenerated-documentation-from-source.md b/contribute/autogenerated-documentation-from-source.md index 7d2b2a48a77..600a025cc4b 100644 --- a/contribute/autogenerated-documentation-from-source.md +++ b/contribute/autogenerated-documentation-from-source.md @@ -74,8 +74,3 @@ Adding a new page can be done by: 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) The script takes the content of the temporary markdown file and inserts it into the destination file between tags `` and ``. If those tags do not exist you will get a warning. - - - - -