Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ You should be able to reuse its structure for your projects!

## Overview

This template comes with a simple entrypoint called `main.carp`. This is the
file that people will load when they first load your project. It doesn’t
currently compile—can you find out why?
This template comes with a simple entrypoint called `main.carp`. **Rename this
file to match your module name** (e.g. `my-mod.carp` for a module called
`MyMod`). This is the convention used by carpentry-org packages and makes your
library easier to discover. Remember to update the `(load ...)` paths in
`gendocs.carp` and `test/tests.carp` when you rename it.

We also have some tests. They reside in `test/tests.carp`. If we run them using
`carp -x test/tests.carp`, they fail! Please write some useful tests for your
Expand All @@ -18,7 +20,8 @@ invoke it by calling `carp gendocs.carp`) will generate documentation from the
docstrings of your functions and modules, and put it in the `docs/` directory.
You can style and customize it by editing the CSS or fiddling with the
configuration options in `gendocs.carp`. They should be pretty
self-explanatory.
self-explanatory. Make sure to update `docs-url` in `gendocs.carp` to point to
your repository.

<hr/>

Expand Down
1 change: 1 addition & 0 deletions gendocs.carp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(Project.config "title" "My Awesome Project")
(Project.config "docs-directory" "./docs/")
(Project.config "docs-logo" "")
(Project.config "docs-url" "https://github.com/your-user/your-project")
(Project.config "docs-styling" "style.css")

; useful if you only have 1 module
Expand Down
24 changes: 18 additions & 6 deletions main.carp
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
(doc MyMod "is a template module you should replace with your own.

## Installation

```
(load \"git@github.com:your-user/your-project@0.1.0\")
```

## Usage

```
(MyMod.greet \"Carp\") ; => \"Hello, Carp!\"
```

Rename this file to match your module name (e.g. `my-mod.carp` for a
module called `MyMod`). See the carpentry-org packages for examples.")
(defmodule MyMod
(doc greet "returns a friendly greeting for `name`.")
(defn greet [name]
(if (= name "Carp")
@"Hello, Carp!"
@"Hello!"))
(defn greet [name] (if (= name "Carp") @"Hello, Carp!" @"Hello!"))

(doc myfun "is a tiny no-op function used by tests.")
(defn myfun [] ())
)
(defn myfun [] ()))
Loading