docs.AntoraTemplate_examples - V
type: V ( view ), modify_date: 2021-11-17 10:44:46
RepoObject_guid: F430C24A-759B-EB11-84F5-A81E8446D5B0
Description
-
generates the content for the 'partial$template/master-page-examples.adoc[]'
-
uses all properties with prefix 'example' (here: exampleAbc)
ifdef::ExistsProperty--exampleabc[] .Abc ==== [source,sql,numbered] ---- include::partial$content/{docname}.adoc[tag=exampleabc] ---- ==== endif::ExistsProperty--exampleabc[]
Columns
PK | Column Name | Data Type | NULL? | ID |
---|---|---|---|---|
|
|
sql_modules_definition
docs.AntoraTemplate_examples - V script
/*
<<property_start>>Description
* generates the content for the 'partial$template/master-page-examples.adoc[]'
* uses all properties with prefix 'example' (here: exampleAbc)
====
....
\ifdef::ExistsProperty--exampleabc[]
.Abc
====
[source,sql,numbered]
----
\include::partial$content/{docname}.adoc[tag=exampleabc]
----
====
\endif::ExistsProperty--exampleabc[]
....
====
<<property_end>>
*/
CREATE View [docs].[AntoraTemplate_examples]
As
Select
page_content = Char ( 13 ) + Char ( 10 ) + Char ( 13 ) + Char ( 10 ) + '== Examples'
--
+ Char ( 13 ) + Char ( 10 ) + Char ( 13 ) + Char ( 10 ) + IsNull ( sta.sta, '' )
From
(
--ensure existing of one row in case no property_name Like 'example%' exists
Select
dummy = 1
) As dummy
Left Join
(
Select
sta = String_Agg (
Concat (
Cast(N'' As Varchar(Max))
, '\ifdef::ExistsProperty--' + Lower ( property_name ) + '[]'
, Char ( 13 ) + Char ( 10 )
, Char ( 13 ) + Char ( 10 )
, '.' + Substring ( property_name, 8, Len ( property_name ))
, Char ( 13 ) + Char ( 10 )
, '===='
, Char ( 13 ) + Char ( 10 )
, '[source,sql,numbered]'
, Char ( 13 ) + Char ( 10 )
, '----'
, Char ( 13 ) + Char ( 10 )
, '\include::partial$content/{docname}.adoc[tag=' + Lower ( property_name ) + ']'
, Char ( 13 ) + Char ( 10 )
, '----'
, Char ( 13 ) + Char ( 10 )
, '===='
, Char ( 13 ) + Char ( 10 )
, Char ( 13 ) + Char ( 10 )
, '\endif::ExistsProperty--' + Lower ( property_name ) + '[]'
, Char ( 13 ) + Char ( 10 )
)
, Char ( 13 ) + Char ( 10 )
) Within Group(Order By
property_name)
From
property.PropertyName_RepoObject
Where
property_name Like 'example%'
) As sta
On
1 = 1
sql