Repository navigation
feat: support for tryit buttons that send snippets to live vscode editor. - #101
Conversation
… for every example.
I updated the intro demo video to also show how theme changes are now being tracked nicely. |
…hich is 'navy' and let the onLoad event then change it to 'coal'. This is the only way that works properly.
|
It's a bit awkward that we have to have such a tight integration with the mdbook tool. Users also want to use their custom documentation generators; e.g. sphinx is fairly popular. But we can add support for that when the time comes. I was actually really surprised to see these kind of theming issues here. I didn't recall any such issues from the Lean 3 extension. It turns out that sphinx themes set both Let's wait with merging until we can switch to the official links for TPIL4 and the reference manual. The back button still doesn't work btw. I think you just need to increase the z-index. |
I'm confused, what theming issues? Were you expecting the mdbook themes to pickup the vscode themes automatically or something? Do you know how that was supposed to work? I couldn't see anything in the mdbook styles that would do that. And the mdbook styles default to "navy" but "coal" looks better in VSCode... Hence the translation thunk that I'm adding with the vscode themes.js overrides. I also don't know a more general way of doing acquireVsCodeApi. Most "webview" hosting apps provide a callback api like this that you can call "sendMessage" on, but I'm not aware of a general pattern across all hosts are you? Sometimes you can inject javascript callbacks, but that requires taking a dependency on the same javascript runtime... |
Fixed. |
Just the fact the we have to set the theme at all, and that the colors are awful otherwise. We didn't have to do that in Lean 3 (because the sphinx styles set explicit background and foreground colors).
I'm not talking about extensibility on this side, we're not going to use the |
|
In any case, we can iterate on that extensibility later. I'm just waiting for https://leanprover.github.io/lean4/doc/ and https://leanprover.github.io/theorem_proving_in_lean4/ to be upgraded to the new mdbook version before merging. |
|
@gebner this PR is now ready to merge, Leo just published a new version of the TPIL book built using the new version of mdbook so it has the correct book.js that works nicely inside vs code now: |



Fixes #47
Dependent on latest version of mdbook and a new build of the book being published with that version of book.js: See leanprover/mdBook#6 which is now merged.
TryItDemo3.mp4