Ah, we did finally settle on using the  $:/config/FileSystem* filters, 
possibly to set custom extensions..... so you appear to have everything 
setup correclty.

But it also looks like we do have a bug with the current behavior. Any 
tiddlers loaded from OUTSIDE the Wiki directory will try to write back to 
that location, and the last check for this always encoded those file-paths 
and writes the file to the `tiddlers/` folder instead.

There is a security concern this has uncovered, but I will write up a bug 
report and we will try to get a fix in by the 5.1.24 release.

For now, I can suggest moving the source-directory into your Wiki directory 
(it can be parallel to your `tiddlers/` directory).

Best,
Joshua Fontany

On Sunday, February 7, 2021 at 3:44:04 PM UTC-8 Joshua Fontany wrote:

> Thank you for your config/setup. When we were updating the 
> `tiddlywiki.files` behavior for 5.1.23 we were still experimenting with how 
> it would interact with the $:/config/FileSystem* tiddlers.
>
> I believe that the final implementation was that as long as your 
> `tiddlywiki.files` config is setup correctly, you do not need to mess with 
> any $:/config/FileSystem* filters.
>
> The `isEditableFile: true` flag should cause TW to save the 
> location-on-disk for that tiddler and write it back to that location 
> automatically. Changes to non *.tid files will cause a *.meta file to be 
> generated storing the non-text-body "metadata" (all other fields).
>
> I will attempt to recreate your setup to see if we have a bug or what else 
> is going on.
>
> Thanks!
> Best,
> Joshua Fontany
>
> On Sunday, February 7, 2021 at 2:50:25 PM UTC-8 RA wrote:
>
>> The example of $:/config/FileSystemPaths in 
>> https://tiddlywiki.com/#Customising%20Tiddler%20File%20Naming does not 
>> include a filter matching the external notes, so I am questioning whether 
>> your recommendation is correct.
>>
>> On Sunday, February 7, 2021 at 1:51:09 PM UTC-8 RA wrote:
>>
>>> Added a matching filter to $:/config/FileSystemPaths, same result. 
>>> Tried both absolute and relative path. I know the filter is correct because 
>>> it generates a filename with the correct absolute path encoded (all slashes 
>>> replaced by %2F).
>>>
>>> Added $:/config/FileSystemExtensions as well, the extension part is now 
>>> ok. Here's a universal filter that will keep the extension as is: 
>>> [split[.]last[]addprefix[.]] 
>>>
>>>
>>> On Saturday, February 6, 2021 at 7:14:11 PM UTC-8 Mark S. wrote:
>>>
>>>> I'm not an expert on this, but I don't see anything in your 
>>>> $:/config/FileSystemPaths that would match the files you imported. It 
>>>> looks 
>>>> to me like you need one that starts [tag[external]... or that matches 
>>>> prefix scripts/t-sql/ . Also, if you read further here 
>>>> <https://tiddlywiki.com/#Customising%20Tiddler%20File%20Naming> , you 
>>>> need to specify the text extension in $:/config/FileSystemExtensions 
>>>> <https://tiddlywiki.com/#%24%3A%2Fconfig%2FFileSystemExtensions> with 
>>>> something like:
>>>>
>>>> [tag[external]then[.sql]] (or whatever your matching/extension logic 
>>>> is).
>>>>
>>>>
>>>>
>>>> On Saturday, February 6, 2021 at 4:33:39 PM UTC-8 RA wrote:
>>>>
>>>>> In the wiki, the external tiddler's name is `scripts/t-sql/detach.sql`, 
>>>>> and I like it exactly that way.
>>>>>
>>>>> On Saturday, February 6, 2021 at 4:14:59 PM UTC-8 RA wrote:
>>>>>
>>>>>> I am using `tiddlywiki.files` method.
>>>>>>
>>>>>> tiddlywiki.files:
>>>>>>
>>>>>> {
>>>>>>     "directories": [
>>>>>>         {
>>>>>>             "path": "/srv/git/scripts/t-sql",
>>>>>>             "isTiddlerFile" :false,
>>>>>>             "isEditableFile": true,
>>>>>>             "fields": {
>>>>>>                 "title": {"source": "filename", "prefix": 
>>>>>> "scripts/t-sql/"},
>>>>>>                 "created": {"source": "created"},
>>>>>>                 "modified": {"source": "modified"},
>>>>>>                 "type": "text/plain",
>>>>>>                 "tags": ["t-sql", "external"],
>>>>>>                 "linux-path":  {"source": "filename", 
>>>>>> "prefix":        "/srv/git/scripts/t-sql/"},
>>>>>>                 "win-path": {"source": "filename", "prefix": 
>>>>>> "c:\\vm\\srv\\git\\scripts\\t-sql\\"}
>>>>>>             }
>>>>>>         }
>>>>>>     ]
>>>>>> }iddler
>>>>>>
>>>>>> $:/config/FileSystemPaths:
>>>>>>
>>>>>> [is[system]!has[draft.of]removeprefix[$:/]addprefix[_system/]]
>>>>>> [is[draft]search-replace:g:regexp[/|\\],[_]addprefix[drafts/]]
>>>>>> [tag[task]addprefix[mytasks/]]
>>>>>> [!tag[external]]   -- Tried without this filter, same result. (This 
>>>>>> comment is for the posting, it's not in the tiddler.)
>>>>>>
>>>>>> Wiki directory structure:
>>>>>> .
>>>>>> +-- tiddlers
>>>>>> ¦   +-- %2Fsrv%2Fgit%2Fscripts%2Ft-sql%2Fdetach.txt               -- 
>>>>>> these two appear after I edit and save the external tiddler
>>>>>> ¦   +-- %2Fsrv%2Fgit%2Fscripts%2Ft-sql%2Fdetach.txt.meta    -- and 
>>>>>> the original file `/srv/git/scripts/t-sql/detach.sql` is deleted 
>>>>>> ¦   +-- …
>>>>>> ¦   +-- scripts
>>>>>> ¦   ¦   +-- t-sql
>>>>>> ¦   ¦       +-- tiddlywiki.files
>>>>>> ¦   +-- _system
>>>>>> ¦   ¦   +-- config
>>>>>> ¦   ¦   ¦   +-- …
>>>>>> ¦   ¦   ¦   +-- FileSystemPaths.txt
>>>>>> ¦   ¦   ¦   +-- FileSystemPaths.txt.meta
>>>>>> ¦   ¦   +-- …
>>>>>> ¦   +-- …
>>>>>> +-- tiddlywiki.info
>>>>>>
>>>>>> On Saturday, February 6, 2021 at 3:28:17 PM UTC-8 
>>>>>> [email protected] wrote:
>>>>>>
>>>>>>> To clarify, what method are you using to load/import these scripts 
>>>>>>> with the Node.js Tiddlywiki server?
>>>>>>>
>>>>>>> Best,
>>>>>>> Joshua F
>>>>>>>
>>>>>>> On Saturday, February 6, 2021 at 1:16:01 PM UTC-8 RA wrote:
>>>>>>>
>>>>>>>> Forgot to mention I'm running it on Node.js.
>>>>>>>>
>>>>>>>> On Saturday, February 6, 2021 at 12:17:36 PM UTC-8 RA wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I got my collection of scripts to show up in my wiki as plain text 
>>>>>>>>> tiddlers. ( I am using an absolute path, and the scripts have various 
>>>>>>>>> extensions like ".sql",".ps" etc.). When I edit them, however, they 
>>>>>>>>> get 
>>>>>>>>> saved not at the original location, but along with regular tiddlers. 
>>>>>>>>> Their 
>>>>>>>>> extensions are stripped and replaced with ".txt", and the absolute 
>>>>>>>>> path 
>>>>>>>>> added to the name with slashes encoded as "%2F". I'd like the scripts 
>>>>>>>>> to be 
>>>>>>>>> saved back to the original location with the name and extension 
>>>>>>>>> unchanged. 
>>>>>>>>> Is that possible?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9fe105d6-5d70-463a-95d0-76460ba73799n%40googlegroups.com.

Reply via email to