diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
commit | da78a9e329e272dedb2400b79a3bdeebff387d47 (patch) | |
tree | e6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/it/mdn/guidelines | |
parent | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff) | |
download | translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2 translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip |
initial commit
Diffstat (limited to 'files/it/mdn/guidelines')
-rw-r--r-- | files/it/mdn/guidelines/index.html | 13 | ||||
-rw-r--r-- | files/it/mdn/guidelines/macros/index.html | 42 | ||||
-rw-r--r-- | files/it/mdn/guidelines/migliore_pratica/index.html | 34 |
3 files changed, 89 insertions, 0 deletions
diff --git a/files/it/mdn/guidelines/index.html b/files/it/mdn/guidelines/index.html new file mode 100644 index 0000000000..11412724a1 --- /dev/null +++ b/files/it/mdn/guidelines/index.html @@ -0,0 +1,13 @@ +--- +title: MDN content and style guides +slug: MDN/Guidelines +tags: + - Documentation + - Landing + - MDN + - NeedsTranslation + - TopicStub +translation_of: MDN/Guidelines +--- +<div>{{MDNSidebar}}</div><p><span class="seoSummary">These guides provide details on how MDN documentation should be written and formatted, as well as how our code samples and other content should be presented.</span> By following these guides, you can ensure that the material you produce is clean and easy to use.</p> +<p>{{LandingPageListSubpages}}</p> diff --git a/files/it/mdn/guidelines/macros/index.html b/files/it/mdn/guidelines/macros/index.html new file mode 100644 index 0000000000..a09cf37e30 --- /dev/null +++ b/files/it/mdn/guidelines/macros/index.html @@ -0,0 +1,42 @@ +--- +title: Using macros on MDN +slug: MDN/Guidelines/Macros +tags: + - italino tags +translation_of: MDN/Structures/Macros +--- +<div>{{MDNSidebar}}</div><p><span class="seoSummary">The <a href="/en-US/docs/Project:MDN/Kuma" title="/en-US/docs/Project:MDN/Kuma">Kuma</a> platform on which MDN runs provides a powerful macro system, <a href="/en-US/docs/Project:MDN/Kuma/KumaScript_guide" title="/en-US/docs/Project:MDN/Kuma/KumaScript_guide">KumaScript</a>, which makes it possible to do a wide variety of things automatically. This article provides information on how to invoke MDN's macros within articles.</span></p> + +<p>The <a href="/en-US/docs/Project:MDN/Kuma/KumaScript_guide" title="/en-US/docs/Project:MDN/Kuma/KumaScript_guide">KumaScript guide</a> provides an in-depth look at how to use macros on MDN, so this section is more of a brief overview. If you've already read the section above on {{SectionOnPage("/en-US/docs/Project:MDN/Contributing/Editor_guide/Links", "Using link macros")}}, you're already at least a little bit familiar with the concept.</p> + +<h2 id="How_macros_are_implemented">How macros are implemented</h2> + +<p>Macros on MDN are implemented using server-executed <a href="/en-US/docs/Web/JavaScript" title="/en-US/docs/Web/JavaScript">JavaScript</a> code, interpreted using <a href="http://nodejs.org/" title="http://nodejs.org/">Node.js</a>. On top of that we have a number of libraries we've implemented that provide wiki-oriented services and features to let macros interact with the wiki platform and its contents. If you're interested in learning more, see the <a href="/en-US/docs/Project:MDN/Kuma/KumaScript_guide" title="/en-US/docs/Project:MDN/Kuma/KumaScript_guide">KumaScript guide</a>; the <a href="/en-US/docs/Project:MDN/Kuma/KumaScript_reference" title="/en-US/docs/Project:MDN/Kuma/KumaScript_reference">KumaScript reference</a> provides details on the libraries and other KumaScript APIs we've implemented.</p> + +<h2 id="Using_a_macro_in_content">Using a macro in content</h2> + +<p>To actually use a macro, you simply enclose the call to the macro in a pair of double-braces, with its parameters, if any, enclosed in parentheses; that is:</p> + +<pre class="notranslate">\{{macroname(parameter-list)}}</pre> + +<p>A few notes about macro calls:</p> + +<ul> + <li>Macro names are case-sensitive, but some attempt is made to correct for common capitalization errors; you may use all lowercase even if the macro name uses caps within it, and you may capitalize a macro whose name normally starts with a lower-case letter.</li> + <li>Parameters are separated by commas.</li> + <li>If there are no parameters, you may leave out the parentheses entirely; <code>\{{macroname()}}</code> and <code>\{{macroname}}</code> are identical.</li> + <li>Numeric parameters can be in quotes, or not. It's up to you (however, if you have a version number with multiple decimals in it, it needs to be in quotes).</li> + <li>If you get errors, review your code carefully. If you still can't figure out what's going on, see <a href="/en-US/docs/MDN/Kuma/Troubleshooting_KumaScript_errors">Troubleshooting KumaScript errors</a> for help.</li> +</ul> + +<p>Macros are heavily cached; for any set of input values (both parameters and environmental values such as the URL for which the macro was run), the results are stored and reused. This means that the macro is only actually run when the inputs change.</p> + +<div class="note"> +<p><strong>Note:</strong> You can force all the macros on a page to be re-evaluated by force-refreshing the page in your browser (that is, a shift-reload).</p> +</div> + +<p>Macros can be as simple as just inserting a larger block of text or swapping in contents from another part of MDN, or as complex as building an entire index of content by searching through parts of the site, styling the output, and adding links.</p> + +<p>You can read up on our most commonly-used macros on the <a href="/en-US/docs/Project:MDN/Contributing/Custom_macros" title="/en-US/docs/Project:MDN/Contributing/Custom_macros">Custom macros</a> page; also, there's a <a href="https://developer.mozilla.org/en-US/docs/templates" title="https://developer.mozilla.org/en-US/docs/templates">complete list of all macros</a> here. Most macros have documentation built into them, as comments at the top.</p> + +<p>{{EditorGuideQuicklinks}}</p> diff --git a/files/it/mdn/guidelines/migliore_pratica/index.html b/files/it/mdn/guidelines/migliore_pratica/index.html new file mode 100644 index 0000000000..2aadc92c27 --- /dev/null +++ b/files/it/mdn/guidelines/migliore_pratica/index.html @@ -0,0 +1,34 @@ +--- +title: Migliore pratica +slug: MDN/Guidelines/Migliore_pratica +tags: + - Guida + - MDN Meta + - linee guida +translation_of: MDN/Guidelines/Conventions_definitions +--- +<div>{{MDNSidebar}}</div><p>Quest'articolo descrive i metodi raccomandati di lavoro con il contenuto su MDN. Queste linee guida descrivono i metodi preferiti per fare tutto ciò che porta ad un miglior risultato, o offrire un consiglio nel decidere tra diversi metodi nel fare cose simili.</p> + +<h2 id="Copiare_il_contenuto">Copiare il contenuto</h2> + +<p>A volte, avrai la necessità di utilizzare lo stesso testo su più pagine (oppure utilizzare il modello di una pagina per un'altra). Hai tre opzioni:</p> + +<ul> + <li>Se vuoi copiare un'intera pagina: + <ol> + <li>Visualizzando una pagina che vuoi copiare, nel menù Avanzate (ingranaggio), scegli <strong><a href="/en-US/docs/MDN/Contribute/Creating_and_editing_pages#Clone_of_an_existing_page">Clona questa pagina</a></strong>. Si aprirà l'editor per l'interfaccia utente per una nuova pagina, con il contenuto della pagina clonata già pronto.</li> + <li>Inserisci un nuovo <strong>Titolo</strong> e uno <strong>Slug</strong> per la pagina clonata.</li> + <li>Modifica il contenuto della pagina come necessario, e salva come sempre.</li> + </ol> + </li> + <li>Se vuoi copiare solamente una parte della pagina, <strong>non visitare semplicamente la pagina copiandolo da lì</strong>. Questo metodo aggiunge dei bit di HTML indesiderati nella pagina di destinazione, e qualcuno dovrà sistemarlo, tu o un altro editor. Nessuno vuole questo. Per copiare una parte di una pagina MDN in un'altra: + <ol> + <li>Nella pagina originale, clicca il pulsante <strong>modifica.</strong> n the source page, click the <strong>Edit</strong> button on the source page.</li> + <li><strong>Copia il contenuto che vuoi riutilizzare attraverso l'editor dell'interfaccia utente.</strong></li> + <li>Clicca <strong>Annulla</strong> per uscire dell'editor di quella pagina.</li> + <li>Apri l'editor della pagina di destinazione.</li> + <li>Incolla il testo copiato.</li> + </ol> + </li> + <li>A volte avrai bisogno di utilizzare lo stesso contenuto su diverse pagine in maniera letterale. In questo caso, sarebbe meglio posizionare il contenuto in una pagina, poi utilizzando la macro {{TemplateLink("Page")}} trasferire il materiale da una pagina all'altra. In questo modo, quando il testo della pagina sorgente sarà aggiornato, la pagina di destinazione lo sarà di conseguenza (ovvero, succederà quando ci sarà un aggiornamento forzato o la pagina andrà in manutenzione automatica).</li> +</ul> |