switch to a makefile and update contribution instructions

This commit is contained in:
Ben Harris 2019-09-22 23:07:21 -04:00
parent 19c91c4033
commit 8b7f95ae74
Signed by: ben
GPG Key ID: 4E0AF802FFF7960C
5 changed files with 38 additions and 80 deletions

22
wiki/Makefile Normal file
View File

@ -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

View File

@ -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.

View File

@ -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`

View File

@ -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

View File

@ -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