APL Wiki:Formatting: Difference between revisions

Jump to navigation Jump to search
1,726 bytes added ,  20:59, 8 February 2021
→‎Inserting code: Section on non-highlighted code
m (→‎Inserting code: Move math section after code section)
(→‎Inserting code: Section on non-highlighted code)
(4 intermediate revisions by 2 users not shown)
Line 13: Line 13:
== Mentioning subjects that have their own page ==
== Mentioning subjects that have their own page ==
It is fine for a page to have a section about a subject that also has its own page. When that happens, begin the section with <code><nowiki>{{Main|subject}}</nowiki></code> where <code>subject</code> is the target page title. Don't include double brackets (as a page link) — it is done for you.
It is fine for a page to have a section about a subject that also has its own page. When that happens, begin the section with <code><nowiki>{{Main|subject}}</nowiki></code> where <code>subject</code> is the target page title. Don't include double brackets (as a page link) — it is done for you.
== Also on Wikipedia ==
If a subject is notable for reasons unrelated to APL, in addition to being [[APL Wiki:Content guidelines#Notability|APL notable]], then you can indicate this fact using the [[Template:Also on Wikipedia|Also on Wikipedia]] template. By default, both the text and the Wikipedia link target are taken from the page's title. The optional first argument changes the name used in the text (for example, to use only a person's last name) and the second gives the Wikipedia article to link to.
As the template suggests, only APL-related topics, and important background information, should be covered on the APL Wiki if there is also a substantial Wikipedia article. In contrast, topics which are on Wikipedia only because of APL should eventually have APL Wiki articles with at least as much information as Wikipedia, and should not use the Also on Wikipedia template—instead, these articles should include a link to the Wikipedia article in an "External links" section. However, content should not be copied directly from Wikipedia. Rewrite it from an APL perspective instead.


== Yes/No tables ==
== Yes/No tables ==
Line 83: Line 88:
</source></blockquote>
</source></blockquote>


==== Tagging dialects ====
Optionally, you can indicate one or more APL dialects which are able to run the code by using a special template immediately after the source tag, like
Optionally, you can indicate one or more APL dialects which are able to run the code by using a special template immediately after the source tag, like


Line 99: Line 105:
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[GNU APL]], [[ngn/apl]]}}</blockquote>
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[GNU APL]], [[ngn/apl]]}}</blockquote>


==== Run online ====
You can also include a permalink to [[TryAPL]], [[Try It Online]], ''repl.it'', or ''n9n.gitlab.io'' right before the source tag, for example
You can also include a permalink to [[TryAPL]], [[Try It Online]], ''repl.it'', or ''n9n.gitlab.io'' right before the source tag, for example


Line 153: Line 160:
</source>
</source>
}}</blockquote>
}}</blockquote>
=== Unsupported languages ===
If your code is in a language the highlighter doesn't support, then there are two ways to present code without highlighting it. Don't use a <source lang=text inline><source></source> tag with no <code>lang</code> attribute as this puts the page in the "Pages with syntax highlighting errors" category, which is visible at the bottom of the page.
* Use <source lang=text inline><code></source> tags for inline code and <source lang=text inline><pre></source> tags for blocks, avoiding <code><source></code> entirely
* Use <code>lang=text</code>.


=== Mathematical notation ===
=== Mathematical notation ===
Line 218: Line 230:
and also adds a large floating illustration of the [[glyph]], as seen at the right. You can use the <code>Built-ins</code> template for primitives with two different glyphs (for example <code><nowiki>{{Built-ins|Reverse|⌽|⊖}}</nowiki></code>), and <code>Glyphbox</code> if you just want a box at the right (for example <code><nowiki>{{Glyphbox|⍤}}</nowiki></code>). Since all of these templates must be put at the very beginning of the article's first paragraph, <code>Glyphbox</code> is useful if there should be leading text before the primitive's name.
and also adds a large floating illustration of the [[glyph]], as seen at the right. You can use the <code>Built-ins</code> template for primitives with two different glyphs (for example <code><nowiki>{{Built-ins|Reverse|⌽|⊖}}</nowiki></code>), and <code>Glyphbox</code> if you just want a box at the right (for example <code><nowiki>{{Glyphbox|⍤}}</nowiki></code>). Since all of these templates must be put at the very beginning of the article's first paragraph, <code>Glyphbox</code> is useful if there should be leading text before the primitive's name.


At the bottom such pages, include <code><nowiki>{{APL built-ins}}</nowiki></code> and [{{fullurl:Template:APL_built-ins|action=edit}} edit that template's content] if the page you're creating isn't already listed there.
At the bottom of such pages, include <code><nowiki>{{APL built-ins}}</nowiki></code> and [{{fullurl:Template:APL_built-ins|action=edit}} edit that template's content] if the page you're creating isn't already listed there.


==== Dialects ====
==== Dialects ====

Navigation menu