How to index all the files and folders inside a folder?

114 views
Skip to first unread message

Prestige

unread,
Dec 6, 2020, 11:16:37 PM12/6/20
to TiddlyWiki
Hello all,

Currently I am using this tiddlywiki.files:

{
    "directories": [
    {
            "path": "../NotesVault",
        "filesRegExp": "^.*\\.md$",
            "isTiddlerFile": true,
            "fields": {
                "title": {"source": "basename-uri-decoded"},
                "created": {"source": "created"},
                "modified": {"source": "modified"},
                "type": "text/x-markdown"
        }
    },

    {
            "path": "../tiddlers",
        "isTiddlerFile": true
    }
   ]  
}

But the folders inside the "NotesVault" isn't getting indexed in the Wiki. What should I add to this file?

Joshua Fontany

unread,
Dec 7, 2020, 7:56:14 PM12/7/20
to TiddlyWiki
We would need to see the folder structure to troubleshoot. I have a feeling the directory path is not correct. Where on disk is this tiddlywiki.info file located within your folder structure?

For example, if your folder structure is so that the "tiddlywiki.files" config file is inside a folder within your "wikiFolder/tiddlers" folder, like so

wikiFolder
|-- tiddlywiki.info
|-- NotesVault/  
|-- tiddlers/
|----NotesImport/
|------tiddlywiki.files

Then the tiddlywiki.files data is being loaded from "wikifolder/tiddlers/NotesImport/tiddlywiki.files", and so the path back to the vault has to include 2 "move up one level" relative shortcuts: ` "path": "../../NotesVault"  `.

With only a single "../" in the relative path, the path pointer is inside" the "wikiFolder/tiddlers/" directory....

I hope this example helps.

Best,
Joshua Fontany



Joshua Fontany

unread,
Dec 7, 2020, 7:57:47 PM12/7/20
to TiddlyWiki
Also, get rid of the `"isTiddlerFile" : true`, that may be causeing the files to be misread if the path is in-fact correct. *.md files are their own type, not "tiddler files".

Best,
Joshua Fontany

Dummy ME

unread,
Dec 7, 2020, 11:12:57 PM12/7/20
to tiddl...@googlegroups.com
Hi Joshua
Thanks for the reply. 

Yes, the folder path seems to be correct. My tiddlywiki.files is inside tiddlers, while NotesVault is a folder behind. 

I will get rid of the 'isTiddlerFile=true', and see if all the subfolders of NotesVault is included. 

--
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/KbPf73oEPxo/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/fcd54146-a73d-4246-9943-616cf37f39c7n%40googlegroups.com.

Joshua Fontany

unread,
Dec 8, 2020, 7:14:20 PM12/8/20
to TiddlyWiki
I do not think that subfolders are automatically read when using "tiddlywiki.files" configs. Unlike the main "tiddlers/" folder, those are not recursively searched.

From https://tiddlywiki.com/prerelease/#tiddlywiki.files%20Files

The format of the file is an object with two optional properties:

  • tiddlers - an array of objects describing external files with the ability to override or modify any of the fields read from the file
  • directories - an array of objects describing external directories, a filter determining which files within those directories should be processed, and the ability to override or modify any of the fields read from the file
... and later

  • path - (required) the absolute or relative path to the directory containing the tiddler files (relative paths are interpreted relative to the path of the tiddlywiki.files file). Note that the directory is not recursively searched; sub-directories are ignored
So you will need a separate object inside the Directories array for each sub-folder. Just copy and paste the whole config object, and add the subdirectory to the path. Repeat as necessary.

This looks like an area that could be improved in the next edition, I will check with the GitHub dev team. :)

Best,
Joshua F 

Dummy ME

unread,
Dec 9, 2020, 12:14:46 AM12/9/20
to tiddl...@googlegroups.com
Yes, definitely. ,annually adding folders is actually a hassle. There are quite a few folders and there might be some changes along the way, which would mean changing the path every time!

Thanks for the clarification though, I will move my folders into tiddlers folder then.

Thanks a lot

Reply all
Reply to author
Forward
0 new messages