@@ -119,8 +119,84 @@ SELECT prefix || (SELECT groupConcat(*) FROM main_content)
119119INTO OUTFILE 'settings.md' TRUNCATE FORMAT LineAsString
120120" > /dev/null || { echo " Failed to Autogenerate Core settings" ; exit 1; }
121121
122+ ./clickhouse -q "
123+ WITH
124+ settings_outside_source AS
125+ (
126+ SELECT
127+ arrayJoin(extractAllGroups(raw_blob, '## (\\ w+)(?:\\ s[^\n]+)?\n\\ s+((?:[^#]|#[^#]|##[^ ])+)')) AS g,
128+ g[1] AS name,
129+ replaceRegexpAll(replaceRegexpAll(g[2], '\n(Type|Default( value)?): [^\n]+\n', ''), '^\n+|\n+$', '') AS doc
130+ FROM file('_server_settings_outside_source.md', RawBLOB)
131+ ),
132+ settings_in_source AS
133+ (
134+ SELECT
135+ name,
136+ replaceRegexpAll(description, '(?m)^[ \t]+', '') AS description
137+ FROM system.server_settings
138+ ),
139+ combined_settings AS
140+ (
141+ SELECT
142+ name,
143+ description
144+ FROM settings_in_source
145+ UNION ALL
146+ SELECT
147+ name,
148+ doc AS description
149+ FROM settings_outside_source
150+ ),
151+ formatted_settings AS
152+ (
153+ SELECT
154+ format('## {} {}\n\n{}\n\n', name, '{#'||name||'}', description) AS formatted_text
155+ FROM combined_settings
156+ ORDER BY name ASC
157+ ),
158+ prefix_text AS
159+ (
160+ SELECT
161+ '---
162+ description: ''This section contains descriptions of server settings that cannot be
163+ changed at the session or query level.''
164+ keywords: [''global server settings'']
165+ sidebar_label: ''Global Server Settings''
166+ sidebar_position: 57
167+ slug: /operations/server-configuration-parameters/settings
168+ title: Global Server Settings
169+ ---
170+
171+ import Tabs from ''@theme/Tabs'';
172+ import TabItem from ''@theme/TabItem'';
173+ import SystemLogParameters from ''@site/docs/operations/server-configuration-parameters/_snippets/_system-log-parameters.md''
174+
175+ # Global Server Settings
176+
177+ This section contains descriptions of server settings that cannot be changed at
178+ the session or query level. These settings are stored in the ` config.xml` file
179+ on the ClickHouse server. For more information on configuration files in
180+ ClickHouse see [" " Configuration Files" " ](/operations/configuration-files).
181+
182+ Other settings are described in the " " [Settings](/operations/settings/overview)" " section.
183+ Before studying the settings, we recommend reading the [Configuration files](/operations/configuration-files)
184+ section and note the use of substitutions (the ` incl` and ` optional` attributes).
185+
186+ ' AS prefix_content
187+ )
188+ SELECT
189+ arrayStringConcat([
190+ (SELECT prefix_content FROM prefix_text),
191+ arrayStringConcat(groupArray(formatted_text), '')
192+ ], '')
193+ FROM formatted_settings
194+ INTO OUTFILE 'server_settings.md'
195+ TRUNCATE FORMAT LineAsString" > /dev/null || { echo " Failed to Autogenerate Format settings" ; exit 1; }
196+
122197mv settings-formats.md " $root /docs/operations/settings" || { echo " Failed to move generated settings-format.md" ; exit 1; }
123198mv settings.md " $root /docs/operations/settings" || { echo " Failed to move generated settings.md" ; exit 1; }
199+ mv server_settings.md " $root /docs/operations/server-configuration-parameters/settings.md" || { echo " Failed to move generated server_settings.md" ; exit 1; }
124200
125201echo " [$SCRIPT_NAME ] Auto-generation of settings markdown pages completed successfully"
126202
0 commit comments