Tiddlers tagged $:/core/wiki/rawmarkup are not being included on the header during the build process

82 views
Skip to first unread message

Danielo Rodríguez

unread,
Sep 13, 2016, 4:23:02 PM9/13/16
to TiddlyWikiDev
Hello,

I just added some tiddlers with the tag $:/core/wiki/rawmarkup to one of mu plugins. If I run the wiki from node it works perfectly, no issues, no problems, the tiddlers are being included in the head section.
But if I built the wiki using the build command, those tiddlers are not being included on the resulting wiki, which produces big errors on my plugin.

Could someone point me to a solution?

Thanks in advance.

Danielo Rodríguez

unread,
Sep 13, 2016, 4:25:51 PM9/13/16
to TiddlyWikiDev
By the way, this is the template that I'm using:

title: $:/NoteSelf/save/download

\define saveTiddlerFilter()
[[$:/core]] [[$:/isEncrypted]] [[$:/plugins/danielo515/tiddlypouch]] [[$:/themes/tiddlywiki/snowwhite]] [tag[$:/default-config]] [[$:/themes/tiddlywiki/vanilla]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[prefix[$:/config/]] +[sort[title]]
\end
\define savingEmpty()
yes
\end
{{$:/core/templates/tiddlywiki5.html}}


Jeremy Ruston

unread,
Sep 13, 2016, 4:47:24 PM9/13/16
to tiddly...@googlegroups.com
Hi Danielo

> I just added some tiddlers with the tag $:/core/wiki/rawmarkup to one of mu plugins. If I run the wiki from node it works perfectly, no issues, no problems, the tiddlers are being included in the head section.

I guess you mean running the wiki via the --server command? Can you show the complete command line you are using?

> But if I built the wiki using the build command, those tiddlers are not being included on the resulting wiki, which produces big errors on my plugin.

Can you show the complete build command that you are using, and the relevant section of your tiddlywiki.info file?

Best wishes

Jeremy




--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/b61342ca-b682-4430-ae80-8c76b18dbe8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Danielo Rodríguez

unread,
Sep 13, 2016, 5:01:02 PM9/13/16
to TiddlyWikiDev


El martes, 13 de septiembre de 2016, 22:47:24 (UTC+2), Jeremy Ruston escribió:
Hi Danielo

> I just added some tiddlers with the tag $:/core/wiki/rawmarkup to one of mu plugins. If I run the wiki from node it works perfectly, no issues, no problems, the tiddlers are being included in the head section.

I guess you mean running the wiki via the --server command? Can you show the complete command line you are using?

Yes running it via the --server command works flawlessly. 
 

> But if I built the wiki using the build command, those tiddlers are not being included on the resulting wiki, which produces big errors on my plugin.

Can you show the complete build command that you are using, and the relevant section of your tiddlywiki.info file?


This is my build section 

"build": {
"index": [
"--rendertiddler","$:/NoteSelf/save/deploy","index.html","text/plain"],
        "OnlineDemo": [
"--rendertiddler","$:/NoteSelf/save/download","online.html","text/plain"]
}

An my build command is very simple:

$ TIDDLYWIKI_PLUGIN_PATH="/h/My Dropbox/tiddlywiki/plugins/danielo515/tiddlypouchPlugin/master/src/plugins" tiddlywiki ./wiki --verbose --build

Which gives the following output:

Boot log:
  Startup task: load-modules
  Startup task: info after: load-modules before: startup
  Startup task: startup after: load-modules
  Startup task: story after: startup
  Startup task: commands platforms: node after: story
Executing command: build
Executing command: rendertiddler ReadMe readme.md text/html
Executing command: rendertiddler License license.md text/html
Executing command: savetiddler $:/favicon.ico favicon.ico
Executing command: rendertiddler $:/core/save/all online.html text/plain
Executing command: rendertiddler $:/NoteSelf/save/deploy index.html text/plain



I also tried using 

"OnlineDemo": [
"--rendertiddler","$:/core/save/all","online.html","text/plain"],

Same result, no luck.

What I'm doing wrong? The dev edition has stuff on its head and I suppose the flow is exactly the same

 

Jeremy Ruston

unread,
Sep 13, 2016, 5:03:59 PM9/13/16
to tiddly...@googlegroups.com
Hi Danielo

Yes running it via the --server command works flawlessly. 

Are you using any parameters with the --server command? If not, it will use the default template ($:/core/save/all), and not your custom save template.

Best wishes

Jeremy

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.

Danielo Rodríguez

unread,
Sep 13, 2016, 5:15:41 PM9/13/16
to TiddlyWikiDev


El martes, 13 de septiembre de 2016, 23:03:59 (UTC+2), Jeremy Ruston escribió:
Hi Danielo

Yes running it via the --server command works flawlessly. 

Are you using any parameters with the --server command? If not, it will use the default template ($:/core/save/all), and not your custom save template.

Yes I'm using the core/save/all template for the plugin development:

"args": [ "--verbose",
                "--server", "8087",
                "$:/core/save/all",
                "text/plain",
                "text/html"]

 But as I said, changing to the default core/save/all template does not have the desired effect... I tried modifying save all template to the following:

\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[prefix[$:/config/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
\end
{{$:/core/templates/tiddlywiki5.html}}

Just to exclude the -[prefix[$:/config/]] and it is not working neither.
And I can't use such template, because I should be excluding lots of tiddlers....

My folder structure is


/plugin-folder
   
|_demo_wiki


/Other_wiki
   
|_wiki


As you can see on my build command, I'm uncluding the plugin in the plugin path, so the plugin it's being included. But I can't understand why the stuff on the header section is not being included on the header section.... With any of the options I tried (including core/save all)

Jeremy Ruston

unread,
Sep 13, 2016, 5:20:07 PM9/13/16
to tiddly...@googlegroups.com
Hi Danielo

Are the $:/tags/RawMarkup tiddlers shadow tiddlers within $:/plugins/danielo515/tiddlypouch plugin? What happens if you move them into the wiki, so that they are no longer shadow tiddlers?

At the point that you are running the --build command, is the $:/plugins/danielo515/tiddlypouch plugin properly loaded? Or rather, is the plugin loaded in the usual way via tiddlywiki.info?

Best wishes

Jeremy.

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.

Danielo Rodríguez

unread,
Sep 13, 2016, 5:29:13 PM9/13/16
to TiddlyWikiDev


El martes, 13 de septiembre de 2016, 23:20:07 (UTC+2), Jeremy Ruston escribió:
Hi Danielo

Are the $:/tags/RawMarkup tiddlers shadow tiddlers within $:/plugins/danielo515/tiddlypouch plugin?

Yes they are
 
What happens if you move them into the wiki, so that they are no longer shadow tiddlers?

I'll have to try, but I think I found the issue, read below
 

At the point that you are running the --build command, is the $:/plugins/danielo515/tiddlypouch plugin properly loaded? Or rather, is the plugin loaded in the usual way via tiddlywiki.info?

What do you mean with properly? It is being loaded in the usual way, via tiddlywiki.info.

Here is what I think the problem is: In the presentation page I don't want the plugin to be active. So, I have a specific config tiddler on the presentation page:
$./config/Plugins/Disabled/$:/plugins/danielo515/tiddlypouch: yes

 that's why I tried excluding -[prefix[$:/config/]] 

So, because the plugin is inactive, the required stuff is not being included in the rendered wiki, even if I try to exlcude the config prefix.
Is there any possible solution to this? Maybe I should edit the build template? I can see that it already includes shadow tiddlers, so I don't know what else I could do.

Regards

Danielo Rodríguez

unread,
Sep 13, 2016, 6:11:45 PM9/13/16
to TiddlyWikiDev
The only solution that I found is this one proposed by  buggyj 


It works also for deactivated plugins, which was a life saver. Having this integrated into the core is now a must have for me.

Regards

Tobias Beer

unread,
Sep 13, 2016, 6:28:26 PM9/13/16
to TiddlyWikiDev
Hi Danielo / Jeremy,
 
$./config/Plugins/Disabled/$:/plugins/danielo515/tiddlypouch: yes

What exactly does (not) happen to a disabled plugin? If disabling prevents unpacking plugin tiddlers, including shadows then there's little wonder why your packaged tiddlers tagged $:/core/wiki/rawmarkup would not take any effect. You probably have to distribute them separately.

Best wishes,

Tobias.

Jeremy Ruston

unread,
Sep 14, 2016, 3:19:14 AM9/14/16
to tiddly...@googlegroups.com
Hi Tobias

What exactly does (not) happen to a disabled plugin? If disabling prevents unpacking plugin tiddlers, including shadows then there's little wonder why your packaged tiddlers tagged $:/core/wiki/rawmarkup would not take any effect. You probably have to distribute them separately.

That’s correct: disabled plugins are inert, and do not generate any shadow tiddlers.

Best wishes

Jeremy.


Best wishes,

Tobias.

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.

Danielo Rodríguez

unread,
Sep 14, 2016, 3:22:32 AM9/14/16
to TiddlyWikiDev
Hello Tobias,

If you read my answer above you can see that is what I said:they are not being unpacked, and they are not accessible for the filters.

I find odd to be forced to distribute parts of a single plugin as separate plugins just for this reason. Implementing the solution proposed by BG fixes this situation. You should be pretty familiar with his code because there are a bunch of comments from you on his commit proposal :D


As I said, this is a real problem. The good part about it is that the solution exists already, it's just a matter of making it official

Jeremy Ruston

unread,
Sep 14, 2016, 4:28:03 AM9/14/16
to tiddly...@googlegroups.com
Hi Danielo

I’ve just downloaded the source from https://github.com/danielo515/tiddlypouch and had a quick look.

It seems that you’re using $:/core/wiki/rawmarkup to include PouchDB in the browser wiki. (Actually, "$:/core/wiki/rawmarkup” is deprecated, it’s more consistent to use the equivalent “$:/tags/RawMarkup”).

I would strongly recommend a different approach: wrapping "pouchdb-5.4.5.min.js” up as an ordinary TiddlyWiki module tiddler, and allowing it to be executed by TiddlyWiki’s module loader in the usual way. Taking this approach allows you to use the same plugin consistently in the browser and under Node.js, and avoids the problems with $:/tags/RawMarkup (which is only intended as a hack, anyway).

There are several examples of external JS libraries wrapped in this way:


The last five all demonstrate different ways of using the “prefix” and “suffix” properties to wrap the external code, and set things up so that the right globals are exposed to the external code. But the majority of libraries have been integrated without requiring any special adaptation.

Does that all make sense?

Best wishes

Jeremy.


--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.

Danielo Rodríguez

unread,
Sep 14, 2016, 9:00:59 AM9/14/16
to TiddlyWikiDev


Does that all make sense?

Hello Jeremy, 

Yes that makes sense. In fact, that is what I made 
If you checkout to the tag v0.14.4 (or any other previous one) you can see that I took that approach since the beginning




   I would strongly recommend a different approach: wrapping "pouchdb-5.4.5.min.js” up as an ordinary TiddlyWiki module tiddler, and allowing it to be executed by TiddlyWiki’s module loader in the usual way. Taking this approach allows you to use the same plugin consistently in the browser and under Node.js, and avoids the    problems with $:/tags/RawMarkup (which is only intended as a hack, anyway).

As I said, that was what I was doing. But, because I want to be able to load plugins from the database I have to implement several parts of my plugin logic outside of TW environment. This is required (and suggested by you by the way) for being able to inject tiddles before TW boots up. And the first step taken in that direction was moving PouchDB library outside the TW environment and making it available before TW boots.

As you can see I am hitting a wall on every move that I made, but it should be expected when you made such custom things. My most successful attempt for implementing this workflow while preserving the convenient TW environment was OctoWiki, another project that I'm particularly proud of but is not public yet. Basically it is a TW that acts as a CAJA for another TW that runs inside it, pretty fun stuff.

Regards

Danielo Rodríguez

unread,
Sep 14, 2016, 5:13:14 PM9/14/16
to TiddlyWikiDev

Jeremy Ruston

unread,
Sep 18, 2016, 4:01:03 AM9/18/16
to tiddly...@googlegroups.com
Hi Danielo

Why is $:/core/wiki/rawmarkup old and deprecated?

Because it doesn't match the $:/tags/Xxxx pattern used elsewhere in the core.

It is encouraged on developer edition of tiddlywiki

Both those examples should be switched; pull requests welcome!

Many thanks,

Jeremy

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
Reply all
Reply to author
Forward
0 new messages