since my last reply i’ve learned a lot more, but now im more confused:
-
since
createButton()
is a javascript function, that the buttons plugin uses under the hood, (source code) why people when creating js scripts (using dvjs) usesconst {createButton} = app.plugins.plugins["buttons"]
instead of justcreateButton()
(examples 1, 2, 3) -
does that mean i can access the buttons plugin variables/ arguments/ syntax from javascript? if that’s the case why the
type: link
variable isn’t valid, if by using the buttons plugin interface, the button types are:command, link, template, text, calculate
andswap
in my daily note i have this text and button:
##### Sueño y sueños
```button
name Log
type link
action obsidian://vault/Notes/Sleep/Log/<% tp.user.sleeplogdate(tp) %>
color blue
```\
i want to fit them both in a single codeblock
Why?
(inspired by the same reasons you gave when creating the container for the header) i :
1 - embed it from a file, this way by modifying the file, all daily notes, including past ones will be automatically modified too
2 - can style exclusively this codeblock, targetting it with CSS
in my daily note im setting a dv.view
function (Codeblock Reference - Dataview)
```dataviewjs
dv.view("_js/journalLog")
```\
inside journalLog.js
const {createButton} = app.plugins.plugins["buttons"]
(createButton({
app,
el: this.container,
args: {
name: "Log",
type: "link",
action: "obsidian://vault/Notes/Sleep/Log/<% tp.user.sleeplogdate(tp) %>",
color: "blue",
}
}))
i can’t even replicate what i could do in the buttons plugin syntax, so im not using other const
or appending text yet
-
assuming its not buttons plugin syntax, but the js
createButton()
function:
i want to make a button that has inside a note link, what is the correcttype
variable -
is there documentation with the list of variables i can chug?, searching
createButton()
tutorials gave me html tutorials
sorry for replying again, but after days and a couple questions you’re the only user that hasn’t ignored my help requests here