I prefer Android Outliner to NoteLynX as a Leo-Editor partner

422 views
Skip to first unread message

SegundoBob

unread,
Feb 1, 2015, 2:31:18 PM2/1/15
to leo-e...@googlegroups.com
I have barely begun using Android, so I know only a little about Android Outliner and NoteLynX.  I have used both Android programs to read, modify, and create outlines that I also read, modify, and create using Leo-Editor.

I first tried exporting outlines in OPML from Android Outliner and importing them into Leo-Editor using read-opml-file.  This worked fine.  Exporting OPML from Leo-Editor using write-opml-file worked fine. But importing an OPML file into Android Outliner does not work correctly.  As far as I can determine, there is no way to import an OPML file into Android Outliner and end up with any "Activity Notes" (corresponding to node body in Leo-Editor).  In fact, Android Outliner does not round-trip OPML correctly!

Now I export outlines in "Bonsai CSV (UTF-8)" from Android Outliner.  I wrote a script aor2leo.py to generate a Leo-Editor file from a "Bonsai CSV (UTF-8)" file.  I wrote another script leo2aor.py to generate a "Bonsai CSV (UTF-8)" file from a Leo-Editor file.

Since Android Outliner doesn't have clones, leo2aor.py just duplicates the Leo-Editor node each time it encounters a clone occurrence.

Leo-Editor and Android Outliner make good partners.

Unfortunately there is no way to make Android Outliner "sync" with a CSV file.  So all my syncing is manual.

I have a program that compares Leo-Editor files.  This will allow me to merge changes when I make changes to the same file using Android Outliner and Leo-Editor--as soon as the bug described in Issue #130 is fixed.

I wrote a script leo2nlx.py to generate a NoteLynX XML file from a Leo-Editor file.  Since NoteLynX has clones, this script preserves clones.  Unlike Leo-Editor, NoteLynX only allows one root node and it does NOT have a "hidden root node."  So leo2nlx.py makes the Leo-Editor "hidden root node" the unique NoteLynX root node and it sets the "title" of this root node to the basename of the Leo-Editor file without the extension.

I stopped investigating NoteLynX when I couldn't find a way to rearrange the "projects" (outlines) in the Project Main Menu, and, much more seriously, I discovered that line breaks are ignored in the node body.  Also, I think the Android Outliner displays are better than the NoteLynX displays.

Tomorrow I may encounter a problem with Android Outliner or a benefit of NoteLynX that drastically changes my views, but right now my opinion is as stated above.

Edward K. Ream

unread,
Feb 3, 2015, 6:59:15 AM2/3/15
to leo-editor
​​
​​On Sun, Feb 1, 2015 at 1:31 PM, SegundoBob <segun...@gmail.com> wrote:

 I wrote a script aor2leo.py to generate a Leo-Editor file from a "Bonsai CSV (UTF-8)" file.  I wrote another script leo2aor.py to generate a "Bonsai CSV (UTF-8)" file from a Leo-Editor file.

​Are you willing to share these scripts?  leo/scripts/scripts.leo would be a good place for them.  I'll put them there if you like: just send me the scripts or include them here.

Leo-Editor and Android Outliner make good partners.

​Thanks for this research.​

I have a program that compares Leo-Editor files.  This will allow me to merge changes when I make changes to the same file using Android Outliner and Leo-Editor--as soon as the bug described in Issue #130 is fixed.

​Could you share this program as well?  It could be extremely important, as I shall now explain.​
 

​There is another use for a program that compares Leo files.  If suitably easy to use (integrated into Leo), it could be the foundation for using @nosent files instead of @shadow files.

The idea is to run the outline-compare program (script) when the tree in an an @nosent tree does not exactly match the corresponding external file.  This would be kinda like what @shadow's read algorithm does, but with the following subtle, but important differences:

1. No duplicate hidden file is written when writing the @nosent node.
2. [Maybe] The user is always made aware of the differences.
3. The user is in complete charge of how to resolve ambiguous updates: changes that fall at the end of one node or the beginning of the next.
4. [Maybe] The diff algorithm (in your script) ​will be simpler than the diff algorithm in the @shadow code.

Using @nosent should be more intuitive, simpler and faster than @shadow.  This is something I definitely want to explore.

Crucially, this scheme preserves both node identities (gnx's) and clone links because both are stored in @nosent trees in the .leo file.

**Important**: Leo already has several flavors of outline-comparisons, but none of them are simple enough to be the basis of an automatic update of @nosent files.   We want something as easy to use and understand as the best external diff/merge programs, such as the diff used in git clients such as SourceTree.

I wrote a script leo2nlx.py to generate a NoteLynX XML file from a Leo-Editor file.

​Again, I would like to put this script in scripts.leo.​
 
 
​​
I stopped investigating NoteLynX when I couldn't find a way to rearrange the "projects" (outlines) in the Project Main Menu, and, much more seriously, I discovered that line breaks are ignored in the node body.  Also, I think the Android Outliner displays are better than the NoteLynX displays.

​This kind of "negative result" is good to know. Many thanks for your details description of the issues involved.​​ 

Edward

Segundo Bob

unread,
Feb 3, 2015, 10:02:02 PM2/3/15
to leo-e...@googlegroups.com
AOR export:
"Action" - "Export Outline" - "File Type: Bonsai CSV (UTF-8)"

AOR import:
"Action" - "Import Outline" - "File Type: Bonsai CSV (UTF-8)"
"Replace Outline"

AOR to Leo-Editor:
aor2leo xxx.csv xxx.leo

Leo-Editor to AOR:
leo2aor xxx.leo xxx.csv


aor2leo.py
leo2aor.py

Segundo Bob

unread,
Feb 3, 2015, 10:02:14 PM2/3/15
to leo-e...@googlegroups.com
NoteLynx Export:
Project list -- Press & hold target project -- Export

The "Export" is export xml. Other options are "Export as HTML" and
"Export as CSV".
All exported files are put in folder /sdcard/NoteLynX.

NoteLynx Import:
Project list -- Menu - Import

This pops up a list of all the *.xml files in folder /sdcard/NoteLynX.

Leo-Editor to NoteLynx:
leo2nlx

Problem: Must Edit before a leo2nlx file can be opened

Suppose you use leo2nlx.py to produce file xyz.xml. NoteLynX imports
xyz.xml producing NoteLyX "project" xyz. Now if you tap on project xyz,
NoteLynX terminates without displaying any error. I think is occurs
because leo2nlx does not generate any of the "overhead" nodes usually
present in a NoteLynX "project." You can work around this problem by
first opening xyz for editing: press xyz for several seconds till a
menu pops up, then select edit. You can immediately hit either the
checkmark or the yellow plus sign to terminate the edit. Now project
xyz can be opened, viewed, and modified normally.

You could obviously change leo2nlx to generate the overhead nodes:

Example of overhead nodes:
Caution: Node ID 1 must be the unique root node. All other node ID's
vary from project to project.

<!--NoteLynX Export - Modified _#_2015-01-31 19-34-17_#_-->

<node id="3" title="notelynx_bookmarks" body="" links=" 1 " linkTypes="1"/>

<node id="4" title="notelynx_style_main"
body="body&nbsp;{<br>font-family:&nbsp;"Arial";<br>font-size:&nbsp;100%;<br><br>margin-top:&nbsp;10px;<br>margin-left:&nbsp;10px;<br>margin-right:&nbsp;10px;<br>margin-bottom:&nbsp;10px;<br>}<br><br>h1,&nbsp;h2,&nbsp;h3,&nbsp;h4,&nbsp;h5,&nbsp;h6&nbsp;{<br>display:&nbsp;inline;<br>}<br><br>a:link&nbsp;{<br>color:&nbsp;#007FFF;<br>}<br><br>a:visited&nbsp;{<br>color:&nbsp;#007FFF;<br>}<br><br>.title&nbsp;{<br>font-size:120%;<br>font-weight:&nbsp;bold;<br>}<br><br>/*&nbsp;Alternate&nbsp;Fonts<br>Arial,&nbsp;Times,&nbsp;Courier,&nbsp;Monospace<br>*/"
links="" linkTypes=""/>

<node id="5" title="notelynx_style_day"
body="body<br>{<br>background-color:&nbsp;white;<br>color:&nbsp;black;<br>}<br><br>"
links="" linkTypes=""/>

<node id="6" title="notelynx_style_night"
body="body<br>{<br>background-color:&nbsp;black;<br>color:&nbsp;white;<br>}<br><br>"
links="" linkTypes=""/>

<node id="7" title="notelynx_sort" body="" links=" " linkTypes="
"/></network>

leo2nlx.py

Segundo Bob

unread,
Feb 4, 2015, 1:03:57 PM2/4/15
to leo-e...@googlegroups.com
My program is named diff_leo.py. I am almost certain that it is of no
interest to you. It does not address any of the problems you address
above. It does not have any of the functionality you desire. The ideas
it embodies are not applicable to your problems.

diff_leo addresses the problem: Given two files containing outline
information how do you use the outline information to improve finding
and presenting the differences between the two files.

You are interested in comparing one file containing outline information
(and all headline and body content) with a flat file containing no
outline information, but only node body contents. This is a new problem
to me. I have nothing to contribute to its solution.

diff_leo is a command line program. It contains no GUI code. It uses
Leo-Editor and meld or xxdiff to present the differences to the user.

diff_leo has nothing to contribute to speeding up diffing. I hoped it
would, but in the end I gave that up. It's worst case is impractically
slow. But I think that for almost all practical cases it is fast enough
to be useful.

I intend to put diff_leo on the Python Package Index and github at the
same time. I've worked on the packaging problems quite a bit, but I'm
far from finished and I may never finish.

--
Segundo Bob
Segun...@gmail.com

Edward K. Ream

unread,
Feb 4, 2015, 1:44:19 PM2/4/15
to leo-editor
On Wed, Feb 4, 2015 at 12:03 PM, Segundo Bob <segun...@gmail.com> wrote:

diff_leo addresses the problem:  Given two files containing outline
information how do you use the outline information to improve finding
and presenting the differences between the two files.

​An interesting problem.​
 

I intend to put diff_leo on the Python Package Index and github at the
same time. 

​Works for me.

Edward

Todd Mars

unread,
Feb 4, 2015, 4:49:21 PM2/4/15
to leo-e...@googlegroups.com
Neat!
NoteLynx does not use clones, it uses 'links'.
links just point to siblings and alternate parents and friends.  Alternate parents are shown as 'categories' for multiple categories.
So the tree can be infinite cycling, and multiple parents and friends are simply displayed as such and can cycle recursively.
The hidden xml nodes are bookmarks and styles, so they are control nodes.
Nodes can be 'orphans' and orphans can be imported back into the project put into a default tree.
The project view can be sorted alphabetically.
I find it fascinating and will be looking at your .py files!
Todd.

Also on Android program errors can just cause programs to terminate (just disappear) so your import could do that potentially when those setup nodes were not found.
user guide:

cheers!


Segundo Bob

unread,
Feb 5, 2015, 6:50:05 PM2/5/15
to leo-e...@googlegroups.com
On 02/04/2015 01:49 PM, Todd Mars wrote:
> I find it fascinating

Great. I'm benefiting from your interest in NoteLynX. I find the
documentation correct, but extremely hard to use. Consequently, I
haven't been able to do much in NoteLynX.

> NoteLynx does not use clones, it uses 'links'.

NoteLynX doesn't call them "clones," but if you look at the XML file,
you will see that the implementation is the same as Leo-Editor's
implementation of "clones." Both NoteLynX and Leo-Editor use multiple
"parent" pointers. They both call them "parent" pointers. This is
all there is to it in the data structure. The differences are in how
this structure is presented to the user by the GUI; and in Leo-Editor's
prohibition of loops.

> Alternate parents are shown as 'categories' for multiple categories.

All parents are equal. In the "outline" (I know that NoteLynX doesn't
call it an outline, but it is an outline.) if node X has parents A and
B, then when X is shown under A, B is shown as the "alternate parent";
and when X is shown under B, A is shown as the "alternate parent." In
the XML file, node X has parent links to A and to B; and the order of
the links doesn't matter. All parents are equal.

When you designate a node as a "category," the node does NOT become a
category. Instead if becomes a Parent-of-Categories and its immediate
children become categories, but its grandchildren, etc. do NOT become
categories.

> So the tree can be infinite cycling, and multiple parents and friends
> are simply displayed as such and can cycle recursively.

Really? In my experiments, I think NoteLynX deals with loops
unpredictably. That is, I think loops expose bugs in NoteLynX. That
is, it seems to me that when I do exactly the same thing (contracting
and expanding nodes) several times NoteLynX produces different displays
and I can't make any sense out of the displays.

--
Segundo Bob
Segun...@gmail.com

Todd Mars

unread,
Feb 6, 2015, 9:05:47 AM2/6/15
to leo-e...@googlegroups.com
>>I stopped investigating NoteLynX when I couldn't find a way to rearrange the "projects" (outlines) in the Project Main Menu, and, much more seriously, I discovered that line breaks are ignored in the node body.  Also, I think the Android Outliner displays are better than the NoteLynX displays.

The projects can simply be cut and pasted to re-arrange their order in the project list.  The UI is a little odd but it's very simple. Simply select one (shows a filled in circle) then select another with a context menu, and move there.
In general, the GUI is sometimes hard to use.  It works better with a faster tablet because touching tiny areas on cell phones can be confusing to the system and user.

 
 
>>Really?  In my experiments, I think NoteLynX deals with loops
unpredictably.  That is, I think loops expose bugs in NoteLynX.  That
is, it seems to me that when I do exactly the same thing (contracting
and expanding nodes) several times NoteLynX produces different displays
and I can't make any sense out of the displays.


I've experienced problems like yours and I think they are usually user touch and confusing gui issues.  The author responds to bugs quickly.
I'll keep studying and investigating.
Thanks a lot for your code and comments about the .XML!
Todd.


Todd Mars

unread,
Feb 6, 2015, 9:09:30 AM2/6/15
to leo-e...@googlegroups.com
Also, there are I think 3 types of views (or 4) including different node and editing views, so THAT can be confusing!
Todd.
However, it makes a lot of sense.
 

Bogomil Manoilov

unread,
Jun 2, 2016, 2:58:11 PM6/2/16
to leo-editor
Hi,
Do you have any updated script, compatible with the latest NoteLynx?
I've made TheBrain to NotelynX conversion before (on perl), because it was a little bit complicated for me to create leo to NoteLynX one.

Else i have an intention to update the SegundoBob script

Thanks and regards
Bogomil

SegundoBob

unread,
Jun 2, 2016, 4:42:55 PM6/2/16
to leo-editor


On Thursday, June 2, 2016 at 11:58:11 AM UTC-7, Bogomil Manoilov wrote:
Hi,
Do you have any updated script, compatible with the latest NoteLynx?


Sorry, no.  I have not touched NoteLynx since I posted the leo2nlx.py script above.

Bogomil Manoilov

unread,
Jul 6, 2016, 8:33:18 AM7/6/16
to leo-editor
Hi,
I've made little changes in leo2nlx and now it produces an xml file, ready for import in NoteLynx. Attached LeoDocs export as example. 
I am very pleased that now i have an Android companion of the Leo Editor and i am able to produce structured knowledge bases (including pictures) in Leo and browse them on the smartphone
Thanx

Regards
Bogomil
leo2nlx.py
LeoDocs.xml

Segundo Bob

unread,
Jul 6, 2016, 11:29:58 AM7/6/16
to leo-e...@googlegroups.com, bogo...@gmail.com
On 07/06/2016 05:33 AM, Bogomil Manoilov wrote:
> I've made little changes in leo2nlx and now it produces an xml file,
> ready for import in NoteLynx. Attached LeoDocs export as example.
> I am very pleased that now i have an Android companion of the Leo Editor
> and i am able to produce structured knowledge bases (including pictures)
> in Leo and browse them on the smartphone
> Thanx
>

Great. You're welcome. Congratulations on creating something useful.

--
Segundo Bob
Segun...@gmail.com
Reply all
Reply to author
Forward
0 new messages