From cc853567ccbe64bacf8d2fd8ee5d1a4af0ae4b71 Mon Sep 17 00:00:00 2001 From: Benjamin Kott Date: Wed, 16 Oct 2024 13:36:02 +0200 Subject: [PATCH] [TASK] Add set support --- Configuration/Sets/Base/config.yaml | 2 + Configuration/Sets/Base/setup.typoscript | 37 +++++++++++++++++++ .../ContentElement/Syntax.typoscript | 35 ------------------ Configuration/TypoScript/setup.typoscript | 25 +------------ 4 files changed, 40 insertions(+), 59 deletions(-) create mode 100644 Configuration/Sets/Base/config.yaml create mode 100644 Configuration/Sets/Base/setup.typoscript delete mode 100644 Configuration/TypoScript/ContentElement/Syntax.typoscript diff --git a/Configuration/Sets/Base/config.yaml b/Configuration/Sets/Base/config.yaml new file mode 100644 index 0000000..17f4a51 --- /dev/null +++ b/Configuration/Sets/Base/config.yaml @@ -0,0 +1,2 @@ +name: syntax/base +label: 'Syntax' diff --git a/Configuration/Sets/Base/setup.typoscript b/Configuration/Sets/Base/setup.typoscript new file mode 100644 index 0000000..47446c2 --- /dev/null +++ b/Configuration/Sets/Base/setup.typoscript @@ -0,0 +1,37 @@ +tt_content.syntax =< lib.contentElement +tt_content.syntax { + templateName = Syntax + templateRootPaths { + 1 = EXT:syntax/Resources/Private/Templates/ContentElements/ + } + partialRootPaths { + 1 = EXT:syntax/Resources/Private/Partials/ContentElements/ + } + layoutRootPaths { + 1 = EXT:syntax/Resources/Private/Layouts/ContentElements/ + } + settings { + syntax { + theme = {$plugin.tx_syntax.settings.theme} + plugins { + linenumbers = {$plugin.tx_syntax.settings.plugins.linenumbers} + } + } + } +} + +page { + includeCSSLibs { + syntax_theme = EXT:syntax/Resources/Public/Css/prism{$plugin.tx_syntax.settings.theme}.min.css + syntax_plugins_linenumbers = EXT:syntax/Resources/Public/Css/prism-plugin-linenumbers.min.css + syntax_plugins_linenumbers.if.isTrue = {$plugin.tx_syntax.settings.plugins.linenumbers} + syntax_plugins_toolbar = EXT:syntax/Resources/Public/Css/prism-plugin-toolbar.min.css + } + includeJSFooter { + syntax_prism = EXT:syntax/Resources/Public/JavaScript/prism.min.js + syntax_plugins_linenumbers = EXT:syntax/Resources/Public/JavaScript/prism-plugin-linenumbers.min.js + syntax_plugins_linenumbers.if.isTrue = {$plugin.tx_syntax.settings.plugins.linenumbers} + syntax_plugins_showlanguage = EXT:syntax/Resources/Public/JavaScript/prism-plugin-showlanguage.min.js + syntax_plugins_toolbar = EXT:syntax/Resources/Public/JavaScript/prism-plugin-toolbar.min.js + } +} diff --git a/Configuration/TypoScript/ContentElement/Syntax.typoscript b/Configuration/TypoScript/ContentElement/Syntax.typoscript deleted file mode 100644 index a776b66..0000000 --- a/Configuration/TypoScript/ContentElement/Syntax.typoscript +++ /dev/null @@ -1,35 +0,0 @@ -####################### -#### CTYPE: SYNTAX #### -####################### - -tt_content.syntax > -tt_content.syntax =< lib.contentElement -tt_content.syntax { - - ################ - ### TEMPLATE ### - ################ - templateName = Syntax - templateRootPaths { - 1 = EXT:syntax/Resources/Private/Templates/ContentElements/ - } - partialRootPaths { - 1 = EXT:syntax/Resources/Private/Partials/ContentElements/ - } - layoutRootPaths { - 1 = EXT:syntax/Resources/Private/Layouts/ContentElements/ - } - - ################ - ### SETTINGS ### - ################ - settings { - syntax { - theme = {$plugin.tx_syntax.settings.theme} - plugins { - linenumbers = {$plugin.tx_syntax.settings.plugins.linenumbers} - } - } - } - -} diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index 1429c1b..1ca44ad 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -1,24 +1 @@ -################################### -#### CONTENT ELEMENT RENDERING #### -################################### - - - -############## -#### PAGE #### -############## -page { - includeCSSLibs { - syntax_theme = EXT:syntax/Resources/Public/Css/prism{$plugin.tx_syntax.settings.theme}.min.css - syntax_plugins_linenumbers = EXT:syntax/Resources/Public/Css/prism-plugin-linenumbers.min.css - syntax_plugins_linenumbers.if.isTrue = {$plugin.tx_syntax.settings.plugins.linenumbers} - syntax_plugins_toolbar = EXT:syntax/Resources/Public/Css/prism-plugin-toolbar.min.css - } - includeJSFooter { - syntax_prism = EXT:syntax/Resources/Public/JavaScript/prism.min.js - syntax_plugins_linenumbers = EXT:syntax/Resources/Public/JavaScript/prism-plugin-linenumbers.min.js - syntax_plugins_linenumbers.if.isTrue = {$plugin.tx_syntax.settings.plugins.linenumbers} - syntax_plugins_showlanguage = EXT:syntax/Resources/Public/JavaScript/prism-plugin-showlanguage.min.js - syntax_plugins_toolbar = EXT:syntax/Resources/Public/JavaScript/prism-plugin-toolbar.min.js - } -} +@import 'EXT:syntax/Configuration/Sets/Base/setup.typoscript'