-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for TypoScript (#2505)
- Loading branch information
Showing
14 changed files
with
349 additions
and
4 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
(function(Prism) { | ||
|
||
var keywords = /\b(?:ACT|ACTIFSUB|CARRAY|CASE|CLEARGIF|COA|COA_INT|CONSTANTS|CONTENT|CUR|EDITPANEL|EFFECT|EXT|FILE|FLUIDTEMPLATE|FORM|FRAME|FRAMESET|GIFBUILDER|GMENU|GMENU_FOLDOUT|GMENU_LAYERS|GP|HMENU|HRULER|HTML|IENV|IFSUB|IMAGE|IMGMENU|IMGMENUITEM|IMGTEXT|IMG_RESOURCE|INCLUDE_TYPOSCRIPT|JSMENU|JSMENUITEM|LLL|LOAD_REGISTER|NO|PAGE|RECORDS|RESTORE_REGISTER|TEMPLATE|TEXT|TMENU|TMENUITEM|TMENU_LAYERS|USER|USER_INT|_GIFBUILDER|global|globalString|globalVar)\b/; | ||
|
||
Prism.languages.typoscript = { | ||
'comment': [ | ||
{ | ||
// multiline comments /* */ | ||
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, | ||
lookbehind: true | ||
}, | ||
{ | ||
// double-slash comments - ignored when backslashes or colon is found in front | ||
// also ignored whenever directly after an equal-sign, because it would probably be an url without protocol | ||
pattern: /(^|[^\\:= \t]|(?:^|[^= \t])[ \t]+)\/\/.*/, | ||
lookbehind: true, | ||
greedy: true | ||
}, | ||
{ | ||
// hash comments - ignored when leading quote is found for hex colors in strings | ||
pattern: /(^|[^"'])#.*/, | ||
lookbehind: true, | ||
greedy: true | ||
} | ||
], | ||
'function': [ | ||
{ | ||
// old include style | ||
pattern: /<INCLUDE_TYPOSCRIPT:\s*source\s*=\s*(?:"[^"\r\n]*"|'[^'\r\n]*')\s*>/, | ||
inside: { | ||
'string': { | ||
pattern: /"[^"\r\n]*"|'[^'\r\n]*'/, | ||
inside: { | ||
'keyword': keywords, | ||
}, | ||
}, | ||
'keyword': { | ||
pattern: /INCLUDE_TYPOSCRIPT/, | ||
}, | ||
}, | ||
}, | ||
{ | ||
// new include style | ||
pattern: /@import\s*(?:"[^"\r\n]*"|'[^'\r\n]*')/, | ||
inside: { | ||
'string': /"[^"\r\n]*"|'[^'\r\n]*'/, | ||
}, | ||
} | ||
], | ||
'string': { | ||
pattern: /^([^=]*=[< ]?)(?:(?!]\n).)*/, | ||
lookbehind: true, | ||
inside: { | ||
'function': /{\$.*}/, // constants include | ||
'keyword': keywords, | ||
'number': /^[0-9]+$/, | ||
'punctuation': /[,|:]/, | ||
} | ||
}, | ||
'keyword': keywords, | ||
'number': { | ||
// special highlighting for indexes of arrays in tags | ||
pattern: /[0-9]+\s*[.{=]/, | ||
inside: { | ||
'operator': /[.{=]/, | ||
} | ||
}, | ||
'tag': { | ||
pattern: /\.?[\w-\\]+\.?/, | ||
inside: { | ||
'punctuation': /\./, | ||
} | ||
}, | ||
'punctuation': /[{}[\];(),.:|]/, | ||
'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, | ||
}; | ||
|
||
Prism.languages.tsconfig = Prism.languages.typoscript; | ||
|
||
}(Prism)); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<h2>Typical TypoScript Setup File</h2> | ||
<pre><code># import other files | ||
@import 'EXT:fluid_styled_content/Configuration/TypoScript/setup.typoscript' | ||
@import 'EXT:sitepackage/Configuration/TypoScript/Helper/DynamicContent.typoscript' | ||
|
||
page = PAGE | ||
page { | ||
typeNum = 0 | ||
|
||
// setup templates | ||
10 = FLUIDTEMPLATE | ||
10 { | ||
templateName = TEXT | ||
templateName.stdWrap.cObject = CASE | ||
templateName.stdWrap.cObject { | ||
key.data = pagelayout | ||
|
||
pagets__sitepackage_default = TEXT | ||
pagets__sitepackage_default.value = Default | ||
|
||
pagets__sitepackage_alternate = TEXT | ||
pagets__sitepackage_alternate.value = Alternative | ||
|
||
default = TEXT | ||
default.value = Default | ||
} | ||
|
||
templateRootPaths { | ||
0 = EXT:sitepackage/Resources/Private/Templates/Page/ | ||
1 = {$sitepackage.fluidtemplate.templateRootPath} | ||
} | ||
|
||
partialRootPaths { | ||
0 = EXT:sitepackage/Resources/Private/Partials/Page/ | ||
1 = {$sitepackage.fluidtemplate.partialRootPath} | ||
} | ||
|
||
layoutRootPaths { | ||
0 = EXT:sitepackage/Resources/Private/Layouts/Page/ | ||
1 = {$sitepackage.fluidtemplate.layoutRootPath} | ||
} | ||
|
||
dataProcessing { | ||
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor | ||
10 { | ||
levels = 1 | ||
includeSpacer = 1 | ||
as = mainnavigation | ||
} | ||
} | ||
} | ||
|
||
// include css into head | ||
includeCSS { | ||
bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css | ||
bootstrap.external = 1 | ||
website = EXT:sitepackage/Resources/Public/Css/styles.css | ||
} | ||
|
||
// include js into footer | ||
includeJSFooter { | ||
jquery = https://code.jquery.com/jquery-3.2.1.slim.min.js | ||
jquery.external = 1 | ||
bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js | ||
bootstrap.external = 1 | ||
website = EXT:sitepackage/Resources/Public/JavaScript/scripts.js | ||
} | ||
} | ||
|
||
// global site configuration | ||
config { | ||
absRefPrefix = auto | ||
cache_period = 86400 | ||
debug = 0 | ||
disablePrefixComment = 1 | ||
doctype = html5 | ||
extTarget = | ||
index_enable = 1 | ||
index_externals = 1 | ||
index_metatags = 1 | ||
inlineStyle2TempFile = 1 | ||
intTarget = | ||
linkVars = L | ||
metaCharset = utf-8 | ||
no_cache = 0 | ||
pageTitleFirst = 1 | ||
prefixLocalAnchors = all | ||
removeDefaultJS = 0 | ||
sendCacheHeaders = 1 | ||
compressCss = 0 | ||
compressJs = 0 | ||
concatenateCss = 0 | ||
concatenateJs = 0 | ||
} | ||
</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.