mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-01 23:56:18 +00:00
0c1d478e19
* add alt-text field to image meta data files * add aria-label to some HelloThere links * improve flex-card procedure to render alt-text for images and aria-hide the new-badge because it causes problems * revert HelloThere modified date
135 lines
4.3 KiB
Plaintext
135 lines
4.3 KiB
Plaintext
code-body: yes
|
|
created: 20150117184156000
|
|
modified: 20240716181836632
|
|
tags: $:/tags/Macro
|
|
title: $:/editions/tw5.com/wikitext-macros
|
|
type: text/vnd.tiddlywiki
|
|
|
|
\whitespace trim
|
|
|
|
\procedure activatePluginTab()
|
|
<$action-setfield $tiddler="$:/state/tab-1749438307" text="$:/core/ui/ControlPanel/Plugins"/>
|
|
<$action-navigate $to="$:/ControlPanel"/>
|
|
\end
|
|
|
|
\procedure activateTiddlerWindow()
|
|
<$action-sendmessage $message="tm-open-window" $param=<<currentTiddler>> windowTitle="Side by Side View" width="800" height="600" />
|
|
\end
|
|
|
|
\procedure controlPanel-plugin-link()
|
|
<$button actions=<<activatePluginTab>> class="tc-btn-invisible tc-tiddlylink">
|
|
{{$:/core/images/options-button}} ~ControlPanel
|
|
</$button>
|
|
\end
|
|
|
|
\procedure open-tiddler-in-window()
|
|
\whitespace notrim
|
|
<$button actions=<<activateTiddlerWindow>> class="tc-btn-invisible tc-tiddlylink">
|
|
open ''this'' tiddler in a new window
|
|
</$button>
|
|
\end
|
|
|
|
\procedure activateEditionWindow(url)
|
|
<$action-sendmessage $message="tm-open-external-window" $param=<<url>> windowName="_edition" windowFeatures="width=800 height=600" />
|
|
\end
|
|
|
|
\procedure open-external-window(url)
|
|
\whitespace notrim
|
|
<$button actions=<<activateEditionWindow <<url>> class="tc-btn-invisible tc-tiddlylink">
|
|
open the ''example edition'' in a new window
|
|
</$button>
|
|
\end
|
|
|
|
|
|
\procedure wikitext-example(src)
|
|
<div class="doc-example">
|
|
<$macrocall $name="copy-to-clipboard-above-right" src=<<src>>/>
|
|
<$codeblock code=<<src>>/>
|
|
<p>
|
|
That renders as:
|
|
</p>
|
|
<$transclude $variable="src" $mode="block"/>
|
|
<p>
|
|
... and the underlying HTML is:
|
|
</p>
|
|
<$wikify name="html" text=<<src>> output="html">
|
|
<$codeblock code=<<html>>/>
|
|
</$wikify>
|
|
</div>
|
|
\end
|
|
|
|
\procedure wikitext-example-without-html(src)
|
|
<div class="doc-example">
|
|
<$macrocall $name="copy-to-clipboard-above-right" src=<<src>>/>
|
|
<$codeblock code=<<src>>/>
|
|
<p>
|
|
That renders as:
|
|
</p>
|
|
<$transclude $variable="src" $mode="block"/>
|
|
</div>
|
|
\end
|
|
|
|
\procedure wikitext-example-table-header() <thead><tr><th/><th>wiki text</th><th>renders as</th></tr></thead>
|
|
|
|
\procedure wikitext-example-table-row(id, code)
|
|
<tr>
|
|
<th><<id>></th>
|
|
<td><$codeblock code=<<code>>/></td>
|
|
<td><$transclude $variable="code" $mode="block"/></td>
|
|
</tr>
|
|
\end
|
|
|
|
\procedure tw-code(tiddler)
|
|
<$codeblock language={{{ [<tiddler>get[type]] }}} code={{{ [<tiddler>get[text]] }}}/>
|
|
\end
|
|
|
|
\procedure tw-code-link(tiddler)
|
|
<$link to=<<tiddler>>/>:
|
|
<$transclude $variable=tw-code tiddler=<<tiddler>> />
|
|
\end
|
|
|
|
\procedure flex-card(class,bordercolor:"",backgroundcolor:"",textcolor:"",imageField:"image",captionField:"caption",subtitle:"",descriptionField:"description",linkField:"link")
|
|
<$link class={{{ [<class>addprefix[tc-card ]] }}}
|
|
to={{{ [<currentTiddler>get<linkField>else<currentTiddler>] }}}
|
|
aria-label=<<currentTiddler>>
|
|
>
|
|
<div class="tc-card-accent" style.borderTop={{{ [<bordercolor>!is[blank]addprefix[5px solid ]] }}} style.background={{!!background}} style.backgroundColor=<<backgroundcolor>> style.color=<<textcolor>> style.fill=<<textcolor>>>
|
|
<$list filter="[<currentTiddler>has[ribbon-text]]" variable="ignore">
|
|
<div class="tc-card-ribbon-wrapper" aria-hidden="true">
|
|
<div class="tc-card-ribbon" style.backgroundColor={{{ [<currentTiddler>get[ribbon-color]else[red]] }}}>
|
|
<div class="tc-card-ribbon-inner">
|
|
<$text text={{!!ribbon-text}}/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</$list>
|
|
<$list filter="[<currentTiddler>has<imageField>]" variable="ignore">
|
|
<div class="tc-card-image">
|
|
<$image source={{{ [<currentTiddler>get<imageField>] }}}
|
|
alt={{{ [<currentTiddler>get<imageField>get[alt-text]else[Image.]] }}}
|
|
/>
|
|
</div>
|
|
</$list>
|
|
<div class="tc-card-title"><$transclude field=<<captionField>>><$view field="title"/></$transclude></div>
|
|
<$list filter="[<subtitle>!is[blank]]" variable="ignore">
|
|
<div class="tc-card-subtitle">
|
|
<$text text=<<subtitle>>/>
|
|
</div>
|
|
</$list>
|
|
<div class="tc-card-icon"><$transclude tiddler={{!!icon}}/></div>
|
|
<div class="tc-card-body-wrapper">
|
|
<div class="tc-card-body">
|
|
<$transclude field=<<descriptionField>> mode="block"/>
|
|
</div>
|
|
<div class="tc-card-body-clear">
|
|
</div>
|
|
</div>
|
|
<$list filter="[all[current]has[button-text]]" variable="ignore">
|
|
<div class="tc-card-button" style.background-color={{!!button-color}} style.border-color={{!!button-color}}>
|
|
<$text text={{!!button-text}}/> {{$:/core/images/chevron-right}}
|
|
</div>
|
|
</$list>
|
|
</div>
|
|
</$link>
|
|
\end
|