Show stylesheets as rendered plain text with highlighting (#6778)

* First commit

* Enable syntax highlighting when highlight plugin is installed

* Use highlighting for the control panel stylesheet listings
This commit is contained in:
Jeremy Ruston 2022-07-14 09:00:56 +01:00 committed by GitHub
parent 22d8fdd259
commit 338dc11436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 10 deletions

View File

@ -0,0 +1,6 @@
title: $:/core/ui/ViewTemplate/body/rendered-plain-text
\whitespace trim
<$wikify name="text" text={{!!text}} type={{!!type}}>
<$codeblock code=<<text>> language="css"/>
</$wikify>

View File

@ -1,6 +1,7 @@
title: $:/config/ViewTemplateBodyFilters/
tags: $:/tags/ViewTemplateBodyFilter
stylesheet: [tag[$:/tags/Stylesheet]then[$:/core/ui/ViewTemplate/body/rendered-plain-text]]
system: [prefix[$:/boot/]] [prefix[$:/config/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/core/ui/]split[/]count[]compare:number:eq[4]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/info/]] [prefix[$:/temp/]] +[!is[image]limit[1]then[$:/core/ui/ViewTemplate/body/code]]
code-body: [field:code-body[yes]then[$:/core/ui/ViewTemplate/body/code]]
import: [field:plugin-type[import]then[$:/core/ui/ViewTemplate/body/import]]

View File

@ -23,11 +23,7 @@ title: $:/snippets/peek-stylesheets
<$reveal type="match" state=<<state>> text="yes" tag="div">
<$set name="source" tiddler=<<currentTiddler>>>
<$wikify name="styles" text=<<source>>>
<pre>
<code>
<$text text=<<styles>>/>
</code>
</pre>
<$codeblock code=<<styles>> language="css"/>
</$wikify>
</$set>
</$reveal>

View File

@ -1,3 +1,3 @@
title: $:/tags/ViewTemplateBodyFilter
list: $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/default
list: $:/config/ViewTemplateBodyFilters/stylesheet $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/default

View File

@ -1,6 +1,5 @@
title: $:/_tw_shared/styles
tags: $:/tags/Stylesheet TiddlyWikiSitesMenu
code-body: yes
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock

View File

@ -1,6 +1,5 @@
title: $:/_tw5.com/CustomStoryTiddlerTemplateDemo/Styles
tags: $:/tags/Stylesheet
code-body: yes
.tc-custom-tiddler-template {
border: 3px solid <<colour muted-foreground>>;

View File

@ -1,4 +1,3 @@
code-body: yes
created: 20150117152612000
modified: 20220617125128201
tags: $:/tags/Stylesheet

View File

@ -1,6 +1,5 @@
title: $:/plugins/tiddlywiki/katex/styles
tags: [[$:/tags/Stylesheet]]
code-body: yes
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline