# list all available commands
default:
  just --list

# store various dirs and filepaths
FILE_URI := justfile_directory() + "/paper.qmd"
BUILD_DIR := justfile_directory() + "/_build/"

# remove build files
clean:
    rm -fr {{BUILD_DIR}}
    rm -fr {{justfile_directory()}}/.quarto
    rm -fr {{justfile_directory()}}/paper.ipynb

# create conda env and install all deps
setup name="soft-search-paper":
    conda env create -n {{name}} --file {{justfile_directory()}}/environment.yml -v

# watch file, build, and serve
watch:
    quarto preview {{FILE_URI}} --to html

# build webpage
build-html:
    quarto render {{FILE_URI}} --to html
    touch {{BUILD_DIR}}.nojekyll

# build pdf
build-pdf:
    quarto render {{FILE_URI}} --to acm-pdf

# build docx
build-docx:
    quarto render {{FILE_URI}} --to docx

# build all
build:
    quarto render {{FILE_URI}} --to html,acm-pdf,docx