Save directly Tiddlywiki 5 file to GitHub

1,670 views
Skip to first unread message

Mohammad

unread,
Apr 4, 2019, 7:20:36 AM4/4/19
to TiddlyWiki
Referring to: https://github.com/Jermolene/TiddlyWiki5/issues/3890


To save Tiddlywiki directly to GitHub Pages, is it possible to 

  1. Have GitHub Saver plugin? or
  2. Update the current classic TW to TW5?

--Mohammad

Jeremy Ruston

unread,
Apr 8, 2019, 6:44:18 AM4/8/19
to tiddl...@googlegroups.com
Hi Mohammad

That is very interesting, I'm sorry I missed it when it was first released. More to the point, I missed the existence of the GitHub APIs that it uses for saving files. When I get a chance I shall try to spin up a GitHub Pages saver for TW5.

Best wishes

Jeremy.


To save Tiddlywiki directly to GitHub Pages, is it possible to 

  1. Have GitHub Saver plugin? or
  2. Update the current classic TW to TW5?

--Mohammad

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/d2c2a41a-f9bf-42e6-8fce-11534ebfaf48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mohammad

unread,
Apr 8, 2019, 12:43:36 PM4/8/19
to TiddlyWiki
Many Thanks Jeremy!
TW deserves to have that capability

Best
Mohammad


On Monday, April 8, 2019 at 3:14:18 PM UTC+4:30, Jeremy Ruston wrote:
Hi Mohammad


That is very interesting, I'm sorry I missed it when it was first released. More to the point, I missed the existence of the GitHub APIs that it uses for saving files. When I get a chance I shall try to spin up a GitHub Pages saver for TW5.

Best wishes

Jeremy.


To save Tiddlywiki directly to GitHub Pages, is it possible to 

  1. Have GitHub Saver plugin? or
  2. Update the current classic TW to TW5?

--Mohammad

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Jeremy Ruston

unread,
Apr 8, 2019, 5:00:16 PM4/8/19
to tiddl...@googlegroups.com
I’ve made a first cut at a saver to save directly to GitHub:


It works similarly to the upload saver that is used with TiddlySpot: once configured in control panel it takes over saving duties. It can save to an arbitrary filename, path, branch and repository.

We still need a beginners tutorial, but there’s some docs here:


This is a single file saver, but there’s a lot of potential with this API for other configurations, in particular supporting single file wikis.

As ever, please reply here with any questions or comments,

Best wishes

Jeremy



To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Xavier Cazin

unread,
Apr 9, 2019, 2:49:25 AM4/9/19
to tiddl...@googlegroups.com
Hi Jeremy,

I think this saver will prove immensely useful, thank you!

Since we'll certainly want to use it to publish wikis (with Github Pages), I'd suggest adding a setting Filter that allows to save only a subset of the tiddlers. For instance, a value "[!tag[Work In Progress]]" would sync all tiddlers but those not yet ready for public release.

Cheers,
-- Xavier Cazin


Jeremy Ruston

unread,
Apr 9, 2019, 3:30:32 AM4/9/19
to tiddl...@googlegroups.com
Hi Xavier

I think this saver will prove immensely useful, thank you!

I’m just embarrassed that it took me so long to realise that this was possible, and immense gratitude to 38911BytesFree on GitHub who developed a version for TiddlyWiki Classic 4 years ago:


Since we'll certainly want to use it to publish wikis (with Github Pages), I'd suggest adding a setting Filter that allows to save only a subset of the tiddlers. For instance, a value "[!tag[Work In Progress]]" would sync all tiddlers but those not yet ready for public release.

That can be done by creating a custom download button that references a custom template. The download button would look like this:

<$button class="tc-btn-big-green">
<$action-sendmessage $message="tm-download-file" $param="$:/_mytemplate" filename="output.html"/>
Download Filtered {{$:/core/images/save-button}}
</$button>

And then $:/_mytemplate would look like this:

\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[tag[Work In Progress]] +[sort[title]]
\end
{{$:/core/templates/tiddlywiki5.html}}

If one wanted to arrange things so that clicking the usual “save changes” button invokes the default saver, but that the special “publish” button invokes the GitHub saver, then one would temporarily set the $:/GitHub/Username tiddler within the button action string.

Best wishes

Jeremy

Mohammad

unread,
Apr 9, 2019, 7:29:37 AM4/9/19
to TiddlyWiki
Many thanks Jeremy!

  1. I opened the https://tiddlywiki.com/prerelease/#Saving+to+GitHub
  2. In control panel GitHub saver filled up required information 
  3. Click save and I got this error: 
XMLHttpRequest Error 401

renamed it to index.html and uploaded to a public repository

--Mohammad

Xavier Cazin

unread,
Apr 9, 2019, 11:58:50 AM4/9/19
to tiddl...@googlegroups.com
Hi Jeremy,

Wonderful, thank you for the additional tips.

Cheers,
-- Xavier Cazin


Xavier Cazin

unread,
Apr 9, 2019, 12:03:54 PM4/9/19
to tiddl...@googlegroups.com
Hi Mohammad,

I think you need to create a first version of the file on GitHub before being able to push subsequent versions from your wiki.

Cheers,
-- Xavier Cazin


To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Jeremy Ruston

unread,
Apr 9, 2019, 12:43:46 PM4/9/19
to tiddl...@googlegroups.com
Hi Mohammad

I think you need to create a first version of the file on GitHub before being able to push subsequent versions from your wiki.

You shouldn’t need to do that, it should work for saving to a brand new path within the repo.

The 401 error code means “Unauthorised”, so I think there’s a problem with the credentials you’re supplying. Are you using a personal access token? See here:


Best wishes

Jeremy

Mohammad

unread,
Apr 9, 2019, 2:31:23 PM4/9/19
to TiddlyWiki
Hi Jeremy,
I uses a personal access token, I created one for experimenting this new feature!
But it is not clear what kind of permissions TW needs to save on GitHub.
I tried different forms.

--Mohammad



On Tuesday, April 9, 2019 at 9:13:46 PM UTC+4:30, Jeremy Ruston wrote:
Hi Mohammad


Cheers,
-- Xavier Cazin


To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mohammad

unread,
Apr 9, 2019, 2:55:49 PM4/9/19
to TiddlyWiki
Thanks Xavier!
I followed Jeremy and even I created one as you told, no success!

--Mohammad


On Tuesday, April 9, 2019 at 8:33:54 PM UTC+4:30, Xavier wrote:
Hi Mohammad,

I think you need to create a first version of the file on GitHub before being able to push subsequent versions from your wiki.

Cheers,
-- Xavier Cazin


To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mohammad

unread,
Apr 9, 2019, 3:01:48 PM4/9/19
to TiddlyWiki
Hi Jeremy,

More input!

I created a new personal access token and enabled all permissions.
I also created the /wiki/ folder
Now I could save, but not easily as I get sometimes 409, 0, error.

I tried to strip out the wiki to have a small one to be able save it quicker.

--Mohammad


On Tuesday, April 9, 2019 at 9:13:46 PM UTC+4:30, Jeremy Ruston wrote:
Hi Mohammad


Cheers,
-- Xavier Cazin


To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mohammad

unread,
Apr 9, 2019, 3:52:53 PM4/9/19
to tiddl...@googlegroups.com
More inputs
  1. From https://tiddlywiki.com/prerelease I downloaded an empty version
  2. I created a new personal access token and enabled permissions for gist and repo
  3. I created a new repository at GitHub
  4. I opened the empty.html from step 1 and from control panel, GitHub Save filled out the required information (user, password=access token), file-index.hrml, path=/docs/
  5. I clicked on save
  6. It is now on the GitHub (suuessful)
To use for publishing
  1. In the repo I enabled Github pages
  2. I pointed out to .docs/ folder 
  3. Now I have GitHub pages working
  4. see demo at: https://kookma.github.io/TW5-GitHub-Saver/

One point:
The saving in progress message like the one is displaying when you save to tiddlyspot  can not be seen. Hope Jeremy fix this. 

Mohammad



Mohammad

unread,
Apr 9, 2019, 4:08:13 PM4/9/19
to TiddlyWiki
Hi Jeremy,
 I think this feature should be properly announced!
This way many GitHub users can use Tiddlywiki for project, organization website and documentation.
So there is a huge opportunity to replace the static GitHub pages with dynamic webpages created by Tiddlywiki.


--Mohammad

bimlas

unread,
Apr 10, 2019, 3:12:27 AM4/10/19
to TiddlyWiki
Jeremy,

Thank you very much for this! I can't express how important this opportunity is, this is a huge milestone in the development of TiddlyWiki! With this saver you don't have to bother with Dropbox and Google Drive. Please ping me in mail when it is ready and I'll do it for GitLab.


Jeremy Ruston

unread,
Apr 10, 2019, 3:25:56 AM4/10/19
to tiddl...@googlegroups.com
Hi Mohammad

Glad you got it working. Was the only problem fixing the access rights for the personal access token?

Can you confirm that you were able to save to a new location as well as saving over an existing file?

Many thanks,

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Jeremy Ruston

unread,
Apr 10, 2019, 3:31:34 AM4/10/19
to tiddl...@googlegroups.com
Hi Bimlas

Thank you very much for this! I can't express how important this opportunity is, this is a huge milestone in the development of TiddlyWiki! With this saver you don't have to bother with Dropbox and Google Drive.

Thank you! Really it's thanks to @38911BytesFree and to Mohammad for finding it.

I agree that it's pretty sweet, with quite a few advantages over Dropbox/Drive, notably that Git gives us an automatic revision history that can easily be inspected and rolled back.

Please ping me in mail when it is ready and I'll do it for GitLab.

It looks like the API for GitLab is almost identical to that of GitHub. I'll expose the API endpoint as a configuration parameter and then you can experiment with it more easily.

Best wishes

Jeremy




--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

TonyM

unread,
Apr 10, 2019, 4:14:27 AM4/10/19
to TiddlyWiki
I look forward to trying this.

I hope the available instructions are good enough for a newby GitHub user. 

To clarify as I understand it 
  • all wikis will be publicly visible unless you get a paid account and host it privately in github, so for many this may not make sense for wikis with personal content, but of course it is great for people to publish special public editions and provides the whole issues and pull request infrastructure.
  • What would be the upgrade path with the release of an updated core?

Regards
Tony

bimlas

unread,
Apr 10, 2019, 4:57:31 AM4/10/19
to TiddlyWiki
With GitLab you can have unlimited number of private repositories. ;)

Mohammad

unread,
Apr 10, 2019, 5:24:00 AM4/10/19
to TiddlyWiki
Hi Jeremy
  1. The problem was the PAT (personal access token)
  2. Overwriting the current index.html is okay (each save overwrite the previous one)
  3. I just had to create the folder in advance if the path is not existed! (for examples for /docs/ I had first create the folder)
  4. The saving process in GitHib is slower comparing the saving on tiddlyspot
--Mohammad


On Wednesday, April 10, 2019 at 11:55:56 AM UTC+4:30, Jeremy Ruston wrote:
Hi Mohammad

Glad you got it working. Was the only problem fixing the access rights for the personal access token?
Yes 

Can you confirm that you were able to save to a new location as well as saving over an existing file?
No 

Many thanks,

To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

CHUN LI

unread,
Apr 10, 2019, 5:29:02 AM4/10/19
to tiddl...@googlegroups.com
What about BitBucket? Anyone has experience with it? 

I wonder if pushing a HTML single file TW from a versioning control platform to a S3 Server will be useful? Don’t know a use case yet. 

On Wed, 10 Apr 2019 at 8:57 PM, bimlas <bimba....@gmail.com> wrote:
With GitLab you can have unlimited number of private repositories. ;)

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

ILYA

unread,
Apr 10, 2019, 11:56:09 AM4/10/19
to tiddl...@googlegroups.com, Jeremy Ruston
Hello,


This is great!!!
If we are able to publish single file to github.com how hard it would be to implement a layout similar to nodejs. Where every tiddler is in its own file. In this case index.html wouldn't be changing and it would be easier to get git history for single tiddler.

BR,
ILYA
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

bimlas

unread,
Apr 11, 2019, 12:29:29 AM4/11/19
to TiddlyWiki
I think the saver broke Tiddly: cannot download prerelease, it drops RSOD.

bimlas

unread,
Apr 11, 2019, 12:46:20 AM4/11/19
to TiddlyWiki
"Path to target file" in GitHub saver has to be filled to prevent RSOD.. (sorry for short messages, I'm on phone).

bimlas

unread,
Apr 11, 2019, 1:53:50 AM4/11/19
to TiddlyWiki

oleghbond

unread,
Apr 15, 2019, 2:12:37 PM4/15/19
to TiddlyWiki
Hi, Mohammed,

sounds attractive because of simplicity, I did precisely what you describe, however, eventually obtained: "Error while saving: XMLHttpRequest error code: 404". 

What could be wrong?

Olegh


вівторок, 9 квітня 2019 р. 22:52:53 UTC+3 користувач Mohammad написав:
More inputs
  1. From https://tiddlywiki.com/prerelease I downloaded an empty version
  2. I created a new personal access token and enabled permissions for gist and repo
  3. I created a new repository at GitHub
  4. I opened the empty.html from step 1 and from control panel, GitHub Save filled out the required information (user, password=access token), file-index.hrml, path=/docs/
  5. I clicked on save
  6. It is now on the GitHub (suuessful)
To use for publishing
  1. In the repo I enabled Github pages
  2. I pointed out to .docs/ folder 
  3. Now I have GitHub pages working
image001.png

Mohammad

unread,
Apr 15, 2019, 2:37:53 PM4/15/19
to TiddlyWiki
Hi Olegh,
 Jeremy may have a better answer, but by my best knowledge this is because of wrong credential!
Check you have entered the right PAT (create a new personal access token and enabled permissions for gist and repo)

--Mohammad

Jeremy Ruston

unread,
Apr 15, 2019, 4:09:53 PM4/15/19
to tiddl...@googlegroups.com
Hi Olegh, Mohammad,

I think that 404 error might be because the target directory doesn’t exist. I’ve just pushed an update to fix it:


In a few moments the new build will be available at:


Best wishes

Jeremy

-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Jeremy Ruston

unread,
Apr 15, 2019, 4:32:13 PM4/15/19
to tiddl...@googlegroups.com

On 10 Apr 2019, at 08:31, Jeremy Ruston <jeremy...@gmail.com> wrote:

It looks like the API for GitLab is almost identical to that of GitHub. I'll expose the API endpoint as a configuration parameter and then you can experiment with it more easily.

I’ve made an update so that the API URL is configurable in the control panel:


 If I’m reading GitLab’s docs correctly, the value you’ll need is:


The update should be at https://tiddlywiki.com/prerelease in about 6 minutes,

Best wishes

Jeremy

oleghbond

unread,
Apr 16, 2019, 5:18:47 AM4/16/19
to TiddlyWiki
Hi, Mohammad, 

everything works fine. BUT I've encountered a certain security issue which I don't know how to walk around.

Namely: 
  • After the wiki is saved at GitHub it stores PAT in itself. So anyone can download the whole wiki and similarly take control of the published content. 
  • In opposite if PAT is deleted the wiki cannot be saved at GitHub and it is suggested to save the wiki locally instead.
  • However, in your demonstration https://kookma.github.io/test-tw5github/ your wiki the PAT field is empty.
The question: How can one securely save a wiki at GitHub keeping own PAT in secret?

Look forward for your assistance.

Olegh

вівторок, 9 квітня 2019 р. 22:52:53 UTC+3 користувач Mohammad написав:
More inputs
  1. From https://tiddlywiki.com/prerelease I downloaded an empty version
  2. I created a new personal access token and enabled permissions for gist and repo
  3. I created a new repository at GitHub
  4. I opened the empty.html from step 1 and from control panel, GitHub Save filled out the required information (user, password=access token), file-index.hrml, path=/docs/
  5. I clicked on save
  6. It is now on the GitHub (suuessful)
To use for publishing
  1. In the repo I enabled Github pages
  2. I pointed out to .docs/ folder 
  3. Now I have GitHub pages working

Jeremy Ruston

unread,
Apr 16, 2019, 5:20:11 AM4/16/19
to tiddl...@googlegroups.com
Hi Olegh

  • After the wiki is saved at GitHub it stores PAT in itself. So anyone can download the whole wiki and similarly take control of the published content. 
No, the PAT is stored in browser local storage, not in the wiki itself.

Best wishes

Jeremy.


  • In opposite if PAT is deleted the wiki cannot be saved at GitHub and it is suggested to save the wiki locally instead.
  • However, in your demonstration https://kookma.github.io/test-tw5github/ your wiki the PAT field is empty.
The question: How can one securely save a wiki at GitHub keeping own PAT in secret?

Look forward for your assistance.

Olegh

вівторок, 9 квітня 2019 р. 22:52:53 UTC+3 користувач Mohammad написав:
More inputs
  1. From https://tiddlywiki.com/prerelease I downloaded an empty version
  2. I created a new personal access token and enabled permissions for gist and repo
  3. I created a new repository at GitHub
  4. I opened the empty.html from step 1 and from control panel, GitHub Save filled out the required information (user, password=access token), file-index.hrml, path=/docs/
  5. I clicked on save
  6. It is now on the GitHub (suuessful)
To use for publishing
  1. In the repo I enabled Github pages
  2. I pointed out to .docs/ folder 
  3. Now I have GitHub pages working
  4. see demo at: https://kookma.github.io/test-tw5github/

One point:
The saving in progress message like the one is displaying when you save to tiddlyspot  can not be seen. Hope Jeremy fix this. 

Mohammad




-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Olegh Bondarenko

unread,
Apr 16, 2019, 5:26:47 AM4/16/19
to tiddl...@googlegroups.com
Jeremy, thanks, 

I've just checked in other browser. Indeed the PAT field is empty. 

So, I prove TW5 GitHub Saviour as well https://protw.github.io/tw5ghs/

Olegh Bondarenko
https://bit.ly/oleghbond





вт, 16 квіт. 2019 о 12:20 Jeremy Ruston <jeremy...@gmail.com> пише:
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/r-okut9mkJE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Jeremy Ruston

unread,
Apr 16, 2019, 6:11:38 AM4/16/19
to tiddl...@googlegroups.com
Hi Olegh

That looks great, I’m pasting an image here for posterity.

Best wishes

Jeremy



Olegh Bondarenko

unread,
Apr 16, 2019, 1:22:09 PM4/16/19
to tiddl...@googlegroups.com
Jeremy, 

you're welcome. With great pleasure. It's just a little reimbursement to you for what you've done.

Olegh Bondarenko
https://bit.ly/oleghbond





вт, 16 квіт. 2019 о 13:11 Jeremy Ruston <jeremy...@gmail.com> пише:

Mohammad

unread,
Apr 16, 2019, 1:42:34 PM4/16/19
to TiddlyWiki
Hi Olegh,
 Sorry for late reply! I saw you have successfully set up your wiki on!
Congrats!

--Mohammad 
Hi Olegh
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/r-okut9mkJE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.

bimlas

unread,
Apr 22, 2019, 10:30:06 AM4/22/19
to TiddlyWiki
Jeremy,

Sorry for the late reply. I've modified the saver to work with GitLab, please check it out: https://github.com/Jermolene/TiddlyWiki5/pull/3931

I would like to ask the others to try out the GitHub/GitLab saver to find out the possible problems as soon as possible.

Jeremy Ruston

unread,
Apr 26, 2019, 2:01:56 PM4/26/19
to tiddl...@googlegroups.com
Hi Bimlas

Apologies for the late response, I’ll respond on the GitHub ticket,

Best wishes

Jeremy

-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

camero...@gmail.com

unread,
May 2, 2019, 3:54:49 PM5/2/19
to tiddl...@googlegroups.com
Hi, 

I've been trying to get this working but I feel that I am missing something. i can get my repository to host to github pages but when I use my local browser to open the tiddlywiki (index.html) I've got in the git repo I then cannot save it. Is the workflow (once it works) to navigate to the file on your hard drive, make edits, save it then git commit, push, etc? Every time I try to make modifications they are either not saved because I used the hosted tiddlywiki at github.io to try to make changes or I get a n XHMLHttpRequest error code: 409 if I try to edit the on-disk index.html in my browser and use the tiddlywiki save function. I note that I do have an earlier version of this index.html file being served in my github pages. What could I be missing?



On Thursday, April 4, 2019 at 7:20:36 AM UTC-4, Mohammad wrote:

Jeremy Ruston

unread,
May 2, 2019, 4:10:30 PM5/2/19
to tiddl...@googlegroups.com
Hi Cameron

Firstly, are you using Firefox? I think it doesn’t support XMLHttpRequests from files loaded from a file:// URI. I used Chrome in most of my testing.

The intended workflow is to load the wiki via the https://username.github.io/index.html URI, and then save changes directly back to GitHub. The challenge is that GitHub pages doesn’t update instantly, it takes a few minutes for a pushed HTML file to be accessible. So, care has to be taken not to reload the wiki from GitHub pages before the changes have been processed. To be cautious, one might want to check the wiki in a separate tab to see when it has refreshed.

Best wishes

Jeremy.

On 2 May 2019, at 20:54, camero...@gmail.com wrote:

Hi, 

I've been trying to get this working but I feel that I am missing something. i can get my repository to host to github pages but when I use my local browser to open the tiddlywiki (index.html) I've got in the git repo I then cannot save it. Is the workflow (once it works) to navigate to the file on your hard drive, make edits, save it then git commit, push, etc? Every time I try to make modifications they are either not saved because I used the hosted tiddlywiki at github.io to try to make changes or I get a n XHMLHttpRequest error code: 409 if I try to edit the on-disk index.html in my browser and use the tiddlywiki save function. I note that I do have an earlier version of this index.html file being served in my github pages. What could I be missing?

On Thursday, April 4, 2019 at 7:20:36 AM UTC-4, Mohammad wrote:
Referring to: https://github.com/Jermolene/TiddlyWiki5/issues/3890


To save Tiddlywiki directly to GitHub Pages, is it possible to 

  1. Have GitHub Saver plugin? or
  2. Update the current classic TW to TW5?

--Mohammad

-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

camero...@gmail.com

unread,
May 2, 2019, 7:36:08 PM5/2/19
to TiddlyWiki
Hi Jeremy,
  Thanks for reading my comment. I am actually using Chrome, and when I follow along with the intended workflow it removes my github auth token and also the save feature just downloads index.html in-browser. If you follow my link or look at the attached image you can also see that all the styling and formatting is messed up, I'm using empty.html downloaded from prerelease as the basis and no nonstandard tiddlers are added. I understand this is prerelease so I am not depending on it I was just excited to use tiddlywiki in a  new way. I'm willing to provide more debugging information, but I am a bit of a novice so I don't know where to start.

Capture.PNG




On Thursday, May 2, 2019 at 4:10:30 PM UTC-4, Jeremy Ruston wrote:
Hi Cameron

Firstly, are you using Firefox? I think it doesn’t support XMLHttpRequests from files loaded from a file:// URI. I used Chrome in most of my testing.

The intended workflow is to load the wiki via the https://username.github.io/index.html URI, and then save changes directly back to GitHub. The challenge is that GitHub pages doesn’t update instantly, it takes a few minutes for a pushed HTML file to be accessible. So, care has to be taken not to reload the wiki from GitHub pages before the changes have been processed. To be cautious, one might want to check the wiki in a separate tab to see when it has refreshed.

Best wishes

Jeremy.

On 2 May 2019, at 20:54, camero...@gmail.com wrote:

Hi, 

I've been trying to get this working but I feel that I am missing something. i can get my repository to host to github pages but when I use my local browser to open the tiddlywiki (index.html) I've got in the git repo I then cannot save it. Is the workflow (once it works) to navigate to the file on your hard drive, make edits, save it then git commit, push, etc? Every time I try to make modifications they are either not saved because I used the hosted tiddlywiki at github.io to try to make changes or I get a n XHMLHttpRequest error code: 409 if I try to edit the on-disk index.html in my browser and use the tiddlywiki save function. I note that I do have an earlier version of this index.html file being served in my github pages. What could I be missing?

On Thursday, April 4, 2019 at 7:20:36 AM UTC-4, Mohammad wrote:
Referring to: https://github.com/Jermolene/TiddlyWiki5/issues/3890


To save Tiddlywiki directly to GitHub Pages, is it possible to 

  1. Have GitHub Saver plugin? or
  2. Update the current classic TW to TW5?

--Mohammad


-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Jeremy Ruston

unread,
May 3, 2019, 5:05:20 AM5/3/19
to tiddl...@googlegroups.com
Hi Cameron

Can you show a screenshot of the control panel settings prior to clicking “save changes”?

It may also be worth precisely listing the steps you took so that I can try to duplicate your result.

Best wishes

Jeremy.

On 3 May 2019, at 00:36, camero...@gmail.com wrote:

Hi Jeremy,
  Thanks for reading my comment. I am actually using Chrome, and when I follow along with the intended workflow it removes my github auth token and also the save feature just downloads index.html in-browser. If you follow my link or look at the attached image you can also see that all the styling and formatting is messed up, I'm using empty.html downloaded from prerelease as the basis and no nonstandard tiddlers are added. I understand this is prerelease so I am not depending on it I was just excited to use tiddlywiki in a  new way. I'm willing to provide more debugging information, but I am a bit of a novice so I don't know where to start.

<Capture.PNG>

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

For more options, visit https://groups.google.com/d/optout.
<Capture.PNG>

Richard Campbell

unread,
Sep 6, 2019, 8:29:40 PM9/6/19
to TiddlyWiki
I'm late to this conversation, but have a small github pages site which can be used to download a (normal) github repo index.html file using their GET blob api. You can enter your username, repo, and a PAT (currently it assumes the tiddlywiki file is "index.html".)   The location and PAT are stored in local storage, nothing stored in github or on any other site. 


Once you've entered the username/repo/PAT, the download just takes a second or so (on good connection!).  Then of course the GitHub saver works nicely in the background to save all changes.

Richard

Jeremy.

To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

TonyM

unread,
Sep 6, 2019, 9:18:58 PM9/6/19
to TiddlyWiki
Richard

Thanks for sharing this.

Tony

Mohammad Rahmani

unread,
Sep 6, 2019, 11:51:02 PM9/6/19
to tiddl...@googlegroups.com
Hi Richard,

What is this


for me the solution proposed does not work!
After creating the bookmark in firefox and chrome it returns 

...working... caught some error: url: https://api.github.com/repos/atronoush/tiddly/contents/ 

 


Best wishes
Mohammad


To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/8e780ebf-edea-4985-8156-36a8d31d8e0b%40googlegroups.com.

Mohammad Rahmani

unread,
Sep 7, 2019, 12:05:40 AM9/7/19
to tiddl...@googlegroups.com
Richard,
 It seems in tgbm.js the below line should be revised

like
const GH_USER = "username here";
const GH_PAT = "PAT value here";
const GH_REPO = "repo-name- here"
const contentsUrl = `https://api.github.com/repos/${GH_USER}/${GH_REPO}/contents/`;

More questions

  1. Does it require to use the GitHub save of TW or your method works without it for example does this method works with TW 5.1.17 (it has not GitHub Saver)?
  2. Does this method allows to save to other branches?
  3. Does this method solves the error 409?
By the way many thanks for sharing this neat technique.


Best wishes
Mohammad


On Sat, Sep 7, 2019 at 4:59 AM Richard Campbell <gne...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/8e780ebf-edea-4985-8156-36a8d31d8e0b%40googlegroups.com.

Mohammad Rahmani

unread,
Sep 7, 2019, 12:09:19 AM9/7/19
to tiddl...@googlegroups.com
This work like a charm



Lovely! 


Best wishes
Mohammad


On Sat, Sep 7, 2019 at 4:59 AM Richard Campbell <gne...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/8e780ebf-edea-4985-8156-36a8d31d8e0b%40googlegroups.com.

Jeremy Ruston

unread,
Sep 7, 2019, 4:35:02 AM9/7/19
to tiddl...@googlegroups.com
Hi Richard

Good stuff, thanks for sharing. I’ve wondered about using a similar approach to load at startup individual tiddler files from a tiddler folder stored on GitHub.

Best wishes

Jeremy

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/8e780ebf-edea-4985-8156-36a8d31d8e0b%40googlegroups.com.

Richard Campbell

unread,
Sep 7, 2019, 8:09:24 AM9/7/19
to TiddlyWiki
Hi - the repo is a bit of a jumble.  I first tried a Google Cloud Function to do the work (free hosting for the function!); that worked fine, but couldn't figure out a nice way to get variables and PATs stored. I then tried the code as a bookmarklet, which also worked, but was just a hassle - the tgbm.js is the tiddly github bookmarklet code. At least a user could edit their own code and make their own bookmarklet, but that's a lot of work.

So the current design is just to make it an index.html page (in the repo) and serve it via github pages, initially draws out the user input fields, then downloads your tiddlywiki index.html and overwrites the page. Can't figure out a way to change the URL location so your info/PAT is stored under <username>.github.com  rather than netrc.github.com but at least it is your local storage.

A couple more things to perhaps clean up in index.html (the only file/code that runs). But seems to be mostly ok.

Richard
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Mohammad Rahmani

unread,
Sep 7, 2019, 9:13:47 AM9/7/19
to tiddl...@googlegroups.com
Thanks for clarification!


Best wishes
Mohammad


To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/0ccaf8c7-54d7-4574-9756-7d6974f8e691%40googlegroups.com.

Richard Campbell

unread,
Sep 8, 2019, 9:34:34 AM9/8/19
to TiddlyWiki
Jeremy - if this is useful, feel free to copy and host it from tiddlywiki.com directly.

I was wondering the same thing about per-tiddler github saving, but wonder about the performance as github isn't really designed as a full database (e.g. file lookups are always a two request process). Something like firebase might be better, and firebase perhaps could help enable collaborative/shared tiddlers.

Cheers,

.ric
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Jeremy Ruston

unread,
Sep 9, 2019, 9:20:26 AM9/9/19
to tiddl...@googlegroups.com
Hi Richard

Jeremy - if this is useful, feel free to copy and host it from tiddlywiki.com directly.

Thanks, that might be cool. In the meantime, please feel free to send a PR for the tiddlywiki-com branch with a “Resources” tiddler announcing the link.

I was wondering the same thing about per-tiddler github saving, but wonder about the performance as github isn't really designed as a full database (e.g. file lookups are always a two request process). Something like firebase might be better, and firebase perhaps could help enable collaborative/shared tiddlers.

Indeed, I can’t imagine it working well for a wiki like tw5.com, but it might be reasonable for smaller wikis.

Best wishes

Jeremy

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e5c2bf32-d363-47a6-90e2-d9d9652b57b1%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages