Viewrendered3 Updates

106 views
Skip to first unread message

Thomas Passin

unread,
Apr 16, 2020, 10:25:33 PM4/16/20
to leo-e...@googlegroups.com
I have updated the VR3 plugin with some bug fixes and minor changes, and more significantly by adding a new @image directive.  Edward (@ekr) had  suggested this, and after some reflection I decided to try it out.  The new directive requires a url:

@image url-to-image

where the url can be absolute including a file: url to the file system, a relative url (relative to the directory your outline is in), or a data: url.
The new directive works for both Markdown and Restructured Text trees.  The attached screen capture shows the new directive being used in a Markdown node.

For the time being, the updated version is available from my fork on Github.  It is in the devel branch of


I'll push it to the upstream Leo distro once I work out how to persuade Github that yes, I'm supposed to be authorized to do that.

Please let me know of any bugs you find!


at-image_example.png

Matt Wilkie

unread,
Apr 18, 2020, 8:13:59 PM4/18/20
to leo-editor
That is very inspiring Thomas!

Thomas Passin

unread,
Apr 19, 2020, 7:54:34 PM4/19/20
to leo-editor
Thanks, Matt!


On Saturday, April 18, 2020 at 8:13:59 PM UTC-4, Matt Wilkie wrote:
That is very inspiring Thomas!

I'm still stuck on pushing my changes to the Leo repo.  Here's hoping you can help!  Edward told me he's added me to Leo's contributors, but every attempt I've made to push a file has failed with an Unauthorized or 403 Forbidden error.   Here's what I've tried:

1. Push directly from a Git Leo clone, using GitHub Desktop;
2. Push from my own Leo fork, using Git Extensions (as you recommended);
3. In Git Extensions, set up Putty to create and use a key pair, and informed Github of the public key.

Within my own fork, I didn't have any trouble pushing or merging my changes.  But all of these failed when I tried to go to the Leo repo.  I'm out of ideas to try.

So far as I know, both GitHub desktop and Git Extensions use the command line behind the scenes.  Is there some other configuration thing at Github that needs to be done?

Matt Wilkie

unread,
Apr 19, 2020, 8:45:19 PM4/19/20
to leo-editor
Hmm. What happens with `git push` from console?  (see tab button beside [commit, diff, file tree, ...] in Git Extensions, or just from a regular command prompt). Any error messages?

Do you have more than one GitHub account? I've run into problems with Git Extensions and multiple GitHub identities. I think I've sorted it now, but I've thought that before.

-matt

Thomas Passin

unread,
Apr 19, 2020, 9:32:00 PM4/19/20
to leo-editor

On Sunday, April 19, 2020 at 8:45:19 PM UTC-4, Matt Wilkie wrote:
Hmm. What happens with `git push` from console?  (see tab button beside [commit, diff, file tree, ...] in Git Extensions, or just from a regular command prompt). Any error messages?

That pushes to my fork, but not upstream to Leo.  It works fine.  Do you think it's worth cloning Leo using Git-Ext?  Right now, I have the fork, managed with Git Ext, and the Leo clone, managed by Github Desktop.

Do you have more than one GitHub account? I've run into problems with Git Extensions and multiple GitHub identities. I think I've sorted it now, but I've thought that before.

Not so far as I know, and Git Ext only seems to know about the one. There is one thing in this area that's a little confusing to me.  I don't let GutHub show my real mailing address.  It has told me that in that case, It cooked up a different email address for me to use - but I don't understand for what purposes.  I've tried using that one too, and no joy.

Matt Wilkie

unread,
Apr 20, 2020, 12:00:12 AM4/20/20
to leo-editor

Hmm. What happens with `git push` from console?  (see tab button beside [commit, diff, file tree, ...] in Git Extensions, or just from a regular command prompt). Any error messages?

That pushes to my fork, but not upstream to Leo.  It works fine.  Do you think it's worth cloning Leo using Git-Ext?  Right now, I have the fork, managed with Git Ext, and the Leo clone, managed by Github Desktop.

Ahh, I think I see now. You need to add a new remote to push to. This could be done in any client, but I only know how for git extensions. Once the remote(s) are set all the clients should be able to use them. Right now in the GitExt manged repo the remote named "origin" is probably set to your personal fork.

Right click on "Remotes"  >> select "Manage" >> then [+] to add a new remote. Call it 'upstream' (or anything else that makes sense to you) and put in Leo's repo address for url:


When you save changes the next prompt is confusingly worded. What it's really asking is: "make this new remote the default one?".

From this point on, when you use the Push or Pull dialogs (via dropdown) you can choose between Origin (yours) and Upstream (Leo Editor organization) for the destination.


Matt Wilkie

unread,
Apr 20, 2020, 12:08:50 AM4/20/20
to leo-editor
So that's (a very brief) intro for how to work with multiple remotes for a single source code repo. For me that's too complicated and I prefer this route:
  1. Clone Leo (using the client you like best)
  2. On your machine immediately checkout and Devel, and create a new branch
  3. Make a teeny change, commit and push. (to verify your memberhsip in Leo org works).
  4. copy your work into this new branch, commit, hack, push, repeat.
-matt

Thomas Passin

unread,
Apr 20, 2020, 10:52:28 AM4/20/20
to leo-editor
I already had the upstream origin configured.  To follow your suggestions, I created a new one and deactivated the previous one.  I still get the same results, and in thedialog to manage remotes, using the  "Test Connection" button gave this:

Unable to open connection:
Host does not exist

Hmm, I wonder if that could be my Windows firewall preventing the outbound connection because it's ssh?

Edward K. Ream

unread,
Apr 20, 2020, 11:59:11 AM4/20/20
to leo-editor
On Mon, Apr 20, 2020 at 9:52 AM Thomas Passin <tbp1...@gmail.com> wrote:
I already had the upstream origin configured.  To follow your suggestions, I created a new one and deactivated the previous one.  I still get the same results, and in thedialog to manage remotes, using the  "Test Connection" button gave this:

Unable to open connection:
Host does not exist

Hmm, I wonder if that could be my Windows firewall preventing the outbound connection because it's ssh?

I can't help you here. For now, could you please just email me your latest vr3.py? I'll push it to devel myself.

Edward

Matt Wilkie

unread,
Apr 20, 2020, 4:20:31 PM4/20/20
to leo-editor
Hmm, I wonder if that could be my Windows firewall preventing the outbound connection because it's ssh?

I get the same error, but I'm not using Putty/ssh to connect and don't have any keys loaded.

As I understand it (and I'm not sure I do understand it!) there 3 common pathways on Windows for git authentication:
  • Putty and SSH keys
  • Windows Credentials (example below)
  • OAuth tokens (in Git Extensions see "Plugins>>Github" menu)
I think it is possible to be have all 3 configured at once on a single machine, but only using one at any given moment, through means opaque to me.

On my main Leo computer going to "Control Panel\User Accounts\Credential Manager >> Windows Credentials >> Generic" shows 2 github entries. I don't know how these got setup initially, but I know on my work computer I was able to add a github entry manually and that after that I could push. Here's where I learned about Credential Manager: https://github.com/gitextensions/gitextensions/issues/4916



For my work computer troubles I took the step of resetting my credentials and now enter my password every time. Painful but alway works.

Clearing stored git username and passwords

 

elevate git config --system --unset credential.helper

git config --global --unset credential.helper

 

then for each repo:


git config --unset credential.helper


(elevate refers to https://code.kliu.org/misc/elevate/)


And then go to "Control Panel\User Accounts\Credential Manager" >> Windows Credentials >> Generic" and remove the GitHub entries.

After this using "git push" in console asked for credentials -- every time though. Still need to figure out how to safely save them for re-use on this machine.

So, a bunch info, some of which may even be useful.

Sign me,
a-reluctant-git-user-who-resents-the-amount-time-required-for-stupid-git-administrivia
-matt

Thomas Passin

unread,
Apr 21, 2020, 11:05:48 AM4/21/20
to leo-editor
I really appreciate all these suggestions!  Unfortunately none of them have lead to success, although I've learned a few things.

Even after doing the unset credential.helper commands and creating a new remote, I get this:

C:\repos\leo-editor>git push leo_origin_2 devel
Username for 'https://github.com': tbpassin
Password for 'https://tbpa...@github.com':
remote: Permission to leo-editor/leo-editor.git denied to tbpassin.
fatal: unable to access 'https://github.com/leo-editor/leo-editor.git/': The requested URL returned error: 403

That's to say, the very same thing I've gotten all along.  I used my github user name and pw, the same ones I use to log into GitHub with.  I get the same whether I push from GitHub Extensions using the Push menu item, or by directly running git in a Windows cmd window.

Some things I've learned:

If you use the https://github ... URL, then no private key is involved, so it doesn't matter if you created one and told putty to use it.

You saw some github entries in the Windows Credentials Manager that you couldn't account for. I had them too. I discovered that after I had deleted them all, then the next time I tried to push to upstream that a new such entry had been created, with the user name being <Personal Identification Token>.  In the GitHub page that shows your personal tokens, I saw that a new one had been created.  There's no way to find out the actual value of that token, but git seems to know.

After I ran the unset credential.helper commands, I always got a username/pw dialog (as you did), and these credential entries didn't get added.

So that's all interesting but didn't get me connected.  I wonder if the Leo repo just doesn't have me marked as being able to push?
Reply all
Reply to author
Forward
0 new messages