Comments (11)
Tags are exposed to scripting . There's a property to get the parent tag object and another one to get tag's name.
from scripts.
I was digging around in the script and found this:
[23:17:40] [warning] file:///[...]/epsilon-notes-tags.qml:100: ReferenceError: tagLineStartIndex is not defined
This is probably the reason why no additional tags can be added.
I don't get why tagLineMatch
is null if it parses fine for the other iterations of the code?
from scripts.
I saw this too while testing your issue. Don't remember this error last time I've updated the script. I'll fix it.
from scripts.
I think tagLineStartIndex
and tagLineEndIndex
should be declared for the function and not locally.
const tagLineStartIndex = tagLineMatch.index
const tagLineEndIndex = tagLineStartIndex + tagLineMatch[0].length
This fixes the error for me, I can now add and remove yaml tags via the tag panel (and doubleclick).
from scripts.
As for the nested tags, there would be a lookup function for parent tags needed. Is there an API call besides script.searchTagsByName("game");
and if not, could you add it? @pbek
from scripts.
How are you guys debugging scripts? Is there a way to get code completion and break points/references in the QtCreator?
I get the feeling that this nested tags feature will get pretty messy if I have to iterate recursively over an entire tag list to get all parents' names by id.
A little exercise:
var tagList = []
note.tags.forEach(function(tag, index, array) {
script.log(tag)
if (tag.parentId !== 0)
tagList.push(tag)
})
Why does this throw a TypeError, isn't QQmlListProperty
a list/array?
from scripts.
I use good old script.log
all over the place. It will be messy and if you want it to be pulled into original script nested tags should be optional.
As for QQmlListProperty, looks like it can't do forEach
. Maybe @pbek knows better.
from scripts.
Try a classic loop like:
var i
for (i = 0; i < note.tags.length; i++) {
script.log(note.tags[i])
}
from scripts.
Try a classic loop like:
Will try, thank you.
I use good old script.log all over the place. It will be messy and if you want it to be pulled into original script nested tags should be optional.
That's what I was afraid of, logs it it. I don't think nested tags are within capabilities yet, I'll try something smaller first. Do you have an idea how to handle the parent search elegantly?
from scripts.
As for the nested tags, there would be a lookup function for parent tags needed. Is there an API call besides script.searchTagsByName("game"); and if not, could you add it?
Could you please make QOwnNotes feature requests and be more specific of what you need.
from scripts.
Do you have an idea how to handle the parent search elegantly?
I'd go with a recursive function.
from scripts.
Related Issues (20)
- [SUPPORT] Stuck trying to get Backlinks script to work HOT 4
- [SUPPORT] Mermaid diagrams script: theme configuration for sequenceDiagram HOT 6
- [BUG] Latex Math v0.0.6 script doesn't update pictures when color style is changed HOT 7
- [BUG] Toggle checkbox - checkbox where added in wrong place when autocreated from list HOT 5
- [FEATURE] Add video display support HOT 3
- [BUG] The "YAML nested tags" script breaks formatting and causing text lost in preview HOT 4
- [BUG] "exportFolder is not defined" in export-notes-as-website HOT 7
- [BUG] A Wiki Link to a note under notes sub-folder gives pop up "Note was not found" even if it exists HOT 4
- [SUPPORT] HOT 11
- [SUPPORT] HOT 2
- [SUPPORT] LateX Math results in very aliased images HOT 8
- adding favorite note script results with error " Expected a qualified name id"[BUG] HOT 10
- [SUPPORT] HOT 7
- [BUG] can't follow [[wiki linked]] file links that have spaces HOT 2
- [BUG] Scripts "export note as website" not working properly on Windows HOT 7
- [BUG] export note using pandoc not working on windows HOT 2
- [BUG] Backlinks doesn't support setext headers for title HOT 6
- [BUG] LaTeX math script generates empty icons instead of images HOT 3
- [BUG] Backlinks on Windows HOT 8
- [BUG] meeting-note filename when headline prefix is empty HOT 1
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 scripts.