Giter VIP home page Giter VIP logo

tw-commander's Introduction

TW-Commander

A tiddler toolkit for Tiddlywiki 5. Tiddler Commander can perform many kinds of batch operation like create or delete tiddlers, rename tiddlers, add/remove fields, tags, inspect tiddlers and do search and replace in all fields of tiddler.

Project code and demo

Tiddler Commander at Tiddlywiki Google forum

Batch operation

Making the same changes to large numbers of tiddlers in TW5 can be repetetive and time consuming.

  • Batch operations work on groups of tiddlers at the same time and make changes 'in bulk', in one go.

  • Batch operations operate on groups of tiddlers that share matching criteria.

  • Tiddlers which share a common tag, a common field, a word in their title, or were created on the same day, month or year are all candidates for batch operations.

As a result batch operations can save users a great deal of time but, because they work on several tiddlers at once, the price of a mistake is multiplied! Back-up your wiki!

Types of Batch operations :

  • create/delete bulk of tidlers
  • Rename tiddlers
  • add a suffix/prefix to title
  • add ordinal number to title
  • Add/remove tag or any field
  • Change/replace the content of any field
  • Inspect tiddlers

Installation

Eeasy way single file (packaged version, see manual installation)

  • download the commander.tid from packaged folder and drag and drop to your wiki, or
  • open the demo and drag the plugin from demo page and drop into your wiki

Client-Server installation (separate files)

  • for node.js (server version) download the commander folder from source folder and paste in your Tiddlywiki plugins folder
  • for local installation put the commander folder into your local plugins folder under your wiki folder

tw-commander's People

Contributors

flibbles avatar kookma avatar marxsal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tw-commander's Issues

Option to prevent updating modified field

Some of the operations performed are mundane (like changing id field) and 100s of tiddlers showing up in recent tab is unhelpful. A toggle to prevent that would be very useful.

Images and PDFs are deleted when being exported from Docker-Container using lazy-images mode

I'm using tiddlywiki in several Docker-Containers (based on nicolaw/tiddlywiki). To make the TW start page load faster especially on my smartphone they run with TW_ROOTTIDDLER: $$:/core/save/lazy-images.

In order to upgrade from TW 5.2.2 to 5.2.3 I built a new container and wanted to export the content from the old to the new container. For this I used TW-Commander with the filter "[all[tiddlers]]-[is[system]]" and exported all the found tiddlers as JSON. Importing the JSON-file into the new container seemed to be ok.
277 Tiddlers were imported.
I later discovered that all images and PDFs were lost. Even in the source-container all tiddlers were marked as modified and the image- and pdf-content disappeared. The size of the JSON export file was 1,5 MB. The only reason for this behavior had to be the lazy-images mode.

Fortunately I had a backup. When I repeated the process running the source container with TW_ROOTTIDDLER: $$:/core/save/all, everything worked fine. Now the JSON-export-file had a size of 49 MB. All content was imported.

I like TW Commander because of its powerful functionality. But using it in lazy-images mode it seems to be quite dangerous :-(
From the users point of view there is no hint not to be able to use the lazy-images mode.

Best regards
xgadscu

Installation on Node.js failed

Hi,
I'm experiencing problems with the installation on Node.js... I've followed the guide, stop server, copy source/commander to tiddlywiki/plugins/kookma/, modify tiddlywiki.info and start server. But when I browse to $:/Commander I'm getting an funny looking tiddler. Also the icon for Commander is not in the page controls.
Below a screenshot.
TW-Comander_Screenshot from 2021-09-16 11-43-44

Old Tag drop-down list

the drop down list of old tag in tag tab doesn't work it wont open

even after checking the demo website in which the drop-down list doesn't open

Bulk tiddlers exported not workes!

I select multiple tiddlers to export in the list, but always only get the first tiddler in the file. But the log says that everything is fine. But this is not so!

And "Number of tiddlers selected for export: 4" but only 1.

"fied" should be "field"

$:/plugins/kookma/commander/field/macros/rename:

msg="""fied `$oldField$` renamed to `$newField$`"""

Suggestion: Regex section allows non-destructive "test mode"?

An issue with Regular Expressions is they can have unpredictable results, especially in the text field.
Safe testing is important to see the effect before application.

I'm wondering if it would be possible to have a "test-mode" where you apply regex to a temporary test tiddler before you apply it across Tiddlers?

Or maybe http://tw-regexp.tiddlyspot.com could have a subset of TC that allows that?

[Feature request] Allow TC to modify/create non-existent tiddlers

Currently you can only apply batch changes to tiddlers that actually exist. So, for instance, if you wanted to add color to a set of tags that aren't represented by tiddlers, you couldn't do it with TC. Having an option to allow adding new fields to also create new tiddlers would be useful in many such cases.

Thanks!

New fields is added as lower case

If you add a new field to a selection of tiddlers with a field name of, say, "NewField" it is added as "newfield". Can this be fixed?

Renaming the field does not work either from "newfield" to "NewField".

Search and replace regex/non-regex flag, and filter differences found flag [Improvement request]

Hello.

I think it'll improve the search and replace functionality by adding non-regex flag. It gets very annoying having to escape certain symbols and I have to look at the help section to remember which symbols are meant to escape. Not all of us have good memorisation skill, or maybe some of us just aren't familiar with regex.

I think it would be even better if this flag is added to every possible search operations. So that regex can be used if needed, and turn off of when it isn't.

This will also help a lot of trouble having to go look at the the differences since non-regex search is more certain than annoying regex operations that could produce unexpected results due to the regex symbols -- also which is very unhelpful since the differences does not list only tiddlers that found to have match/differences, it list even the tiddlers that found no matching string to replace. I believe this need improvement as well. Maybe a default enabled flag that filter only found differences.

Thank you for creating and maintaining this amazing plugin! We hope to see it become even better!

This issue is written according to latest 2.1.5 commit.

cannot delete tag with a space [ ] as first charachter

I had some tags where, by accident they had a space in front of the text.

I tried to use commander to add a correct tag and delete the one with space in front.

  1. search for [tag[ issue]
    2- select all tiddlers
  2. add new tag (ok)
  3. delete old tag [ issue]

I tried "delete tag" and replace tag but neither worked and the log just show
"2020-02-10 11:58:57 remove-old-tag-bulk" but with no entries below the text.

Add fields not working if plugin "JSON Mangler" is enabled

Hi,

Maybe this is not TW-Commander's fault, but I'd like to report this phenomenon I saw.

I have the plugin "JSON Mangler" (https://github.com/joshuafontany/TW5-JsonMangerPlugin) installed, and as a result, my TW-Commander's "Field > Add fields" couldn't work because every time I type something into "field name" or "field value" input, the just typed in character get deleted immediately. If I disable "JSON Mangler" plugin, than it works normally.

TW-Commander for NodeJS

So after having experimented with your plugin because of our discussion, I've identified a few times your plugin would have been helpful just this afternoon.

However, I have many projects, and they work through NodeJS. Instead of installing Commander individually into all of them, I'd much prefer to be able to install Commander in my /usr/local/lib/node_modules/tiddlywiki/plugins directory and then have my servers import them on startup by having commander listed under plugins in my project's tiddlywiki.info file. That way, I only need one instance of TW5-Commander on my machine.

Except, the only thing in your repository is the precompiled plugin. That's only good for standalone tiddlywiki.

Is there any chance you could include your individual source files in a /kookma/commander?
It'd also allow other contributors to help out. I would have made a pull request for the change we discussed earlier, but I couldn't because I had no source files to work with.

-Flibbles

Document the modularity better?

I find the docs already pretty good.

The modularity of the design in TC is really good. But it might be worth documenting the modularity more as TC is a tool that users can extend. That is its strength. Its got a consistent internal design you can hook into.

Because TC is so well-featured it means that you can build an app from it, or extend it, without having to yet again remake basic functions. The basic functions are already done by it.

Option to use a sub-branch of a toc as search criterion

I like to use Tiddlywiki for documenting several things. The topics are organized as sub-branches of a toc.
Now I want to be able to export such sub-branches. Is it possible to introduce an option in TW-commander, which allows to gather all tiddlers of a sub-branch in order to export them?

Maybe it is already possible and I missed something.

Best Regards
xgadscu

Spaces in buttons need to be dealt with

$:/plugins/kookma/commander/buttons/pagecontrol

Here are my modifications:

\whitespace trim
\define commander-button(class)
\whitespace trim
<$button to="$:/Commander" tooltip={{$:/language/Buttons/Commander/Hint}} aria-label={{$:/language/Buttons/Commander/Caption}} class="""$(tv-config-toolbar-class)$ $class$""">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/plugins/kookma/commander/images/commander.svg}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Commander/Caption}}/></span>
</$list>
</$button>
\end

<$list filter="[list[$:/StoryList]] +[field:title[$:/Commander]]" emptyMessage=<<commander-button>>>
<<commander-button "tc-selected">>
</$list>

OCD, can't accept one more or less space

Rename Fields Make Them Lowercase

Before TW 5.2.0 Commander used to convert field names to lower case and space to underscore.
From TW 5.2.0+ these restrictions are lifted.

Set field value to the value of another field

I'm not sure if I may have missed this ability, but as far as I can tell, you can only replace hard coded text in a field. I have the need to set the value of one field to the value of another field for a few hundred tiddlers. Would be nice to have the option for 2 dropdown menus, one as source field and the other for target field.

Not functioning on TiddlyDesktop

Hey, just downloaded this plugin. Not a super accomplished coder here, but I installed it on TiddlyDesktop, and the image won't display on the toolbar, just a blank area, and when I try to open it as its own window through the manager, it gives me a javascript error and asks me to reload. Any idea what to do?

Adding new field "chapter" wipes the text field

I was enjoying using the power of Commander until this happened. For a batch of tiddlers, I tried to add a new field "chapter". Commander erased all contents of all tiddlers (it wiped the text field). Thankfully, I had made a back up.

I restored the tiddlers, tried again, same result - batch of empty tiddlers. :(

TC 2.1.0
TW 5.1.21
Firefox 79.0

DOTALL mode missing?

I have a search and replace job which I think I need DOTALL to work with, but the interface doesn't allow DOTALL:

first match
global match
multiline mode
global multiline mode

If you're curious, my RE can be seen at https://regexr.com/7i46v (it uses global and DOTALL).

Design critique

I've been using Commander off and on since it synced up with Relink, and it's definitely useful, but there are a few design choices that seem like they could be improved upon. This is just a critique, and this issue can absolutely be closed after you've read it.

  1. There is a dropdown arrow labeled "Select Tiddlers" which you must always expand in order to use Commander at all. I can't think of any reason why it would ever not be expanded since the tiddlers in a list are unselected by default. I suppose in the case that the tiddler list is so long that it pushes the controls off screen, but in that case, perhaps a split view would work better. Maybe the always-expanded list on the left, and the controls on the right, or something like that.
  2. There's a button to "commit" a typed-in filter and show the resulting list, which is incongruous with the rest of Tiddlywiki. In all other places, the list updates with each keystroke.
  3. Also, about the "commit" thing, is Commander doesn't seem to gain any benefit from it. A frequent operation I've done is to change the prefix of several tiddlers. This is tedious with Commander currently, because after I remove the old prefix. The list clears before I can add the new prefix. This seems at odds with the whole "commit" button, which would have me think the list won't change unless that button is pressed again. Right now, I have to add a dummy tag to those tiddlers to re-search for them so I can add the new prefix.

Just as a user, the kind of behavior I feel like would be intuitive would be that either search button to "commit" your search filter, the resulting list doesn't change or unselect until the commit button his hit again. OR the commit button wouldn't exist at all, and the filter list just updates with each keystroke.

Again, feel free to ignore these. I just know how it can be as a developer to sometimes not see how a layman would expect a program to work. I also may not be representative of how everyone uses Commander.

-Flibbles

Question: Does combo search only support of a subset of filter operators?

I ask because I have this situation:

I have a list of tiddler names (>100) that I want to do a batch add field operation. As a trial I created a temporary tiddler workingTemp with field 'list' whose value is set to [[All Else Equal]] [[Allegro Vivace]]. If I do an advanced search using the filter [list[workingTemp]] I get as expected All Else Equal and Allegro Vivace. However using Commander combo search [list[workingTemp]] I get 0 matches.

Thanks.

PS. Thanks for making this plugin it has been a huge time saver.

Boot Issue

Hello,

I installed Commander and it was working great. I had to restart the server it was installed on and now I get this error when I try to start TW:

Error executing boot module $:/plugins/kookma/commander/macro/snr/regexpsub.js: {}

$:/plugins/kookma/commander/macro/snr/regexpsub.js:43
  } catch { return "ERROR IN REG EXPRESSION. YOU MAY NEED TO ESCAPE VALUES"; }
          ^

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInNewContext (vm.js:135:10)
    at Object.$tw.utils.evalSandboxed (/usr/local/lib/node_modules/tiddlywiki/boot/boot.js:456:5)
    at Object.$tw.modules.execute (/usr/local/lib/node_modules/tiddlywiki/boot/boot.js:732:15)
    at /usr/local/lib/node_modules/tiddlywiki/boot/boot.js:772:30
    at Object.$tw.utils.each (/usr/local/lib/node_modules/tiddlywiki/boot/boot.js:78:12)
    at Object.$tw.modules.forEachModuleOfType (/usr/local/lib/node_modules/tiddlywiki/boot/boot.js:771:12)
    at Object.$tw.modules.getModulesByTypeAsHashmap (/usr/local/lib/node_modules/tiddlywiki/boot/boot.js:782:14)
    at Object.exports.startup ($:/core/modules/startup/load-modules.js:31:27)
    at Object.$tw.boot.executeNextStartupTask (/usr/local/lib/node_modules/tiddlywiki/boot/boot.js:2110:10)

Unfortunately, I cannot even get TW started due to this issue, and therefore cannot uninstall Commander or install a new version. Is there a way to fix this without going back to a previous snapshot of the server?

Thanks,
Josh

Suggestion: TC & your Trash-bin be integrated as an "Undo" function?

A long term issue in TW has been that it lacked an "Undo" function. Your "Trash" tool largely addresses that issue.

I'm wondering if it could be integrated with TC in such a way that you can from the interface progressively undo? I.e. click "Undo" once and the last change is restored?

FWIW, at the moment I do by using Mal's "versioning" plugin, but have to remember to use it manually.

A thought! TT

Todos for TiddlyWIki 5.3.0+

Tiddler Commander is a set of tools for batch processing of tiddlers and very common among TW users.
It supports all TW from 5.1.18 - 5.2.3

There request for adding new features and improving the UI which will be done, once official release of TiddlyWiki 5.3.0 is in public access. The reason is 5.3.0 makes implementing Commander more semantic.

List of to dos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.