Comments (3)
I decided to "solve" this by doing a combination of a couple of things:
- I use the method stated here for managing labels (I don't add them individually). Namely, I am just setting the labels in the actions themselves and then using
lib.rulesLabels
. - Now when specifying labels in a filter, I use this function instead of a "bare" label array:
When you call
local nestedLabels(labels) = local splitLabel(label) = std.split(label, '/'); local genSubLabels(label) = [ std.join( '/', splitLabel(label)[:i + 1] ) for i in std.range(0, std.length(splitLabel(label)) - 1) ]; std.flattenArrays([genSubLabels(i) for i in labels]);
nestedLabels(["some/thing", "lol/okay/no"])
the array will be transformed to["some", "some/thing", "lol", "lol/okay", "lol/okay/no"]
, which works perfectly for my needs.
from gmailctl.
There are people calling their labels exactly like that (with slashes), and we don't want to break those use cases.
Perhaps you know this already, but just to make sure: to have that label as nested, you have to add a Some
and a Some/Label
label. After you do this, Gmail will interpret Some/Label/Name
as a sub-label.
Since gmailctl uses Jsonnet, you can implement this in your config directly. See e.g. how we automatically create labels through https://github.com/mbrt/gmailctl/blob/master/internal/data/gmailctl.libsonnet#L68. I think that doing something similar to extendWithParents should work for you.
from gmailctl.
This issue is stale because it has been open for 30 days without activity.
This will be closed in 7 days, unless you add the 'lifecycle/keep-alive' label or comment.
from gmailctl.
Related Issues (20)
- gmailctl should not try to create "INBOX" label HOT 6
- Tests fail with realistic inputs HOT 2
- Cant figure it out HOT 1
- Option for `gmailctl download` to "download" a local XML file HOT 2
- Add option to apply all parent labels if `gmailctl` is managing labels HOT 4
- Consider editing repository setings to remove "Packages" section HOT 1
- Progress indicators HOT 4
- Token has been expired or revoked HOT 6
- Following flow for sorting mails possible? HOT 3
- Potential GMail bug causes exporting to XML not working with category action rules, workaround needed HOT 2
- Support diffing with colordiff/delta/etc HOT 4
- Why does gmailctl split this kind of "or" filter into separate rules? HOT 19
- Support `deliveredto` rule HOT 3
- Could libsonnet helper files be situated next to the tmp file for `gmailctl edit` to avoid import path errors? HOT 4
- Is it possible to programatically edit filters with gmailctl? HOT 2
- Expose a public API HOT 2
- automatic quoting of addresses with plus sign should not quote addresses that are already quoted HOT 2
- Dependency Dashboard
- Requires Go v1.19 but README says v1.17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gmailctl.