Skip to content

Commit

Permalink
update frame and randomizer blueprints to add .rst documentation pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim Scott committed Nov 7, 2020
1 parent d93418f commit 641426d
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 61 deletions.
26 changes: 1 addition & 25 deletions blueprints/exp-frame/files/app/components/__name__/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,16 @@ import ExpFrameBaseComponent from '../exp-frame-base/component';
import layout from './template';
// Import any mixins here, e.g. import VideoRecord from '../../mixins/video-record';

// The YUIdoc comments, using /** ... */ syntax, will be automatically compiled into
// nice user-facing documentation as shown here (https://lookit.github.io/ember-lookit-frameplayer/modules/frames.html)
// once your changes are merged into the lookit/ember-lookit-frameplayer repo. You can see how they look
// locally as described here: https://lookit.readthedocs.io/en/develop/ember-app-installation.html#writing-documentation-of-frames


/**
* @module exp-player
* @submodule frames
*/

/**
* TODO: short description of what your frame does. Include example usage below.
*
* TODO: You should also add a screenshot of your frame in the location
* ember-lookit-frameplayer/screenshots/Exp-your-frame-name.png, and it will be added
* ember-lookit-frameplayer/images/Exp-your-frame-name.png, and it will be added
* to the YUIdoc page.
*
```json
"frames": {
"test-trial": {
"kind": "exp-your-frame-name",
"id": "test-trial"
}
}
* ```
* @class ExpYourFrameName TODO: change to your actual frame name
* @extends ExpFrameBase
* @uses FullScreen TODO: add any mixins that your frame uses like this
*/



export default ExpFrameBaseComponent.extend({ //list any mixins here before the {
type: '<%= dasherizedModuleName %>',
layout: layout,
Expand Down
67 changes: 67 additions & 0 deletions blueprints/exp-frame/files/app/components/__name__/doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.. _<%= dasherizedModuleName %>:

<%= dasherizedModuleName %>
==============================================

Overview
------------------

Short (a few sentences) overview of your frame.

TODO: Also add this file to the list of frames in app/index.rst!

What it looks like
~~~~~~~~~~~~~~~~~~

.. image:: /../images/<%= dasherizedModuleName %>.png
:alt: Example screenshot from <%= dasherizedModuleName %> frame

More general functionality
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Below is information specific to this particular frame. There may also be available parameters, events recorded,
and data collected that come from the following more general sources:

- the :ref:`base frame<base frame>` (things all frames do)
- TODO: link to any other mixins you use


Examples
----------------

This frame will <DESCRIBE WHAT IT WILL DO AND FILL IN A WORKING EXAMPLE BELOW>

.. code:: javascript
"test-trial": {
"kind": "<%= dasherizedModuleName %>",
...
}
Parameters
----------------

firstParameter [Boolean | ``true``]
TODO: list each parameter like this (above are name [type | default value]) and
describe how to use it!


Data collected
----------------

The data specifically recorded by this frame are:

firstDatum [Boolean]
TODO: list each piece of data collected like this (above is name [type]) and
describe how to interpret it!

Events recorded
----------------

TODO: The events recorded specifically by this frame are:

:firstEvent: What this event means

:firstEventData: [String]
What this event data means (omit if only the event timestamp is recorded)
11 changes: 8 additions & 3 deletions blueprints/exp-frame/files/app/styles/components/__name__.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/* Important: You will need to add a line to addon/styles/addon.scss importing this file, like this:
@import "components/exp-your-frame-name.scss" */
/*
/* Add CSS styles for your frame here. See https://lookit.readthedocs.io/en/develop/frames.html#adding-css-styling */
Important: You will need to add a line to addon/styles/addon.scss importing this file, like this:
@import "components/<%= dasherizedModuleName %>.scss"
Add CSS styles for your frame here. See https://lookit.readthedocs.io/en/develop/frame-dev-creation.html#adding-css-styling
*/
34 changes: 1 addition & 33 deletions blueprints/randomizer/files/app/randomizers/__name__.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,7 @@ export default {


/**
* TODO: SHORT DESCRIPTION OF YOUR RANDOMIZER FRAME HERE (will be used by YUIdoc)
* INSERT EXAMPLE USAGE BELOW.
*
```json
"frames": {
"test-trials": {
"sampler": "your-randomizer-name",
"kind": "choice",
"id": "test-trials"
}
}
* ```
* @class yourRandomizerName
* TODO: SHORT DESCRIPTION OF YOUR RANDOMIZER FRAME HERE
*/


Expand All @@ -59,16 +45,6 @@ var randomizer = function(/*frameId, frameConfig, pastSessions, resolveFrame*/)
*/


// To specify the data a user needs to provide to your randomizer (i.e. the expected
// fields of frameConfig), include YUIdoc "properties" using YUIdoc comment syntax.
// These can be anywhere in your file. Here's an example...

/**
* An example property.
*
* @property {Boolean} whetherToStartOnLeft
*/


/* Return:
resolvedFrames: a list of resolved frames that have resulted from your randomization
Expand All @@ -79,14 +55,6 @@ var randomizer = function(/*frameId, frameConfig, pastSessions, resolveFrame*/)
called 'conditions':
*/

/**
* Parameters captured and sent to the server
*
* @attribute conditions
* @param {Number} exampleConditionNumber which condition was chosen
* @param {Array} exampleConditionObject which images were shown
*/

// return [resolvedFrames, conditions]

};
Expand Down
42 changes: 42 additions & 0 deletions blueprints/randomizer/files/app/randomizers/__name__.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. _<%= dasherizedModuleName %>:

<%= dasherizedModuleName %>
==============================================

Overview
------------------

TODO: Short description of what your randomizer does.

To use, define a frame with ``"kind": "choice"`` and ``"sampler": "<%= dasherizedModuleName %>"``,
as shown below, in addition to the parameters described under 'properties'.

Example
----------------

This frame ... <INSERT DESCRIPTION OF HOW THIS EXAMPLE WORKS AND INSERT WORKING EXAMPLE>

.. code:: javascript
"select-randomizer-test": {
"sampler": "<%= dasherizedModuleName %>",
"kind": "choice",
...
}
Parameters
----------------

parameter1 [Array]
TODO: Describe each parameter this randomizer accepts like this.


Data collected
----------------

The information returned by this randomizer will be available in ``expData["conditions"]["THIS-RANDOMIZER-ID"]``. The
randomizer ID will depend on its order in the study - for instance, ``6-test-trials``.

datum1 [Array]
TODO: Describe each piece of data the randomizer will store.

0 comments on commit 641426d

Please sign in to comment.