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[]

Examples

Entity Diagram

entity-docs.antoratemplate_examples

Columns

Table 1. Columns of docs.AntoraTemplate_examples - V
PK Column Name Data Type NULL? ID

nvarchar(max)

NULL

Foreign Key Diagram

entity_1_1_fk-docs.antoratemplate_examples

References

Object Reference Diagram - 1 1

entity_1_1_objectref-docs.antoratemplate_examples

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-docs.antoratemplate_examples

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-docs.antoratemplate_examples

Column Reference Diagram

entity_1_1_colref-docs.antoratemplate_examples

Column Details

_

page_content

page_content

nvarchar(max)

NULL

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