How to disable automatic renaming file

178 views
Skip to first unread message

Cyril SANTUNE

unread,
Oct 6, 2017, 5:20:09 AM10/6/17
to TiddlyWiki
Hi, I have some plain text file with ".dot" extension.
When I save one file with the ".dot" it is rename to ".dot.txt".

How can I disable that ?

Jed Carty

unread,
Oct 6, 2017, 5:46:51 AM10/6/17
to TiddlyWiki
What operating system are you using? That sounds like a windows thing.

Cyril SANTUNE

unread,
Oct 6, 2017, 6:18:45 AM10/6/17
to TiddlyWiki
Yes i'm on Windows with the node.js "mode"

PMario

unread,
Oct 6, 2017, 9:52:44 AM10/6/17
to TiddlyWiki
On Friday, October 6, 2017 at 11:20:09 AM UTC+2, Cyril SANTUNE wrote:
Hi, I have some plain text file with ".dot" extension.
When I save one file with the ".dot" it is rename to ".dot.txt".

TW is designed to deal with tiddlers. It isn't designed to be an all purpose text editor.

The extension is defined by the tiddler type. If you use type: "text/plain" it is set to .txt   ... because it's defined by the tiddler mime type.

Tiddlers with no type default to .tid because type is set to "text/vnd.tiddlywiki" by the core.

In TW tiddler titles are not necessarily related to OS file system names. eg: asdf.tid could be imported as myName title.
 
How can I disable that ?

I don't know a way to disable this behvior. ...

IMO you'll need a plugin, that registers your extension with an new eg: "text/x-myType" mime type, that probably handels your files as text files and doesn't add an extension. Instead it should use the tiddler name. .... AND it needs to create a ??.dot.meta file, which contains the TW metat data.

.meta is needed since the server startup procedure will ignore unknown file extensions without a .meta file.

-m

Jed Carty

unread,
Oct 6, 2017, 10:09:00 AM10/6/17
to TiddlyWiki
I am confused about what is going on now. Are you exporting a tiddler as a text file (using the export function in tiddlywiki) and giving it a name that ends it .dot?
Because the exporter adds the extension when exporting so that is expected behaviour. If that is what is going on than you can make your own custom exporter (it is simple) and have it use a .dot extension instead. Documentation is here: http://tiddlywiki.com/#Creating%20a%20custom%20export%20format 

Otherwise I think we need a clearer explanation of what you are trying to do.

Cyril SANTUNE

unread,
Oct 6, 2017, 11:08:53 AM10/6/17
to TiddlyWiki
I don't remember how I import the file. I manually create ".meta" for lot of my file. I probably do the same for the ".dot" file.

I don't understand why you say "TW is designed to deal with tiddlers. It isn't designed to be an all purpose text editor." TW handles my markdown file properly and I also put ".pdf", images, etc in it.

My purpose is to use tags for all my file in my documentation directory. There is several types of file. However I want to tag everything (not only text file). 

PMario

unread,
Oct 6, 2017, 11:10:28 AM10/6/17
to TiddlyWiki
On Friday, October 6, 2017 at 4:09:00 PM UTC+2, Jed Carty wrote:
I am confused about what is going on now.

node.js version has changed behaviour for "writing new files" quite a bit.
see: http://tiddlywiki.com/#Release%205.1.14 ... Node.js Improvements
especially: Fixed multiple issues the creation of new tiddler files by the filesystem adaptor ..
 
Are you exporting a tiddler as a text file (using the export function in tiddlywiki) and giving it a name that ends it .dot?

If you crate a new tiddler __and__ immmediately change the type to eg: "text/plain" it will be saved as xx.txt and xx.txt.meta
Same for .md and .md.meta  or .css and .css.meta and some others.

Important: New tiddlers only!

-m

Cyril SANTUNE

unread,
Oct 6, 2017, 11:11:28 AM10/6/17
to TiddlyWiki
@Jed Carty : I try the exporter but I fail.

I'm not use about the configuration. Can I simply copy the content in the documentation or the exportFilter must be change? I am not sure to understand the documentation.

\define renderContent()
{{{ $(exportFilter)$ ||$:/core/templates/plain-text-tiddler}}}
\end
<<renderContent>>

PMario

unread,
Oct 6, 2017, 5:59:42 PM10/6/17
to TiddlyWiki
On Friday, October 6, 2017 at 5:08:53 PM UTC+2, Cyril SANTUNE wrote:
I don't remember how I import the file. I manually create ".meta" for lot of my file. I probably do the same for the ".dot" file.

That's ok. The problem is, that TW doesn't have an idea of your .dot extension, what it means and how to handle it. At the startup it regesters about 30 file extensions, where it knows how to deal with them. 

If you set the type field in the .meta file to "text/plain", tiddlywiki knows the mime type and imports it as a text file.

The title field eg: test.dot   is just a string. the extension doesn't have any meaning! That's the reason, why TW renames your file if you edit the tiddler.
It uses the type field to set the extension. ... text/plain -> .txt

In your case this results to: test.dot.txt  ... where the first .dot  is just a part of the name.

I don't understand why you say "TW is designed to deal with tiddlers.

As written above. There is a limited ammount of extensions, that TW knows. ".dot" isn't one of them, so it's ignored. .... If a new tiddler is created it never uses the tiddler title to create the file extension. It uses the tiddler mime-type field!
 
It isn't designed to be an all purpose text editor." TW handles my markdown file properly and I also put ".pdf", images, etc in it.

Because they are known.
 
My purpose is to use tags for all my file in my documentation directory.

ok
 
There is several types of file. However I want to tag everything (not only text file).

That's fine. ... But as I wrote, you'll probably need a plugin, that registers your extension(s) with some rules, how to view and save them.

-mario


Cyril SANTUNE

unread,
Oct 9, 2017, 3:42:14 AM10/9/17
to TiddlyWiki
Thanks, I modify the "boot.js" file. It is probably not the best way to do it but it seems to work.

TonyM

unread,
Oct 9, 2017, 8:29:53 AM10/9/17
to TiddlyWiki
Mario
I would to love to register some additional extensions or export import additional extensions as text tiddlers. so if you know a plugin please pass it on. otherwise I will create a custom export.

regards
tony

PMario

unread,
Oct 9, 2017, 10:33:35 AM10/9/17
to TiddlyWiki
On Monday, October 9, 2017 at 2:29:53 PM UTC+2, TonyM wrote:
I would to love to register some additional extensions or export import additional extensions as text tiddlers.

I first thought, we could add mime-type parameters, __but__ according to the spec. They are not dynamic. .. So you need to register them prior to using them.

So we would need an additional tiddler field, that would specify and overwrite the default ".txt" configuration for text/plain. Since the "text/plain" check is hardcoded several times in the TW source, we would need to be careful! ...
 
so if you know a plugin please pass it on.

There is no plugin atm. 

-mario
Reply all
Reply to author
Forward
0 new messages