ClickHouse/docs/tools/make_links.sh
Ivan Blinkov 2e1f6bc56d
[experimental] add "es" docs language as machine translated draft (#9787)
* replace exit with assert in test_single_page

* improve save_raw_single_page docs option

* More grammar fixes

* "Built from" link in new tab

* fix mistype

* Example of include in docs

* add anchor to meeting form

* Draft of translation helper

* WIP on translation helper

* Replace some fa docs content with machine translation

* add normalize-en-markdown.sh

* normalize some en markdown

* normalize some en markdown

* admonition support

* normalize

* normalize

* normalize

* support wide tables

* normalize

* normalize

* normalize

* normalize

* normalize

* normalize

* normalize

* normalize

* normalize

* normalize

* normalize

* normalize

* normalize

* lightly edited machine translation of introdpection.md

* lightly edited machhine translation of lazy.md

* WIP on translation utils

* Normalize ru docs

* Normalize other languages

* some fixes

* WIP on normalize/translate tools

* add requirements.txt

* [experimental] add es docs language as machine translated draft

* remove duplicate script

* Back to wider tab-stop (narrow renders not so well)
2020-03-21 07:11:51 +03:00

25 lines
669 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 es ru zh ja fa)
src_file="$1"
for lang in "${langs[@]}"
do
# replacing "/./" with /
dst_file="../${lang}${src_file}"
dst_file="${dst_file/\/\.\//\/}"
dst_file="${dst_file/${lang}\./${lang}}"
mkdir -p $(dirname "${dst_file}")
ln -sr "${src_file}" "${dst_file}" 2>/dev/null
done
}
export -f do_make_links
find . -iname '*.md' -exec /bin/bash -c 'do_make_links "{}"' \;