If you are an extension developer, in addition to npm update note that I broke some things, if you were using extensionURL, you should now instead use bike.extensionURL. The reason for this is you can also now more easily find other Bike globals such as bike.defaults and bike.keychain, etc. Also, don’t miss the new extension settings API and see the Core calendar extension for example of how to use.
Besides the extension API most everything else is a bug fix in this release. Keep sending crash reports. This one fixes some bugs with multibyte strings that I wasn’t testing well.
A value for the key data-id can bet set and read through the api, and
does show up in the .bike file source, but
does not seem to be read back in from .bike files.
osascript for checking:
Row.setAttribute and Row.getAttribute with the argument 'id'
that Row.id is not overwritten when this argument is used.
Expand disclosure triangle to view JS source
(() => {
"use strict";
// `data-id` value settable and written to .bike file
// but not read back from .bike file.
const bikeAppContext = () => {
const selectedRow = bike.frontmostOutlineEditor.selection.row;
// A value can be set for `data-id`
selectedRow.setAttribute('id', 'customValueFor_data-id');
// and retrieved for `data-id`
return JSON.stringify(
{
"rowString": selectedRow.text.string,
"data-id": selectedRow.getAttribute("id"),
"id": selectedRow.id
},
null, 2
);
// And inspection of the resulting .bike source shows
// that `data-id` has been successfully written out.
// But when the Bike document is closed,
// and the .bike file read back in,
// `data-id` seems to have been lost or discarded.
};
// For osascript / Script Editor (JavaScript) evaluation
return Application("Bike").evaluate({ script: `${bikeAppContext}` });
})();
Context
Noticed while experimenting with ways of setting a unique (custom, user-chosen) mnemonic identifier for a given row, in the spirit of Pandoc’s annotation of headings etc with {#foo}.
Yes, this is controlled by the stylesheet. The hide/show behavior is determined by context.isKey. For the next release I’ll update so that when Settings > General > Show caret line is selected, it shows both when the editor has key and when it doesn’t.
But you could also add your own formatting as you see fit to indicate, even if user does not have that setting checked.
( Not sure if this is the best approach, but I’ve put a few lines in the style folder of the extension, to get a red cursor while the focus leaves the outline editor )