From 4e5a60e6857ae6d43ecc828174840b57adcd9411 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 27 Jun 2014 15:24:10 -0400 Subject: [PATCH] Add script to enable/disable links to translations. --- toggle-lang | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 toggle-lang diff --git a/toggle-lang b/toggle-lang new file mode 100755 index 00000000..c59452d6 --- /dev/null +++ b/toggle-lang @@ -0,0 +1,22 @@ +#!/bin/bash +# Really quick hacky script to comment/uncomment links to translations +# of the GPG guide. + +enc_mode=$1 +enc_lang=$2 + +if [ $enc_mode = 'enable' ] +then + # Regex to match
  • tag with language link + enc_regex="" + # Uncomment it + sed -i "s/$enc_regex/\1/" **/*.html +elif [ $enc_mode = 'disable' ] +then + # Regex to match
  • tag with language link + enc_regex="\(
  • \)" + # Comment it out + sed -i "s/$enc_regex//" **/*.html +else + echo 'Usage: toggle-lang enable|disable ' +fi -- 2.25.1