Permalink
Browse files

doc: migrate the remaining scomp docs.

  • Loading branch information...
1 parent 964fa00 commit bd4e118a4ce6d9e55ffa7c34a69e6e92299de1de @kaos kaos committed Oct 8, 2012
View
@@ -25,6 +25,7 @@ Emacs' `rst-mode
for most things. It has nice coloring and indenting. Paragraphs are
hard-wrapped at 80 characters with single newlines.
+
Heading styles
..............
@@ -45,6 +46,24 @@ When writing documentation of modules, actions, etc; anything under
in the ``meta-*.rst`` file. So you should only use ``----------`` and
``..........`` for the headings in the ``ref/`` files.
+
+When using Emacs, this little snippet helps with adding underlines to headings::
+
+ (defun underline-with-char (char)
+ (interactive (list (read-from-minibuffer "Char: ")))
+ (when (= 0 (length char))
+ (error "Need a character"))
+ (setq char (aref char 0)) ; Ignore everything but the first char.
+ (save-excursion
+ (goto-char (point-at-eol))
+ (insert "\n"
+ (make-string (- (point-at-eol)
+ (point-at-bol))
+ char))))
+
+From a mailing list `post <http://lists.gnu.org/archive/html/help-gnu-emacs/2008-05/msg00305.html>`_.
+
+
References
..........
@@ -7,15 +7,18 @@ This is an utility tag providing a simplified interface to the pie chart feature
Example of simple pie chart::
- {% chart_pie data=[["firefox",23], ["internet explorer", 67], ["safari",4], ["chrome",3], ["other", 3]] %}
+ {% chart_pie data=[["firefox",23], ["internet explorer", 67], ["safari",4],
+ ["chrome",3], ["other", 3]] %}
This generates the following image tag::
- <img class='google_chart' alt='google chart' src='http://chart.apis.google.com/chart?&amp;cht=p&amp;chts=909090,10&amp;chs=300x150&amp;chg=0,0,1,5&amp;chf=bg,s,ffffff|c,s,ffffff&amp;chdlp=b&amp;chbh=-3,3,7&amp;chxt=x&amp;chxl=0:|firefox|internet explorer|safari|chrome|other&amp;chxs=0,909090,10&amp;chco=&amp;chds=0,100&amp;chd=t:23,67,4,3,3&amp;chls=1,1,0' width='300' height='150'/>
+ <img class='google_chart' alt='google chart'
+ src='http://chart.apis.google.com/chart?&amp;cht=p&amp;chts=909090,10&amp;chs=300x150&amp;chg=0,0,1,5&amp;chf=bg,s,ffffff|c,s,ffffff&amp;chdlp=b&amp;chbh=-3,3,7&amp;chxt=x&amp;chxl=0:|firefox|internet
+ explorer|safari|chrome|other&amp;chxs=0,909090,10&amp;chco=&amp;chds=0,100&amp;chd=t:23,67,4,3,3&amp;chls=1,1,0' width='300' height='150' />
`View the pie chart`_.
-The tag chart_pie accepts the following arguments::
+The tag chart_pie accepts the following arguments:
+---------------+-----------------------------------------------------------------------+------------------------------------+
|Argument |Description |Example |
@@ -1,4 +1,23 @@
.. include:: meta-chart_pie3d.rst
-.. todo:: Not yet documented.
+Show a pie chart with 3D effect.
+
+This scomp is just a convenient interface to the :ref:`scomp-chart_pie` tag with the “threed” argument set to true.
+
+For example::
+
+ {% chart_pie3d data=[["firefox",23], ["internet explorer", 67], ["safari",4],
+ ["chrome",3], ["other", 3]] %}
+
+Gives::
+
+ <img class='google_chart' alt='google chart'
+ src='http://chart.apis.google.com/chart?&amp;cht=p3&amp;chts=909090,10&amp;chs=300x150&amp;chg=0,0,1,5&amp;chf=bg,s,ffffff|c,s,ffffff&amp;chdlp=b&amp;chbh=-3,3,7&amp;chxt=x&amp;chxl=0:|firefox|internet
+ explorer|safari|chrome|other&amp;chxs=0,909090,10&amp;chco=&amp;chds=0,100&amp;chd=t:23,67,4,3,3&amp;chls=1,1,0' width='300' height='150'/>
+
+`View the pie chart`_.
+
+.. seealso:: :ref:`scomp-chart_pie` and :ref:`scomp-google_chart`.
+
+.. _View the pie chart: http://chart.apis.google.com/chart?&cht=p3&chts=909090,10&chs=300x150&chg=0,0,1,5&chf=bg,s,ffffff|c,s,ffffff&chdlp=b&chbh=-3,3,7&chxt=x&chxl=0:|firefox|internet%20explorer|safari|chrome|other&chxs=0,909090,10&chco=&chds=0,100&chd=t:23,67,4,3,3&chls=1,1,0
@@ -1,4 +1,59 @@
.. include:: meta-draggable.rst
-.. todo:: Not yet documented.
+Mark a html element as draggable.
+
+The draggable tag is used in conjunction with the :ref:`{% droppable %} <scomp-droppable>` tag to implement drag & drop. Elements that are marked as draggable can be dropped on elements marked as droppable. Drag & drop generates dragdrop events that are sent to the :term:`controller` or the :term:`delegate`.
+
+For example::
+
+ <div id="drag1">Drag me</div>
+ {% draggable id="drag1" tag="drag-one" %}
+
+Now the div with id “drag1” can be dragged. When it is dropped then ``event/2`` of the controller or delegate Erlang module is called signaling the drag (and also the drop to the module receiving the droppable events)::
+
+ event({drag, Drag, Drop}, Context).
+
+Where both Drag and Drop are ``#dragdrop`` records::
+
+ -record(dragdrop, {tag, delegate, id}).
+
+The draggable tag accepts the following arguments:
+
++----------------+-----------------------------------------------------+---------------------------+
+|Argument |Description |Example |
++================+=====================================================+===========================+
+|id |The id of the element that becomes draggable. |id="drag1" |
++----------------+-----------------------------------------------------+---------------------------+
+|tag |The tag of the draggable that is sent as part of the |tag={subject_list id=42 |
+| |drag and drop events. This can be any value, |changed=false} |
+| |including a tuple. | |
++----------------+-----------------------------------------------------+---------------------------+
+|clone |Clone the element when dragging or drag the element |clone=true |
+| |itself. Defaults to false. | |
++----------------+-----------------------------------------------------+---------------------------+
+|revert |When the element has to revert to its starting |revert=false |
+| |position. Defaults to "invalid", i.e. when the drop | |
+| |was above an invalid position. Other options are | |
+| |true, false and "valid". | |
++----------------+-----------------------------------------------------+---------------------------+
+|axis |Constrain the drag movement to either the x or y | |
+| |direction. Normally the drag is not | |
+| |constrained. Acceptable values are "x" or "y" | |
+| |axis="x" | |
++----------------+-----------------------------------------------------+---------------------------+
+|handle |The css selector that is the handle to drag with. |handle="handleclass" |
+| |Defaults to the whole element. | |
++----------------+-----------------------------------------------------+---------------------------+
+|group |The name of this drag group, for use in the droppable|group="edges" |
+| |element's "accept" argument. Multiple groups are | |
+| |allowed. | |
++----------------+-----------------------------------------------------+---------------------------+
+|opacity |Change the opacity while dragging. Defaults to "0.8".|opacity="0.5" |
++----------------+-----------------------------------------------------+---------------------------+
+|delegate |The Erlang module that will receive the drag event | |
+| |after a successful drop. | |
++----------------+-----------------------------------------------------+---------------------------+
+
+.. seealso:: the :ref:`scomp-droppable` tag.
+
@@ -1,4 +1,51 @@
.. include:: meta-droppable.rst
-.. todo:: Not yet documented.
+Mark an element as valid drag destination.
+
+The droppable tag is used in conjunction with the :ref:`{% draggable %} <scomp-draggable>` tag to implement drag & drop. Elements that are marked as droppable can receive drops of draggable elements. Drag & drop generates dragdrop events that are sent to the :term:`controller` or the :term:`delegate`.
+
+For example::
+
+ <div id="dropzone">Drop your stuff here</div>
+ {% droppable id="dropzone" tag="drop-tag" %}
+
+Now draggable elements can de dropped onto the div with id “dropzone”. When a draggable is dropped then ``event/2`` of the controller or delegate Erlang module is called signaling the drop (and also the drag to the module receiving the draggable events)::
+
+ event({drop, Drag, Drop}, Context).
+
+Where both Drag and Drop are ``#dragdrop`` records::
+
+ -record(dragdrop, {tag, delegate, id}).
+
+The droppable tag accepts the following arguments:
+
++---------------+---------------------------------------------+------------------+
+|Argument |Description |Example |
++===============+=============================================+==================+
+|id |The id of the element that will accept drops |id="dropzone" |
+| |of draggables. | |
++---------------+---------------------------------------------+------------------+
+|tag |The tag of the droppable that is sent as part|tag={subject |
+| |of the drag and drop events. This can be any |id=123} |
+| |value, including a tuple. | |
++---------------+---------------------------------------------+------------------+
+|active |The droppable will have this CSS class added |active="draghere" |
+| |when there is an acceptable draggable being | |
+| |dragged. | |
++---------------+---------------------------------------------+------------------+
+|hover |The droppable will have this CSS class added |active="dropnow" |
+| |when there is an acceptable draggable | |
+| |hovering over it. | |
++---------------+---------------------------------------------+------------------+
+|accept |The group the droppable accepts. See the |accept="edges" |
+| |group argument of the draggable. A droppable | |
+| |can accept multiple groups, just repeat the | |
+| |accept argument. | |
++---------------+---------------------------------------------+------------------+
+|delegate |The Erlang module that will receive the drop | |
+| |event after a successful drop. | |
++---------------+---------------------------------------------+------------------+
+
+.. seealso:: the :ref:`scomp-draggable` tag.
+
Oops, something went wrong.

0 comments on commit bd4e118

Please sign in to comment.