diff --git a/.gitignore b/.gitignore index 750bcf3..4bdbb4e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ nimcache/ nimblecache/ htmldocs/ - +bin/ +doc/ diff --git a/Makefile b/Makefile index 3a27b20..ab34682 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,21 @@ BUILD_DIR := bin/ -SOURCE_DIR := src/ +SRC_DIR := src/ +DOC_DIR := doc/ +DOC_TYPE ?= doc all: - nim compile --out:$(BUILD_DIR) $(SOURCE_DIR)*.nim + nim compile --out:$(BUILD_DIR) $(SRC_DIR)*.nim + +doc: + nim $(DOC_TYPE) --outdir:$(DOC_DIR) $(SRC_DIR)*.nim release: - nim compile --define:release --out:$(BUILD_DIR) $(SOURCE_DIR)*.nim + nim compile --define:release --out:$(BUILD_DIR) $(SRC_DIR)*.nim run: @$(BUILD_DIR)main clean: - @rm -rf $(BUILD_DIR) + @rm -rf $(BUILD_DIR) $(DOC_DIR) clear: clean \ No newline at end of file diff --git a/src/main.nim b/src/main.nim index 8214f7b..d452ba9 100644 --- a/src/main.nim +++ b/src/main.nim @@ -1 +1,12 @@ -echo "Hello, World!" \ No newline at end of file +## This module is a sample. + +import strutils + +proc helloWorld*(times: int) = + ## Takes an integer and outputs + ## as many indented "hello world!"s + + for i in 0 .. times-1: + echo "hello world!".indent(2) # using indent to avoid `UnusedImport` + +helloWorld(5) \ No newline at end of file