[Feedback] Wikitext Cheatsheet and Searching for Symobls

Great idea! Have you considered contributing it to the official documentation? I mean just contents of the modal as a single tiddler. The documentation covers all of those things already, but it lacks a compact collection of everything in one place, as in your plugin.

Some suggestions:

  • I think it would be more readable and consistent with most of the documentation and the editing/preview pane to have the code on the left and rendered result on the right, but it might be just a matter of preference.
  • The {{$:/Cheatsheet PlainText}} makes many examples longer than necessary, but I guess it is to 1) indicate an empty line is needed between previous paragraph and e.g. list; 2) transclusion instead of plain text makes it easier to maintain the plugin.
  • I quite often find myself confused with the syntax of macros, variables, parameters, in what context should I/ am I allowed to use $x$, $(x)$, <<x>>,<x> , <__x__>, """$x$""" and so on. There are many threads that come down to these exact problems (a recent thread: Frustrations of Wikitext from a Software Dev - Developers - Talk TW (tiddlywiki.org). However it seems difficult to present it all in a compact cheatsheet form.

@vilc I think @pmario is/was working on such a PR.
Check this GitHub link…https://github.com/Jermolene/TiddlyWiki5/pull/6842#issue-1321377265

Also, I will add that in the 5.3 update a bunch of new features are going to be added to alleviate this, but will also create the need for new documentation. (The pull request has already been merged)

That’s right. Jeremy and I could not come to a conclusion yet. I think the info is important and useful. That’s why I published it as a plugin, so I can collect user feedback and improve it on my own pace.

The tiddler Wikitext Cheatsheet is easier to edit / develop with the current order. … That’s basically it.

Yea, I did add it as a transclusion, because I wanted to avoid so much “text duplication”.

If others also think it should be replaced by text, just let me know. … IMO there has to be some text otherwise the indentation of lists looks “displaced” … strange.

It’s there “for the looks”

The only way variables should be used starting with TW v5.3.0 is <<x>>
All the other versions are confusing and should be deprecated once the core code is cleaned up.

I hope I only used <<__x__>> in my examples, because they are needed for v5.2.x code to work.

I will change the whole thing once v5.3.0 is out.

The new code is already there, … but I just found out that the <<.from-version "5.3.0">> macro is missing in the plugin.

But <<.from-version "5.3.0">> can be seen in the code examples, but they are not rendered. I’ll fix that as soon as possible :wink:

2 Likes

@pmario Thanks for building and maintaining this.

I have long being frustrated with the inability to search for wikitext symbols, especially since the default search makes it impossible to search for two symbols. eg @@ or $(. Have a look at this work in progress tiddler, a form of which I would like to add to tiddlywiki.com documentation, but until then perhaps you could incorporate it in your cheatsheet?

  • Note the use of comments to include three symbols so for example to search for @@ you can type @@@ for $( you would use $$$ or (((, and ~~~ for ~
  • By giving it a title beginning ! it appears at the top of the ‘’ All matches:’’ list and does not get lost in the results.
  • It would be nice to add all symbols used to a key like this including !!! ^^ ,, etc… and more references to existing documentation. All searchable with a triple entry.
  • Try this improved “too short” message $ _language_Search_Search_TooShort.json (217 Bytes) you could even include [[Wikitext Cheatsheet]] in it, with your cheatsheet plugin.

! Wikitext symbol sets.json (953 Bytes)

* `$x$`
* `$(x)$`
* `<__x__>` <!-- ___  -->
* `(( shortcut ))` <!-- ((( )))  --> [[Keyboard Shortcut Tiddler]], [[Keyboard Shortcut Descriptor]], [[Demonstration: keyboard-driven-input Macro]].
* `@@` Custom style and classed <!-- @@@  --> [[Styles and Classes in WikiText]]
* `{{` Shortcut transclusions <!-- {{{ }}} --> 
* `[[` Tiddler title or filter run <!-- [[[ ]]]--> 
* `<<` Macro, variable, function or procedure <!-- <<< >>> --> 
*  `$$$` [[Typed Blocks in WikiText]]
* `"""` [[Hard Linebreaks in WikiText]]
* `---` [[Horizontal Rules in WikiText]] > use `---------------` to emphasise in editor
* ` triple backticks ` [[Code Blocks in WikiText]], [[Substituted Attribute Values]]
* `{{{ filter }}}` [[Filtered Transclusions|Transclusion in WikiText]], [[Filtered Attribute Values]]
1 Like

There is a trick to search for 2 symbols like {{ → add a space at the end {{<space>. It works for me.

Thanks for the info. I’ll have a closer look

1 Like

Wow that’s nice to know! I always used filter search for such things. Of course this also works for two-character titles.
Now this should be in the docs!

Yes, I think this is often by accident, but we could ensure that the documentation tiddlers for each of these contains within it a comment like <!-- {{ --> then {{ will be present, this is a side effect of also including a triple like above <!-- {{{ }}} -->

Actually not. The $:/core/ui/DefaultResultList has 2 search related fields

  • first-search-filter: [!is[system]search:title<userInput>sort[title]limit[250]]
  • second-search-filter: [!is[system]search<userInput>sort[title]limit[250]]

As you can see, it uses the search-operator which searches the title-field and uses the words-flag by default.

  • words: (the default) treats the search string as a list of tokens separated by whitespace, and matches if all of the tokens appear in the string (regardless of ordering and whether there is other text in between)

So the tokens are separated by whitespace. → So adding a space to 2 symbols does search for the symbol and ignores the whitespace.

Q.E.D

1 Like

Mario on the cheatsheet and tiddlywiki.com searching for @@<space> or @@@ still will not result in a title or even a prominant other search result that user can confidently find what @@ is called or does.

  • my previously shared tiddler addressed this
  • is there another way?
  • perhaps if we had glossary tiddlers like @@ at symbol $$$ dollar … & ampersand

For me it works on tiddlywiki.com if I search for @@<space> I get this:

The cheatsheet-plugin uses shadow-tiddlers. So you will not find anything there.

As you can see from the search results you need to look through multiple tiddlers and already have some understanding to find the defintion.

Search Drop down too short message

Then

  • Tiddler containing symbol documentation at the top

Yea, but the sort order in the search is completely different topic. I do want search to work with prose text that somebody else wrote. So we cannot rely on extra comments, because the will not be there.

I did write about my ideas at the “Can we make the standard search a little smarter?” thread.

IMO this would be a suggestion for GitHub.

IMO the text would need to be “For symbols like @ add 1 or more spaces

@jeremyruston What do you think?

Thinking about this there may be a smarter way to modify the too short message to illustrate this better, as you said its a word search. Perhaps even pad with blanks and a click to search symbols or 1 and 2 char strings.

The minimum length is after all to stop very long dropdown lists.

Or perhaps if not a-z 0-9 offer a symbol search.

This may be needed to support searching documentation but other wikis may also benifit.

  • we could have a config option to allow symbol search

I think it should be possible to remove the search limit if the search term start with a configurable element in a list.

eg: $:/config/Search/PrioritySymbols or something similar, which may contain a list of symbols,
that will ignore the $:/config/Search/MinLength setting.

IMO This one would also make a good “feature request” at GitHub. BUT – The search dropdown is already super complex code. So imo it will not be a quick fix :confused:

So the cheatsheet plugin may be a short term workaround with the new Wikitext Symbol table

1 Like

But perhaps making use of the top short drop down will be a simple intervention.

  • I will investigate

There is a solution I would like you to try;

Search text too short,

Edit this tiddler $:/language/Search/Search/TooShort

Replace with

Too short, 
<$button setTitle="$:/temp/search/input" setTo={{{ [{$:/temp/search/input}addsuffix[   ]] }}} tooltip="word search">
{{$:/core/images/advanced-search-button}}
</$button>

Now try and search for @ or @@ and notice the button in the too short message, click it for a word search by adding two spaces which makes it long enough, but still only searches for the one or two character word.

If a tiddler exists with @ or @@ in the title it will be listed at the top

Now we can also create tiddlers containing sysmbols or symbols pairs the either document them or link to an appropriate document tiddler.

We could modify it to pad the search string with spaces up to the min length.