Jump to content

Wikifunciones: Introducción

From Wikifunctions
This page is a translated version of the page Wikifunctions:Introduction and the translation is 41% complete.
Outdated translations are marked like this.

Functions make calculations on the data you provide.

Wikifunciones es un proyecto de código abierto que permite a cualquiera crear funciones y compartirlas para que otros las usen, remixen, prueben y aprendan de ellas.

Utiliza las siguientes guías para probar las características básicas de Wikifunciones. ¡Esperamos tus comentarios y contribuciones!.

Evaluar una Función

¡Puedes probar las funciones aportadas por la comunidad en Wikifunciones por ti mismo! Elige una de nuestra biblioteca de funciones, y dale valores de entrada para descubrir la salida.

Pasos:

  1. Encuentra una función en la Página principal.
  2. Navega a una página de función.
  3. Ingresa los valores de entrada.
  4. Ejecuta la función.

Resultados:

  1. ¿La salida fue lo que esperabas?
  2. ¿Tienes correcciones o comentarios para reportar?

Share a Function call

After you run a function, use the 'Copy result link' button beneath the result panel to copy a shareable URL. When someone opens that link, Wikifunctions preloads the same function call and runs it automatically, so they see the inputs and result exactly as you did. This is a quick way to demonstrate reproducible examples or ask others for help with a specific function input/output.

Steps (continue from "Evaluate a Function"):

  1. After the result loads, click 'Copy result link' under the result panel.
    Share a function call feature in Wikifunctions screenshot
  2. Share the URL with others!

Note: the shared link preloads your exact inputs and runs them again, so recipients see the same result unless the underlying implementation has changed since you generated the link.

Crear una Función

¡Puedes añadir tus propias funciones a Wikifunciones! Crea una nueva función para usar en tus propias implementaciones y permite que otros la usen también. Las nuevas funciones pueden escribirse en tu lenguaje preferido.

Pasos:

  1. Ve a la página de creación de función.
  2. Nombra tu función.
  3. Define las entradas de tu función:
    1. Agrega/elimina campos de entrada.
    2. Define el tipo de cada entrada.
    3. Nombra cada entrada.
  4. Define el tipo de salida de tu función.
  5. Opcionalmente, proporciona valores multilingües para cualquiera de estos campos:
    • Nombre de la función, alias de la función, etiquetas de entrada.
  6. Publica tu función.

Resultados:

  1. ¿La función fue guardada exitosamente?
  2. ¿Tienes correcciones o comentarios para reportar?

Editar una Función

Puedes contribuir a Wikifunciones editando su biblioteca de funciones. Añade o edita información multilingüe a las funciones, y amplía y modifica las definiciones de las funciones.

Pasos:

  1. Encuentra una función en la Página Principal.
  2. Navega a la página de función.
  3. Haz clic en Editar fuente para ver las opciones de edición para esta función.
  4. Opcionalmente, modifica los valores de:
    1. Nombre de la función,
    2. Alias de la función,
    3. Lista de entradas
      1. Agrega/elimina campos de entrada
      2. Modifica el tipo de entrada
      3. Modifica las etiquetas de entrada
    4. Tipo de salida.
  5. Opcionalmente, proporciona valores multilingües para cualquiera de estos campos:
    1. Nombre de la función
    2. Alias de la función
    3. Etiquetas de entrada.
  6. Publica tus cambios.

Resultados:

  1. ¿Tus cambios fueron guardados exitosamente?
  2. ¿Tienes correcciones o comentarios para reportar?

Create tests

You can create tests for your function implementations in Wikifunctions to ensure they are working properly.

Steps:

  1. Find a function on the Main Page or the function you created in the previous workflow.
  2. Navigate to the function page.
  3. Click the “+” link in the tests table.
  4. The "Call" section should automatically be expanded.
    1. In the field under "Function", type in the name of the function you are testing and select the function when it shows up.
    2. Add values for the inputs in the respective fields.
  5. The "Result Validation" section should automatically be expanded.
    1. In the field under "Function", type in the name of the function you want to use to check the result.
    2. For a function whose output is String, this will be "String equality", for a function whose output is Boolean, this will be "Boolean equality".
    3. Add the expected value in the given field (either "Second String" or "Second Boolean").
  6. Publish your updates.

Results:

  1. Was the test successfully published?
  2. Do you have corrections or feedback to report?

Create an implementation

Functions are brought to life in implementations created to suit your needs. Run, remix, and combine functions via implementations in Wikifunctions. See the section below to learn how to connect your implementation to functions. We recommend creating and connecting a test before creating an implementation. A more comprehensive guide to creating implementations is available at Wikifunctions:How to create implementations.

Steps:

  1. Find a function on the Main Page.
  2. Navigate to the function page.
  3. Click the “+” link in the implementations table.
  4. You can create a new implementation in one of two ways:
    1. Code
      • Select the required programming language to write the function code.
      • Input your code.
    2. Composition:
      • Create a composition using existing functions.
  5. Publish your updates (after running a test by clicking the round arrow on the right of the box titled Pruebas).

Results:

  1. Was the implementation successfully published?
  2. Do you have corrections or feedback to report?

Connect an Implementation or Test to a Function

Note: This feature is only available to Functioneers.

Connect tests and implementations to your function to see it come to life.

Steps:

  1. Find a function on the Main Page.
  2. Navigate to the function page.
  3. Select one or more tests, or one or more implementations.
  4. Click on the button “Conectar”.

Results:

  1. Was the Conectado/Desconectado state successfully changed?
  2. Do you have corrections or feedback to report?

Insert a Function in a Wikipedia article

Now it is time to insert a function in a Wikipedia article and see the magic unfold.

Steps:

  1. Open the article you want to add a function to.
  2. Go to the edit tab and open visual editor.
  3. Click on the “Insert” menu at the top of the visual editor. Scroll down and click on “Function”. A dialog box will open.
  4. Search for the function you want to insert and click on it. Or, try one of the Suggested Functions below the search bar.
  5. Enter the necessary inputs and click on the “Insert” button at the top right to insert the function into the article.
  6. You can now see the output of your function in the article. You can proceed to publish the changes.
  7. If you want to edit the function, click on it. A tooltip will appear with the function name and description. Click on the “Edit” button.
  8. Then you can make changes to the inputs and click on “Apply changes” when you are done editing.

Results:

  1. Was the output what you expected?
  2. Do you have corrections or feedback to report?