Freemind Import command?

閲覧: 45 回
最初の未読メッセージにスキップ

Seth Johnson

未読、
2019/05/16 17:29:582019/05/16
To: leo-e...@googlegroups.com
The other imports in the File->Import Files menu give me a file
selection window, but it appears the menu item for Freemind lacks a
command/function call.

Leo generates an error:

no command for @item 'import-free-mind-files'

Can I edit something somewhere to get it to work?


Leo Log Window:
Leo 5.9-final, build 20190501110101, Wed May 1 11:01:01 CDT 2019
Git repo info: branch = master, commit = 0129e6cddbd6
Python 3.7.3, PyQt version 5.12.2
darwin
isPython3: True

I'm on MacOS High Sierra version 10.13.6

Edward K. Ream

未読、
2019/05/16 18:24:002019/05/16
To: leo-editor
On Thu, May 16, 2019 at 4:29 PM Seth Johnson <seth.p....@gmail.com> wrote:
The other imports in the File->Import Files menu give me a file
selection window, but it appears the menu item for Freemind lacks a
command/function call.

This command requires lxml.  Try installing it.  This importer appears to be the only code in Leo that uses lxml.  Have no idea why, or where the code came from.

Anyone want to convert the code to use xml.etree.ElementTree?

Edward

Seth Johnson

未読、
2019/05/16 20:34:582019/05/16
To: leo-e...@googlegroups.com
Thanks!

pip3 install lxml

. . . did it.

Except:
1) The file selection menu defaults to a .mm.html file extension
rather than .mm . That's a simple tweak. The import is not actually
designed to import an html file exported as such from FreeMind.
2) Not sure it imports very optimally, as I guess it's figuring node
texts should be headlines and body texts will only be filled for nodes
that have notes attached. But there the notes get put into body text
that's nested two levels deep below the node text, first a
"richcontext" headline child, then a "p" headline child under that,
which holds the note text as its body text.
3) Tried exporting as html from Freemind first. Not better: all I get
is headlines that are html codes ("li" headline per each node in the
map).

But at least it gets in there once I select .mm .

I get a lot of really long headlines that I can't easily read because
that's how I use FreeMind.

So something to mull over as a suggestion for possible future
development: some sort of generalized importer that gives the user
various options like shunting node texts to the body text, various
choices about how you want the import to behave. It would be
generalized so people can make importers for different formats that
give a common set of conversion options that all the importers will be
able to support. I don't think this is a priority for the usual use
case for most people here in the Leo community, so I'm not putting in
an official request. :-)

Thanks for the quick response and easy fix! :-)


Seth


On 5/16/19, Edward K. Ream <edre...@gmail.com> wrote:
> On Thu, May 16, 2019 at 4:29 PM Seth Johnson <seth.p....@gmail.com>
> wrote:
>
>> The other imports in the File->Import Files menu give me a file
>> selection window, but it appears the menu item for Freemind lacks a
>> command/function call.
>>
>
> This command requires lxml <https://lxml.de/installation.html>. Try
> installing it. This importer appears to be the only code in Leo that uses
> lxml. Have no idea why, or where the code came from.
>
> Anyone want to convert the code to use xml.etree.ElementTree?
>
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leo-editor+...@googlegroups.com.
> To post to this group, send email to leo-e...@googlegroups.com.
> Visit this group at https://groups.google.com/group/leo-editor.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/leo-editor/CAMF8tS0ZL4ZoP9zvk6WhsTbd8LxY7bczL-jMT%3Dg-VMV9uX_xnA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

Seth Johnson

未読、
2019/05/16 20:57:032019/05/16
To: leo-e...@googlegroups.com
On 5/16/19, Seth Johnson <seth.p....@gmail.com> wrote:
>
> I get a lot of really long headlines that I can't easily read because
> that's how I use FreeMind.


I wonder if you couldn't implement a headline-text-wraps option, like
you have for the Windows->body pane options setting in LeoSettings?

That would turn the outline window into a readable outline (and little
fiddling with the import). Might well cause trouble in your
one-line-per-headline/node outline format, but could be a simple
option for simple imports. With that, simple imports could easily get
something that shows the same full text on screen that other tools put
up front, right there in the outline pane.

Seth

Terry Brown

未読、
2019/05/16 23:20:162019/05/16
To: leo-e...@googlegroups.com
On Thu, 16 May 2019 17:23:50 -0500
"Edward K. Ream" <edre...@gmail.com> wrote:

> On Thu, May 16, 2019 at 4:29 PM Seth Johnson
> <seth.p....@gmail.com> wrote:
>
> > The other imports in the File->Import Files menu give me a file
> > selection window, but it appears the menu item for Freemind lacks a
> > command/function call.
> >
>
> This command requires lxml <https://lxml.de/installation.html>. Try
> installing it. This importer appears to be the only code in Leo that
> uses lxml. Have no idea why, or where the code came from.

Heh - I may have written it when I switched from Freemind to Leo :)

At the time lxml had better support for XPath than core Python libs,
not sure if that's still true. Recent work makes me still prefer XPath
over DOM traversal, so if lxml is still the leader XPath wise I'd still
lean towards it - I know it's actively maintained.

Cheers -Terry

Edward K. Ream

未読、
2019/05/17 6:20:162019/05/17
To: leo-editor
On Thu, May 16, 2019 at 10:20 PM Terry Brown <terry...@gmail.com> wrote:

Heh - I may have written it when I switched from Freemind to Leo :)

At the time lxml had better support for XPath than core Python libs,
not sure if that's still true.  Recent work makes me still prefer XPath
over DOM traversal, so if lxml is still the leader XPath wise I'd still
lean towards it - I know it's actively maintained.

Thanks for this.  For now I'll just add a dummy import-free-mind* commands if lxml can not be imported.

Edward

Edward K. Ream

未読、
2019/05/17 6:21:172019/05/17
To: leo-editor
On Thu, May 16, 2019 at 7:57 PM Seth Johnson <seth.p....@gmail.com> wrote:

I wonder if you couldn't implement a headline-text-wraps option, like
you have for the Windows->body pane options setting in LeoSettings?

Not likely to happen, but you could file an enhancement request.

Edward

Seth Johnson

未読、
2019/05/18 0:54:422019/05/18
To: leo-e...@googlegroups.com
Okay, I might. Looked at the code and haven't figured it out, but so
far I see you do seem to explicitly truncate headlines after a hard
return in (I think it was) a LeoTree procedure, maybe related to
supporting LeoBridge. I may try diddling with it on my machine if I
figure out where to hack. Maybe in the GUI code you're subclassing,
but I haven't figured out what you're doing yet.


Seth

> Edward
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leo-editor+...@googlegroups.com.
> To post to this group, send email to leo-e...@googlegroups.com.
> Visit this group at https://groups.google.com/group/leo-editor.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/leo-editor/CAMF8tS02vLphxAdfL0MaZ%2BEjXyJ_CziTtxu__kH1Qc3o6AU1%3DQ%40mail.gmail.com.
全員に返信
投稿者に返信
転送
新着メール 0 件