Adding a github repository?

85 views
Skip to first unread message

DazedTurtle

unread,
Sep 12, 2021, 12:09:51 AM9/12/21
to mementodatabase
I'm trying to use the "add JavaScript libraries" feature because I realized there's a couple instances of reusing code between two different libraries, and I'd like to keep it consistent.

I tried using "Add GitHub Repository," and while I can link the root folder of my repository, MD can't seem to find any subfolders. Normally I'd assume that maybe it just can't access subfolders, but it clearly can because it links to this repository subfolder and this repository subfolder.

Is there some less-than-obvious step I'm missing? I've tried taking the URL directly from my browser and formatting the URL to follow the same pattern as the built-in subfolders, but MD says it can't find the repository.

Er Mo

unread,
Sep 12, 2021, 3:51:02 AM9/12/21
to mementodatabase
Hallo
Ich verwende script Code in Mehreren Bibliotheken und verwende dabei die URL . Ich lege dazu eine JS Datei im Internet ab , auf die wird dann Verwiesen . Der Pfaht muss Koreckt eingegeben werden . Habe auch schon mehrere im selben Verzeichnis abgelegt . Der Code von der JS Datei wird nicht automatisch Synchronisiert . Das muss man bei jeden Gerät Manuel machen .

Hello
I am using script code in multiple libraries using the url. To do this, I put a JS file on the Internet, which is then referred to. The path must be entered correctly. I have already put several in the same directory. The code from the JS file is not automatically synchronized. You have to do this manually for every device.

Bill Crews

unread,
Sep 12, 2021, 8:38:06 AM9/12/21
to Er Mo, mementodatabase
Thanks to Denise for educating us on something I haven't tried yet but expect to.

Thanks to Ernst for his info, but it didn't answer her question. Did you try to access subfolders over there? (I assume that's in GitHub.)

And either of you: I'm familiar with GitHub, but only dabbled a bit. If you have a moment, could you tell us what's involved in putting it there & updating it later? I have an account at GitHub already. I'll get further info at GitHub or on the Internet (a link would be handy & appreciated.)

I'm happier the more info sharing we all get from the forum. Thanks again.
__

Danke an Denise für die Aufklärung über etwas, was ich noch nicht ausprobiert habe, aber erwarte.

Danke an Ernst für seine Info, aber es hat ihre Frage nicht beantwortet.  Haben Sie versucht, auf die Unterordner dort zuzugreifen?  (Ich nehme an, das ist in GitHub.)

Und einer von euch: Ich kenne GitHub, habe mich aber nur ein bisschen versucht.  Wenn Sie einen Moment Zeit haben, könnten Sie uns sagen, was dazu gehört, es dort zu platzieren und später zu aktualisieren?  Ich habe bereits einen Account bei GitHub.  Weitere Infos erhalte ich bei GitHub oder im Internet (ein Link wäre praktisch und erwünscht.)

Ich bin glücklicher, je mehr Informationen wir alle aus dem Forum teilen.  Danke noch einmal.

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/352177ba-b4fd-4437-bc24-8696ca9cbbf3n%40googlegroups.com.

DazedTurtle

unread,
Sep 17, 2021, 2:39:46 AM9/17/21
to mementodatabase
I figured out the problem! Before I start, I want to note that this is the first time I've relied on files that I didn't have a local copy of while programming. I assume this concept is probably well understood by people with more experience, and I provide the below "obvious" explanation for fellow newbies like me that may come across this:

It turns out, GitHub updates certain things (such as the raw files for apps to use) at specific intervals (maybe every five minutes?), which makes sense in retrospect.

My subfolders could not be found because, even though the ability to view them on a web page was available immediately, I still needed to wait until the app was able to access them.

The same issue can also pop up when updating a file on GitHub. I figured it out when I discovered that I had to wait a few minutes before an error I fixed finally went away.

Bill: What I did was create a public repository, chose "create new file" in the repository, and directly pasted a bunch of code that I'd previously had in shared scripts. I named the file

  • [Category_Name]/[Library_Name]/[Descriptive_Name].js

This created both my subfolders and the files.

Side note, there are definitely other ways to do this that tend to be vastly preferred, but with the way MD is set up (combined with me pretty much exclusively using the phone app rather than desktop), I've decided that this roundabout, amateurish method is good enough.

To add it to MD, choose "Add GitHub Repository," and then, if you copy the URL for the subfolder directly from the address bar, you'll get (assuming you used the same naming structure I did):


just erase "/tree/main" from the URL to get


And use that URL to access the repository.

As a side note, it's possible that functions you want to use in JavaScript fields need to be in files that are separate from the functions used in shared/trigger/action scripts, but it's entirely possible that I also only ran into a problem with this because I tried to use the "fixed" file before GitHub updated the raw file. I think I actually prefer to keep them separated, so I'm not inclined to put it back just to check.

(Sorry for not having a German translation. Unfortunately, I'd be restricted to using Google Translate, and I have a feeling that your own translation abilities are much more accurate than that of a machine's!)

DazedTurtle

unread,
Sep 19, 2021, 7:04:04 PM9/19/21
to mementodatabase
Sorry for double-posting, but it turns out, I said I solved the problem a bit too soon.

The problem seems to be resolved for going in one folder deep from the root. In short, no issue.

But I assumed that because the problem was solved for one folder deep, it was solved for everything. It is not.

In short, when I said earlier that I named a file

  • [Category_Name]/[Library_Name]/[Descriptive_Name].js

That still wouldn't work. However,

  • [Library_Name]/[Descriptive_Name].js

does work, because it's only one folder deep from the root.

Which would then make the URL you get from the address bar


and the URL you give MD


However, if you choose "Add URL" instead of "Add GitHub Repository," then you *can* get the raw file URL from GitHub, and use that, regardless of how many folders deep it is. So


would work just fine.

Bill Crews

unread,
Sep 20, 2021, 9:38:34 AM9/20/21
to DazedTurtle, mementodatabase
If I ever get into Github very deep, this will make great reading matter for me. Thanks, Denise!

Reply all
Reply to author
Forward
0 new messages