Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    qbit
    @qbit:tapenet.org
    [m]
    my full def
    @yanderella:sibnsk.net
    [m]
    Well, just like I thought.... It all works, you only had a typo... that I did see the first time which i purposefully repeated because I didn't know your full definition
    After fixing this typo, your macro definition works as intended
    qbit
    @qbit:tapenet.org
    [m]
    ha! thanks for the clue stick :D
    @yanderella:sibnsk.net
    [m]
    I was shy to point it out the first time, thinking it was intended
    qbit
    @qbit:tapenet.org
    [m]
    :D - i write code for a living - maybe i should switch professions \o/
    @yanderella:sibnsk.net
    [m]
    Keep it up! You have some amazing work out there! ^^
    qbit
    @qbit:tapenet.org
    [m]
    :D thanks
    tiddlywiki is amazing!
    qbit
    @qbit:tapenet.org
    [m]
    Update on the gitea saver! indeed it does save the entire html file :D
    1 reply
    and i now have it working behind a http basic auth protected sub-location of my gitea instance \o/
    qbit
    @qbit:tapenet.org
    [m]
    hmm, but if the sub-location isn't a clone of the repo.. you will have a bad time :D
    that's sub optimal for sure
    i really wonder how others have used this :D
    @yanderella:sibnsk.net
    [m]
    Indeed. I also wonder how a complete setup with the gitea saver looks like. There is a tutorial about the GitHub Saver by Mohammad on TiddlyWiki.com, so it'd be cool to see similar thing for the Gitea saver.
    1 reply
    qbit
    @qbit:tapenet.org
    [m]
    I was hoping i could have a saver configured AND use webdav, but it seems like it's one or the other only
    @yanderella:sibnsk.net
    [m]

    Sadly, it does seem that way. The saving mechanism uses the saver that is with higher priority. It is possible to use a saver and download a HTML of your Wiki (since that uses a different message tm-download-file), but I am not sure how you can use two savers at the same time via a message or something. I guess there may be more clues if you look at the code of tm-save-wiki message? I don't have idea.

    https://tiddlywiki.com/#SavingMechanism

    qbit
    @qbit:tapenet.org
    [m]
    SyncAdaptorModules ooooo
    cblte
    @cblte

    Hi Guys now that I got my TOC working with the help of @yanderella:sibnsk.net - thanks again - I was wondering how you people store journal entries and how do you keep your journals.

    As I would like to move away from DayOne - I would also like to upload images.

    But more I would like to know how you organize your entries. Thanks

    qbit
    @qbit:tapenet.org
    [m]
    i am interested too :D - at the moment I have .html files strewn across everything while I try to figure out a flow / process
    qbit
    @qbit:tapenet.org
    [m]
    i think my idea situation would be a git saver / server
    i am terrified that i will ruin a file somehow - so having a git repo that can be distributed would be a+doublegood
    qbit
    @qbit:tapenet.org
    [m]
    maybe a TiddlyWeb compat server that stores data in a git repo is a good idea ..
    florhizome
    @florhizom:matrix.org
    [m]
    You know bob?
    qbit
    @qbit:tapenet.org
    [m]
    i looked at it - but it has a lot of features I wouldn't use
    • Allows you to run shell scripts and commands from inside the wiki
    Noooooo thanks
    qbit
    @qbit:tapenet.org
    [m]
    i just learned about \import and transclusions..
    1 reply
    so excited
    qbit
    @qbit:tapenet.org
    [m]

    does anyone have an example of passing a macro a variable? I have it half working..

    <$set name="osName" value="{{!!name}}">
    <$macrocall $name="hardwareTable" filterField="os" filterValue="<<osName>>" />
    </$set>
    
    <<hardwareTable os OpenBSD>>

    The first macrocall shows the table but with no values in the table - the second shows the table but with values

    what's strange is that I can print the vars from inside the macro and they are set as expected in both cases
    the macro is:
    \define hardwareTable(filterField, filterValue, filterSort:"sort[cost]")
    
    showing "$filterField$" with value "$filterValue$"
    
    <table>
    <thead>
    <tr>
    <td> Name </td>
    <td> Usage </td>
    <td> Acquired </td>
    <td> Architecture </td>
    <td> Operating System </td>
    <td> Cost </td>
    </tr>
    </thead>
    <$list filter="[tag[Hardware]field:$filterField$[$filterValue$]$filterSort$]">
      <tr>
        <td> <$link/> </td>
        <td> {{!!usage}} </td>
        <td> {{!!purchased}} </td>
        <td> <$link to={{!!architecture}}>{{!!architecture}}</$link> </td>
        <td> <$link to={{!!os}}>{{!!os}}</$link> </td>
        <td align="right"> {{!!cost}} </td>
      </tr>
    </$list>
    </table>
    done showing "$filterField$" of "$filterValue$".
    \end
    the showing "$filterField$" with value "$filterValue$" lines show as expected in both calls to the macro
    also calling <<hardwareTable os {{!!name}}>> results in the same missing data-in-table issue
    1 reply
    qbit
    @qbit:tapenet.org
    [m]
    i think {{!!name}} is losing scope..
    @yanderella:sibnsk.net
    [m]

    Uh... Doing things a little in reverse than originally intended, because I just saw a glaring error using my TiddlyWiki experience.

    You are doing this as a way to pass external variable to the macro.

    filterValue="<<osName>>"

    That's not how things work, because of macro parameters being stupid simple string subtition and not magic. Essentially by passing this, you are telling the macro. "I want for filterValue to be the string (quotes) <<osName>>. You make filterValue to be exactly the characters <<osName>>, it's not magically going to resolve.

    However, TiddlyWiki has a way to pass a variable as a parameter, this looks like this.

    filterValue=<<osName>>

    Now this means, "I want filterValue to be the value of the variable osName"

    This will give you, your desired result. This is another reason why <<__osName__>> variable also exists, which would be for quote escaping problems.

    This is what your solution should be, so it ends here. Below this, is a small bonus of mine to explain something unrelated (initially thinking you need it) so feel free to ignore it as it is not part of your solution.


    By themselves, the snippets are not parsed as WikiText. However, a variable reference will transclude a snippet into a context where WikiText parsing may be occurring. Within a snippet, the only markup detected is $name$ for a macro parameter transclusion and $(name)$ for a variable transclusion.

    Source: https://tiddlywiki.com/#Variables

    Within a snippet itself, the only markup detected is $name$ (a placeholder for a macro parameter) and $(name)$ (a placeholder for a variable).

    Source: https://tiddlywiki.com/#Macros

    So I would like to present you with an example usage and how you can use these as part to control filters even better and hopefully that way you'll have even better control of things and "scope" understanding.

    \define greet_qbit(greeting)
    $greeting$, $(the_name)$
    <br/>
    <$text text={{{ [[$greeting$]addprefix[$(the_name)$, ]] }}} />
    \end
    
    <$vars the_name={{!!user}} >
    <$macrocall $name=greet_qbit greeting={{!!name}} />
    </$vars>

    Basically, $macroparametertransclusion$ this puts the parameter simply by replacing that placeholder string with the parameter value no other magic involved. $(variabletransclusion)$ this puts a variable defined outside the macro, but that the macro is "inside" of the variable definition. It does it again very simply by replacing the string with that variable value with no magic, just string substitution.


    Now, after you read my simpler explanation of variable transclusion within a macro vs macro parameters transclusion. You should be fully ready to read comfortably the source for macro definitions in WikiText.

    Source and further reading https://tiddlywiki.com/#Macro%20Definitions%20in%20WikiText

    qbit
    @qbit:tapenet.org
    [m]
    awesome - thanks for the explanation !
    switching to {{!!name}} fixed it - what was confusing to me is that it worked in some places but not in the table
    (my invalid setting of filterValue worked)
    @yanderella:sibnsk.net
    [m]
    I am glad that you fixed it! Good job!
    qbit
    @qbit:tapenet.org
    [m]

    Trying to add something similar to this: https://groktiddlywiki.com/read/#Creating%20a%20List%20of%20Links%20and%20Backlinks - I have a tiddler named $:/qbit/TiddlerLinkSummary with basically the template described in the "answers" section

    I have also added it to the list field in $:/tags/ViewTemplate, however, I don't see the templated stuff added to all tiddlers

    perhaps I need to use a different template for that?
    or maybe i am misunderstanding the entire point of $:/tags/ViewTemplate :D
    My goal is to have a list of backlinks and links shown on each tiddler
    @yanderella:sibnsk.net
    [m]

    I am in a rush so I didn't check anything in depth what you are trying to do, but long time ago I read something about ViewTemplate and backlinks. I happen to have the link saved since it seemed helpful. So have a look. It may help?

    https://old.reddit.com/r/TiddlyWiki5/comments/hm5n8n/looking_for_makro_that_will_show_all_relations_to/

    Good luck

    qbit
    @qbit:tapenet.org
    [m]
    Thanks! :D
    qbit
    @qbit:tapenet.org
    [m]
    yay! that had a bit that i was missing :D - needed to add the $:tags/ViewTemplate to my backlink tiddler as a literal tag
    @yanderella:sibnsk.net
    [m]

    Yes, that's how these are. They are core tags where the core has special functionality available that is built in and very useful. Same goes for some special field values like list-after and list-before.

    Not just that but there is an additional way to modify list field of a tag. That is by clicking on the tag pill on any tiddler. Then you get list of tiddlers tagged by that tag and you can drag them around to reorder them. Super convenient, I use this a lot myself. So go ahead and try this on the $:/tags/ViewTemplate tag pill on your template.

    qbit
    @qbit:tapenet.org
    [m]
    excellent :D - thanks again!
    bruno366
    @bruno366:matrix.org
    [m]
    Hello 👋 :)
    qbit
    @qbit:tapenet.org
    [m]
    Hi!