Plugin Hotel California - Can't Disable Plugin

124 views
Skip to first unread message

Kevin Kleinfelter

unread,
May 27, 2020, 10:46:51 AM5/27/20
to TiddlyWiki
I'm trying to convert from using anstosa/tw5-markdown to the markdown plugin in the TW plugin library.

I'm running a node.js Tiddlywiki.  I have anstosa/tw5-markdown installed "in the browser".  I went to TW Control Panel and pressed the Disable button for $:/plugins/anstosa/tw5-markdown.  That disabled it, as expected.

But when I restart node.js, my TW fails to start due to "Cannot find module '$:/plugins/anstosa/tw5-markdown/highlight.js'".  In order to work around it, I have to delete $__config_Plugins_Disabled_$__plugins_anstosa_tw5-markdown.tid

I need to disable (or delete) tw5-markdown without making my wiki un-startable.  

It looks like I'm going to need to manually tell it not to try and load $:/plugins/anstosa/tw5-markdown/highlight.js.  That *is* a shadow tiddler provided by the plugin.  It looks like disabling the plugin hides the shadow tiddler, but something is still trying to load it.

Any suggestions as to how I might find/disable that attempt to load $:/plugins/anstosa/tw5-markdown/highlight.js? 

Flibbles

unread,
May 27, 2020, 12:09:30 PM5/27/20
to TiddlyWiki
I'm not able to replicate this problem. The only file trying to load tw5-markdown/highlight.js is tw5-markdown/wrapper.js. If you remove the plugin altogether, it should allow your server to boot.

(Just a quick note though. If migrating becomes too much of an issue, relink-markdown will work with anastosa. I just reached my own opinion that the core markdown plugin is better after peering under both their hoods.)

TiddlyTweeter

unread,
May 27, 2020, 12:23:22 PM5/27/20
to TiddlyWiki
Sorry, but the title was too inviting ... https://youtu.be/CK0JLpVed0Q

Kevin Kleinfelter

unread,
May 27, 2020, 1:03:41 PM5/27/20
to tiddl...@googlegroups.com
Re: the quick note

Thanks. I appreciate your work on relink-markdown.  I'm just trialing the official Markdown based on you suggestion and I've run into a few issues with anstona.  The issues I'm seeing with converting to the official plugin  include:
  • Gotta change all my internal links from [[tiddler name]] to [tiddler name](#tiddler%20name).  That's going to be an interesting project with sed, and it will mess up a few items because sed won't really parse Markdown.  I have ~1400 tiddlers, so a manual approach is infeasible. Do-able.
  • List of bullets requires a blank line before it in order to be recognized as a list, where anstosa didn't.  More work with grep and sed.  Do-able.
  • Much 'heavier weight' stylesheet.   Gonna have to brush up on CSS.  Do-able.
  • It makes a mess of bullet lists. Each bullet *should* be "<li>text here</li>" but it is "<li><p>text here</p></li>".   This makes bullet lists take up too much space.  Could be a deal-killer.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/2I1U1tHWb9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a4c00432-e54c-4d5f-b743-27b548760570%40googlegroups.com.

Flibbles

unread,
May 27, 2020, 1:09:10 PM5/27/20
to TiddlyWiki
You can configure it to accept [[links like this]]. tiddlywiki/markdown disables a lot of wikipatterns, but you can reenable what you want. Just change $:/config/markdown/renderWikiTextPragma from

\rules only html image macrocallinline syslink transcludeinline wikilink filteredtranscludeblock macrocallblock transcludeblock

to

\rules only html image macrocallinline syslink transcludeinline wikilink filteredtranscludeblock macrocallblock transcludeblock prettylink

As for the bullets lists. I know exactly why it's doing that. tiddlywiki markdown is enterpretting that list content as wikitext, but it's forgetting to consider it as inline only. Let me look into it a second.

You're on your own with the stylesheet though. I never even glanced at that while working.

On Wednesday, May 27, 2020 at 1:03:41 PM UTC-4, Kevin Kleinfelter wrote:
Re: the quick note

Thanks. I appreciate your work on relink-markdown.  I'm just trialing the official Markdown based on you suggestion and I've run into a few issues with anstona.  The issues I'm seeing with converting to the official plugin  include:
  • Gotta change all my internal links from [[tiddler name]] to [tiddler name](#tiddler%20name).  That's going to be an interesting project with sed, and it will mess up a few items because sed won't really parse Markdown.  I have ~1400 tiddlers, so a manual approach is infeasible. Do-able.
  • List of bullets requires a blank line before it in order to be recognized as a list, where anstosa didn't.  More work with grep and sed.  Do-able.
  • Much 'heavier weight' stylesheet.   Gonna have to brush up on CSS.  Do-able.
  • It makes a mess of bullet lists. Each bullet *should* be "<li>text here</li>" but it is "<li><p>text here</p></li>".   This makes bullet lists take up too much space.  Could be a deal-killer.

On Wed, May 27, 2020 at 12:09 PM Flibbles <challeng...@gmail.com> wrote:
I'm not able to replicate this problem. The only file trying to load tw5-markdown/highlight.js is tw5-markdown/wrapper.js. If you remove the plugin altogether, it should allow your server to boot.

(Just a quick note though. If migrating becomes too much of an issue, relink-markdown will work with anastosa. I just reached my own opinion that the core markdown plugin is better after peering under both their hoods.)

On Wednesday, May 27, 2020 at 10:46:51 AM UTC-4, Kevin Kleinfelter wrote:
I'm trying to convert from using anstosa/tw5-markdown to the markdown plugin in the TW plugin library.

I'm running a node.js Tiddlywiki.  I have anstosa/tw5-markdown installed "in the browser".  I went to TW Control Panel and pressed the Disable button for $:/plugins/anstosa/tw5-markdown.  That disabled it, as expected.

But when I restart node.js, my TW fails to start due to "Cannot find module '$:/plugins/anstosa/tw5-markdown/highlight.js'".  In order to work around it, I have to delete $__config_Plugins_Disabled_$__plugins_anstosa_tw5-markdown.tid

I need to disable (or delete) tw5-markdown without making my wiki un-startable.  

It looks like I'm going to need to manually tell it not to try and load $:/plugins/anstosa/tw5-markdown/highlight.js.  That *is* a shadow tiddler provided by the plugin.  It looks like disabling the plugin hides the shadow tiddler, but something is still trying to load it.

Any suggestions as to how I might find/disable that attempt to load $:/plugins/anstosa/tw5-markdown/highlight.js? 

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/2I1U1tHWb9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.

Saq Imtiaz

unread,
May 27, 2020, 1:12:35 PM5/27/20
to TiddlyWiki
the problem is that [[..]] is not valid markdown syntax for a link.

To enable that format for a link with the official MD plugin follow these steps:

edit the following shadow tiddler:
$:/config/markdown/renderWikiTextPragma

and replace the text with:

\rules only html image macrocallinline syslink transcludeinline wikilink filteredtranscludeblock macrocallblock transcludeblock prettylink

This is a list of rules as to what wikisyntax should be parsed from markdown tiddlers after the markdown parser has gone through it. Note the last one, prettylink. That is what you want and is not enabled by default.

On Wednesday, May 27, 2020 at 7:03:41 PM UTC+2, Kevin Kleinfelter wrote:
Re: the quick note

Thanks. I appreciate your work on relink-markdown.  I'm just trialing the official Markdown based on you suggestion and I've run into a few issues with anstona.  The issues I'm seeing with converting to the official plugin  include:
  • Gotta change all my internal links from [[tiddler name]] to [tiddler name](#tiddler%20name).  That's going to be an interesting project with sed, and it will mess up a few items because sed won't really parse Markdown.  I have ~1400 tiddlers, so a manual approach is infeasible. Do-able.
  • List of bullets requires a blank line before it in order to be recognized as a list, where anstosa didn't.  More work with grep and sed.  Do-able.
  • Much 'heavier weight' stylesheet.   Gonna have to brush up on CSS.  Do-able.
  • It makes a mess of bullet lists. Each bullet *should* be "<li>text here</li>" but it is "<li><p>text here</p></li>".   This makes bullet lists take up too much space.  Could be a deal-killer.

On Wed, May 27, 2020 at 12:09 PM Flibbles <challeng...@gmail.com> wrote:
I'm not able to replicate this problem. The only file trying to load tw5-markdown/highlight.js is tw5-markdown/wrapper.js. If you remove the plugin altogether, it should allow your server to boot.

(Just a quick note though. If migrating becomes too much of an issue, relink-markdown will work with anastosa. I just reached my own opinion that the core markdown plugin is better after peering under both their hoods.)

On Wednesday, May 27, 2020 at 10:46:51 AM UTC-4, Kevin Kleinfelter wrote:
I'm trying to convert from using anstosa/tw5-markdown to the markdown plugin in the TW plugin library.

I'm running a node.js Tiddlywiki.  I have anstosa/tw5-markdown installed "in the browser".  I went to TW Control Panel and pressed the Disable button for $:/plugins/anstosa/tw5-markdown.  That disabled it, as expected.

But when I restart node.js, my TW fails to start due to "Cannot find module '$:/plugins/anstosa/tw5-markdown/highlight.js'".  In order to work around it, I have to delete $__config_Plugins_Disabled_$__plugins_anstosa_tw5-markdown.tid

I need to disable (or delete) tw5-markdown without making my wiki un-startable.  

It looks like I'm going to need to manually tell it not to try and load $:/plugins/anstosa/tw5-markdown/highlight.js.  That *is* a shadow tiddler provided by the plugin.  It looks like disabling the plugin hides the shadow tiddler, but something is still trying to load it.

Any suggestions as to how I might find/disable that attempt to load $:/plugins/anstosa/tw5-markdown/highlight.js? 

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/2I1U1tHWb9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.

Flibbles

unread,
May 27, 2020, 1:24:52 PM5/27/20
to TiddlyWiki
@Saq Imtiaz: I think we just experienced a race condition with responding to Kleinfelter. Same answer asynchronously.

@Kleinfelter: As for the paragraph break, turns out that's actually how Remarkable rolls. It treats all the content in <li> as a block. BUT, I got good results by adding the following CSS to my project:

.tc-tiddler-body ul li p::first-child, .tc-tiddler-body ol li p::first-child {
  display
: inline
}


You might want to make sure that solution is working in all cases though before moving forward with it.

Flibbles

unread,
May 27, 2020, 1:34:33 PM5/27/20
to TiddlyWiki
Sorry. Make that this:

.tc-tiddler-preview li > :first-child, .tc-tiddler-body li > :first-child
{
  display
: inline
}

If you do anything like

* list items
  With multiple lines
  Like this
* Or even
  * Multiple list

Just make sure it's producing what you expect.

Kevin Kleinfelter

unread,
May 27, 2020, 1:45:05 PM5/27/20
to tiddl...@googlegroups.com
Beautiful!  Thanks to you both.

Another question: I use KaTeX. anstosa seems to pass that through to KaTeX. The standard plugin doesn't.  Perhaps there is a pragma?

e.g. This should render as a formula: $$\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi$$

Where can I read about the pragma and what each one does?

Thanks for the help!


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/2I1U1tHWb9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5aa1b73d-04b5-4f97-bab6-c698a0f78975%40googlegroups.com.

Flibbles

unread,
May 27, 2020, 1:53:33 PM5/27/20
to TiddlyWiki
\rules is pretty poorly documented, but here's the best I can give you. That's what documenation exists, the list of rules, and the relevant source.

I glanced at katex, and the wikirule's name is "latex-parser", so just add that to the end of the renderWikTextPragma string.

Kevin Kleinfelter

unread,
May 27, 2020, 2:02:56 PM5/27/20
to tiddl...@googlegroups.com
Absolutely fantastic!  Thank you.

On Wed, May 27, 2020 at 1:53 PM Flibbles <challenge...@gmail.com> wrote:
\rules is pretty poorly documented, but here's the best I can give you. That's what documenation exists, the list of rules, and the relevant source.

I glanced at katex, and the wikirule's name is "latex-parser", so just add that to the end of the renderWikTextPragma string.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/2I1U1tHWb9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Kevin Kleinfelter

unread,
May 27, 2020, 2:24:28 PM5/27/20
to tiddl...@googlegroups.com
Back to my original question regarding disabling the plugin, I think I know what happened.

I think I must have visited the $:/plugins/anstosa/tw5-markdown tiddler, and opened+saved the shadow tiddler $:/plugins/anstosa/tw5-markdown/wrapper.js.  

That would cause a $__plugins_anstosa_tw5-markdown_wrapper.js file to be created.  When I disabled the plugin via Control Panel, it only disabled $:/plugins/anstosa/tw5-markdown and not the 'realized' shadow tiddler.

On Wed, May 27, 2020 at 12:09 PM Flibbles <challenge...@gmail.com> wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/2I1U1tHWb9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Flibbles

unread,
May 27, 2020, 2:25:58 PM5/27/20
to TiddlyWiki
That would do it. I'm glad it's working out for you now. :)

Kevin Kleinfelter

unread,
May 27, 2020, 3:05:41 PM5/27/20
to tiddl...@googlegroups.com
More question:

This works with KaTeX, whether content-type is set to TW5 or Markdown.
  • $$\ce{CO2 + C -> 2 CO}$$
With type=text/vnd.tiddlywiki, the following works, but with text/x-markdown it just shows up as text (without the $$):
  • $$\ce{CO2 + C -> 2 CO}$$
So it looks like the pragma latex-parser is only working for single-line LaTeX.  Is there further magic which can be worked to make multi-line LaTeX work?

Kevin Kleinfelter

unread,
May 27, 2020, 3:06:38 PM5/27/20
to tiddl...@googlegroups.com
Whoops! Typo:


Kevin Kleinfelter

3:04 PM (0 minutes ago)
to tiddlywiki
More question:

This works with KaTeX, whether content-type is set to TW5 or Markdown.
  • $$\ce{CO2 + C -> 2 CO}$$
With type=text/vnd.tiddlywiki, the following works, but with text/x-markdown it just shows up as text (without the $$):
-----
$$
\ce{CO2 + C -> 2 CO}
$$
--------

So it looks like the pragma latex-parser is only working for single-line LaTeX.  Is there further magic which can be worked to make multi-line LaTeX work?

Flibbles

unread,
May 27, 2020, 4:06:03 PM5/27/20
to TiddlyWiki
This is because there's a bug in tiddlywiki/markdown where it's not properly respecting the $:/config/markdown/breaks tiddler. I'll submit a PR later today, but it'll probably take a while before it gets into master. Jermolene is still recovering.

In the meantime, attached is a shadow-override you can drop in that has my "5 minutes of testing" guarantee.

(Google Groups won't let me upload anything but a text file, so you need to remove the ".txt" from the end before putting it into your project.)
$ _plugins_tiddlywiki_markdown_wrapper.js.tid.txt

Kevin Kleinfelter

unread,
May 27, 2020, 5:09:46 PM5/27/20
to tiddl...@googlegroups.com
Hmmm... I'm not seeing any effect.  I saved it as '$__plugins_tiddlywiki_markdown_wrapper.js.tid' in my tiddlers folder, and restarted TW.

I do have a plugins/tiddlywiki/markdown/wrapper.js.  Is that overriding the .tid maybe?  If I hide it and restart, I lose rendering of Markdown.  


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/2I1U1tHWb9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Flibbles

unread,
May 27, 2020, 5:22:40 PM5/27/20
to TiddlyWiki
Odd. It's working for me.

Are you certain you actually removed the .txt file extension? My operating system only pretended to when I first tried it just now. If you search for "wrapper" in your tiddlywiki, and you get a tiddler with a title that has a filepath relative to your operating system, then it's still txt.

Flibbles

unread,
May 27, 2020, 5:49:54 PM5/27/20
to TiddlyWiki
Also, I've put more effort into it and have created the version of wrapper which is better tested, and supports hardbreak (putting spaces at the end of lines to force a linebreak). This is the one I'll be submitting in my PR.
wrapper-v2.js.tid.txt

Kevin Kleinfelter

unread,
May 27, 2020, 6:39:50 PM5/27/20
to tiddl...@googlegroups.com
Huh. I changed content-type to text and then back to markdown and now it (the old one) works.  I'm going to guess it was a caching issue.
... and I've applied your v2, and that works too.

Thank you for all your effort!


On Wed, May 27, 2020 at 5:23 PM Flibbles <challenge...@gmail.com> wrote:
Odd. It's working for me.

Are you certain you actually removed the .txt file extension? My operating system only pretended to when I first tried it just now. If you search for "wrapper" in your tiddlywiki, and you get a tiddler with a title that has a filepath relative to your operating system, then it's still txt.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/2I1U1tHWb9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Flibbles

unread,
May 27, 2020, 6:53:59 PM5/27/20
to TiddlyWiki
No problem. I was the one who convinced you to move to tiddlywiki/markdown.I might as well make sure it works for you.

David Gifford

unread,
May 27, 2020, 7:27:13 PM5/27/20
to TiddlyWiki
Reply all
Reply to author
Forward
0 new messages