From 1dc3d721e3b43d4ddaa52e0c3f6ffb81ec2088ed Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Mon, 2 Aug 2021 18:03:13 -0400 Subject: remove link 'title' attributes that's just the 'href' (pt-br, part 5) (#1849) --- files/pt-br/mdn/tools/kumascript/index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'files/pt-br/mdn/tools') diff --git a/files/pt-br/mdn/tools/kumascript/index.html b/files/pt-br/mdn/tools/kumascript/index.html index 9c89712e59..51fb751707 100644 --- a/files/pt-br/mdn/tools/kumascript/index.html +++ b/files/pt-br/mdn/tools/kumascript/index.html @@ -15,7 +15,7 @@ translation_of: MDN/Tools/KumaScript ---
{{MDNSidebar}}

Overview

-

On the Kuma platform that powers MDN, the template system for automating aspects of content on the wiki is called KumaScript. KumaScript is powered by server-side JavaScript, implemented using Node.js. This article provides basic information on how to use KumaScript.

+

On the Kuma platform that powers MDN, the template system for automating aspects of content on the wiki is called KumaScript. KumaScript is powered by server-side JavaScript, implemented using Node.js. This article provides basic information on how to use KumaScript.

For a detailed overview and Q&A of KumaScript, watch the MDN dev team's KumaScript Fireside Chat (the meeting starts at 10 minutes into the video). KumaScript replaced DekiScript, which was the template language for MindTouch, the previous platform used by MDN.

@@ -38,7 +38,7 @@ translation_of: MDN/Tools/KumaScript

Basics

-

KumaScript is used on MDN in embedded JavaScript templates. These templates can be invoked in document content by any MDN author, through the use of macros.

+

KumaScript is used on MDN in embedded JavaScript templates. These templates can be invoked in document content by any MDN author, through the use of macros.

A script in KumaScript is a template, and each template is a file in the macros directory of the KumaScript repository on Github. A  template looks like this:

@@ -81,7 +81,7 @@ Hello #2

The data from this macro is available in template code as an object in the $0 argument (e.g., $0.Alpha, $0.Beta, $0.Foo). This also allows you to express complex data structures in macro parameters that are hard or impossible to do with a simple list of parameters.

-

Note that this parameter style is very picky — it must adhere to JSON syntax exactly, which has some requirements about escaping characters that are easy to miss (e.g., all forward slashes are escaped). When in doubt, try running your JSON through a validator.

+

Note that this parameter style is very picky — it must adhere to JSON syntax exactly, which has some requirements about escaping characters that are easy to miss (e.g., all forward slashes are escaped). When in doubt, try running your JSON through a validator.

How to write "\{{" in text

@@ -93,7 +93,7 @@ Hello #2

Each KumaScript template is a file under the macros directory of KumaScript. You create and edit these files as you would the files of any open-source project on GitHub (see the KumaScript README for more information).

-

KumaScript templates are processed by an embedded JavaScript template engine with a few simple rules:

+

KumaScript templates are processed by an embedded JavaScript template engine with a few simple rules:

Tips

@@ -207,7 +207,7 @@ Hello #<%= i %>

Built-in methods

-

This manually-maintained documentation is likely to fall out of date with the code. With that in mind, you can always check out the latest state of built-in APIs in the KumaScript source. But here is a selection of useful methods exposed to templates:

+

This manually-maintained documentation is likely to fall out of date with the code. With that in mind, you can always check out the latest state of built-in APIs in the KumaScript source. But here is a selection of useful methods exposed to templates:

md5(string)
@@ -223,7 +223,7 @@ Hello #<%= i %>
cacheFn(key, timeout, function_to_cache)
Using the given key and cache entry lifetime, cache the results of the given function. Honors the value of env.cache_control to invalidate cache on no-cache, which can be sent by a logged-in user hitting shift-refresh.
request
-
Access to mikeal/request, a library for making HTTP requests. Using this module in KumaScript templates is not yet very friendly, so you may want to wrap usage in module APIs that simplify things.
+
Access to mikeal/request, a library for making HTTP requests. Using this module in KumaScript templates is not yet very friendly, so you may want to wrap usage in module APIs that simplify things.
log.debug(string)
Outputs a debug message into the script log on the page (i.e. the big red box that usually displays errors).
@@ -496,5 +496,5 @@ var s_title = mdn.localString({ -- cgit v1.2.3-54-g00ecf