Skip to content

Commit

Permalink
Docs - make .from-version and .deprecated-since macros more readable (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pmario authored Mar 10, 2024
1 parent b22570a commit 0202d7b
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions editions/tw5.com/tiddlers/system/version-macros.tid
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
code-body: yes
created: 20161008085627406
modified: 20231206135257498
modified: 20240229155633000
tags: $:/tags/Macro
title: $:/editions/tw5.com/version-macros
type: text/vnd.tiddlywiki

\procedure .from-version-reference() 5.3.0
\whitespace trim

\function tf.from-version-reference() 5.3.0

\procedure .from-version-template(class, text)
<$link to={{{ [<version>addprefix[Release ]] }}} class=<<class>> >@@.tc-tiny-gap-right {{$:/core/images/info-button}}@@<<text>><<version>></$link>
<$link to={{{ [<version>addprefix[Release ]] }}} class=<<class>> >
<span class="tc-tiny-gap-right">
{{$:/core/images/info-button}}
</span>
<<text>><<version>>
</$link>
\end

\procedure .from-version(version)
<$list filter="[<version>compare:version:gteq<.from-version-reference>]"><<.from-version-template "doc-from-version doc-from-version-new" "New in v">></$list>
<$list filter="[<version>compare:version:lt<.from-version-reference>]"><<.from-version-template "doc-from-version" "Introduced in v">></$list>
<% if [<version>compare:version:gteq<tf.from-version-reference>] %>
<<.from-version-template "doc-from-version doc-from-version-new" "New in v">>
<% else %>
<<.from-version-template "doc-from-version" "Introduced in v">>
<% endif %>
\end

\define .deprecated-since(version, superseded:"TODO-Link")
<$link to="Deprecated - What does it mean" class="doc-deprecated-version tc-btn-invisible">{{$:/core/images/warning}} Deprecated since: <$text text=<<__version__>>/></$link> (see <$link to=<<__superseded__>>><$text text=<<__superseded__>>/></$link>)
\procedure .deprecated-since(version, superseded:"TODO-Link")
<$link to="Deprecated - What does it mean" class="doc-deprecated-version tc-btn-invisible">
{{$:/core/images/warning}}
<span class="tc-tiny-gap">Deprecated since:</span>
<$text text=<<version>>/>
</$link>
<span class="tc-tiny-gap-left">
(see <$link class="tc-tiny-gap-left" to=<<superseded>>><$text text=<<superseded>>/></$link>)
</span>
\end

0 comments on commit 0202d7b

Please sign in to comment.