On Saturday, 10 March 2018 14:00:30 UTC-8, Mat wrote: > > On Saturday, March 10, 2018 at 7:29:47 PM UTC+1, Joe Armstrong wrote: > >> I have a pretty good idea how to debug almost any language by writing >> functions calling the code >> >> and adding print statements to the code. But I'm unclear as to how I >> would do this in TW. >> > > Well, as far as I understand, TW works on a few layers that can go wrong > depending on what you do. There's the backend JS that is supposed to be > hidden, there are the widgets as a functional layer with fundamental > building blocks, the macros are merely text-substitutions not actual > functions. But wikitext also allow for direct use of html-elements and CSS. > > The browser inspector is probably the only real *tool* that you can use to > investigate things. > > I think the RSOE (Red Screen of Embarrassment) exclusively is for JS and > it usually gives a clue to what is wrong. There are a few build in error > codes that I believe are for wikitext - I'm primarily thinking of when a > bracket is missing in filters. > > BTW, you may find my SideEditor <http://sideeditor.tiddlyspot.com/>of > use. I use it all the time for testing stuff. It has similarities with the > editor preview function. > > > I wanted to take a few tiddlers i don't understand and add a few print >> statement to clarify >> >> what is happening - is this possible? >> > > ... it depends ... ;-) > > > If I take a maco I think what happens is that it returns some text which >> is >> >> then rescanned - it would be nice to a get a trace of what get called and >> what the >> >> return values are (same for widgets and JS code) >> > > Macros are pure text substitution. I'm not sure what you mean with > "rescanned". > > You can check global variables with this syntax "$(variable)$". > > If you give us your actual wikitext code it would be much easier to help > you. >
Ok - I want to make a numbered list of tiddlers with tag post Version 1) <$list filter="[tag[post]]"> <<currentTiddler>> </$list> This resulted in Building a story line Changing how we think How this blog was created How to create a new blog entry One idea per tiddlerThe Web Is Broken Uplifting Projects What would you like to hear about? So far so good Vsn 2: <ol> <$list filter="[tag[post]]"> <li><<currentTiddler>></li> </$list> </ol> Output 1. Building a story line 2. Changing how we think 3. How this blog was created 4. How to create a new blog entry 5. One idea per tiddler 6. The Web Is Broken 7. Uplifting Projects 8. What would you like to hear about? Almost right at this point I thought this would work: vsn4 <ol> <$list filter="[tag[post]]"> <li>[[<<currentTiddler>>]]</li> </$list> </ol> But this results in 1. <<currentTiddler>> <http://127.0.0.1:8080/#%3C%3CcurrentTiddler%3E%3E> 2. <<currentTiddler>> <http://127.0.0.1:8080/#%3C%3CcurrentTiddler%3E%3E> 3. <<currentTiddler>> <http://127.0.0.1:8080/#%3C%3CcurrentTiddler%3E%3E> 4. <<currentTiddler>> <http://127.0.0.1:8080/#%3C%3CcurrentTiddler%3E%3E> 5. <<currentTiddler>> <http://127.0.0.1:8080/#%3C%3CcurrentTiddler%3E%3E> 6. <<currentTiddler>> <http://127.0.0.1:8080/#%3C%3CcurrentTiddler%3E%3E> 7. <<currentTiddler>> <http://127.0.0.1:8080/#%3C%3CcurrentTiddler%3E%3E> 8. <<currentTiddler>> <http://127.0.0.1:8080/#%3C%3CcurrentTiddler%3E%3E> So <<currentTiddler>> is not expanded *inside* [[ .. ]] Hang on [[Link]] is expanded into a link and <<....>> is expanded so what are the precedence rules? Finally <ol> <$list filter="[tag[post]]"> <li> <$link> <<currentTiddler>> </$link> </li> </$list> </ol> This worked 1. Building a story line <http://127.0.0.1:8080/#Building%20a%20story%20line> 2. Changing how we think <http://127.0.0.1:8080/#Changing%20how%20we%20think> 3. How this blog was created <http://127.0.0.1:8080/#How%20this%20blog%20was%20created> 4. How to create a new blog entry <http://127.0.0.1:8080/#How%20to%20create%20a%20new%20blog%20entry> 5. One idea per tiddler <http://127.0.0.1:8080/#One%20idea%20per%20tiddler> 6. The Web Is Broken <http://127.0.0.1:8080/#The%20Web%20Is%20Broken> 7. Uplifting Projects <http://127.0.0.1:8080/#Uplifting%20Projects> 8. What would you like to hear about? <http://127.0.0.1:8080/#What%20would%20you%20like%20to%20hear%20about%3F> Now I'll have to make this into a macro :-) /Joe > > <:-) > > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/0efa1415-d3cb-4507-8f33-d9f940bff0cb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

