From 8b7f95ae74538150a261f0ba2bfde07024294d24 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sun, 22 Sep 2019 23:07:21 -0400 Subject: [PATCH] switch to a makefile and update contribution instructions --- wiki/Makefile | 22 ++++++++++++ wiki/README.md | 12 ++++--- wiki/Safe-Scripting-the-Tilde-Way.md | 52 ---------------------------- wiki/build-wiki.sh | 18 ---------- wiki/source/wiki.md | 14 +++++--- 5 files changed, 38 insertions(+), 80 deletions(-) create mode 100644 wiki/Makefile delete mode 100644 wiki/Safe-Scripting-the-Tilde-Way.md delete mode 100755 wiki/build-wiki.sh diff --git a/wiki/Makefile b/wiki/Makefile new file mode 100644 index 0000000..28584f7 --- /dev/null +++ b/wiki/Makefile @@ -0,0 +1,22 @@ +SRC_MD_FILES != find source -name '*.md' +DST_HTML_FILES := $(SRC_MD_FILES:source/%.md=%.html) + +PANDOC != command -v pandoc 2> /dev/null + +all: $(DST_HTML_FILES) + +%.html: source/%.md + $(PANDOC) \ + --template wiki.tmpl \ + --lua-filter header-permalinks.lua \ + --title-prefix "tilde.club wiki" \ + --standalone \ + --table-of-contents \ + --output $@ \ + $< + +clean: + rm *.html + +.PHONY: clean + diff --git a/wiki/README.md b/wiki/README.md index c6035d2..ba972cc 100644 --- a/wiki/README.md +++ b/wiki/README.md @@ -1,10 +1,12 @@ # tilde.club wiki -to write an article, make a markdown file in source/ and fill out the appropriate -metadata keys (see source/ssh.md). +to write an article, make a markdown file in source/ and fill out the +appropriate metadata keys. only title and author are required. -run - ./build-wiki.sh +to build the wiki pages, just run `make`. the resulting html files will +not be tracked in this repo. -before committing, and open a PR! +open a PR with your changes! feel free to send a patch with +[git-send-email(1)](https://git-send-email.io) to root@tilde.club if you prefer +that workflow. diff --git a/wiki/Safe-Scripting-the-Tilde-Way.md b/wiki/Safe-Scripting-the-Tilde-Way.md deleted file mode 100644 index b89eee8..0000000 --- a/wiki/Safe-Scripting-the-Tilde-Way.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: safe scripting the tilde way -author: michaelcoyote ---- - -Welcome to tilde.club. For many of you this may be your first multi-user host and for even more of you this may be your *first* host. Welcome to all of you. - -Whether you are used to Unix, Linux and programming or a complete beginner please consider this an invitation to create and build new things. - -It's important when creating however that we respect the shared environment and that we respect the boundaries of others. - -As Paul says: - -> no drama. be respectful. have fun. - -What does that mean with respect to scripting and programming on a shared host? - -- DOs - - Respect shared CPU/Disk/Network resources - - Keep things that require a tilde.club login local to the server (don't post publicly) : - - Finger info - - local home directory files such as `~/.plan` and `~/.profile` files - - Note that exceptions could include an opt-in file or special permissions from the user. - - Respect `robots.txt` when writing web crawlers - -In short use your common sense and consider how your actions may affect others. - -If you are unsure if something is a good idea or not, head to irc or message using the `wall` command and ask others what they think. - -If you want a conclusive answer, contact one of the system operators. - -##### Thinking privacy - -Consider the source of the data. - -E.g. We know that finger data might contain personal data such as phone numbers, and other identifying information and is not generally available without a tilde.club login. - -Before exposing data such as this to the world, it should check for an opt in file such as the .public file file test before presenting info to the outside world. - -#### Shared Resources - -- In general - - Consider executing long running processes during overnight hours when fewer users are on the system -- CPU - - Use the `nice` command to keep intensive processes from affecting others - - The `nice -n19 -p$$` placed in a script will make sure it runs at the lowest priority. - - Run a long command at the lowest CPU priority: `nice -n 19 ~/bin/command` - - Change the priority of process 923 (also known as "re-nicing a process") : `renice -17 -p923` -- Disk - - On any commands that will heavily use disk, consider using the `ionice` command so that scripts will not affect interactive users - - By adding the `ionice -c3 -p$$` command to any script, it will only use disk when idle. - - You can also run a command or script: `ionice -c3 -t ~/bin/command` diff --git a/wiki/build-wiki.sh b/wiki/build-wiki.sh deleted file mode 100755 index 2b46002..0000000 --- a/wiki/build-wiki.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -printf "removing previous html build artifacts" -rm *.html - -for page in source/*.md; do - pagename=$(basename $page ".md") - printf "building %s wiki article\n" "$pagename" - - pandoc \ - --toc \ - --template wiki.tmpl \ - --lua-filter header-permalinks.lua \ - -T "tilde.club wiki | " \ - -o "$pagename.html" \ - "source/$pagename.md" -done - diff --git a/wiki/source/wiki.md b/wiki/source/wiki.md index 93e2894..e3e32c0 100644 --- a/wiki/source/wiki.md +++ b/wiki/source/wiki.md @@ -3,15 +3,19 @@ title: how to contribute to this wiki author: benharri --- +## got a topic you want to write about? + +or maybe you just found a typo on one of the existing pages! + +follow these steps to submit a change. + 1. grab a copy of the site's source code git clone https://github.com/tildeclub/site tilde.club && cd tilde.club/wiki -1. make a new article or update an existing one (only change the markdown - source) - -1. generate the wiki pages. you need to be in the wiki directory. - run `./build-wiki.sh` to create the html. +1. make a new article or update an existing one. make sure that you create the + title and author keys in the yaml frontmatter (see an existing article for + an example) 1. submit the code via a PR on github or with git-send-email(1) to root@tilde.chat see [git-send-email.io](https://git-send-email.io) for more info on how to use