Difference between revisions of "LSL Editing Primer/es"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {{Multi-lang}} {{LSL Header}} __TOC__ En esta sección del Portal LSL del wiki hay varias plantillas en uso para uniformar la apariencia y hacer la edición más fácil. == Plantillas G...)
 
Line 8: Line 8:
== Plantillas Generales ==
== Plantillas Generales ==


Hay varias plantillas universales y los nombres de plantillas mas usados son cortos para facilidad de uso.  
Hay varias plantillas universales y los nombres de plantillas más usados son cortos para facilidad de uso.  


{|{{Prettytable}}
{|{{Prettytable}}
!Name
!Nombre
!Description
!Descripción
!example
!ejemplo
|-
|-
|<nowiki>{{</nowiki>[[Template:LSLC|LSLC]]<nowiki>|category|sort}}</nowiki>
|<nowiki>{{</nowiki>[[Template:LSLC|LSLC]]<nowiki>|category|sort}}</nowiki>
|Adds a page to a group<br/>Use instead of <nowiki>[[Category:LSL name|name]]</nowiki><br/>sort is optional.
|Añade una página al grupo<br/>Use en vez de <nowiki>[[Category:LSL name|name]]</nowiki><br/>clasificar (sort) es opcional.
|
|
|-
|-
|<nowiki>{{</nowiki>[[Template:LSLGC|LSLGC]]<nowiki>|category|text}}</nowiki>
|<nowiki>{{</nowiki>[[Template:LSLGC|LSLGC]]<nowiki>|category|text}}</nowiki>
|Links to a LSL Category<br/>Use instead of <nowiki>[[:Category:LSL category|text]]</nowiki><br/>if '''text''' is omitted then it defaults to '''category'''
|Une a una Categoría LSL <br/>Use en vez de <nowiki>[[:Category:LSL category|text]]</nowiki><br/>si '''text''' se omite entonces vuelve al valor predeterminado de '''category'''
|<nowiki>{{LSLGC|Math/3D|3D Math Functions}}</nowiki><br/>{{LSLGC|Math/3D|3D Math Functions}}<br/><nowiki>{{LSLGC|Math}}</nowiki><br/>{{LSLGC|Math}}<br/>
|<nowiki>{{LSLGC|Math/3D|3D Math Functions}}</nowiki><br/>{{LSLGC|Math/3D|3D Math Functions}}<br/><nowiki>{{LSLGC|Math}}</nowiki><br/>{{LSLGC|Math}}<br/>
|-
|-
|<nowiki>{{</nowiki>[[Template:HoverText|HoverText]]<nowiki>|word|description}}</nowiki>
|<nowiki>{{</nowiki>[[Template:HoverText|HoverText]]<nowiki>|word|description}}</nowiki>
|When you move the cursor over this it shows a box containing '''description'''.
|Cuando mueve el cursor sobre esta área muestra una casilla que contiene '''description'''.
|<nowiki>{{HoverText|monkeys|A species of mammal}}</nowiki><br/>{{HoverText|monkeys|A species of mammal}}
|<nowiki>{{HoverText|monkeys|A species of mammal}}</nowiki><br/>{{HoverText|monkeys|A species of mammal}}
|-
|-
|<nowiki>{{</nowiki>[[Template:LSL Header|LSL_Header]]<nowiki>}}</nowiki>
|<nowiki>{{</nowiki>[[Template:LSL Header|LSL_Header]]<nowiki>}}</nowiki>
|Used for pages that don't use a template that includes it. Like categories and this page.
|Usado en páginas que no usan una plantilla que le incluya.   Como categorías y esta página.  
|<nowiki>{{LSL Header}}</nowiki>
|<nowiki>{{LSL Header}}</nowiki>
|-
|-
|<nowiki>{{</nowiki>[[Template:LSL Hex|LSL_Hex]]<nowiki>|hex|int}}</nowiki>
|<nowiki>{{</nowiki>[[Template:LSL Hex|LSL_Hex]]<nowiki>|hex|int}}</nowiki>
|A HoverText for '''hex''' showing the '''int''' with a short standard description.<br/>If '''int''' is excluded or empty, then '''int''' is calculated from '''hex'''.
|Un texto suspdendido (HoverText) para '''hex''' que muestra el '''int''' con una descripción corta uniforme. <br/>Si '''int''' se excluye o esta vacia entonces '''int''' se calcula de '''hex'''.
|<nowiki>{{LSL Hex|0x100|256}}</nowiki><br/>{{LSL Hex|0x100|256}}<br/><nowiki>{{LSL Hex|0x100}}</nowiki><br/>{{LSL Hex|0x100}}
|<nowiki>{{LSL Hex|0x100|256}}</nowiki><br/>{{LSL Hex|0x100|256}}<br/><nowiki>{{LSL Hex|0x100}}</nowiki><br/>{{LSL Hex|0x100}}
|-
|-
|<nowiki>{{</nowiki>[[Template:!|!]]<nowiki>}}</nowiki>
|<nowiki>{{</nowiki>[[Template:!|!]]<nowiki>}}</nowiki>
|Used instead of a {{HoverText|<nowiki>|</nowiki>|vertical pipe}} for when embedding them in templates parameters.
|Usado en vez de {{HoverText|<nowiki>|</nowiki>|vertical pipe}} cuando se integran en los parámetros de la plantilla.  
|<nowiki>{{!}}</nowiki><br/><nowiki>|</nowiki>
|<nowiki>{{!}}</nowiki><br/><nowiki>|</nowiki>
|-
|-
|<nowiki>{{</nowiki>[[Template:=|=]]<nowiki>}}</nowiki>
|<nowiki>{{</nowiki>[[Template:=|=]]<nowiki>}}</nowiki>
|Used instead of a = for when you need a text equals sign that cannot interfere with templates parameters.
|Usado en vez de = cuando necesitas un símbolo de igual en el texto que no interfiera con los parámetros de la plantilla.
|<nowiki>{{=}}</nowiki><br/><nowiki>=</nowiki>
|<nowiki>{{=}}</nowiki><br/><nowiki>=</nowiki>
|}
|}

Revision as of 12:20, 5 March 2008

En esta sección del Portal LSL del wiki hay varias plantillas en uso para uniformar la apariencia y hacer la edición más fácil.

Plantillas Generales

Hay varias plantillas universales y los nombres de plantillas más usados son cortos para facilidad de uso.

Nombre Descripción ejemplo
{{LSLC|category|sort}} Añade una página al grupo
Use en vez de [[Category:LSL name|name]]
clasificar (sort) es opcional.
{{LSLGC|category|text}} Une a una Categoría LSL
Use en vez de [[:Category:LSL category|text]]
si text se omite entonces vuelve al valor predeterminado de category
{{LSLGC|Math/3D|3D Math Functions}}
3D Math Functions
{{LSLGC|Math}}
Math
{{HoverText|word|description}} Cuando mueve el cursor sobre esta área muestra una casilla que contiene description. {{HoverText|monkeys|A species of mammal}}
monkeys
{{LSL_Header}} Usado en páginas que no usan una plantilla que le incluya. Como categorías y esta página. {{LSL Header}}
{{LSL_Hex|hex|int}} Un texto suspdendido (HoverText) para hex que muestra el int con una descripción corta uniforme.
Si int se excluye o esta vacia entonces int se calcula de hex.
{{LSL Hex|0x100|256}}
0x100
{{LSL Hex|0x100}}
0x100
{{!}} Usado en vez de | cuando se integran en los parámetros de la plantilla. {{!}}
|
{{=}} Usado en vez de = cuando necesitas un símbolo de igual en el texto que no interfiera con los parámetros de la plantilla. {{=}}
=

Tablas Integradas

One of the weaknesses in MediaWiki is the difficulty in embedding tables as parameters for templates. There are a few ways around this.

  1. Write the table in HTML using <table> & </table>, <tr> & </tr>, <th> & </th>, <td> & </td> tags. If you go this route you must close your tags properly (or MediaWiki will do strange things).
  2. Use MediaWiki syntax for tables and replace every occurrence (not being used as a template separator) of '|' with '{{!}}'
  3. Wrap the table with <div></div> tags (doesn't always work).
  • Note that you may need to play with the whitespace to get MediaWiki to display it properly.


HTML Method
Before After Embedded
{|{{Prettytable}}
! Permissions
! Value
! Description
|- 
| [[PERM_ALL]]
| {{LSL Hex|0x7FFFFFFF|2147483647}}
| Move/Modify/Copy/Transfer permissions
|- 
| [[PERM_COPY]]
| {{LSL Hex|0x00008000|32768}}
| Copy permission
|- 
| [[PERM_MODIFY]]
| {{LSL Hex|0x00004000|16384}}
| Modify permission
|- 
| [[PERM_MOVE]]
| {{LSL Hex|0x00080000|524288}}
| Move permission
|- 
| [[PERM_TRANSFER]]
| {{LSL Hex|0x00002000|8192}}
| Transfer permission
|}
<table {{Prettytable}}><tr>
<th> Permissions</th>
<th> Value</th>
<th> Description</th>
</tr><tr>
<td> [[PERM_ALL]]</td>
<td> {{LSL Hex|0x7FFFFFFF|2147483647}}</td>
<td> Move/Modify/Copy/Transfer permissions</td>
</tr><tr>
<td> [[PERM_COPY]]</td>
<td> {{LSL Hex|0x00008000|32768}}</td>
<td> Copy permission</td>
</tr><tr>
<td> [[PERM_MODIFY]]</td>
<td> {{LSL Hex|0x00004000|16384}}</td>
<td> Modify permission</td>
</tr><tr>
<td> [[PERM_MOVE]]</td>
<td> {{LSL Hex|0x00080000|524288}}</td>
<td> Move permission</td>
</tr><tr>
<td> [[PERM_TRANSFER]]</td>
<td> {{LSL Hex|0x00002000|8192}}</td>
<td> Transfer permission</td>
</tr></table>

Table in Table:

Permissions Value Description
PERM_ALL 0x7FFFFFFF Move/Modify/Copy/Transfer permissions
PERM_COPY 0x00008000 Copy permission
PERM_MODIFY 0x00004000 Modify permission
PERM_MOVE 0x00080000 Move permission
PERM_TRANSFER 0x00002000 Transfer permission

Table as template parameter:

Permissions Value Description
PERM_ALL 0x7FFFFFFF Move/Modify/Copy/Transfer permissions
PERM_COPY 0x00008000 Copy permission
PERM_MODIFY 0x00004000 Modify permission
PERM_MOVE 0x00080000 Move permission
PERM_TRANSFER 0x00002000 Transfer permission
Pipe Replacement Method
Before After Embedded
{|{{Prettytable}}
! Permissions
! Value
! Description
|- 
| [[PERM_ALL]]
| {{LSL Hex|0x7FFFFFFF|2147483647}}
| Move/Modify/Copy/Transfer permissions
|- 
| [[PERM_COPY]]
| {{LSL Hex|0x00008000|32768}}
| Copy permission
|- 
| [[PERM_MODIFY]]
| {{LSL Hex|0x00004000|16384}}
| Modify permission
|- 
| [[PERM_MOVE]]
| {{LSL Hex|0x00080000|524288}}
| Move permission
|- 
| [[PERM_TRANSFER]]
| {{LSL Hex|0x00002000|8192}}
| Transfer permission
|}
{{{!}}{{Prettytable}}
! Permissions
! Value
! Description
{{!}}- 
{{!}} [[PERM_ALL]]
{{!}} {{LSL Hex|0x7FFFFFFF|2147483647}}
{{!}} Move/Modify/Copy/Transfer permissions
{{!}}- 
{{!}} [[PERM_COPY]]
{{!}} {{LSL Hex|0x00008000|32768}}
{{!}} Copy permission
{{!}}- 
{{!}} [[PERM_MODIFY]]
{{!}} {{LSL Hex|0x00004000|16384}}
{{!}} Modify permission
{{!}}- 
{{!}} [[PERM_MOVE]]
{{!}} {{LSL Hex|0x00080000|524288}}
{{!}} Move permission
{{!}}- 
{{!}} [[PERM_TRANSFER]]
{{!}} {{LSL Hex|0x00002000|8192}}
{{!}} Transfer permission
{{!}}}

Table in Table:

Permissions Value Description
PERM_ALL 0x7FFFFFFF Move/Modify/Copy/Transfer permissions
PERM_COPY 0x00008000 Copy permission
PERM_MODIFY 0x00004000 Modify permission
PERM_MOVE 0x00080000 Move permission
PERM_TRANSFER 0x00002000 Transfer permission

Table as template parameter:

Permissions Value Description
PERM_ALL 0x7FFFFFFF Move/Modify/Copy/Transfer permissions
PERM_COPY 0x00008000 Copy permission
PERM_MODIFY 0x00004000 Modify permission
PERM_MOVE 0x00080000 Move permission
PERM_TRANSFER 0x00002000 Transfer permission
Div Tag Method (doesn't always work)
Before After Embedded
{|{{Prettytable}}
! Permissions
! Value
! Description
|- 
| [[PERM_ALL]]
| {{LSL Hex|0x7FFFFFFF|2147483647}}
| Move/Modify/Copy/Transfer permissions
|- 
| [[PERM_COPY]]
| {{LSL Hex|0x00008000|32768}}
| Copy permission
|- 
| [[PERM_MODIFY]]
| {{LSL Hex|0x00004000|16384}}
| Modify permission
|- 
| [[PERM_MOVE]]
| {{LSL Hex|0x00080000|524288}}
| Move permission
|- 
| [[PERM_TRANSFER]]
| {{LSL Hex|0x00002000|8192}}
| Transfer permission
|}
<div>
{|{{Prettytable}}
! Permissions
! Value
! Description
|- 
| [[PERM_ALL]]
| {{LSL Hex|0x7FFFFFFF|2147483647}}
| Move/Modify/Copy/Transfer permissions
|- 
| [[PERM_COPY]]
| {{LSL Hex|0x00008000|32768}}
| Copy permission
|- 
| [[PERM_MODIFY]]
| {{LSL Hex|0x00004000|16384}}
| Modify permission
|- 
| [[PERM_MOVE]]
| {{LSL Hex|0x00080000|524288}}
| Move permission
|- 
| [[PERM_TRANSFER]]
| {{LSL Hex|0x00002000|8192}}
| Transfer permission
|}
</div>

Table in Table:

Permissions Value Description
PERM_ALL 0x7FFFFFFF Move/Modify/Copy/Transfer permissions
PERM_COPY 0x00008000 Copy permission
PERM_MODIFY 0x00004000 Modify permission
PERM_MOVE 0x00080000 Move permission
PERM_TRANSFER 0x00002000 Transfer permission

Funciones

Además de las plantillas generales hay solo una plantilla con función específica.


Template:LSL Function
This template provides a structure to write the functions documentation over; it includes several sections.

  • Please do not remove information.
  • Order of variables does not matter.
  • Most variables if not set will cause the applicable section to hide (not all sections hide).
  • Unused variables do not need to be included but it is better to not removed unused variables to aid future editors.
  • Please head all messages generated by the template.
  • If you think a section should be added please add it to LSL Function Style (and they will shortly be added to the template).

Please refer to LSL_Function for a detailed explanation of it's syntax and attributes.

Base Example: llFrand
{{LSL_Function
|func
|func_id
|func_sleep
|sort
|func_desc
|func_footnote
|return_type
|return_text
|p1_type|p1_name|p1_desc
|p2_type|p2_name|p2_desc
|p3_type|p3_name|p3_desc
|p4_type|p4_name|p4_desc
|p5_type|p5_name|p5_desc
|p6_type|p6_name|p6_desc
|p7_type|p7_name|p7_desc
|p8_type|p8_name|p8_desc
|p9_type|p9_name|p9_desc
|p10_type|p10_name|p10_desc
|p11_type|p11_name|p11_desc
|p12_type|p12_name|p12_desc
|constants
|spec
|caveats
|examples
|helpers
|also_header
|also_functions
|also_tests
|also_articles
|also_events
|also_footer
|notes
|mode
|deprecated
|permission
|negative_index
|cat1
|cat2
|cat3
|cat4
|cat5
|cat6
|location
}}
{{LSL_Function
|sort=Frand
|func=llFrand
|func_id=8
|func_sleep=0.0
|func_energy=10.0
|p1_type=float
|p1_name=mag
|p1_desc=Any valid float value
|return_type=float
|return_text=that is pseudo random number in the range [0.0,mag) or (mag, 0.0].
|spec=returns a pseudo random number in range [0.0, mag) or (mag, 0.0], depending upon the sign of mag.
|caveats=The random number generator is not a source of entropy.
|examples=<lsl>
default
{
    touch_start(integer total_number)
    {
        // When touched, say "Heads" with probability 0.5, 
        // otherwise, say "Tails."
        if ( llFrand(1.) < .5)
            llSay(0, "Heads");
        else
            llSay(0, "Tails");
    }
}
</lsl>
|helpers
|also_header
|also_functions
|also_tests
|also_events
|also_articles
|also_footer
|notes=
The random number generator is not a source of entropy.

The sequence of random numbers are shared across the entire process, and not independently seeded.
Therefore, the pseudo random number generation is not suitable for any application which requires
completely predictable or completely unpredictable results.
|cat1=Math
|cat2
|cat3
|cat4
}}

Eventos

Ademas de las plantillas generales hay una sola plantilla para eventos específicos.

LSL_Event This template provides a structure to write the event documentation over; it includes several sections. Secciones sin usar típicamente se ocultan.

Consulte LSL_Event para una explicación detallada de su sintaxis y atributos.

Constantes

Solo hay una plantilla con constante específica.

LSL_Constant This template provides a structure to write constant documentation over; it includes several sections. Secciones sin usar típicamente se ocultan. Consulte LSL_Constant para una explicación detallada de su sintaxis y atributos.