r/Supernote_dev • u/magic_notetaker • May 08 '26
Suggestion to enable creating headings pages beyond the current
Thanks for this API. It is really quite powerful already. What works great is creating textboxes and other objects on different pages of the note. But currently, it seems there is no option to also create a textbox that is a header. This would be powerful for my use case (basically importing markdown files into a note for detailed review, annotation, and editing. Currently, you cannot navigate to another page, nor lasso something on another page; any of these would be necessary to create a heading from an existing textbox object. It would be great to enable creating a heading directly from a collection of objects, or at least from a certain textbox on any page. u/Dunn_sn
2
u/Dunn-sn Official May 14 '26
Thanks for the feedback.
The current plugin APIs already support what you’re looking for: creating headings directly. You can use `PluginFileAPI.insertElements` to insert elements such as text boxes and titles into a note (including notes that are not currently opened).
One possible implementation flow is:
- Call `PluginFileAPI.getElements` to get all elements on the target page, find the target TextBox, and get its `numInPage` (the element index/ID within that page).
- Use `PluginFileAPI.createElement` to create a new element with type `Title` (100).
- In the Title object, put the TextBox’s `numInPage` into `controlTrailNums`.
- Finally, call `PluginFileAPI.insertElements` to insert the Title element into the target page. This will set the corresponding TextBox as a heading.
2) If the target page does not have a TextBox
- First, insert a TextBox via `PluginFileAPI.insertElements`.
- Then follow the same steps in (1) to create and insert the `Title` element.
If you run into any issues while implementing this, feel free to ask—I’m happy to help confirm the data structures or call details.
1
u/vegheadjones-99 May 08 '26
I do this all the time:
1
u/theBlackOddity May 09 '26
i could be misunderstanding... you're saying headings... but you mean the element type titles cannot be inserted / manipulated in the same way as textboxes?