What are your thoughts about allowing the URL value of a link, in Bike, to consist simply of the number sign (#) followed by a fragment identifier (unique row id) ?
We can do this on web pages, where RFC 3986 presents it as an assumption that the referenced id is in the same document.
Section 4.4. Same-Document Reference
I was able to achieve this via custom styling in 274, while link decorations were in a different z-plane, but since that was fixed for 275, my draft style code still enables same-document jumps to a bare #identifier reference if I click on blued text, but a click on the link decoration icon now triggers Bike’s core URL opening logic, and the message:
What seems like a sensible approach here ? Should my styling code
Expand disclosure triangle to view JS source
import { Color, defineEditorStyleModifier } from 'bike/style'
defineEditorStyleModifier('footnote-jumper', 'Internal Link Jumper')
.layer('run-formatting', (_, run) => {
// Outline path matching runs that have an
// 'a' (link) attribute starting with a hash (#).
run('.@a beginswith "#"', (_, runStyle) => {
runStyle.color = Color.systemBlue();
runStyle.underline.single = true;
runStyle.decoration('footnote-click-target', (decoration, layout) => {
decoration.width = layout.width;
decoration.height = layout.height;
// Route clicks to registered command
decoration.commandName = 'pandoc:jump-to-footnote';
decoration.zPosition = 10;
});
});
});
find some way of competing for z-axis priority,
or might it, perhaps, be possible to allow Bike’s Open Link logic to treat
href="#row_identifier"
as a synonym of
href="bike://this_doc/row_identifier"
in the pattern of RFC 3986, Section 4.4?