Jump to content

Abstract Wikipedia/Beta tutorial

From Meta, a Wikimedia project coordination wiki

This page offers incomplete guidance on how to navigate the early Beta of Wikifunctions.

How do I find a function?

Search doesn’t work yet. The best way to find out which functions exist and to find functions is to go to the list of functions, and select the function you want.

How do I run a function?

You go to a function page (e.g. here is the function page for the Boolean And function). On the right hand side you will find a header “Details”, and underneath a subheader “Evaluate Function”, and underneath a gray box that allows you to enter the necessary arguments for the function. Enter the arguments, and click on the button “Call Function”. The result should show up underneath.

How do I create a function?

First you need to create the function itself. Go to the page to create a function. Enter a name, the input types, the output type, and then publish the function.

How do I create a function implementation?

On the page of the function that you want to create an implementation for, you can switch into the tab Details, and click on the link “Create a new implementation”. Now you can choose whether you want to enter code, or a composition.

Code

For now, you need to enter a name for the implementation or you won’t be able to publish the implementation.

For entering an implementation in code follow of the existing examples for entering code:

Composition

For entering an implementation as a composition, follow the following recipe:

  1. Select the functions you want to call
  2. If you need an argument, first try selecting the option “arg” from the mode drop down
  3. In case that doesn’t work, select “argument reference” as the type
  4. Select the argument you need in the drop down

Check out this short video for guidance.

Ignore the buttons “Create Function” and “Create Type” at the bottom of the screen. If the “Publish” button is grayed out, check if you entered a name for the implementation. If you just did, the button sometimes does not update properly. In that case click somewhere else to change focus and update the button.

How to connect the implementation with the function?

Once the implementation is created, you need to connect the function with the implementation. For that, go to the function page, click on “Edit source”, click on the button “Fallback editor”, and then, under the heading “Implementation list’, click on the big plus, and choose the just created implementation. Click on “Publish”. Now you should be able to call the function from the function page.