New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IDEA] Introduce charcode macro #6284
Comments
Jeremy, If I may just add, Control characters are often very different to the other cases as they may not easily be copy/pasted, or read when in text/wiki text etc... This functionality is important. Here are a few notes that may help clarify or scope what you are proposing. If you do not expect to merge or address these in the same macro feel free to request spawn another discussion. Sorry for my verbosity, but its all "pent up", and hopefully useful, and relevant to charcode design considerations. In fact it may simplify its scope and suggest other macros/operators. Perhaps I can even write these other macros.
The named special characters are a great idea but it would be helpful if it were extensible, where the user/designer could add named character sequences eg rather than cr lf, I could name a paragraph "cr lf cr lf" "13 10 13 10". We could call these named character codes. below is an example and how I may hope this feature to assist with;
But this is also important when importing and exporting content and the ability to "give a character"/"returning a code" may also be helpful. After all the problem with Control Characters is their visibility and remembering them. The ability to use multiple numbers an names (lf) to build a string to use in the filter is valuable. Arguably if the solution is extensible then its size can be minimised ie no need to document all the names, if people can make them as needed. However just he invisible control characters is a small set to name. However as implied by your example, you are also suggesting charcode can be also used to introduce anything but "whole of filter delimiters" to a filter as you demonstrated with "[[" , this is often as a parameter to a filter operator eg Finally beyond control characters, named or otherwise, including special characters or strings there is the question of access to Unicode characters.
Perhaps the hardest issue I see with unicode is being able to see "programmatically" if the Unicode character of choice is visible to the current user with the fonts available. Although many are "browser safe" characters, many are not. We need to document the ranges that are safe with the fonts tiddlywiki makes use of by default. I have not shared much on my experiments with unicode in tiddlywiki yet but there is a lot of potential value, including what is effectively additional name spaces. They key issue is there has being insufficient support to easy develop an in tiddlywiki "unicode keyboard" to copy, set or type content in unicode characters from one or more ranges. The advantage of a keyboard is one could select a unicode character range copy and or type (with 0-9A-Z equivalent sets) once copied they can be pasted in filters and wiki text and you need not use a charcode macro etc... It would also be nice to use an offset into another character set so you can translate between different contiguous ranges eg 0-9A-Z to 𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ and back. Safe Unicode characters are a good alternative to installing images for icons and can themselves be text inside svg so this consuming far less space. More on unicode as an alternate name space If however you named a tiddler 𝕝𝕚𝕤𝕥𝕚𝕥𝕖𝕞 it is another tiddler, not as searchable and the following works {{||𝕝𝕚𝕤𝕥𝕚𝕥𝕖𝕞}} [[𝕝𝕚𝕤𝕥𝕚𝕥𝕖𝕞]] even macros defined <<𝕄>> this way. So we can use simple language tiddler names for templates etc... without them ending up in user searches. Once we have the underlying mechanism I would build a unicode EditorToolbar item to enter such alt-character sets, or unicode icons. including Emoticons, Only a little extensibility is needed. |
Here is a sample of unicode characters to see how they display for you; Remember these are alt-characters not FONTs. Circled 0①②③④⑤⑥⑦⑧⑨ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ |
Thanks @AnthonyMuscio – I appreciate your thoughts very much but I would also really appreciate it if you could try to write shorter. There's 800 words in your first post, and it's really quite hard work to figure out what you're trying to say. I think your post boils down to:
The post you have written reads like somebody thinking aloud. It's an interesting insight into your process, but it would be much more efficient for everybody else if you could aim for the brief, precise style you see most of us using on GitHub. Imagine if I woke up to 5 posts like yours every morning. I simply would not have the time to put in the work to try to understand what is being said. The reason why this matters is because you have a track record of very good insights and suggestions. I don't want to miss the good stuff! |
Thanks for summarizing it!
I do like the "offset" idea, but I wouldn't want it to be part of the charcode macro. I'm thinking about "shift-string", "morph-string" or something similar, which imo should be explored in a different issue. |
I'll create a draft-PR soon |
Hey, before we get too far into this, I have another proposal. I noticed recently that there is no complement operator to IF such an operator existed (say |
I'm going to post this on that talk.tiddlywiki thread too. |
@flibbles we now have the |
I see. I hope this is very new, or else I will feel very stupid. |
For sure, it was only added v5.2.0 |
I feel better. Too bad it's no good for what I needed. I was hoping for a real complement, like |
@AnthonyMuscio ... Unicode Math bold will be relatively complicated to be mapped, since they are not arranged in a way the standard Latin character set is. See: https://unicode-table.com/en/blocks/mathematical-alphanumeric-symbols/ We will need to map it like so:
Which will look like this |
Mario et al, Please note, this is not off topic to the charcode macro, but in my view needs to be considered along side the expansion of the charcode macro. Morph comments in particular moved here Ideally we need to consider the usability of charcode, morph and or recode macros to be used in wikitext and code so we can easily display, text etc... the result in either direction and use them as parameters to other macros and wikitext. |
this is a lookup table. .. I'll have to look for an implementation, that doesn't need to recalculate the matches everytime the macro is called. |
This Morph post moved to #6295 (comment) On JSString/Charcode Can the list of named control codes be extended by the user?, or do we need to decide what is included to publish this? |
I do not see the link here I'm afraid. Unless I'm missing something the proposed There is a very high bar for showing that the ability to morph character sets belongs in the core. The core is intended for functionality that is universally useful. This OP derives from many requests over the years from end users. The I'm tempted to delete the last 5 posts, but in any case if you want to continue that discussion please open a discussion thread. |
In favour of the counter argument charcode addresses access to characters we can not access from the keyboard, or in operators and macros. Morph and JSstring also does. I believe access to the Unicode set has also long being neglected, perhaps also for many years. Never the less, as long as the those attending to the charcode issues is aware of morph, and JSString on the demo it seem to me simply an administrative issue to split. Please allow us an opportunity to move the content if you prefer. Mario's elegant Morph and especially JSstring may actually contain code for the charcode solution, and perhaps a few bytes of tweaks would "kill a few birds with the one stone". |
Thanks @AnthonyMuscio I should said more clearly that I think the morph stuff is a fun idea and cool in it's own right |
As discussed here, it is proposed to add a new
charcode
JavaScript macro designed to make it easier to introduce sequences of control characters into filters:The
charcode
macro would take a variable number of parameters, each being either:"
,'
)The text was updated successfully, but these errors were encountered: