| 1 | Documentation tips |
| 2 | |
| 3 | ## Change an URL in all files with Perl |
| 4 | |
| 5 | For example this url "https://docs.kde.org/trunk5/en/kdeedu/marble/index.html" is not working anymore, we want to redirect to "https://marble.kde.org/" which is working. |
| 6 | |
| 7 | Perl syntax is `perl -pi -e 's/before/after/g' file` |
| 8 | |
| 9 | So we need to use that for several files: |
| 10 | - English quickstart |
| 11 | - English overview |
| 12 | - translated quickstarts and overviews |
| 13 | |
| 14 | To fix the url in English files, do the following : |
| 15 | |
| 16 | ```perl -pi -e 's/docs\.kde\.org\/trunk5\/en\/kdeedu\/marble\/index.html/marble\.kde\.org/' doc/quickstart/*``` |
| 17 | |
| 18 | ```perl -pi -e 's/docs\.kde\.org\/trunk5\/en\/kdeedu\/marble\/index.html/marble\.kde\.org/' doc/overview/*``` |
| 19 | |
| 20 | For the translations do this: |
| 21 | |
| 22 | ```perl -pi -e 's/docs\.kde\.org\/trunk5\/en\/kdeedu\/marble\/index.html/marble\.kde\.org/' locale/*/LC_MESSAGES/quickstart/*``` |
| 23 | |
| 24 | ```perl -pi -e 's/docs\.kde\.org\/trunk5\/en\/kdeedu\/marble\/index.html/marble\.kde\.org/' locale/*/LC_MESSAGES/overview/*``` |