hide_emails.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. #
  3. # description: Mangle email addresses in the HTML documentation
  4. # author: Kai Vehmanen <kai.vehmanen@nokia.com>
  5. # version: 20050908-3
  6. #
  7. # --------------------------------------------------------------------
  8. #
  9. # This file is part of the Sofia-SIP package
  10. #
  11. # Copyright (C) 2005 Nokia Corporation.
  12. #
  13. # Contact: Pekka Pessi <pekka.pessi@nokia.com>
  14. #
  15. # This library is free software; you can redistribute it and/or
  16. # modify it under the terms of the GNU Lesser General Public License
  17. # as published by the Free Software Foundation; either version 2.1 of
  18. # the License, or (at your option) any later version.
  19. #
  20. # This library is distributed in the hope that it will be useful, but
  21. # WITHOUT ANY WARRANTY; without even the implied warranty of
  22. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  23. # Lesser General Public License for more details.
  24. #
  25. # You should have received a copy of the GNU Lesser General Public
  26. # License along with this library; if not, write to the Free Software
  27. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  28. # 02110-1301 USA
  29. #
  30. # --------------------------------------------------------------------
  31. echo "Postprocessing HTML in ${1:-.}: hiding email addresses, fixing links"
  32. find ${1:-.} -name '*.html' -print0 |
  33. xargs -0 \
  34. sed -r -i '
  35. # Hide e-mail addresses
  36. s/([:>;][a-z][-a-z.]*)(@[a-z][a-z]*)\.[a-z][a-z]*(["<\&])/\1\2-email.address.hidden\3/gi;
  37. # Fix cross-module links
  38. s!doxygen="([a-z]*).doxytags:../\1/" href="../\1/\1_index.html"!doxygen="\1.doxytags:../\1/" href="../\1/index.html"!g;
  39. '