Giter Site home page Giter Site logo

Comments (7)

scarbajali avatar scarbajali commented on June 3, 2024 2

Thanks for the detailed reply. I will try out your workaround. As in my case datepicker is being called by another plugin (ToDoNow), I've also opened an issue in the caller plugin.

from tiddlyremember.

sobjornstad avatar sobjornstad commented on June 3, 2024

Are you sure your wiki is loading properly with both plugins installed, if you do a full reload of the page? At first glance, this doesn't look like anything related to TiddlyRemember, but rather that TiddlyWiki is failing to load your wiki at all with the date-picker plugin installed, and TiddlyRemember is thus unable to sync it.

from tiddlyremember.

scarbajali avatar scarbajali commented on June 3, 2024

Yes, I'm quite sure. I have installed both plugins in TiddlyWiki (Node.js) and there is no error. The error only appears when I try to synchronize it with Anki. But as I said above, if I disable the DatePicker plugin, the error disappears. So my current flow is:

  1. Disable DatePicker (not to uninstall)
  2. Synchronize TiddlyRemember in Anki.
  3. Enable DataPicker again.

from tiddlyremember.

sobjornstad avatar sobjornstad commented on June 3, 2024

The error didn't happen for me when I merely installed the plugin, but on further investigation it does happen when I include a date-picker widget in a tiddler that TiddlyRemember is rendering. It appears that this is a known bug in the date picker plugin. As I suspected before, TiddlyRemember isn't actually involved here at all, except that it has to render your tiddlers to extract the content and the date picker widget isn't rendering correctly. The reason you don't see this when interactively using your wiki is that the bug only crops up when running noninteractively under Node.js without access to a browser.

So if you really want it fixed, you might visit the thread on that plugin and poke over there, but it sounds like the author of the plugin doesn't know enough about TiddlyWiki on Node.js to fix it themselves, so unless you have that experience, we might be stuck waiting until someone else who does comes along and wants to use the plugin like this!

Workarounds

If you don't ever use a date picker and TiddlyRemember macros on the same tiddler, you could work around the issue by setting the filter in TiddlyRemember's Anki settings to a value that excludes any tiddlers that might end up with date picker widgets rendering within them. You might even be able to do it dynamically by finding the text $edit-date or some such within the text of tiddlers being considered by the filter.

If you want to use them on the same tiddler, a dumb hack would be to wrap all references to the $edit-date widget in a $list widget, like this, such that TiddlyWiki only tries to render the date picker widget if a variable matches a value:

<$list filter="[<myvar>match[myvalue]]">
  <$edit-date field="mydate"/>
</$list>

You would then need to make myvar set to myvalue somewhere on the ViewTemplate that transcludes tiddlers in the story river, so that your date picker widgets would appear (this would almost certainly require overriding a shadow tiddler). TiddlyRemember uses a custom template, $:/plugins/sobjornstad/TiddlyRemember/templates/TiddlyRememberParseable, to render tiddlers and search them for notes, so the variable would stay undefined there and avoid displaying the widget when being read by TiddlyRemember.

from tiddlyremember.

sobjornstad avatar sobjornstad commented on June 3, 2024

(Note to self: in a future version of TR, it might be handy to set a variable within the TiddlyRememberParseable template indicating that TiddlyRemember is running. Then it wouldn't be quite so ugly a hack if you needed to include conditional logic like this.)

from tiddlyremember.

jasonmhoule avatar jasonmhoule commented on June 3, 2024

Another workaround I am playing with is to make shadow tiddlers of offending module scripts and add if (!$tw.browser) { return; } as the first line under a widget's .render method (and also in a few other spots that have caused trouble with TiddlyRemember sync). I only use a browser TW so I'm not sure if this would screw up a wiki running on node (I suspect it might), but it gets the job done for my TiddlyRemember workflow, and I can use TR and other widgets without wrapping them as suggested above.

from tiddlyremember.

sobjornstad avatar sobjornstad commented on June 3, 2024

A variable tr-rendering will be available in the next release to easily distinguish when TiddlyRemember is running.

from tiddlyremember.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.