question re: file clones and paths

2018-04-10 Thread k-hen
Hi Again,

There's a tip that says to clone your file nodes and put the clones in a 
folder at the end of the outline to match your output directories.
Also, there has been some notices recently regarding using @path 
directives, potentially recursively to simply your @file naming.
Both of these seem great.

I have this set up now, but some of the files aren't picking up the @path 
directives from the last node.
Also, not sure if this is related but performance has gotten significantly 
worse since doing this.

So  I'm not sure ... 
Is there a 'primary' version of the @file (or @clean in my case) which 
would define the @path? (I'm hoping it's the ending?)
i.e. does it matter if you clone from Section A to Section B vs Section B 
to Section A?
Should it only be the _contents_ of the file and not the actual @file 
headline node that gets cloned?
Should the @path's be higher up in the outline?
Should I just stick with fully qualified file names?

Loving Leo so far but I've still got lots to learn.

Thanks very much,
Kevin


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Edward K. Ream
On Tue, Apr 10, 2018 at 12:15 PM, Terry Brown  wrote:

> ​This may be yet another 2/3 difference.  Try e912eeb67.
>
> Ok, no tracebacks, cool.
>

​Great.  Thanks for the confirmation.

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Terry Brown
On Tue, 10 Apr 2018 11:40:36 -0500
"Edward K. Ream"  wrote:

> ​This may be yet another 2/3 difference.  Try e912eeb67.

Ok, no tracebacks, cool.

Cheers -Terry

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Edward K. Ream
On Tue, Apr 10, 2018 at 11:35 AM, Terry Brown  wrote:

Seems to work, but still a Traceback
> ​ [TypeError].
>

​This may be yet another 2/3 difference.  Try e912eeb67.

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Terry Brown
On Tue, 10 Apr 2018 11:26:02 -0500
"Edward K. Ream"  wrote:

> >
> > So it loaded, but with the Traceback I just posted.  
> 
> 
> ​Please try fb16c99b9.

Seems to work, but still a Traceback

Leo Log Window
Leo 5.7.2 devel, build 20180408225138, Sun Apr  8 22:51:38 PDT 2018
Git repo info: branch = devel, commit = fb16c99b9aef
Python 3.5.5, PyQt version 5.8.0

Exception running Import_IPYNB
Traceback (most recent call last):

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/core/leoApp.py", 
line 1508, in scanner_for_ext_cb
return scanner.run(s, parent)

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/plugins/importers/ipynb.py",
 line 57, in run
self.import_file(fn, parent)

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/plugins/importers/ipynb.py",
 line 44, in import_file
self.indent_cells()

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/plugins/importers/ipynb.py",
 line 113, in indent_cells
n = to_int(n)

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/plugins/importers/ipynb.py",
 line 83, in to_int
return int(n)

TypeError: int() argument must be a string, a bytes-like object or a number, 
not 'NotebookNode'

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Edward K. Ream
>
> So it loaded, but with the Traceback I just posted.


​Please try fb16c99b9.

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Edward K. Ream
On Tue, Apr 10, 2018 at 10:50 AM, Terry Brown  wrote:

> On Tue, 10 Apr 2018 10:49:27 -0500
> Terry Brown  wrote:
>
> > conda says it was installed already.  Current trunk 77b8c7d833 I'm
> > getting
>
> but it did load the file now, so 77b8c7d833 must have helped.
>

​Yeah, python 3 fixes a nasty import problem, so maybe I should back off a
bit about my 2/3 complaints ;-)
​


> So it loaded, but with the Traceback I just posted.
>

​Many thanks for your testing.  I'll fix this asap.

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Using the new insert-*-toc commands

2018-04-10 Thread Edward K. Ream
The new insert-jupyter-toc and insert-markdown-toc commands produce a toc 
(table of contents) for in the selected node, at insert point of the body 
text.  They replace any selected text.

These two commands are almost identical.  They very only in the details of 
how they generate the url part of markdown links.  See Note 2 below.

*Tip*: These commands produce a toc only for the selected node and it's 
descendants, but that is not a real limitation.  For example, you can 
produce a complete toc for an @auto .ipynb tree by executing the command in 
the @auto node itself, then cutting and pasting the toc into the first 
child of the @auto node.

*Notes*

1. You *must *use the insert-jupyter-toc command inside .ipynb files.  The 
Jupyter online notebook is picky about what links it will accept.  In 
particular, case is important in url's.  You probably should use 
insert-markdown-toc for all other files.

2. Both commands clean both parts of markdown links, that is, the *[*] part* 
and the *(*) part*. It's not clear what characters can be allowed in 
general, but for now the rules are:

A. Within [*] parts, all non alpha-nums are removed, except ":" and "-" and 
blanks.
B. Same for (*) parts, except that blanks are converted to "-".

3. Similar logic is used in the exporter to clean section names.

The cleaning of markdown links is over-zealous, but it's not clear exactly 
what characters are valid.  In particular, html escapes will not work.  

4. These two commands are defined in Leo's core. They are completely 
separate from the @auto (importer/export) logic.

*Summary*

These two commands are important tools.  Please try them and report any 
problems or desired improvements.

I will be happy to allow more characters in markdown links, should you want 
them. Just let me know.

The insert-markdown-toc is a component of #767 
: Add markdown command 
similar to rst3 command.

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Terry Brown
On Tue, 10 Apr 2018 10:49:27 -0500
Terry Brown  wrote:

> conda says it was installed already.  Current trunk 77b8c7d833 I'm
> getting

but it did load the file now, so 77b8c7d833 must have helped.

So it loaded, but with the Traceback I just posted.

Cheers -Terry

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Terry Brown
On Tue, 10 Apr 2018 10:39:05 -0500
"Edward K. Ream"  wrote:

> On Tue, Apr 10, 2018 at 8:50 AM, Terry Brown 
> wrote:
> 
> p.s. I also got
> > ​[no children] in the @auto node,
> 
> ​You won't get anything if nbformat can't be imported.  I'll attempt a
> clearer warning.
> 
> Edward

conda says it was installed already.  Current trunk 77b8c7d833 I'm
getting

Exception running Import_IPYNB
Traceback (most recent call last):

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/core/leoApp.py", 
line 1508, in scanner_for_ext_cb
return scanner.run(s, parent)

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/plugins/importers/ipynb.py",
 line 57, in run
self.import_file(fn, parent)

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/plugins/importers/ipynb.py",
 line 44, in import_file
self.indent_cells()

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/plugins/importers/ipynb.py",
 line 113, in indent_cells
stack = self.move_node(n, p, stack)

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/plugins/importers/ipynb.py",
 line 239, in move_node
stack = stack[:n]

TypeError: slice indices must be integers or None or have an __index__ method



-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Edward K. Ream
On Tuesday, April 10, 2018 at 10:39:07 AM UTC-5, Edward K. Ream wrote:
>
> On Tue, Apr 10, 2018 at 8:50 AM, Terry Brown  
> wrote:
>
> p.s. I also got 
>> ​[no children] in the @auto node,
>>
>
> ​You won't get anything if nbformat can't be imported.  I'll attempt a 
> clearer warning.
>

77b8c7d83 warns (once) if nbformat hasn't been imported and is needed for 
@auto x.ipynb.

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Edward K. Ream
On Tue, Apr 10, 2018 at 8:50 AM, Terry Brown  wrote:

p.s. I also got
> ​[no children] in the @auto node,
>

​You won't get anything if nbformat can't be imported.  I'll attempt a
clearer warning.

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Edward K. Ream
On Tue, Apr 10, 2018 at 8:48 AM, Terry Brown  wrote:

Traceback (most recent call last):
>
>   File "/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/
> leo/plugins/importers/ipynb.py", line 192, in parse
> nb = nbformat.reads(payload, as_version=4)
>

​Yeah, you have to have nbformat installed.  I'm working on better error
checking as we speak.​  The "real" code just works, but the itsy-bitsy
details are really important in this kind of code.

Rev 8e05a8d43 handles an import mixup that only affects python 2.

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Segmentation fault when run Leo on Linux

2018-04-10 Thread Sebastian Silva
Hi Edward,

Thanks for Leo. Still trying to figure it out. I installed on Debian
GNU/Linux 9.3 (Stretch) from Git.

I also found a Segmentation Fault when I attempted to run PyLint from
the UI.

Here's the logs in the terminal (nothing stands out, just segmentation
fault at the end, and crash).

(...)
:2: (WARNING/2) Inline substitution_reference start-string
without end-string.
:5: (WARNING/2) Block quote ends without a blank line;
unexpected unindent.
:3: (ERROR/3) Unexpected indentation.
no pylint configuration file found in
/home/icarito/.leo/pylint-leo-rc.txt
/home/icarito/Proyectos/leo-editor/leo/test/pylint-leo-rc.txt
Violación de segmento (`core' generado)

Regards and Thanks,

Sebastian


On 10/04/18 08:03, Edward K. Ream wrote:
>
>
> On Mon, Apr 9, 2018 at 9:08 PM, Brandon Hall  > wrote:
>
> Hello, I installed Leo (5.7) without any issue through |pip
> install leo|, but when I attempt to run Leo, the command line just
> tells me “Segmentation fault”. Please help so that I may be able
> to try Leo out!
>
> ​Thanks for this detailed report. My apologies for your troubles.
>
> The work-around is to install git and then use git to install Leo. 
> Please feel free to ask questions about how to do this.
>
> 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+unsubscr...@googlegroups.com
> .
> To post to this group, send email to leo-editor@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/leo-editor.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Terry Brown
p.s. I also got this in the @auto node,

@nocolor-node

Note: This node's body text is ignored when writing this file.

The @others directive is not required

but no children.  Not necessarily at the same time as the exception,
the above might have come from refresh from disk, whereas the Traceback
was on load of the .leo file.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Terry Brown
On Tue, 10 Apr 2018 05:40:00 -0700 (PDT)
"Edward K. Ream"  wrote:

> Please, please, give this a try and tell me what you think.  Imo it
> moots a lot of Jupyter-related work on Leo's to-do list.

Well, my aspiration was not a better way to edit notebooks, but a way
to execute code in a (possibly remote) Jupyter kernel, and get back
"rendered" results.

Nonetheless, what you describe sounds very cool so I'll try it :)

In my browser my notebook looks likes:

In [2]: import datetime
In [3]: datetime.datetime.now()
Out[3]: datetime.datetime(2018, 4, 10, 8, 33, 15, 831778)
In [4]: datetime.datetime.now().time()
Out[4]: datetime.time(8, 43, 15, 571086)

seems to be behaving as expected.  I've verified the file's
/home/tbrown/r/Untitled.ipynb

Log output

reading: @auto /home/tbrown/r/Untitled.ipynb
Traceback (most recent call last):

  File 
"/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/plugins/importers/ipynb.py",
 line 192, in parse
nb = nbformat.reads(payload, as_version=4)

AttributeError: 'NoneType' object has no attribute 'reads'

HTH, Cheers -Terry

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


ccdc3787 in devel fixes an undo bug

2018-04-10 Thread Edward K. Ream
The bug ruins undo in some cases. The fix strips "&" away before looking up 
a command name.  Recent changes to Leo's menus revealed this bug.

Here is yet another instance where devel is significantly better than 
master.  And no, releasing more often is not a complete cure. Yes, we could 
merge devel into master, but that could cause other problems...

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Segmentation fault when run Leo on Linux

2018-04-10 Thread Edward K. Ream
On Mon, Apr 9, 2018 at 9:08 PM, Brandon Hall  wrote:

> Hello, I installed Leo (5.7) without any issue through pip install leo,
> but when I attempt to run Leo, the command line just tells me “Segmentation
> fault”. Please help so that I may be able to try Leo out!
>
​Thanks for this detailed report. My apologies for your troubles.

The work-around is to install git and then use git to install Leo.  Please
feel free to ask questions about how to do this.

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Segmentation fault when run Leo on Linux

2018-04-10 Thread Brandon Hall


Hello, I installed Leo (5.7) without any issue through pip install leo, but 
when I attempt to run Leo, the command line just tells me “Segmentation 
fault”. Please help so that I may be able to try Leo out!

>>> import leo# 
>>> /home/brandon/anaconda3/lib/python3.6/site-packages/leo/__pycache__/__init__.cpython-36.pyc
>>>  matches 
>>> /home/brandon/anaconda3/lib/python3.6/site-packages/leo/__init__.py# code 
>>> object from 
>>> '/home/brandon/anaconda3/lib/python3.6/site-packages/leo/__pycache__/__init__.cpython-36.pyc'import
>>>  'leo' # <_frozen_importlib_external.SourceFileLoader object at 
>>> 0x7f105bff2550>

and then the output after running leo.run() got cut off at the following:

# extension module '_blake2' executed from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/_blake2.cpython-36m-x86_64-linux-gnu.so'
import '_blake2' # <_frozen_importlib_external.ExtensionFileLoader object at 
0x7f105a3ddfd0># extension module '_sha3' loaded from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/_sha3.cpython-36m-x86_64-linux-gnu.so'#
 extension module '_sha3' executed from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/_sha3.cpython-36m-x86_64-linux-gnu.so'
import '_sha3' # <_frozen_importlib_external.ExtensionFileLoader object at 
0x7f105a3e2128>
import 'hashlib' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f105a3d1e48># 
/home/brandon/anaconda3/lib/python3.6/__pycache__/bisect.cpython-36.pyc matches 
/home/brandon/anaconda3/lib/python3.6/bisect.py# code object from 
'/home/brandon/anaconda3/lib/python3.6/__pycache__/bisect.cpython-36.pyc'# 
extension module '_bisect' loaded from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/_bisect.cpython-36m-x86_64-linux-gnu.so'#
 extension module '_bisect' executed from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/_bisect.cpython-36m-x86_64-linux-gnu.so'
import '_bisect' # <_frozen_importlib_external.ExtensionFileLoader object at 
0x7f105a3dd7b8>
import 'bisect' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f105a3dd358># extension module '_random' loaded from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/_random.cpython-36m-x86_64-linux-gnu.so'#
 extension module '_random' executed from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/_random.cpython-36m-x86_64-linux-gnu.so'
import '_random' # <_frozen_importlib_external.ExtensionFileLoader object at 
0x7f105a3dd2b0>
import 'random' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f105a3ce6a0>
import 'tempfile' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f105b128f98># 
/home/brandon/anaconda3/lib/python3.6/urllib/__pycache__/parse.cpython-36.pyc 
matches /home/brandon/anaconda3/lib/python3.6/urllib/parse.py# code object from 
'/home/brandon/anaconda3/lib/python3.6/urllib/__pycache__/parse.cpython-36.pyc'
import 'urllib.parse' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f105a3d1d30># extension module 'binascii' loaded from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/binascii.cpython-36m-x86_64-linux-gnu.so'#
 extension module 'binascii' executed from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/binascii.cpython-36m-x86_64-linux-gnu.so'
import 'binascii' # <_frozen_importlib_external.ExtensionFileLoader object at 
0x7f105b155898>
import 'leo.core.leoGlobals' # <_frozen_importlib_external.SourceFileLoader 
object at 0x7f105b155dd8># 
/home/brandon/anaconda3/lib/python3.6/site-packages/leo/core/__pycache__/leoApp.cpython-36.pyc
 matches 
/home/brandon/anaconda3/lib/python3.6/site-packages/leo/core/leoApp.py# code 
object from 
'/home/brandon/anaconda3/lib/python3.6/site-packages/leo/core/__pycache__/leoApp.cpython-36.pyc'#
 
/home/brandon/anaconda3/lib/python3.6/site-packages/leo/core/__pycache__/leoExternalFiles.cpython-36.pyc
 matches 
/home/brandon/anaconda3/lib/python3.6/site-packages/leo/core/leoExternalFiles.py#
 code object from 
'/home/brandon/anaconda3/lib/python3.6/site-packages/leo/core/__pycache__/leoExternalFiles.cpython-36.pyc'#
 /home/brandon/anaconda3/lib/python3.6/__pycache__/getpass.cpython-36.pyc 
matches /home/brandon/anaconda3/lib/python3.6/getpass.py# code object from 
'/home/brandon/anaconda3/lib/python3.6/__pycache__/getpass.cpython-36.pyc'# 
extension module 'termios' loaded from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/termios.cpython-36m-x86_64-linux-gnu.so'#
 extension module 'termios' executed from 
'/home/brandon/anaconda3/lib/python3.6/lib-dynload/termios.cpython-36m-x86_64-linux-gnu.so'
import 'termios' # <_frozen_importlib_external.ExtensionFileLoader object at 
0x7f1058cb7f60>
import 'getpass' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f1058cb7b38>
import 'leo.core.leoExternalFiles' # 
<_frozen_importlib_external.SourceFileLoader object at 0x7f1058cada90># 
/home/brandon/anaconda3/lib/python3.6/__pycache__/optparse.cpython-36.pyc 
matches /home/brandon/anaconda3/lib/python3.6/optparse.py# code object from 
'/home/brandon/anaconda3

Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Edward K. Ream
On Monday, April 9, 2018 at 9:30:37 AM UTC-5, Edward K. Ream wrote:

Leo now supports @auto for Jupyter Notebook (.ipynb) files far better than 
> I expected two days ago.
>

Yeah, yesterday was Monday, but I'm surprised nobody has commented about 
how awesome this is ;-)

Perhaps a lot of people don't know what I'm talking about.  Here is the 
script, j.bat, that I use. I execute it in a separate console: 

cd c:\test
jupyter notebook %*

The test directory contains the .ipynb files.  I open a new console and 
just type "j".  This starts the Jupyter server, which then opens my web 
browser on a Jupyter "home" page.  This page shows the contents of the test 
folder.  I select my test .ipynb and it appears in another tab.  Simple as 
that.

I can change any cell in Jupyter and save the file.  If the corresponding 
.leo file is running the new code appears in the @auto tree.  Simple as 
that.  I can also change the @auto tree.  The Jupyter web page will (I 
think) eventually reload automatically.  Or I can reload the page myself.  
Simple as that.

Please, please, give this a try and tell me what you think.  Imo it moots a 
lot of Jupyter-related work on Leo's to-do list.

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please try @auto for Jupyter Notebooks

2018-04-10 Thread Edward K. Ream
On Monday, April 9, 2018 at 8:37:18 PM UTC-5, Edward K. Ream wrote:

A new command, say insert-md-toc, would be better. It would insert the toc 
> at the cursor.
>

Recent revs replace the @toc hack with the insert-jupter-toc command. 

I spent more than an hour experimenting with what should be allowed in 
urls.  This is quite tricky, and depends on undocumented features of 
Jupyter.  The present code generates toc lines as follows:

line = '%s- [%s](#%s)\n' % (
' '*4*(level-1),
clean_headline(p.h),
clean_headline(p.h.replace(' ','-')))

with:

def clean_headline(s):
# Surprisingly tricky.
# This could remove too much, but better to be safe.
aList = [ch for ch in s if ch in '-: ' or ch.isalnum()]
return ''.join(aList).rstrip('-').strip()

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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.