You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contribute/autogenerated-documentation-from-source.md
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,18 +61,16 @@ TO DO
61
61
## Functions
62
62
63
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.
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))
65
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-->`
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.
70
68
71
-
The following pages are autogenerated from the source code for functions:
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