ClickHouse/docs/tools/easy_edit.sh
Ivan Blinkov bff05fa7ff
Some international docs improvements (#3320)
* s/ch/zh/g as it is the correct ISO code

* Add new languages to easy_edit.sh

* Better site_name in docs

* Fix a bunch of links in zh docs

* remove extra trailing slashes
2018-10-08 18:51:16 +03:00

28 lines
675 B
Bash
Executable File

#!/usr/bin/env bash
# Creates symlinks to docs in ClickHouse/docs/edit/
# that are easy to open in both languages simultaneously
# for example, with `vim -O docs/edit/my_article/*`
set -ex
BASE_DIR="$(dirname $(readlink -f $0))/.."
DOCS_DIR="${BASE_DIR}"
EDIT_DIR="${BASE_DIR}/edit"
pushd "${DOCS_DIR}/en"
ARTICLES=$(find . -name '*.md' | sed -e 's/\.md$//g' -e 's/^\.\/en\///g')
popd
rm -rf "${EDIT_DIR}" || true
for DOCS_LANG in en ru zh fa
do
for ARTICLE in ${ARTICLES}
do
ARTICLE_DIR="${EDIT_DIR}/${ARTICLE}"
mkdir -p $ARTICLE_DIR || true
ln -s "${DOCS_DIR}/${DOCS_LANG}/${ARTICLE}.md" "${ARTICLE_DIR}/${DOCS_LANG}.md"
done
done