HELP WANTED: Generating a Community Drafts Wiki

Hi,
we got the idea last week that we all love Drafts and would love to help each other to know it even better.

A Wiki would be a nice addition to this great Forum and I would be interested who would be willing to contribute

Andreas

1 Like

To state the obvious, I would. I’m mostly interested in actions - and javascript ones at that.

1 Like

Sounds interesting. What might contribution mean in this context? Would it be helping to author entries in a collaborative wiki/knowledge-base about ways of working with Drafts, in a way that complements existing documentation?

(Sorry— I feel like I’ve often been the one asking the “what does this actually mean?” question in some of these conversations!)

If there were a wiki to contribute to I could probably work up a VERY simple javascript example which would spawn two things:

  1. Two articles on how to edit and test a javascript action - one for iOS and one for Mac. (Maybe 3 if we want to count iPadOS as different from iOS.)
  2. A simple sample piece of javascript that does very little - such as upper case the first letter in each word. (I dunno.)

That example is just a "how to read the draft text, do something to it and put it back.

The examples could then exercise other functions that people commonly do. And possibly get more complex.

Others might want to major on other kinds of actions than javascript.

because it is a great question

don’t be sorry - I am really great full you ask.

To give my first answer (I surely will elaborate on that longer in upcoming posts)

The Wiki should be placed between this great forum and agile tortoise’s official documentation.

the first is intentionally open for everyone to write and contribute, the second is read only. Both are great tools and should not be changed in their original intend.

I would love to generate a more topic structured resource with mid length in descriptions. That is able to grow in depth if needed and may be coauthored by contributors that are willing to learn and share.

A cool thing would be to have challenges for readers and a way to post their solutions or present their projects.

Sometimes it might be only a link to an article on ThoughtAsylum.com or an extract of extraordinary threads in this forum. Think as a category awesome list as one part.

To run it on github and as a more static page to read through would set a intermediate barrier to contributions. And give the opportunity to host full code examples.

As I am thinking of creating a chunked/fragmented script library to support my bigger goals (logging, meta data, tag management, visualisation of links) this could also live there to be found and studied by draft users that want to automate.

I personally would also mainly focus on Java Script and Python scripting with drafts but think that users with less programming experience might be interested to contribute their solutions.

No this is getting rather long so I will stop myself here.

2 Likes

On “modular script library” we could divide it into simple fragments and more complex chunks.

Example of a fragment:

  • Get the body of a draft into a variable.

Example of a chunk / module:

  • Pass in JSON as key / value pairs for templating. Then run the template and return the substituted text.

The latter is way more complex than the former, and more useful.

The term “module”, by the way, is problematic. It already has meaning to javascripters. I wouldn’t insist on “fragment” and “chunk” but I would avoid “module” unless we mean it.

2 Likes

yep. that’s a good idea. I replaced modular with chunked/fragemented in the post above.

Maybe we could use LEGO as a good example.
A good building block has standard adapters to be used which other projects.

Give the others bricks to play with and to rebuild them if necessary.

1 Like

Just to say, I think this would be useful. I’d love to see a suggested “best practice” workflow for working with JavaScript actions.