Skip to content

Commit 52e995b

Browse files
committed
rework documentation
1 parent 154f5d0 commit 52e995b

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

examples/official-site/component.sql

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,36 @@ from component
2929
where name = $component and introduced_in_version IS NOT NULL;
3030

3131
select 'title' as component, 3 as level, 'Top-level parameters' as contents where $component IS NOT NULL;
32-
select 'card' as component, 3 AS columns where $component IS NOT NULL;
32+
select 'table' as component, true as striped, true as hoverable, true as freeze_columns,
33+
'type' as markdown
34+
where $component IS NOT NULL;
3335
select
34-
name as title,
35-
(CASE WHEN optional THEN '' ELSE 'REQUIRED. ' END) || description as description,
36-
(CASE WHEN optional THEN '' ELSE 'REQUIRED. ' END) || description_md as description_md,
37-
type as footer,
36+
name,
37+
CASE WHEN optional THEN '' ELSE 'REQUIRED' END as required,
3838
CASE type
39-
WHEN 'COLOR' THEN '/colors.sql'
40-
WHEN 'ICON' THEN 'https://tabler-icons.io/'
41-
END AS footer_link,
42-
CASE WHEN optional THEN 'lime' ELSE 'azure' END as color
39+
WHEN 'COLOR' THEN printf('[%s](/colors.sql)', type)
40+
WHEN 'ICON' THEN printf('[%s](https://tabler-icons.io/?ref=sqlpage)', type)
41+
ELSE type
42+
END AS type,
43+
description
4344
from parameter where component = $component AND top_level
4445
ORDER BY optional, name;
4546

4647

4748
select 'title' as component, 3 as level, 'Row-level parameters' as contents
4849
WHERE $component IS NOT NULL AND EXISTS (SELECT 1 from parameter where component = $component AND NOT top_level);
49-
select 'card' as component, 3 AS columns where $component IS NOT NULL;
50+
select 'table' as component, true as striped, true as hoverable, true as freeze_columns,
51+
'type' as markdown
52+
where $component IS NOT NULL;
5053
select
51-
name as title,
52-
(CASE WHEN optional THEN '' ELSE 'REQUIRED. ' END) || description as description,
53-
(CASE WHEN optional THEN '' ELSE 'REQUIRED. ' END) || description_md as description_md,
54-
type as footer,
54+
name,
55+
CASE WHEN optional THEN '' ELSE 'REQUIRED' END as required,
5556
CASE type
56-
WHEN 'COLOR' THEN '/colors.sql'
57-
WHEN 'ICON' THEN 'https://tabler-icons.io/'
58-
END AS footer_link,
59-
CASE WHEN optional THEN 'lime' ELSE 'azure' END as color
57+
WHEN 'COLOR' THEN printf('[%s](/colors.sql)', type)
58+
WHEN 'ICON' THEN printf('[%s](https://tabler-icons.io/?ref=sqlpage)', type)
59+
ELSE type
60+
END AS type,
61+
description
6062
from parameter where component = $component AND NOT top_level
6163
ORDER BY optional, name;
6264

0 commit comments

Comments
 (0)