7 Wiki notation
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog Source Documentation Version 2
        • Wiki notation
          • Structuring conventions
          • Text markup: fonts and links
            • Emphasizing text
            • Inline code
            • Links
          • Images

7.2 Text markup: fonts and links

7.2.1 Emphasizing text

Text emphasis is a combination of old plaintext conventions in Usenet and E-mail and the doxygen version of markdown. Table 1 shows the font-changing constructions. The phrase limited context means that

  • The opening * or _ must be preceeded by white space or a character from the set <{([,:; and must be followed by an alphanumerical character.
  • The closing * or _ may not be followed by an alphanumerical character and may not be preceeded by white space or a character from the set ({[<=+-\@.
  • The scope of these operations is always limited to the identified structure (paragraph, list item, etc.)

Note that =<identifier>= is limited to a an identifier, such as a file name, XML name, etc. Identifiers must start and end with an alphanumerical character, while characters from the set .-/: may appear internally. Note that this set explicitly does not allow for white space in code spans delimited by a single =. This markup is specifically meant to deal with code that is either not Prolog code or invalid Prolog code. Valid Prolog code should use the backtick as described in section 7.2.2.

*bold*Typeset text in bold for limited content (see running text).
*|bold|*Typeset text in bold. Content can be long.
_emphasize_Typeset text as emphasize for limited content (see running text).
_|emphasize|_Typeset text as emphasize. Content can be long.
=code=Typeset text fixed font for identifiers (see running text).
=|code|=Typeset text fixed font. Content can be long.
WordCapitalised words that appear as argument-name are written in Italic
Table 1 : Wiki constructs to change the font

7.2.2 Inline code

Inline code can be realised using the = switch described in section 7.2.1 or the markdown backtick. In addition, it can use the mardown/Doxygen backtick (`) convention: a string that is delimited by backticks is considered code, provided:

  • An internal double backtick is translated into a single backtick.
  • Inline code is limited to the current structure (paragraph, table cell, list item, etc.
  • The content of the code block is valid Prolog syntax. Note that in Doxygen, the syntax is not validated and a single quote cancels the recognition as code. The latter is a problematic in Prolog because single quotes are often required.

Currently,‘Var` is typeset as a variable (italics) and other terms are typeset using a fixed-width code font.

In addition, compound terms in canonical notation (i.e., functor(,...args...) that can be parsed are first verified as a file-specification for absolute_file_name/3 and otherwise rendered as code.

7.2.3 Links

Table 2 shows the constructs for creating links.

name/arityCreate a link to a predicate
`name/arity` Create a link to a predicate
``name/arity`` Predicate indicator that does not create a link
name//arityCreate a link to a DCG rule
`name//arity` Create a link to a DCG rule
``name//arity`` DCG indicator that does not create a link
flag `name` Create a link to the Prolog flag name if this flag exists.
name.extIf <name>.<ext> is the name of an existing file and <ext> is one of .pl, .txt, .md, .png, .gif, .jpeg, .jpg or .svg, create a link to the file.
prot://urlIf <prot> is one of http, https or ftp, create a link.
<url> Create a hyperlink to URL. This construct supports the expand_url_path/2 using the construct <alias>:<local>. <local> can be empty.
[[label][link]] Create a link using the given <label>. Label can be text or a reference to an image file. Additional arguments can be supplied as ;<name>="<value>". More arguments are separated by commas. <link> must be a filename as above or a url.
[label](link) The markdown version of the above.
[@cite] Include LaTeX citation. Multiple citations can be saparated using ;. No white space is allowed.
Table 2 : Wiki constructs that create links