Bike 2 extension for embedding/inlining outlines within outlines

I made an extension for inlining Bike outlines within other Bike outlines! It’s something I’ve been thinking about for ages, and I thought I’d need to develop some kind of helper daemon but it turns out the extension API is enough!

This isn’t “production” or “release” ready, it’s very much a prototype, you can find the code under src/inlining.bkext in my fork of bike-extension-kit, along with instructions for building and installing it

Pretty cool right?

How to use it

  1. Install extension (requires Bike 2.0 preview version)
  2. back up your files (seriously, this extension does programmatic edits, and it has not been QAed)
  3. add a row <inline: $document> where $document is the name of another open document. The inlined document must be open in Bike.
  4. voila
6 Likes

@jessegrosjean

/**
 * NEED THIS API? Let me know!!!
 *
 * Describes change made to an outline.

...
/*export type OutlineChange =

...

To do live inline sync I’m currently using outline.streamQuery as a signal to reserialize every open doc and inline subtree to check for changes.

Sync is done in the background, so the UI stays nice and responsive, but when moby_dick.bike is inlined I can see CPU climb up to 20-30% :grimacing:

Maybe I’m overlooking something I could do with what’s already available in the API, but I’m pretty sure that I need Outline.onChange

2 Likes

Way to stretch the extension API in interesting directions!

I think this could be even more useful in some future “workspace” version of Bike. Then Bike should have access to all documents open or closed, and so the user wouldn’t have to remember to open the inlined documents.

I agree, I think that API is needed to make this efficient for larger outlines. I’ll try to get it done sooner than later.

1 Like

You should be able to subscribe to outline changes in latest release:

1 Like

Seems to work beautifully, thanks! I’ve removed the polling and now it’s both responsive and has nice low CPU even when i embed Moby Dick inside Moby Dick

2 Likes