Skip to content
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

Is this project alive? and underlining wikitext code makes it unreadable #8

Open
pmario opened this issue Feb 10, 2024 · 6 comments
Open

Comments

@pmario
Copy link
Contributor

pmario commented Feb 10, 2024

Hi @joshuafontany,
Do you still update this project? -- Do you accept PRs?

With TW v5.3.x we do have a lot of new syntax. Do you plan to implement it?

There is also one thing, that really is annoying for me personally. In TW wikitext if I define local variables with a double-underscore prefix, like this __localVar it starts to underline the whole code. Which in turn makes the code unreadable. Could the "underline" handling be disabled somehowm

@joshuafontany
Copy link
Owner

joshuafontany commented May 19, 2024

Hi @pmario. Could you provide a full snippet of wikitext? This would be inside a macro definition right?

@pmario
Copy link
Contributor Author

pmario commented May 19, 2024

I think the underscore syntax highlighting should be removed. It does not make sense anyway. Underlining text makes it much harder to read.

@pmario
Copy link
Contributor Author

pmario commented May 19, 2024

Hi @pmario. Could you provide a full snippet of wikitext?

Open any tiddler source code and start to write __var. You'll see, that the rest of the code will be underlined, which makes the editor "jumpy" and the code extremely hard to read.

As I wrote. From my point of view the whole "underline" formatting should be completely removed. It's only a burden.

@joshuafontany
Copy link
Owner

I would like to get a better understanding of the visual-noise you are getting. The underlining function here is the same one that handles http/https links, so we should be able to scope it down to not trigger when in "variable name" contexts.

@pmario
Copy link
Contributor Author

pmario commented May 20, 2024

Have a closer look at: https://github.com/Jermolene/TiddlyWiki5/blob/9cace159ab47e5c29fc7f1f6f44851edd5d7b07f/core/wiki/macros/toc.tid#L264

I initially wanted to create local variables, functions or procedures like so __hasItemTemplate() for better readability. So if there is only 1 such variable, that whole code will be underlined

@joshuafontany
Copy link
Owner

Cool. The current syntax scopes all the names in:

\function __testFunction() [<itemTemplate>!is[blank]then[text]]
\procedure __test(animal, __plant)
<% if [<animal>match[Elephant]] %>
  It is an elephant
<% else %>
  <% if [<animal>match[Giraffe]] %>
    It is a giraffe
  <% else %>
    It is completely unknown
  <% endif %>
<% endif %>

<<__test__>>
\end

as:

entity.name.variable.${procedure|function}.tiddlywiki5
meta.directive.variable.procedure.tiddlywiki5
text.html.tiddlywiki5

And does not underline that. I can only trigger an unterminated underline if I open it __xyz in a "string" or "base text.html.tiddlywiki" context. If you manage to reproduce this with your own code, please give an example/test-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants