ClickHouse/docs/tools/make_links.sh
Ivan Blinkov 387cbca505
Introduction refactoring + a bunch of docs fixes (#8010)
* Create SECURITY.md

* [experimental] auto-mark documentation PRs with labels

* revert #6544

* Sync RPM packages instructions to other docs languages

* Move tutorial to documentation with old content (for now)

* refactor installation guide a bit

* add ../en/getting_started/index.md

* Rename ya_metrica_task.md

* Rename ya_metrica_task.md

* Refactor Yandex.Metrica dataset description

* WIP on rewriting tutorial

* tmp commit

* lots of docs fixes

* partially revert c136bee4ce

* try to fix docs build in CI

* try to fix docs build in CI

* few minor improvements

* Quick refactoring of last portion of tutorial (not thoroughly tested though)

* fix link
2019-12-05 19:36:51 +03:00

24 lines
605 B
Bash
Executable File

#!/bin/bash
# Fixes missing documentation in other languages
# by putting relative symbolic links to the original doc file.
# This is to be run from root of language directory, like "docs/en".
function do_make_links()
{
langs=(en ru zh ja fa)
src_file="$1"
for lang in "${langs[@]}"
do
# replacing "/./" with /
dst_file="../${lang}${src_file}"
dst_file="${dst_file/\/\.\//\/}"
mkdir -p $(dirname "${dst_file}")
ln -sr "${src_file}" "${dst_file}"
done
}
export -f do_make_links
find . -iname '*.md' -exec /bin/bash -c 'do_make_links "{}"' \;