maphew

Vitalije's History Tracer plugin

Vitalije's History Tracer plugin

Thursday, February 20, 2020

10:19 PM

https://groups.google.com/d/topic/leo-editor/wM38DuOxvGA/discussion

 

I finally got around to pack and publish my new plugin history_tracer.

In order to be useful one must have installed leo-ver-serv utility. I'll try to make it available as a binary file for Ubuntu 18.04 and Windows 10.

It should be straightforward to install from source if one already has installed cargo, a Rust building and package management tool.

Here is described how to install cargo. If you have cargo installed then installation of leo-ver-serv would be quite easy.

cargo install leo-ver-serv

 

For Ubuntu 18.04 pre-built binary can be found here size 9.2M, sha1sum: 6dc40bdf73cdd8df540900a254dfcde99f701e28

After installation, leo-ver-serv should be run with the following command:

leo-ver-serv ~/.leo/.leoRecentFiles.txt 8087

The first argument should be a filename of a file containing list of absolute paths to known Leo files. One suitable file that can be used is ~/.leo/.leoRecentFiles.txt which contains list of recently used Leo files. Only files whose names are listed in this file will have their history tracked. The second argument is a port number. The same port number must be in your settings @int history-tracer-port which by default has value 8087.

Once you have leo-ver-serv running, you can start Leo and every time you are inactive for more than 5 seconds, history_tracer plugin will send a snapshot of current outline to leo-ver-serv and that version will be recorded. If you wish to see previous versions you can open:

http://localhost:8087/ in your browser.

Vitalije

 

From <https://groups.google.com/forum/#!searchin/leo-editor/vitalije$20demo%7Csort:date/leo-editor/wM38DuOxvGA/8Vz57-fjCQAJ>

 

--------------------

Things one should know about leo-ver-serv and history_tracer.py.

  1. leo-ver-serv should be running before Leo opens and the port it listens on should match the one from Leo settings (by default 8087)
  2. if leo-ver-serv is running correctly it should populate the Leo files combo-box on http://localhost:8087/public/index.html
    if this is not the case something is wrong and it is best to check browser's console for errors.
  3. front-end is tested on Google-chrome and on Mozilla Firefox.
  4. if list of Leo files in combo-box matches the content of the file you used when starting leo-ver-serv, initially all files will look empty, until Leo sends its first snapshot for each of these files.
  5. history_tracer plugin binds a handler on 'command2' which is executed after any Leo command, and this handler just records the time of the last executed command. Every 5 seconds, plugin checks if there passed more than 5 seconds since last command and if it is it creates snapshot and posts it to leo-ver-serv. 
  6. whenever snapshot is sent from Leo, in the console Leo prints a log message about snapshot
  7. whenever snapshot is successfully accepted and recorded by leo-ver-serv it should print single line log message about it.
  8. after the first recorded snapshot for the given Leo file, this file becomes visible in the front end. Of course one must reload page or to change Leo file to actually see new version.

If anything is not working according to this specification, please let me know which step is not working.

HTH Vitalije

 

From <https://groups.google.com/forum/#!searchin/leo-editor/vitalije$20demo%7Csort:date/leo-editor/wM38DuOxvGA/8Vz57-fjCQAJ>

 

--------------------------------

 

Rustup is listed as choco package, but it doesn't install at present. "not found with current sources".

 

On Windows, download and run rustup-init.exe. It will start the installation in a console and present the above message on success.

 

From <https://doc.rust-lang.org/cargo/getting-started/installation.html>

 

oh, it requires c++ build tools, so:

 

choco install visualcpp-build-tools

 

Here is the Windows10 version: leo-ver-serv-v0.1.7.exe sha1:  0d79fd1864d31f190ed3b33e708778ebc4fd8ee6

 

From <https://groups.google.com/forum/#!searchin/leo-editor/vitalije$20demo%7Csort:date/leo-editor/wM38DuOxvGA/8Vz57-fjCQAJ>

 

 

 

 

Created with OneNote.