✨LeoJS beta 0.2.0 Released!

159 views
Skip to first unread message

Félix

unread,
Dec 10, 2023, 8:43:15 PM12/10/23
to leo-editor
leojs banner1.png
🚀LeoJS Debuts!🌟


I'm thrilled to unveil LeoJS 'beta' 0.2.0, a JavaScript implementation of the Leo Editor, now reimagined as a VSCode extension. Building on the foundation of LeoInteg, LeoJS revolutionizes your coding environment by seamlessly integrating into VSCode.

Available on the VSCode marketplace, or, for VSCodium, on the open-vsx marketplace.

Key Features of LeoJS

 - Like its predecessor, LeoInteg, LeoJS employs VSCode's robust GUI to host a variety of panels and controls, offering a smooth and familiar user experience.

 -   With its entire architecture in TypeScript, LeoJS operates directly within VSCode — no external servers or additional communication layers. This direct integration ensures faster responses and a more efficient workflow.

 -   LeoJS introduces live JavaScript script execution, providing a dynamic and flexible scripting environment. This feature extends the versatility of Leo beyond its traditional Python-based framework.

 -   The bulk of Leo's core and command classes have been meticulously ported to TypeScript in LeoJS.

 -   Key plugins from Leo, such as quicksearch.py, nodeTags.py, and mod_scripting.py, are seamlessly integrated into LeoJS's core.

Web Compatibility

LeoJS isn't just for desktops. For the first time ever, run Leo as a web extension on vscode.dev, enabling direct editing of Leo documents in online repositories.

( See https://code.visualstudio.com/docs/editor/vscode-web#_opening-a-project )

Simply visit a GitHub repository, press '.' to switch to the VSCode web edition, install LeoJS from the extension panel, and you're set!

For local document editing, the regular desktop version of LeoJS & VSCode remains your go-to option.

Using LeoJS alongside LeoInteg

For those who use both extensions, you'll notice distinct activity bar icons and panels for each. To avoid clutter in the explorer panel, LeoInteg will automatically hide when LeoJS's 'show-in-explorer' setting is enabled.

Join the Beta Release Journey

I invite you to be part of this exciting phase: Your feedback and bug reports are invaluable in refining LeoJS for a full release!

Many thanks to Edward for creating Leo, and thanks to you, for trying it out and helping squash the remaining bugs! 😆

Félix

Edward K. Ream

unread,
Dec 10, 2023, 9:21:39 PM12/10/23
to leo-e...@googlegroups.com
On Sun, Dec 10, 2023 at 7:43 PM Félix <felix...@gmail.com> wrote:
leojs banner1.png
🚀LeoJS Debuts!🌟


I'm thrilled to unveil LeoJS 'beta' 0.2.0, a JavaScript implementation of the Leo Editor, now reimagined as a VSCode extension. Building on the foundation of LeoInteg, LeoJS revolutionizes your coding environment by seamlessly integrating into VSCode.

Congratulations! Today is one of the top five most significant milestones in Leo's long history.


I can not fully express my gratitude and admiration for your dedicated and sophisticated work.


I'll be testing LeoJS in the coming days. Installation took a matter of seconds!


Leo info issue #3636 contains more of my thoughts. LeoJS is a zero-install Leo, available from any browser.


Edward

Thomas Passin

unread,
Dec 10, 2023, 10:06:13 PM12/10/23
to leo-editor
I'm afraid I can't get started.  The beta insists on opening a repo first, but I can't figure out how to either find my own repos or to get authenticated for Github.

I'd rather start working on a .leo file that isn't in a repo at all.  I'm never going to have all my outlines in a repo, but I want to be able to open them anyway.  My personal, on-computer repo is Mercurial anyway, not git, and I don't feel like trying to change everything in Mercurial over to git.  So I hope that leoJs can be convinced to work with mercurial if it's not going to be able to work with individual outlines on my drive.

I'll try with vscode next.

Thomas Passin

unread,
Dec 10, 2023, 10:13:14 PM12/10/23
to leo-editor
All right, it installed in vsc and it did open an outline.  I saw a lot of errors like this:

reading settings in C:/Users/tom/.leo/workbook.leo
TypeError: Cannot read properties of undefined (reading 'trim')
at Ini_Importer.find_blocks (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1507413)
at Ini_Importer.gen_block (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1508153)
at Ini_Importer.gen_lines (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1511889)
at Ini_Importer.import_from_string (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1512400)
at exports.do_import (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1522910)
at LeoImportCommands.createOutline (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1338218)
at async AtFile.readOneAtAutoNode (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:955878)
at async AtFile.readFileAtPosition (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:954544)
at async AtFile.readAll (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:953359)
at async FileCommands.readExternalFiles (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1151896)
at async FileCommands._getLeoFileByName (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1151493)
at async FileCommands.getAnyLeoFileByName (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1149953)
at async LoadManager.openFileByName (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:937514)
at async LoadManager.loadLocalFile (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:936309)
at async SessionManager.load_session (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1439599)
at async LoadManager.doPostPluginsInit (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:932259)
at async LoadManager.load (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:931126)
at async runLeo (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1807739)
at async activate (c:\Users\tom\.vscode\extensions\boltex.leojs-0.2.0\dist\extension-node.js:2:1815070)
at async u.n (c:\Users\tom\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:140:6255)
at async u.m (c:\Users\tom\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:140:6218)
at async u.l (c:\Users\tom\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:140:5675)


Félix

unread,
Dec 10, 2023, 10:53:00 PM12/10/23
to leo-editor
Thanks Thomas, 

Indeed I also noticed some problems with the importers (@auto) I've started an issue about .md markdown @auto imports failing. https://github.com/boltex/leojs/issues/60 Feel free to add an issue if you have details about the importers failing.

For the web version, you have to have at least a repo created with at least one commit. Creating a new repo and also adding an automatic readme file inside of it while you create it do work if I recall correctly.
(Totally new and empty repos will not work, as github only really creates a repo after the first commit.) 

Lastly, about mercurial and other versioning systems: leojs does not interact with 'git' per say, it just runs on the web version of vscode. (vscode simulates a file system from the online repository offered by github, azure and others which may use another versioning system)

To use leojs locally as normal like the regular leo, Install leojs on your local vscode installation (like leointeg).

(Using leojs on the web is a simple click or two away if you know exactly what to do, but I can see that it may not be self-evident: I'll make better and more detailed documentation and examples with screenshots to be followed easily shortly. 🤓 )

Thanks again for trying out the most functionality that you can and reporting what fails! much appreciated!

Félix

Thomas Passin

unread,
Dec 10, 2023, 11:06:01 PM12/10/23
to leo-editor
On Sunday, December 10, 2023 at 10:53:00 PM UTC-5 Félix wrote:
For the web version, you have to have at least a repo created with at least one commit. Creating a new repo and also adding an automatic readme file inside of it while you create it do work if I recall correctly.
(Totally new and empty repos will not work, as github only really creates a repo after the first commit.) 

My problem was that I couldn't even get it to find a GitHub repo I know exists (like leo-editor, or any of my own), and I couldn't work out how to get it to authenticate with GitHub.  I imagine you cannot make this problem occur because it takes a new user that has never gone through the leoJS install process before.  As a known user, you can't get this to happen.

Your innocence is touching but hard to debug :-) .

Viktor Ransmayr

unread,
Dec 20, 2023, 6:53:31 AM12/20/23
to leo-editor
Hello Felix,

Félix schrieb am Montag, 11. Dezember 2023 um 02:43:15 UTC+1:
...


Join the Beta Release Journey

I invite you to be part of this exciting phase: Your feedback and bug reports are invaluable in refining LeoJS for a full release!

Many thanks to Edward for creating Leo, and thanks to you, for trying it out and helping squash the remaining bugs! 😆

Thanks a lot for this first public release ! - I finally found some time to look into it ...

For a first beta it is already in a very good shape, as I was able to work on a given outline with all three variants of Leo in sequence.

Here are some notes from my log:

###

Install latest version of Leo [1 & 2]  - OK - See "Log-001".

Check out list of installed extensions in VS Codium - See "Log-002".

* Re-open this outline in LeoInteg [3 & 4] - OK? - See "Log-003".

**Result: Yes, i.e. outline can be read, node can be filled - and - 'rst3' command is working.**

* Re-open this outline in LeoJS [5 & 6] - OK? - See "Log-004".

**Result: Almost, i.e. outline can be read & node can be filled - but - 'rst3' command is not working.**

###

Since I'm using Leo mostly as an outliner,  I'd be very interested to see 'rst3'  - or a variation of it - working in LeoJS as well.

Are you aware of this problem / restriction - or - shall I create a GH issue for it ?

With kind regards,

Viktor

HaveF HaveF

unread,
Dec 20, 2023, 8:21:07 PM12/20/23
to leo-editor
 - Like its predecessor, LeoInteg, LeoJS employs VSCode's robust GUI to host a variety of panels and controls, offering a smooth and familiar user experience.
Hi,  Félix,

Congratulations! 

I have two questions:

1. "Leo Editor for Visual Studio Code" is based on LeoJS, while "Leo Editor Integration with Visual Studio Code" is based on Leo. Currently, development will primarily focus on the former, with the latter transitioning to a maintenance phase—is that correct? 


2. Additionally, having relied heavily on "buttons" in Leo, I am curious, based on the screenshots of the doc, whether there is a plan to incorporate this feature? 



Congratulations again on the milestone!




Félix

unread,
Dec 20, 2023, 11:13:38 PM12/20/23
to leo-editor
Thank you Edward, Viktor, HaveF, and Thomas for trying out and reporting your experience! This will help me polish LeoJS and get rid of hard-to-spot bugs!

Viktor,
About rst3: I've implemented all of the rst related code in LeoJS, (see leoRst.ts in the repository)  but there's a part that I could not transliterate.  Here is the magic lines that I cannot reproduce easily in typescript... :)

# Third-part imports...
try:
    import docutils
    import docutils.core
    from docutils import parsers
    from docutils.parsers import rst

haha! ;) There's no library in javascript that exist (that I know of)
I was lucky in some other instances (pickle, zip, md5, sqlite, etc.) in finding libraries for javascript. But none so far for docutils/rst document reading/writing so far. I'd really like to offer rst3 support in LeoJS just like in Leo, so I'll keep an eye open, or, I'll implement it all myself eventually! Please don't hesitate to suggest other ways for me to support this if you can think of any, your ideas are greatly appreciated! (perhaps Leo only uses a small subset of the rst python library and that implementing it in javascript is not that harsh of a task ...I'd have to look more into it. )

I'll open an issue right away for this: #80 where we can accumulate knowledge and plan more specifically how to go about to accomplish this (important) part of Leo.

Thanks again Viktor for your report!

--

HaveF,
 Thank you also very much for trying out LeoJS and reporting your findings! Much appreciated!!
About your questions:

1- LeoJS is "Leo Editor for Visual Studio Code". Not 'based on'.
 And LeoInteg integrates the real Leo by running an instance of BridgeController in leoServer.py, and talking to it via simple websocket.

But you are right in that LeoInteg is 'mostly complete' and is now somewhat in a 'maintenance phase'. (Although future features of LeoJS will be added to LeoInteg as soon as they are done. e.g. multiple different opened body panes opened at once, UNL @URL click handling, etc.)

2- If you're talking about '@buttons' : LeoJS, like LeoInteg, has full support of @command via the minibuffer (Alt+X), and  @button via its button panel. The button sub-menus are even implemented! see screenshot:
screen.png
Otherwise, LeoJS also has regular buttons for most common Leo commands displayed if your mouse hovers the outline-pane:
screen2.png
Along with the body-pane:
screen2.png
Hover your mouse over them to see a description ! :)

Thanks again HaveF for your questions and suggestions!! :D (please clarify if I didn't address the particular point you were trying to make)

--

Lastly, thanks again to Thomas.

 I hope the latest patches and updates that I did in the last few days now allow the tests you had tried to do with LeoJS to actually work now! :)

(And the tutorial I promised about how to use it live on the web in a browser via github.com is coming soon!  hint: do not go to vscode.dev, instead go to github.com, login in the usual way, navigate on a repo that you own, switch to a branch that you own and have write access, and press the dot "." on your keyboard. ) 

Félix

Félix

unread,
Dec 20, 2023, 11:22:37 PM12/20/23
to leo-editor
Addendum: I just thought Id specify to readers unaware of VSCode's integration into github that yes, It's not a typo: Press the dot "." on your keyboard when viewing a particular branch on repo that you own. Tada! :)

Félix

HaveF HaveF

unread,
Dec 21, 2023, 1:19:47 AM12/21/23
to leo-e...@googlegroups.com
1- LeoJS is "Leo Editor for Visual Studio Code". Not 'based on'.

I thought you also developed a low-level library called LeoJS, and the "Leo Editor for Visual Studio Code" extension was developed on top of this low-level library. (I even wonder if this LeoJS library could be used to integrate Leo into other js-related tools or web pages -- which reminds me of https://github.com/kaleguy/leovue )


Now I understand.

If more people ask the same question in the future, then you should consider whether the name is a bit confusing :-)


Amazing work! Félix!

Edward K. Ream

unread,
Dec 21, 2023, 4:46:31 AM12/21/23
to leo-editor

On Sunday, December 10, 2023 at 7:43:15 PM UTC-6 Félix wrote:

🚀LeoJS Debuts!🌟

I'm thrilled to unveil LeoJS 'beta' 0.2.0, a JavaScript implementation of the Leo Editor, now reimagined as a VSCode extension. Building on the foundation of LeoInteg, LeoJS revolutionizes your coding environment by seamlessly integrating into VSCode.

 Here is the text of a private email Félix sent me a few minutes earlier on Dec. 10:

> I did it my dear friend. Line by line. All of Leo. Available online for free without downloading anything. Forever...

It conveys his justifiable pride. It's also a pithy summary :-)

Edward

Félix

unread,
Dec 21, 2023, 11:28:43 PM12/21/23
to leo-editor
Oh Great point HaveF!

> I thought you also developed a low-level library called LeoJS, and the "Leo Editor for Visual Studio Code" extension was developed on top of this low-level library. 
Yes Indeed, I didn't catch on to what you were implying sorry: Yes -  LeoJS  has an almost 99% separated 'Leo' engine in typescript inside the src folder that I plan to finish making it totally 100% separated. so that you can include it in another project to make your own front-end! (I'll make the nullgui api interface more independent from vscode to make the Leo engine easily separable from this vscode LeoJS extension)

I guess it will also be called 'leojs' - hehe !

Thanks for your excellent questions and discussions HaveF :)

By the way: ✨new version 0.2.6 tonight for all you leonistas to experiment with! 🦁 

don't hesitate to open issues on the github project page!

Félix

Thomas Passin

unread,
Dec 21, 2023, 11:57:53 PM12/21/23
to leo-editor
On Wednesday, December 20, 2023 at 11:13:38 PM UTC-5 Félix wrote:
Viktor,
About rst3: I've implemented all of the rst related code in LeoJS, (see leoRst.ts in the repository)  but there's a part that I could not transliterate.  Here is the magic lines that I cannot reproduce easily in typescript... :)

# Third-part imports...
try:
    import docutils
    import docutils.core
    from docutils import parsers
    from docutils.parsers import rst

haha! ;) There's no library in javascript that exist (that I know of)
The rst3 command can operate without using docutils.  There's a setting about that, rst3-call-docutils. I have used rst3 for many sphinx documents without needing to use docutils.  Sphinx itself will use it, but you run as an external executable outside of the rst3 command.

I'm not sure what using docutils gets you, but it seems to me that you could get the command working without docutils, and if someone changes the settings to ask for them, output a warning message about it. (I think that it's connected with another setting for writing intermediate files, but I'm not sure of that. Anyway, I don't use it.)

Félix

unread,
Dec 22, 2023, 12:05:49 AM12/22/23
to leo-editor
Thanks Thomas, Great info! I've added that info in the issue on github about the rst3 support at https://github.com/boltex/leojs/issues/80  :)
Reply all
Reply to author
Forward
0 new messages