From 1543c0a54ae3ead0121ccf1e4baa92412ccb6dd8 Mon Sep 17 00:00:00 2001 From: ulaulaman Date: Sun, 16 Aug 2020 15:41:33 +0200 Subject: [PATCH] Update macro for styled table; add a javascript macro to simplify syntax --- index.html | 95 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 78 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index 2882a33..7d81ab7 100644 --- a/index.html +++ b/index.html @@ -157,6 +157,8 @@ Error message and password prompt
  • $:/core
  • +
  • $:/core/macros/ulaulaman/TagTable
  • +
  • $:/custom-svg-style
  • $:/custom-tag-styles
  • @@ -169,6 +171,8 @@ Error message and password prompt
  • $:/isEncrypted
  • +
  • $:/macros/ulaulaman/TagTable.js
  • +
  • $:/plugins/tiddlywiki/katex
  • $:/plugins/tiddlywiki/markdown
  • @@ -221,8 +225,6 @@ Error message and password prompt
  • $:/StoryList
  • -
  • $:/TagTable
  • -
  • $:/temp/info-plugin
  • $:/temp/NewTagName
  • @@ -265,6 +267,8 @@ Error message and password prompt
  • Table-of-Contents Macros
  • +
  • TagTable
  • +
  • TikzDraw
  • twitter.svg
  • @@ -300,8 +304,8 @@ Error message and password prompt
    hide
    -
    -
    hide
    +
    +
    show
    hide
    @@ -9685,6 +9689,13 @@ Error message and password prompt } }
    +
    +
    \define TagTable(tag)
    +<table><tr><$list filter="[tag[$tag$]sort[title]]"><td style="background-color:lightblue; border-style: solid; border-width: 1px;border-color:green;"> <<currentTiddler>> </td></$list></tr></table>
    +\end
    +
    +<$macrocall $name="TagTable" tag={{!!title}}/>
    +
    [data-tags*="svg"] .svg-icon {
       width: 100%;
    @@ -9717,10 +9728,14 @@ Error message and password prompt
       font-family: Monaco, Consolas, "Lucida Console", "DejaVu Sans Mono", monospace;
     }
    -
    +
    [data-tags*="Macros"] {
       border: 1px solid red;
     }
    +
    +[data-tags*="javascript"] {
    +  border: 1px solid black;
    +}
     
    @@ -9732,11 +9747,52 @@ Error message and password prompt
    The following tiddlers were imported:
     
    -# [[code]]
    +# [[TagTable]]
    no
    +
    +
    /*\
    +title: $:/macros/ulaulaman/TagTable.js
    +type: application/javascript
    +module-type: macro
    +
    +<<TagTable tag>>
    +
    +Example:
    +<<TagTable>>
    +<<TagTable "tag">>
    +
    +\*/
    +(function(){
    +
    +/*jslint node: true, browser: true */
    +/*global $tw: false */
    +"use strict";
    +
    +/*
    +Information about this macro
    +Create a styled table in order to show tiddlers from a specific tag as a menu.
    +*/
    +
    +exports.name = "TagTable";
    +
    +exports.params = [
    +	{ name: "tag" }
    +];
    +
    +/*
    +Run the macro
    +*/
    +exports.run = function(tag) {
    +	if( !tag) tag = "menu";
    +	var output = "{{" + tag + "||$:/core/macros/ulaulaman/TagTable}}";
    +	return output;
    +};
    +
    +})();
    +
    {
         "tiddlers": {
    @@ -10182,16 +10238,9 @@ Error message and password prompt
     
    ulaulaman
    -
    +
    
     
    -
    -
    \define TagTable(tag)
    -<table><tr><$list filter="[tag[$tag$]sort[title]]"><td style="background-color:lightblue; border-style: solid; border-width: 1px;border-color:green;"> <<currentTiddler>> </td></$list></tr></table>
    -\end
    -
    -<$macrocall $name="TagTable" tag={{!!title}}/>
    -
    {
         "tiddlers": {
    @@ -10250,7 +10299,7 @@ Error message and password prompt
         }
     }
    -
    +
    
     
    @@ -10698,6 +10747,18 @@ These two parameters are combined into a single [[filter expression|Filter Expre [[Examples|Table-of-Contents Macros (Examples)]]
    +
    +
    Following the tricks pubblished by [[Stephan Hradek on TW5 Magick|http://tw5magick.tiddlyspot.com/]] I create a macro that shows tiddlers from a specific tag in a styled table: $:/core/macros/ulaulaman/TagTable
    +
    +Whit the previous title, the syntax must be a bit difficult (`{{menu||$:/core/macros/ulaulaman/TagTable}}`), so I create a javascript in order to simplify the syntax in this way: `<<TagTable "Menu">>`:
    +
    +<<TagTable "Menu">>
    +
    +In you want use the macro, drag the following link in your TiddlyWiki, and don't forget to save and refresh:
    +
    +* $:/core/macros/ulaulaman/TagTable
    +* $:/macros/ulaulaman/TagTable.js
    +
    Un //repository// di grafiche e infografiche realizzate con il pacchetto tikzdraw di LaTeX.
     
    @@ -10718,7 +10779,7 @@ These two parameters are combined into a single [[filter expression|Filter Expre
     
    <tr><td width="50%;">{{ulaulaman||twitterFollowButton}}</td><td width="50%;">{{edu_inaf||twitterFollowButton}}</td></tr>
    -
    +
    ''Gianluigi Filippelli'', wikipediano, divulgatore e blogger scientifico.
     
     !! Lavoro
    @@ -10735,7 +10796,7 @@ In inglese: [[Doc Madhattan|http://docmadhattan.fieldofscience.com/]] | [[for Ma
     
     !! Repository e progetti su github
     
    -{{github||$:/TagTable}}
    +<<TagTable "github">>
     
     !! Social