#@+leo-ver=5-thin
#@+node:ekr.20100805165051.7177: * @file release_notes.txt
#@@language plain
#@@tabwidth -4
#@+all
#@+node:ekr.20150301140303.15: ** Leo 5.1 b1 release notes
Leo 5.1 b1                          March 9, 2015

Leo 5.1 b1 is now available at: http://sourceforge.net/projects/leo/files/Leo/

Leo is a PIM, an IDE and an outliner. Video tutorials: http://leoeditor.com/screencasts.html Text tutorials: http://leoeditor.com/tutorial.html

The highlights of Leo 5.1
--------------------------

* @clean trees, one of the most important developments in Leo's history.

  @clean create external files without sentinel comments, yet Leo can
  update @trees from changes made to the corresponding external files,
  something long thought impossible. @clean trees preserve clone links and
  user attributes (uA's). Reading @clean trees is faster than reading @auto
  or @shadow trees.
    
  The Mulder/Ream algorithm updates @clean trees from changes made from the
  corresponding external files. This is a completely rewritten and much
  simpler version of Bernhard Mulder's original @shadow update algorithm.

  @shadow is now deprecated. @clean is superior to @shadow in all respects.
  Leo will support all flavors of @auto indefinitely.
  
* A new web page, http://leoeditor.com/load-leo.html, displays .leo files
  in the browser.

* A new IdleTime class greatly simplifies idle-time handling.

* Leo now honors @language inside @doc parts, a major convenience.

Links:
------
Leo:       http://leoeditor.com
Docs:      http://leoeditor.com/leo_toc.html
Tutorials: http://leoeditor.com/tutorial.html
Videos:    http://leoeditor.com/screencasts.html
Forum:     http://groups.google.com/group/leo-editor
Download:  http://sourceforge.net/projects/leo/files/
Github:    https://github.com/leo-editor/leo-editor
Quotes:    http://leoeditor.com/testimonials.html
Viewer:    http://leoeditor.com/load-leo.html
#@+node:ekr.20150301140303.16: *3* Highlights
#@+node:ekr.20150217105817.4: *4* * @clean
Leo updates @clean trees from changes made to external files without sentinel comments, something long thought impossible. As a result, Leo can now be used in any environment, including work groups where no one else uses Leo.

@clean is significantly better than @auto for most purposes. Most users will want convert from @auto trees to @clean:

- Updating an @clean tree is faster that importing an @auto tree.

- @clean trees preserve outline structure, clone links and uA's without the need for @persistence trees.

However, Leo will continue to support all forms of @auto for the foreseeable future, especially @auto-rst, @auto-vimoutline and @auto-otl.
#@+node:ekr.20150220115528.5: *4* \@shadow is deprecated
\@shadow is now officially deprecated. @clean is faster and easier to use than @shadow.
#@+node:ekr.20150311123850.5: *4* Added g.IdleTime & LeoQtGui.IdleTime
@language rest
@wrap

Leo 5.1 adds the LeoQtGui.IdleTime class. Creating multiple instances of this class allows multiple, independent (or cooperating) idle-time handlers. g.IdleTime is a thin wrapper that returns None if g.app.gui doesn't an IdleTime class. 

The following creates an instance of the IdleTime class that calls the given handler at idle time, no more than once every 500 msec::
    
@language python

    def handler(it):
        '''The IdleTime handler: called at idle time.'''
        delta_t = it.time-it.starting_time
        g.trace(it.count,it.c.shortFileName(),'%2.4f' % (delta_t))
        if it.count >= 5:
            g.trace('done')
            it.stop()

    it = g.IdleTime(c,handler,delay=500)
    if it: it.start()
    
@language rest

Here is the output::

    handler 1 ekr.leo 0.5100
    handler 2 ekr.leo 1.0300
    handler 3 ekr.leo 1.5400
    handler 4 ekr.leo 2.0500
    handler 5 ekr.leo 2.5610
    handler done

Timer instances are completely independent::

@language python

    def handler1(it):
        '''The IdleTime handler: called at idle time.'''
        delta_t = it.time-it.starting_time
        g.trace('%2s %s %2.4f' % (it.count,it.c.shortFileName(),delta_t))
        if it.count >= 5:
            g.trace('done')
            it.stop()

    def handler2(it):
        '''The IdleTime handler: called at idle time.'''
        delta_t = it.time-it.starting_time
        g.trace('%2s %s %2.4f' % (it.count,it.c.shortFileName(),delta_t))
        if it.count >= 10:
            g.trace('done')
            it.stop()

    it1 = g.IdleTime(c,handler1,delay=500)
    it2 = g.IdleTime(c,handler2,delay=1000)
    if it1 and it2:
        it1.start()
        it2.start()
        
@language rest

Here is the output::

    handler1  1 ekr.leo 0.5200
    handler2  1 ekr.leo 1.0100
    handler1  2 ekr.leo 1.0300
    handler1  3 ekr.leo 1.5400
    handler2  2 ekr.leo 2.0300
    handler1  4 ekr.leo 2.0600
    handler1  5 ekr.leo 2.5600
    handler1 done
    handler2  3 ekr.leo 3.0400
    handler2  4 ekr.leo 4.0600
    handler2  5 ekr.leo 5.0700
    handler2  6 ekr.leo 6.0800
    handler2  7 ekr.leo 7.1000
    handler2  8 ekr.leo 8.1100
    handler2  9 ekr.leo 9.1300
    handler2 10 ekr.leo 10.1400
    handler2 done
#@+node:ekr.20150220115528.4: *3* The Mulder/Ream update algorithm
Leo updates @clean trees using a simplified version of the Mulder update algorithm previously used to update @shadow trees. This algorithm  is easy to understand, provably correct and completely documented. It may be of interest to the developers of other outliners.

http://leoeditor.com/appendices.html#the-mulder-ream-update-algorithm
#@+node:ekr.20150311123850.11: *3* Bugs fixed
#@+node:ekr.20150311123850.12: *4* Fixed bug in g.reportBadChars
https://groups.google.com/forum/#!topic/leo-editor/X9rePlT6Meg

In Python 3 there is no 'unicode' function.

- A big collapse in complexity in g.reportBadChars.
- Added an important guard in g.ue for Python 3.

#@+node:ekr.20150311123850.13: *4* Fixed Python3 compatibility bug in g.pause
#@+node:ekr.20150311123850.14: *4* Fixed bug 108: can't write spellpyx.txt
@language rest

https://github.com/leo-editor/leo-editor/issues/108

The plugin tries to create a new file inside the install path, and doesn't
have the permission.

Is there a way to configure the path of this spellpyx.txt to, say, $HOME/.leo?

@language python
#@+node:ekr.20150311123850.15: *4* Fixed bug 78: find-next match not always scrolled into view
@language rest

https://github.com/leo-editor/leo-editor/issues/78

The problem was in the PythonQSyntaxHighlighter class: it does not work
*exactly* like QSyntaxHighlighter. The fix was to call w.seeInsertPoint()
in pqsh.reformat_blocks_helper.

The fix now involves the g.app.all_delayed_see switch.

Here is how to demonstrate the bug:

- Open leoPy.leo
- select @file ../external/PythonTidy.py
- search for print (whole word)
- The first match shows properly (it doesn't scroll).
- The second match does *not* scroll properly.

@language python
#@+node:ekr.20150311123850.16: *4* Fixed bug 117: <Return> causes unwanted scrolling
https://github.com/leo-editor/leo-editor/issues/117

This was a side effect of fixing https://github.com/leo-editor/leo-editor/issues/78

Added g.app.allow_see and related logic.
#@+node:ekr.20150311123850.17: *4* Fixed bug 119: new setting for @auto-org-mode
https://github.com/leo-editor/leo-editor/issues/119
#@+node:ekr.20150311123850.18: *4* Fixed bug 126:  Inproper handling of @chapter nodes with non ASCII headlines
https://github.com/leo-editor/leo-editor/issues/126
Call g.toUnicode in cc.findChapterNode.
Added test for QString in g.toUnicode.
#@+node:ekr.20150311123850.19: *4* Fixed bug 124: Viewrendered can't display @image
https://github.com/leo-editor/leo-editor/issues/124
#@+node:ekr.20150311123850.20: *4* Fixed bug: Made last log line visible
LeoQtLog.put and app.writeWaitingLog changed.
#@+node:ekr.20150311123850.21: *4* Fixed crash in v._cutLine after paste-retaining-clones
The fix was to add the obvious guard.

Traceback (most recent call last):

  File "c:\leo.repo\leo-editor\leo\core\leoCommands.py", line 556, in doCommand
    val = command(event)

  File "c:\leo.repo\leo-editor\leo\core\leoCommands.py", line 3642, in cutOutline
    c.deleteOutline("Cut Node")

  File "c:\leo.repo\leo-editor\leo\core\leoCommands.py", line 3932, in deleteOutline
    p.doDelete(newNode)

  File "c:\leo.repo\leo-editor\leo\core\leoNodes.py", line 1216, in doDelete
    p._unlink()

  File "c:\leo.repo\leo-editor\leo\core\leoNodes.py", line 1791, in _unlink
    child._cutLink(n,parent_v)

  File "c:\leo.repo\leo-editor\leo\core\leoNodes.py", line 2544, in _cutLink
    v.parents.remove(parent_v)

ValueError: list.remove(x): x not in list
#@+node:ekr.20150311123850.22: *4* Fixed Zatz @nosent problem with @verbatim sentinels
The fix was to x.separate_sentinels.
I no longer adds @verbatim sentinels to the returned list of sentinels.
#@+node:ekr.20150311123850.23: *4* Fixed bug 138: goto-global-line fails in @clean
@nocolor-node

https://github.com/leo-editor/leo-editor/issues/138

goto-global-line doesn't work properly on @nosent files.

It seems that it counts non-existing sentinel lines so it positions cursor
few lines before the requested. The exact difference between required line
number and found one depends on size of file and number of nodes, and also
grows with required line number.

You can exhibit this by looking in attached Leo file. For example Alt+g 45
should position cursor on the declaration line of function temp7(a), but it
positions cursor on line 39.

https://groups.google.com/group/leo-editor/attach/63f325cf79f6b2e9/nosent-goto-line-bug.leo?part=0.1
#@+node:ekr.20150311123850.24: *4* Fixed bug 130: bug in fix to Issue #35
@language rest

bug in fix to Issue #35
https://github.com/leo-editor/leo-editor/issues/130

leoBridge sometimes assigns the same GNX to two distinct vnodes
https://github.com/leo-editor/leo-editor/issues/35

c.initObjects sets c.hiddenRootNode.fileIndex to 'hidden-root-vnode-gnx'

# wrong: fc.getLeoFile calls fc.setMaxNodeIndex after reading all nodes.
# correct: fc.getLeoFile calls ni.end_holding

ni.end_holding now calls ni.compute_last_index.
This *must* be done every time Leo reads a .leo file!
#@+node:ekr.20150311123850.25: *4* Fixed bug 140: @clean does not preserve extended ASCII characters on read
@language rest
@wrap

https://github.com/leo-editor/leo-editor/issues/140

There were two bugs:

1. A bug in the @file read logic. The fix was to call at.readFileToUnicode in at.readOpenFile.

2. A bug in the @clean read logic. The fix was a rewrite of read_at_nosent_lines.
#@+node:ekr.20150311123850.26: *4* Fixed crasher in scroll-wheel code
This was a PyQt5 compatibility problem in lqtb.wheelEvent.

Traceback (most recent call last):
  File "c:\leo.repo\leo-editor\leo\plugins\qt_text.py", line 796, in wheelEvent
    if delta < 0:
TypeError: unorderable types: QPoint() < int()
#@+node:ekr.20150311123850.27: *4* Investigated bug 146: Recursive import script may add extra declaration lines
https://github.com/leo-editor/leo-editor/issues/146

It appears that fixing bug 140 fixed all the import problems!
#@+node:ekr.20150311123850.28: *4* Fixed bug 142: bibtex plugin overwrites body text of @bibtex nodes
@language rest
@wrap

https://github.com/leo-editor/leo-editor/issues/142

- Rewrote & simplified readBibTexFileIntoTree & writeTreeAsBibTex.
- Fixed the actual bug in onHeadKey.  Inserting a new node put the template in the root node rather than the newly-inserted node.
#@+node:ekr.20150311123850.29: *4* Fixed bug 145: The already open dialog can cause Leo to hang
https://github.com/leo-editor/leo-editor/issues/145
#@+node:ekr.20150311123850.30: *4* Fixed bug 138: goto-global-line doesn't work properly in @nosent files
https://github.com/leo-editor/leo-editor/issues/138
#@+node:ekr.20150311123850.31: *4* Fixed bug 149: Clones can revert changes made by git discard...
https://github.com/leo-editor/leo-editor/issues/149

Outline structure::
    
    To do:
        @file ../doc/leoToDo.txt
            (clone) To do: Leo 5.1 b1
                Docs
    (clone) To do: Leo 5.1 b1
        Docs

- In the Docs node write changed.  Save .leo file and quit Leo.
- Revert the change in git.
- Reload Leo.  Change reappears **regardless** of --no-cache option!
#@+node:ekr.20150311164212.5: *4* Fixed a unicode-related problem in the flatten-outline command
Fixed in rev fc3ea68.
#@+node:ekr.20150311164212.7: *4* Fixed bug 151: parse-body creates "None declarations"
https://github.com/leo-editor/leo-editor/issues/151
#@+node:ekr.20150311123850.32: *3* Code level
#@+node:ekr.20150311123850.33: *4* Removed unused file arguments in leoAtFile
From at.readOpenFile, at.scanHeader and at.scanText4.
#@+node:ekr.20150311123850.34: *4* Added external/rope folder
# import rope ; print(rope)

rope = g.importModule('rope',verbose=True)
print(rope)
#@+node:ekr.20150311123850.35: *4* Added g.app.openingSettingsFile
Set in leoApp.openSettingsFile.
#@+node:ekr.20150311123850.36: *4* Removed allow_cloned_sibs switch
#@+node:ekr.20150311123850.37: *4* Removed writeVersion5 switch
#@+node:ekr.20150311123850.41: *3* Features
#@+node:ekr.20150311123850.42: *4* Improved recursive import command
- Fixed bug in ic.importFilesCommand that caused imported nodes to be placed incorrectly.
- Contract all imported nodes.
#@+node:ekr.20150311123850.43: *4* refresh-from-disk is now undoable.
#@+node:ekr.20150311123850.44: *4* import-file command create @nosent nodes
#@+node:ekr.20150311123850.45: *4* Added --old-nosent command-line option
#@+node:ekr.20150311123850.46: *4* The presence of @persistence enables @auto persistence
The @persistence code is now enabled if and only if a .leo file has an
@persistence node.

Removed @bool enable-persistence from leoSettings.leo.

Added @bool create-at-persistence-nodes-automatically = False.
#@+node:ekr.20150311123850.47: *4* Support @clean as the preferred form of @nosent
#@+node:ekr.20150311123850.48: *4* Added unformat-paragraph command
The reformat-paragraph command is surprisingly useful.  It is somewhat like the reverse of the reformat-paragraph command: it removes all extra whitespace from a paragraph.

Extraneous whitespace causes problems with rST text--various kinds of rST markup can't be split between lines. LeoDocs.leo used various workarounds, including preceding @ signs with a backslash.

unformat-paragraph makes all these problems disappear.  Furthermore, the appearance of the text in LeoDocs.leo improves provided that @wrap is in effect.
#@+node:ekr.20150311123850.49: *4* To be documented: xslt
@language rest

I have been wondering whether it would be possible to use xslt to render
.leo files from web pages. This would build on Ville's work. First, a demo:

1. Copy the two attached files to the same folder on your hard drive.

Note: recent revs have added these two files to the top-level leo folder,
so you could also use those files instead. Both demo files are now in the
top-level leo-editor in the git repo *and* on leoeditor.com.

2. Open xslt-test.leo in your browser.  You should see something like this:

    test.leo

    This is a test

        node 1

        Node 1 text.

        node 2

        Node 2 text.

That is, browsers (tested with IE and Mozilla) can render .leo files on
your file system as html.

Alas, there are problems rending .leo files from urls instead of files. But
when we succeed we will have a read-only version of Leo as a web app!

===== About leo_to_html.xsl

Ville created leo_to_html.xsl, but I didn't understand its significance
until early this morning. This xslt file tells a web browser (or other xslt
processor) how to render a .leo file as html.

I made several changes this morning to leo_to_html.xsl so that it works
with the "tryit" editor for xslt at w3schools:
http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog_ex1

This editor is a good way to discover problems either in .xsl files
themselves or references to .xsl files from .xml files.

===== Problems

It does not seem possible to use leo_to_html.xsl directly:

1. Visiting http://leoeditor.com/xslt-test.leo does not work.

The browser renders xslt-test.leo xml, not html. That is, the browser does
not perform the xslt transformations.

2. Visiting
   https://github.com/leo-editor/leo-editor/blob/master/xslt-test.leo shows
   the "raw" xml, without the xslt transformations being applied.

The reason is clear enough. The url is a *representation* of the .leo file,
not the .leo file itself.

3. xslt-test.leo contains the following line::

    <?xml-stylesheet type="text/xsl" href="leo_to_html.xsl"?>

This line is supposed to be set by the following setting::

    @string stylesheet = ekr_test

This default is useless, and setting it to::

    @string stylesheet = type="text/xsl" href="leo_to_html.xsl"

does not appear to work. I'll look into this, but cutting and pasting the
desired <?xml-stylesheet > element into .leo files should work well enough
for testing.

4. By default, Mozilla refuses to render xslt-test.leo containing the
   following stylesheet element::

    <?xml-stylesheet type="text/xsl" href="leoeditor.com/leo_to_html.xsl"?>

In other words, Mozilla refuses to execute "remote" .xsl files. A cryptic
message is shown instead. Googling that message gives:
http://stackoverflow.com/questions/3420513/firefox-and-remote-xsl-stylesheets

Apparently Mozilla enforces "same origin" policy. But it's no good relaxing
that policy: browsers on smart phones are probably even more restrictive.

===== Conclusions

The tryit editor shows that it is possible to apply arbitrary xslt style
sheets to arbitrary xml files. We should be able to create a page, say on
leoeditor.com, that would render .leo files properly using leo_to_html.xsl.
The question is, how exactly to do this?

This is exciting, despite the problem listed above, and probably others.
The xslt approach is almost infinitely easier than alternative approaches.

Once we can properly render, say, a link to a .leo file on GitHub, we can
start improving leo_to_html.xsl. The obvious thing to do is to change the
xsl so that it generates html similar to that generated by Bernhard
Mulder's mod_http plugin.
#@+node:ekr.20150311123850.50: *4* Added @bool make-node-conflicts-node = True
This setting is highly recommended.

The message is given when clone conflicts may have caused data loss.
#@+node:ekr.20150311123850.51: *4* Added wishlist 148: @auto style parse on first @clean 'Refresh From Disk'
https://github.com/leo-editor/leo-editor/issues/148
#@+node:ekr.20150311123850.52: *4* colorizer for @ & @doc now honors @language
Example 1:

    @wrap
    @
    @language rest
    
    My *lengthy* comments.
    
Example 2:
   
    @
    @language rest
    
    My lengthy comments.
    @c
    @language python
    # resume python code.
    
#@+node:ekr.20150311123850.53: *3* Major features
#@+node:ekr.20150311123850.54: *4* \@clean updates outlines automatically
Rev 7a851eb enables automatic updating of @nosent files. When loading a .leo file, Leo will automatically update @nosent trees if the corresponding external file has been changed outside Leo! This is one of the most important advances in Leo's history.

As discussed yesterday, using @nosent files is about twice as fast as using @shadow trees. No shadow directories or shadow files are needed: it's trivial to recreate the "shadow" data from the @nosent tree!

Why, of why, did we never see this before? It could have been done at any time since Leo supported @shadow.

Finally, Leo reports all changes using the "recovered nodes" mechanism. No new code was required: the core @shadow code was not changed in any way.

at.readOneAtNosentNode and two simple helpers handle all the details. readOneAtNosentNode uses the @shadow algorithm to compute the updated lines of the @nosent tree, exactly as described yesterday. If the new lines match the old, nothing more need be done: we can use the existing @nosent tree as is. Otherwise, the new lines are passed to at.readOpenFile to delete the old tree and create the @nosent tree. This part of the code is similar to the code in at.read, but it is much simpler because caching is not involved. In essence, everything "just worked" from the get go.
#@+node:ekr.20150311123850.55: *4* Steve Zatz: in praise of @clean
I just want to provide my own thoughts about the importance of @clean. I look at the posts in this group a fair amount because I find the discussion interesting but I had abandoned leo as a day-to-day tool principally because of the sentinels in @file nodes. Even for solo projects, I just found them visually unappealing and beyond that occasionally confusing when I went to edit files with external editors. I would sometimes start a project in leo, particularly if it was based on code I developed in the past using leo, and then would use the old @nosent to save a version of the code without sentinels and then use my external editor of choice and not use leo at all. I missed many of the features of leo but just couldn't get over the sentinel issue.

@clean really seems to solve all the issues that I had. In particular--and somehow this point doesn't seem to me to have been emphasized enough--it seems to fully support organizer nodes. They are one of the great things about leo--it's happy to guess initially at what the structure of your program is but it's completely up to you to determine the structure and the ability to do things like break up long methods, group like methods, group menu actions in GUI code, etc etc is one of the very cool things about leo. My limited but growing experience with @clean's handling of external changes has been mainly with incremental (as opposed to more sweeping) code changes, and the assignment of new lines is reasonable and you can always fix them it quickly if you don't like how external changes have been handled.

There have been some posts about the recovered nodes, comparing the old and new nodes where there were external changes. I think it's genius. As opposed to hoping that leo has correctly incorporated external changes, it's all there in case you want to take a closer look. Without this, I would just not have the confidence that external changes were being applied correctly and while you can always do a git diff, I am not looking to do that every time I change a file externally especially if I am not at the point where I am about to do a commit.

There has been some discussion of @auto v. @clean. Preference is obviously a matter of taste. I will say that for me the fact that node headlines are unaffected by external file changes is a feature not a problem since I place notes in the headlines that I want preserved when I edit files externally. Yes, if the node headlines are the method names then they won't be updated if an external edit changes a method name but this was true of @file as well.

The ability to work on projects with people who don't have leo is obvious; one perhaps slightly less obvious benefit of no sentinels is that I suspect that the likelihood that someone will clone a git repository is reduced when that repository's code is riddled with leo sentinels (unless the potential cloner is a leo loyalist). The one downside to no sentinels--there is no evidence that leo is being used but I think that raises the broader question of marketing leo, which I certainly believe will be aided significantly by being able to take advantage of leo without sentinels in external files.
#@+node:ekr.20150311123850.56: *4* Why @clean is so important
@clean removes barriers to using Leo that prevented its widespread adoption.  Only now, after the barriers have been removed, do I see how important those barriers were.

For the very first time, Leo can be used in *all* situations without compromise.  There is no longer any need to make excuses for sentinel lines, or argue whether people should accept them.  Sentinels are simply gone.

Not only did I not see how damaging sentinels might be for non-Leo users, I did not see how inconvenient sentinels might be for my *own* work flow.  This was a shocking revelation.  To illustrate, here is the first draft of a new comparison between @clean and @file in the programming tutorial:

QQQQQ
This tutorial discussed @clean first for three reasons:

1. To avoid making excuses for sentinel lines.

2. To brag about the @clean update algorithm.

3. It is often more convenient to avoid sentinels. For example, when I study other people's code I do the following:

- Create a git repo of the directory to be studied, adding all the source files and doing an initial commit.
 
- Use an `import script`_ to create the desired @clean nodes.

- Explicitly save all the imported files using Ctrl-Shift-W (write-at-file-nodes).

- Use `git`_ diff to ensure that no important changes have been made while importing the nodes.

- Use git diff to track any changes I make (such as adding tracing or debugging statements) for the purposes of studying the code.

Using @clean is an essential part of this work flow. The diffs would be much harder to read if I had imported files into @file trees instead.

Nevertheless, there are advantages to using @file instead of @clean. All these advantages arise because external files created by @file contain explicit outline structure.

1. Leo can read @file trees more quickly and without guesses. There is never any need for you to move ambiguous lines from one node to another.
  
2. Sentinels allow you to share structure simply by sending the external file. This is an overwhelming advantage for Leo's developers.
  
3. A minor advantage: @file makes Leo files smaller. Leo stores the entire @clean *tree* in the .leo file, but only stores the top-level @file *node* in the .leo file.
  
In short: use @clean for most purposes. Use @file when all developers in a project use Leo.
QQQQQ

The point is that I have just, in the past few days, realized how badly sentinels interfered with git diffs.

Imo, @clean is the long-sought breakthrough that just might allow Leo to "go viral".  In retrospect, we can see that sentinels were a *fundamental* problem that neither exhortations nor documentation could remedy.  @clean removes the one and only real barrier to using Leo everywhere.
#@+node:ekr.20150311123850.57: *4* A web page that displays .leo files
http://leoeditor.com/load-leo.html is a web page that will show you the contents of a .leo file.

The "Upload from your hard drive" button loads a .leo file from you hard drive. Alternatively, you can paste a url into the text box and click the "Upload from the internet" button.  If you want to view a .leo file on github, be sure to use the "raw" url.  For example, use::

    https://raw.githubusercontent.com/leo-editor/leoeditor/master/leo/test/test.leo

*not*::

    https://github.com/leo-editor/leo-editor/blob/master/leo/test/test.leo

Either way, the leoeditor.com server will replace the page by the .leo file as rendered by Ville's leo_to_html.xsl file. The new page will be called something like::

    http://leoeditor.com/show-leo-0004.leo

There can be up to 1000 such pages open at once.

**Important**: At present, there must be *some* kind of <?xml-stylesheet> element in the .leo file. Many leo files have the following do-nothing line near the start::

    <?xml-stylesheet ekr_test?>

That's fine. If there is *any* such line, Speed's server-side stuff will replace it with::

    <?xml-stylesheet type="text/xsl" href="leo_to_html.xsl"?>

Speed will soon add the above line even if there is no stylesheet element.

I am working on leo_to_html.xsl so that nodes can be expanded and contracted.
#@+node:ekr.20150311123850.58: *4* Added --diff command-line option
@language rest
@wrap

Leo performs a diff automatically after load when --diff is in effect and exactly two files are given.

===== How to configure git diff:

An excellent reference:
http://stackoverflow.com/questions/255202/how-do-i-view-git-diff-output-with-a-visual-diff-program

The essential idea: what you refer to in the config file is actually a shell (/bin/sh) script, not a DOS script.

Here is git-editor.bat::
@language shell

    #!/bin/sh
    # Wrapper for git editor
    "C:/Program Files (x86)/wscite/scite.exe" "$*"

Here is git-difftool.bat::
    
    #!/bin/sh
    
    # sh wrapper for external git diff
    # sourceTree now calls this wrapper for external diffs.
    
    # http://stackoverflow.com/questions/255202/how-do-i-view-git-diff-output-with-a-visual-diff-program
    
    # diff is called by git with 7 parameters:
    #  path old-file old-hex old-mode new-file new-hex new-mode
    #  "<path_to_diff_executable>" "$2" "$5" | cat
    
    C:/python27/python.exe C:/leo.repo/leo-editor/launchLeo.py --diff "$2" "$5" | cat
#@-all
#@-leo
