> For the complete documentation index, see [llms.txt](https://mavolin.gitbook.io/corgi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mavolin.gitbook.io/corgi/learning-corgi/getting-started.md).

# Getting Started

Corgi distinguishes between four file types: main files, library files, template files, and included files. While you'll learn about the last three later, let's talk about main files:

The main file is the file that gets compiled to a Go function. Therefore, unlike the other file types, it must define the name and parameters of it's output function. This is done by adding a Go function header without return value to your file:

{% tabs %}
{% tab title="Corgi" %}

```pug


func MyTemplateFunc(myArg string)


```

{% endtab %}

{% tab title="Go" %}

```go
import __corgi_io "io"

func MyTemplateFunc(__corgi_w __corgi_io.Writer, myArg string) error {
    // ...
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
As you can see by the cryptic import alias and name for the `io.Writer`, corgi tries it best to avoid name collisions.

To do that, the corgi CLI prefixes all its identifiers with `__corgi_`. In turn, it reserves all identifiers starting with that name for current or future use.
{% endhint %}

You can also import other packages and use the types, functions, variables, and constants in it in your template.

{% tabs %}
{% tab title="Corgi" %}

```pug
import
  "time"
  // import aliases work too!
  linkedlist "container/list"


func F(t time.Time, l *linkedlist.List)


```

{% endtab %}

{% tab title="Go" %}

```go
import (
    "time"
    __corgi_io "io"
    linkedlist "container/list"
)

func F(__corgi_w __corgi_io.Writer, t time.Time, l linkedlist.List) error {
    // ...
}
```

{% endtab %}
{% endtabs %}

After you've written the function header, the content of generated document begins. Everything written there will be used to render the document.

Let's start with something very basic and create a `p` element:

{% tabs %}
{% tab title="Corgi" %}

```pug
func Engage()

doctype html
p Engage!
```

{% endtab %}

{% tab title="HTML" %}

```markup


<!doctype html>
<p>Engage!</p>
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
From this point on, examples will only include a `func` directive, if its parameters are relevant for the example. When you also want to try the example, just give the function any name and no parameters!
{% endhint %}
