mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-11 18:50:28 +00:00
81 lines
2.0 KiB
Plaintext
81 lines
2.0 KiB
Plaintext
title: $:/plugins/tiddlywiki/github-fork-ribbon/usage
|
|
|
|
\procedure ribbonCode()
|
|
\whitespace trim
|
|
<$transclude $tiddler="$:/plugins/tiddlywiki/github-fork-ribbon/template" top="30px" fixed=fixed color="green"/>
|
|
\end
|
|
|
|
\procedure ribbonCreateActions()
|
|
<% if [[$:/github-ribbon]!is[tiddler]] %>
|
|
<$action-setfield $tiddler="$:/github-ribbon" $field="text" $value=<<ribbonCode>>
|
|
tags="$:/tags/PageTemplate"
|
|
code-body="yes" />
|
|
<% endif %>
|
|
<$action-navigate $to="$:/github-ribbon" />
|
|
\end
|
|
|
|
\procedure createRibbon()
|
|
<$button actions=<<ribbonCreateActions>> >
|
|
<%if [[$:/github-ribbon]!is[tiddler]] %>
|
|
Create
|
|
<% else %>
|
|
Show
|
|
<% endif %> ~$:/github-ribbon
|
|
</$button>
|
|
\end
|
|
|
|
\procedure ribbonToggleTagActions()
|
|
<$action-listops $tiddler="$:/github-ribbon" $field="tags" $subfilter="+[toggle[$:/tags/PageTemplate]]" />
|
|
\end
|
|
|
|
\procedure ribbonToggleTag() <$button actions=<<ribbonToggleTagActions>> >Toggle Tag</$button>
|
|
|
|
|
|
`$:/plugins/tiddlywiki/github-fork-ribbon/template` is a template tiddler, that can be used with a transclusion and parameters.
|
|
|
|
!! Usage
|
|
|
|
* Create a new tiddler eg: $:/github-ribbon
|
|
* Tag it `$:/tags/PageTemplate`
|
|
* Copy the code below
|
|
|
|
<pre><$text text=<<ribbonCode>>/></pre>
|
|
|
|
<<createRibbon>> <<ribbonToggleTag>>
|
|
|
|
!! Parameters
|
|
|
|
; position
|
|
: "right" (default), "left", "right-bottom" and "left-bottom"
|
|
|
|
; url
|
|
: Target URL, default: https://github.com/Jermolene/TiddlyWiki5
|
|
|
|
; text
|
|
: Ribbon text. default: `Fork me on ~GitHub`
|
|
|
|
; color
|
|
: Ribbon background color: default: `#aa0000`
|
|
|
|
; top
|
|
: Offset from the top if postion is top. default: `0` eg: `30px`, if the menu-toolbar plugin is installed
|
|
|
|
; bottom
|
|
: Offset from the bottom in px
|
|
|
|
; left
|
|
: Offset from the left in px
|
|
|
|
; right
|
|
: Offset from the right in px
|
|
|
|
; fixed
|
|
: If position is ''top'', the ribbon will scroll out of the viewport by default
|
|
: If the parameter `fixed="fixed"` it will be fixed
|
|
|
|
!! Remove the Ribbon
|
|
|
|
* Disable the plugin
|
|
* ''Remove the tag'' from $:/github-ribbon tiddler
|
|
* Delete the $:/github-ribbon tiddler
|
|
* <<ribbonToggleTag>> |