feature: pages index.

By having an index for the pages, it'd allow clients
to build autocomplete's and show an index of pages
making only one request (think `tldr list`). Subsequent
caching of this file would prevent further requests.

Included is a makefile to easily rebuild the index.
It could be tailored in case the pages structure changed.

In a particular case, the web client would benefit greatly
from an index. It'd know exactly what folder a command is in
and thus the number of requests would drop from 4 to 1.
waldyrious/alt-syntax
Leandro Ostera 2015-03-02 15:21:27 -03:00
parent ad79f8f3d9
commit 21cb9ac9e1
2 changed files with 192 additions and 0 deletions

3
Makefile Normal file
View File

@ -0,0 +1,3 @@
index:
ls -d1 ./pages/**/* | grep .md | awk -F"." '{print $$2}' | awk -F"/" '{print $$4,$$3}' | sort > pages/index.md
@echo "Index rebuilt."

189
pages/index.md Normal file
View File

@ -0,0 +1,189 @@
ab common
ack common
ag common
airport osx
alias common
apropos common
apt-get linux
aptitude linux
ar common
awk common
base64 linux
brew osx
bundle common
caffeinate osx
cal common
cat common
cd common
chmod common
chown common
chsh common
cksum common
convert common
cp common
curl common
cut common
date common
deluser common
df common
diff common
dig common
diskutil osx
dpkg linux
drutil osx
du linux
du osx
echo common
electrum common
emerge linux
env common
exiftool common
fdupes common
ffmpeg common
find common
findmnt linux
firewall-cmd linux
free linux
fswebcam common
gcc common
gem common
gifsicle common
git common
git-add common
git-branch common
git-checkout common
git-clone common
git-commit common
git-diff common
git-init common
git-log common
git-merge common
git-push common
git-stash common
git-status common
gpg common
grep common
gzip common
handbrakecli common
haxelib common
head linux
head osx
iconv common
iostat linux
ip linux
ipcs common
journalctl linux
kill common
less common
ln common
locate linux
locate osx
ls common
lsof common
man common
md5 osx
md5sum linux
mdadm linux
mkdir common
more common
mount common
mp4box common
mtr common
mv common
mysql common
mysqldump common
nc common
netstat linux
networksetup osx
nmap common
node common
nohup common
npm common
open osx
pacman linux
passwd common
patch common
pbcopy osx
pbpaste osx
pgrep common
php common
ping common
pip common
play common
prctl sunos
prstat sunos
ps common
psql common
pushd common
pwd common
qlmanage osx
redis-cli common
rename common
rm common
rmdir common
route osx
rsync common
salt-call common
salt-key common
say osx
scp common
screen common
sed common
sha1sum linux
sha224sum linux
sha256sum linux
sha384sum linux
sha512sum linux
shuf linux
shutdown linux
shutdown osx
sort common
sox common
split common
srm common
ss linux
ssh common
sshfs common
sudo common
svcadm sunos
svccfg sunos
svcs sunos
svn common
sw_vers osx
sysctl osx
system_profiler osx
systemctl linux
systemsetup osx
tail common
tar common
tcpdump common
tcpflow linux
tee common
telnet common
time common
tldr common
tmux common
touch common
traceroute common
tree common
umount common
uname common
unzip common
useradd common
userdel common
userdel linux
usermod common
wacaw osx
wall linux
watch linux
wc common
wget common
which common
wpa_cli linux
xargs linux
xed osx
xsltproc osx
yes common
zfs common
zip common
zpool common