scripting / drummerRFC

A place to post RFCs for people who use and develop in Drummer.
MIT License
11 stars 0 forks source link

Sharing code with other users #8

Open scripting opened 2 years ago

scripting commented 2 years ago

Gary Teter wrote yesterday:

Why can't I just break off a chunk of code, and let other people use it?

All we need is a verb that reads a URL, call it from a startup script, and you've now just loaded someone else's code.

I'm pretty sure that kind of thing is pretty easy in JS. I know I've done it with CSS, and there is a verb that does this for CSS.

scotthansonde commented 2 years ago
NPM for Drummer _shudder_

Seriously, JavaScript imports, maybe?

PostMonsterG commented 2 years ago

There's actually two aspects to that "let other people use it" idea—

This example is for the first type.

I'm calling it a "snippet" mostly because I don't have any better suggestions at the moment. But basically the idea is, this is a little, useful, chunk of Drumkit.

In some hypothetical future there might be some sort of discovery mechanism, installer, blah blah.

I think one would probably want to do the distribution via GitHub, since it provides versioning, permanence, content signatures, etc. But since I figure the best way to package it up will be OPML, I went ahead and made an example one here:

http://drummer.scripting.com/PostMonsterG/DocserverLookup.opml

I actually can't view a raw OPML file on the iPad, but this looks about right to me in Drummer. I wonder if "Drumkit" is a node type, or if it should be.

I think, I am not sure, but in my dream world, what I actually put into my icon bar outline is actually just a link to this opml, rather than copy-pasting.

PostMonsterG commented 2 years ago

Here is another sample Drumkit thingie.

This one sends the current outline over to iA Writer on the iPad. Works pretty good for Markdown, in my limited testing.

http://drummer.scripting.com/PostMonsterG/OpenInIAWriterAsNewFile.opml

I'm also refining how I want my Drumkit code to look. I was pleased to discover Drumkit gives me some very nice tools for this, like bold and italics in comments, and block indents that don't have to correspond to language structure.

In addition to wondering if there is (or should be) a Drumkit node type, I'm also wondering if there should be an executable flag. (Maybe it's useful to have Drumkit code that can't be executed? I dunno.)

Note: These examples aren't being proposed as a standard, or anything, I'm just exploring what code and documentation might look like in Drumkit.