Right, thanks.
As for the design of the filters themselves, my idea is quite close to
the Tobias', but as for now I'd like to introduce 5 filters:
1. tiddlers to include // if this is not empty, the other filters are
applied to this set rather then to the whole set of tiddlers
2. necessary tags // include only those having this tags
3. unwanted tags // exclude those with these ones
4. unwanted tiddlers // exclude these ones too
5. additional tiddlers // add these after the filtering anyway
but for the usage I'd like to implement first only "2." is relevant.
The first usage I'm talking about is the sharing of tiddlers between
TiddlyWiki documents. Because I want to have some constraints which
will signal me not to break links between documents my idea is to add
a tag like "shared with: A" where A is a "name" of a document which
includes. In this case, when I'd like to change the name of the
included tiddler or delete it, at least I'll see the tag and do it
carefully. But this is rather a virtual constraint, and as I delete a
link in a incuding document, I should be careful anyway (in this
approach nothing will remind me that a tiddler is not in this
document).
***
As for the definition of the filters, there's quite simple way for it
-- use the bracketed lists. The value of the "exTags" variable will
look like
"tagName [[another tag name which contains spaces]]"
As we have the readBracketedList function in Strings.js [1], parsing
is as simple as
exTags = readTagsString.readBracketedList(true);
Now as for the place to define the filters, in the final version I'd
prefer have smth like
<<include
fromWhere
tiddlersToInclude:"..."
necessaryTags:"..."
tagsToExclude:"..."
tiddlersToExclude: "..."
tiddlersToAdd:"...">>
And some arguments can be substituted with the names of slices, if
necessary; but I can't see much use in separating the macros with
their parameters since they are usually used in the IncludeList
tiddler anyway. But here is a tricky thing: despite the fact that
usage of two <<include>> macros is rather unlikely, there should be at
least some notification if it happens.
There's another thing: as the system of the core filters evolves (and
ideally I'd like it to be extensible and separate the aggregation and
representation completely), I should really think of how to apply the
core mechanism here.
***
Now, back to the storage. Ok, so the simple version is a hybrid of
what Tobias and Mario suggested:
config.options.includePluginFilters[thestore]={
...: ...,
...: ...,
...
}
but here the tricky situatioin of few <<include>> tiddlers with the
same target applies: I should process it in a way that user didn't
imply (simple and keeps the user away from some mess) or make the
structure more complicated. I think the first one is the way to go.
Although, as I understand, SystemSettings can't be used in this case,
microplugin like those "zzConfig"s can be employed.
<<<
> Perhaps it's a good idea to set the "filters" as properties of
> hasToPushWhenIncluded itself, what do you think?
To be honest, I actually don't understand, what you try to do. May
be,
because I never wanted to use IncludePlugin or similar. Or, I'm just
to lazy to think about it ;)
<<<
Well, as I understand, in js every function is an object, so I thought
perhaps it would be a good idea to attach the "filters" to the
function which filters itself
(aStore.hasToPushWhenIncluded.includePluginFilters) rather than make
some object in config.options.
***
So, the issues are:
1) config.options.includePluginFilters[aStore] or
aStore.hasToPushWhenIncluded.includePluginFilters ?
2) how (is it possible) to use core filters here?
and also I need to learn the macros' params handling (ok, I know the
locations of most of the documentation [2], [3], [4], [5], [6], [7],
but if there's something else, feel free to add).
[1]
https://github.com/TiddlyWiki/tiddlywiki/blob/master/js/Strings.js
[2]
http://oldwiki.tiddlywiki.org/wiki/Dev:Macros / not migrated yet
[3]
http://oldwiki.tiddlywiki.org/wiki/Dev:Custom_Macros / not
migrated yet
[4]
http://helloworld.tiddlyspace.com/#HelloWorldButtonPlugin
[5]
http://helloworld.tiddlyspace.com/#HelloWorldNamedParamsPlugin
[6]
http://helloworld.tiddlyspace.com/#HelloWorldManyParamsPlugin
[7]
http://groups.google.com/group/tiddlywiki/browse_thread/thread/420f9c8f19c80a25