<a id="wiki-ticket-editing-cheat-sheet"></a>
<a id="wiki-cheat-sheet"></a>
# Wiki / Ticket Editing Cheat Sheet

The Project Wiki and Tickets use Markdown to edit content. See [https://en.wikipedia.org/wiki/Markdown](https://en.wikipedia.org/wiki/Markdown)

- **Markup:**

  ```
  # Heading (h1)
  ```

  **Becomes:**

  # Heading (h1)

- **Markup:**

  ```
  ## Heading (h2)
  ```

  **Becomes:**

  ## Heading (h2)

- **Markup:**

  ```
  ### Heading (h3)
  ```

  **Becomes:**

  ### Heading (h3)

- **Markup:**

  ```
  #### Heading (h4)
  ```

  **Becomes:**

  #### Heading (h4)

- **Markup:**

  ```
  ##### Heading (h5)
  ```

  **Becomes:**

  ##### Heading (h5)

- **Markup:**

  ```
  ###### Heading (h6)
  ```

  **Becomes:**

  ###### Heading (h6)

- **Markup:**

  ```
  **Bold**
  ```

  **Becomes:** **Bold**

- **Markup:**

  ```
  _Italic_
  ```

  **Becomes:** *Italic*

- **Markup:**

  ```
  [[wiki page]]
  ```

  **Becomes:** [Wiki Page](#)
  A link to a Project Wiki page

- **Markup:**

  ```
  [[TrialGrid|wiki_page]]
  ```

  **Becomes:** [TrialGrid](#)
  A link to a wiki page, using a different name for the link text

- **Markup:**

  ```
  [TrialGrid](https://www.trialgrid.com)
  ```

  **Becomes:** [TrialGrid](https://www.trialgrid.com)
  A link to a web page

- **Markup:**

  ```
  <https://www.trialgrid.com>
  ```

  **Becomes:** [https://www.trialgrid.com](https://www.trialgrid.com)
  Plain link to a web page

- **Markup:**

  ```
  #123
  ```

  **Becomes:** [#123](#)
  Reference to a ticket

- **Markup:**

  ```
  * Bullet
  * List
      * Second Level (4 leading spaces)
  ```

  **Becomes:**

  - Bullet
  - List
    - Second level (4 leading spaces)

- **Markup:**

  ```
  1. First
  2. Second
  3. Third
  ```

  **Becomes:**

  1. First
  2. Second
  3. Third

- **Markup:**

  ```
  3. Third
  4. Fourth
  ```

  **Becomes:**

  3. Third
  4. Fourth

  (A list counts from its first number)

- **Markup:**

  ```
  ---
  ```

  **Becomes:** ---

  (Horizontal Line)

- **Markup:**

  ```
  > Quoted text
  ```

  **Becomes:**

  > Quoted text

- **Markup:**

  ```
  !!! note "Extracted by TrialGrid"
      Indented text of the note
  ```

  **Becomes:**

  > **Extracted by TrialGrid:** Indented text of the note

  (A note, set apart from the rest of the page)

- **Markup:**

  ```
  !!! warning "Check the source"
      Indented text of the warning
  ```

  **Becomes:**

  > **Check the source:** Indented text of the warning

- **Markup:**

  ```
  | Heading 1 | Heading 2 |
  |-----------|-----------|
  | Row1Col1  | Row1Col2  |
  | Row2Col1  | Row2Col2  |

  ```

  **Becomes:**

  | Heading 1 | Heading 2 |
  | --- | --- |
  | Row1Col1 | Row1Col2 |
  | Row2Col1 | Row2Col2 |

  A table.

- **Markup:**

  ````
  ```python
  def total(a, b):
      return a + b
  ```

  ````

  **Becomes:**

  ```python
  def total(a, b):
      return a + b
  ```

  A code block. Name the language after the opening ``` to color it, or leave it out for plain text.

<a id="links-to-sections-of-a-wiki-page"></a>
## Links to sections of a Wiki page

Every heading written with `#` on a Wiki page can be linked to. The link is `#` followed by the heading text in lower case, with spaces replaced by hyphens and punctuation removed. For example, a heading `## Visit Schedule` is linked with `[See the schedule](#visit-schedule)`. When two headings have the same text, the second is linked with `_1` added to the end, the third with `_2`, and so on.

Clicking a section link shows the section's address in the browser, ending in `#wiki-visit-schedule`. That form works too: on the same page as `[See the schedule](#wiki-visit-schedule)`, and from another page or a Ticket as the full address. A link to anything that is not a heading on the page, such as `#top`, is left as written. If a page has headings such as "Setup" and "Wiki Setup", `#wiki-setup` goes to "Wiki Setup", so link to "Setup" with `#setup`.

Accented letters lose their accent and letters from other alphabets are left out, so for headings written in another alphabet use `[TOC]`, which makes the links for you.

Put `[TOC]` on a line of its own to show a contents list of the headings written with `#`, each linking to its section. Headings written in HTML are not listed.

Headings in Tickets and comments cannot be linked to.

<a id="pasting-images"></a>
## Pasting images

To add a screenshot or other image to a Wiki page, Ticket or comment, copy the image and paste it into the text while editing. A line such as `![image](/image/...)` appears where the cursor was. That line is the image, so move it to move the image and delete it to remove the image.

You can also drag an image file from your computer onto the text. Several image files dragged together are all added, one line for each. A file that is not an image is not added.

Every pasted image is checked before it is shown. For a few seconds after pasting you may see a box saying "Image is being checked" where the image will be. You can carry on writing and save while this happens.

PNG, JPEG and GIF images of up to 10 MB can be pasted. An animated GIF is shown as a still image. The image can be seen by anyone who can view the Project.

An image is shown no wider than the text around it. A large image is also made smaller when it is pasted: one that is more than 2560 pixels wide or tall is scaled down to 2560 pixels, keeping its shape. Screenshots of most screens are smaller than this and are kept as they are.

If what you copied is text as well as a picture, as cells copied from a spreadsheet are, the text is pasted and not the picture.

<a id="content-copied-from-other-documents"></a>
## Content copied from other documents

A Wiki page, Ticket or comment can also hold HTML, which is useful for content copied from another document such as a protocol:

- Table cells can span columns and rows with `colspan` and `rowspan`, for example `<th colspan="3">Treatment Period</th>`.
- Images keep a description and a width: `<img src="..." alt="Schedule of activities" width="600">`. The width is a number of pixels or a percentage.
- On a Wiki page, a heading written in HTML keeps its `id`, and a link to it keeps working: `<h3 id="sec-6-1">6.1 Consent</h3>` is linked with `<a href="#sec-6-1">`. The `id` may use letters, digits, hyphens, underscores, dots and colons; an `id` with any other character is removed. Give each heading an `id` of its own: one that repeats another heading's link, such as `consent` beside `## Consent`, makes links to either go to the first.
