Code formatting examples

From DAO Governance Wiki
Revision as of 15:22, 4 April 2023 by Ladd (talk | contribs) (Add example of displaying an image in a larger format)
Jump to navigation Jump to search

Code

In visual editing mode, you can use Insert > Code Block to format and syntax-highlight some code.

Note that pressing escape while inputting text into this code block may cause you to lose unsaved work.

function add(a, b) {
    return a + b;
}

You can also create a link to code housed in GitLab, for example here is a link to the reputation token prototype contract

Screenshots

Screenshots can be inserted as images. Here is a screenshot uploaded as an image. In this case we have disable text wrapping, so the image does not share horizontal space with the text that follows it.

Forum WDAG example
Forum WDAG from the power redistribution example

Here is another example, this time with a larger image.

Sequence diagram
Sequence diagram for the power redistribution example


The default is to display only a thumbnail of the image, but you can instead display the image in a larger format.

Sequence diagram