Browse Source

I think i'm done??

main
Jesse Laprade 3 weeks ago
parent
commit
8685e59976
3 changed files with 233 additions and 3 deletions
  1. +28
    -0
      Makefile
  2. +158
    -2
      README.md
  3. +47
    -1
      wg.fnl

+ 28
- 0
Makefile View File

@ -0,0 +1,28 @@
DESTDIR ?= /usr/local/bin
LOCALDIR = ~/.local/bin
.PHONY: help
help:
@echo "Usage:"
@echo " make help - Displays this help message."
@echo " make install - Installs wg to $(DESTDIR)."
@echo " make install-local - Installs wg to $(LOCALDIR)."
@echo " make uninstall - Deletes wg from $(DESTDIR)."
@echo " make uninstall-local - Deletes wg from $(LOCALDIR)."
install:
@install -Dm755 ./wg.fnl -D $(DESTDIR)/wg
@echo "Successfully installed to $(DESTDIR)!"
install-local:
@install -Dm755 ./wg.fnl -D $(LOCALDIR)/wg
@echo "Successfully installed to $(LOCALDIR)!"
uninstall:
@rm $(DESTDIR)/wg
@echo "Successfully uninstalled wg from $(DESTDIR)!"
uninstall-local:
@rm $(LOCALDIR)/wg
@echo "Successfully uninstalled wg from $(LOCALDIR)!"

+ 158
- 2
README.md View File

@ -1,5 +1,161 @@
# wg
(Terribly under construction)
A static website generator written in Fennel.
A static website generator in Fennel.
## Table of Contents
<!-- vim-markdown-toc GFM -->
* [Requirements](#requirements)
* [Installation](#installation)
* [Downloading wg](#downloading-wg)
* [To download wg](#to-download-wg)
* [Installing wg globally](#installing-wg-globally)
* [To install wg globally](#to-install-wg-globally)
* [Installing wg locally](#installing-wg-locally)
* [To install wg locally](#to-install-wg-locally)
* [Installing wg to a custom location](#installing-wg-to-a-custom-location)
* [To install wg to a custom location](#to-install-wg-to-a-custom-location)
* [Uninstallation](#uninstallation)
* [Uninstalling wg globally](#uninstalling-wg-globally)
* [To uninstall wg globally](#to-uninstall-wg-globally)
* [Uninstalling wg locally](#uninstalling-wg-locally)
* [To uninstall wg locally](#to-uninstall-wg-locally)
* [Uninstalling wg from a custom location](#uninstalling-wg-from-a-custom-location)
* [To uninstall wg from a custom location](#to-uninstall-wg-from-a-custom-location)
* [Commands](#commands)
* [Usage](#usage)
<!-- vim-markdown-toc -->
## Requirements
* [Fennel](https://fennel-lang.org/)
Note: The fennel binary or script should be in a directory on your `$PATH`
## Installation
This section will guide you through downloading and installing wg either
globally or locally.
This section consists of the following subsections:
* [Downloading wg](#downloading-wg)
* [Installing wg globally](#installing-wg-globally)
* [Installing wg locally](#installing-wg-locally)
### Downloading wg
This section will guide you through downloading wg using git.
#### To download wg
1. `git clone https://git.m455.casa/m455/wg`
### Installing wg globally
This section will guide you through installing wg globally. This method
will install wg into `/usr/local/bin`, which requires you to have root
access to your machine.
**Tip**: If you don't have root access to your machine, check out the
[Installing wg locally](#installing-wg-locally) section.
#### To install wg globally
1. `cd wg`
2. `sudo make install`
### Installing wg locally
This section will guide you through installing wg locally. This method
will install wg into `~/.local/bin`.
#### To install wg locally
1. `cd wg`
2. `make install-local`
### Installing wg to a custom location
This section will guide you through installing wg to a custom location.
#### To install wg to a custom location
1. `cd wg`
2. `make DESTDIR=~/path/to/custom/location install`
**Note**: If you choose to install wg to a custom location, you will
need to remember where you installed wg, if you decide to uninstall
later.
## Uninstallation
This section will guide you through uninstalling wg either globally or
locally.
This section consists of the following subsections:
* [Uninstalling wg globally](#uninstalling-wg-globally)
* [Uninstalling wg locally](#uninstalling-wg-locally)
* [Uninstalling wg from a custom location](#uninstalling-wg-from-a-custom-location)
### Uninstalling wg globally
This section will guide you through uninstalling wg globally. This
method will remove wg from `/usr/local/bin`, which requires you to have
root access to your machine.
#### To uninstall wg globally
1. `cd wg`
1. `make uninstall`
### Uninstalling wg locally
This section will guide you through uninstalling wg locally. This method
will remove wg from `~/.local/bin`.
#### To uninstall wg locally
1. `cd wg`
1. `make uninstall-local`
### Uninstalling wg from a custom location
This section will guide you through uninstalling wg from a custom
location.
#### To uninstall wg from a custom location
1. `cd wg`
2. `make DESTDIR=~/path/to/custom/location uninstall`
## Commands
* init - Creates required directories and files in the current
directory.
* build
* Recursively copies directories and files from the 'copy/'
directory into the 'build/' directory, preserving the directory
structure of the 'copy/' directory.
* Recursively converts Markdown files in the 'convert/' directory to
HTML files in the 'build/' directory, preserving the directory
structure of the 'convert/' directory.
* serve - Serves files in the 'build/' directory on port 8000, allowing
you to see how your website will look locally before it goes live.
* clean - Deletes all contents of the 'build/' directory.
* help - Displays the help message.
## Usage
* `wg init`
* `wg build`
* `wg serve`
* `wg clean`
* `wg help`

+ 47
- 1
wg.fnl View File

@ -1,3 +1,5 @@
#!/usr/bin/env fennel
(local directories-required [:build :layout :copy :convert])
(local files-required {:index "convert/index.md"
@ -237,6 +239,49 @@
(build/convert :convert)
(print "Conversion complete!"))))
(fn help []
(print
(.. "wg\n"
" A static website generator written in Fennel.\n"
"\n"
"Author\n"
" Jesse Laprade (m455)\n"
"\n"
"License\n"
" AGPL3 (https://www.gnu.org/licenses/agpl-3.0.en.html)\n"
"\n"
"Commands\n"
" init\n"
" Creates required directories and files in the current directory.\n"
"\n"
" build\n"
" Recursively copies directories and files from the 'copy/'\n"
" directory into the 'build/' directory, preserving the directory\n"
" structure of the 'copy/' directory.\n"
"\n"
" Recursively converts Markdown files in the 'convert/' directory\n"
" to HTML files in the 'build/' directory, preserving the\n"
" directory structure of the 'convert/' directory.\n"
"\n"
" serve\n"
" Serves files in the 'build/' directory on port 8000, allowing\n"
" you to see how your website will look locally before it goes\n"
" live.\n"
"\n"
" clean\n"
" Deletes all contents of the 'build/' directory.\n"
"\n"
" help\n"
" Displays this help message.\n"
"\n"
"Example usage\n"
" wg init\n"
" wg build\n"
" wg serve\n"
" wg clean\n"
" wg help\n")))
;; ---------------------------------------
;; Arg parsing
;; ---------------------------------------
@ -245,6 +290,7 @@
[:init nil] (init)
[:build nil] (build)
[:serve nil] (serve)
[:clean nil] (clean)))
[:clean nil] (clean)
[:help nil] (help)))
(main arg)

Loading…
Cancel
Save