southerntofu 9b44fe8f5a | ||
---|---|---|
src | ||
.gitignore | ||
Cargo.toml | ||
README.md |
README.md
pad2rfc
pad2rfc is a program to facilitate participation in the tildeverse RFC ecosystem. It downloads pads from an Etherpad Lite instance to a rfcs website's drafts folder.
Practically, it enables tildeverse members to draft RFCs collaboratively on a pad service (bringing history & real-time cooperation) while fitting into personal pages (or tilde pages) for a more friendly and accessible format.
Features
- Configurable Etherpad server (defaults to Riseup's pads)
- Automatic tor support (you can use onion pad services)
- Use a file to list pads to download
Setup
$ git clone https://tildeverse.org/southerntofu/pad2rfc
$ cd pad2rfc
$ cargo build --release
$ cp target/release/pad2rfc ~/bin
Usage
Here lies the manual for pad2rfc. If you're looking for a complete example of how to use it, please head over to the Complete example section.
$ pad2rfc --help
pad2rfc 0.1
southerntofu <southerntofu@thunix.net>
Export a list of Markdown pads to ~RFC drafts
USAGE:
pad2rfc [OPTIONS] [pad]...
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-d, --drafts <drafts> A list of pads for drafts
-o, --output <output> The `tildeverse/rfcs` folder to export the files to
-s, --server <server> Etherpad instance to fetch pads from, in the form of `https://pad.riseup.net`
ARGS:
<pad>... A space-separated list of pad names
Drafts
pad2rfc takes a list of drafts as positional arguments, like so:
$ pad2rfc tildeverse-tor-keep tildeverse-rfc-keep
When the list of drafts is not passed directly, it can be read from a file passed with the -d
(or --drafts
) argument:
$ pad2rfc -d ~/drafts.list
When no drafts are passed with either method, pad2rfc will try to read from the drafts
file in the current directory.
Etherpad instance
The Etherpad instance to fetch the pads from can be passed with a -s
(or --server
) argument. It can be spelled with or without the protocol, and with or without a trailing slash:
$ pad2rfc -s "pad.riseup.net"
$ pad2rfc -s "https://pad.riseup.net/"
Output folder
The output folder can be specified by passing a -o
(or --output
) argument pointing to a rfc.tildeverse.org source repository:
$ git clone https://tildegit.org/tildeverse/rfcs ~/rfcs
$ pad2rfc -o ~/rfcs
The argument may contain a trailing slash.
Complete example
Note: this example actually builds the ~RFC website, which requires to have the zola
static site generator installed;
After having setup pad2rfc, we can download the repository of the ~RFC website:
$ git clone https://tildegit.org/tildeverse/rfcs ~/rfcs
We write a list of pads in a file. Here's my ~/drafts
:
tildeverse-tor-keep
onion-discovery-keep
tildeverse-rfc-keep
We then can use a wrapper script to build the site automagically. Here's my ~/bin/rfc.sh
:
#!/bin/bash
DRAFTS=~/RFC/drafts
RFCDIR=~/RFC/rfcs
WWWDIR=~/public_html
SERVER="http://kfahv6wfkbezjyg4r6mlhpmieydbebr5vkok5r34ya464gqz6c44bnyd.onion"
LOG_FILE=~/RFC/rfc.log
LOG_LEVEL="info"
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
RUST_LOG="${LOG_LEVEL}" pad2rfc -s "${SERVER}" -o ${RFCDIR} -d ${DRAFTS} >> ${LOG_FILE}
cd ${RFCDIR}
git pull >> ${LOG_FILE}
zola build >> ${LOG_FILE}
cp -r public/* ${WWWDIR}
rm -r public/
You may use the script above on your personal account by simply changing the variables according to your setup. For example, if you already have personal pages at the root of your ~/public_html
, you can use WWWDIR=~/public_html/rfc
.
Licence
COPYLEFT 2019. GNU GPLv3 licence. Fuck private property. Long live the commune!