File: kdedoc

package info (click to toggle)
kde-dev-scripts 4%3A18.08.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,496 kB
  • sloc: perl: 15,466; lisp: 5,627; sh: 4,157; python: 3,892; ruby: 2,158; makefile: 16; sed: 9
file content (48 lines) | stat: -rwxr-xr-x 1,720 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
# Run from command line, to open a kde help page in kfm/konqueror
# Argument : The classname (case sensitive !).
# Both doxygen and kdoc docs are supported.

# You can edit this line to set the directory holding your KDE docs, or you
# can use the environment variable KDEDOCS to avoid future conflicts with this
# file if the default changes.
KDEDOCS=${KDEDOCS:-"$KDEDIR/share/doc/HTML/en/kdelibs-apidocs"}

if [ $# = 1 ]; then
  if [ -e "$KDEDOCS/doxygen.css" ]; then
    # Docs are laid out in doxygen style.
    if [ -f "$KDEDOCS/class$1.html" ]; then
      kfmclient exec "$KDEDOCS/class$1.html"
    elif [ -f "$KDEDOCS"/*/html/"class$1.html" ]; then
      kfmclient exec "$KDEDOCS"/*/html/"class$1.html"
    else
      classstring=`echo "$1" | sed -e 's/::/_1_1/'`
      if [ -f "$KDEDOCS/class$classstring.html" ]; then
        kfmclient exec "$KDEDOCS/class$classstring.html"
      elif [ -f "$KDEDOCS"/*/html/"class$classstring.html" ]; then
        kfmclient exec "$KDEDOCS"/*/html/"class$classstring.html"
      elif [ -f "$KDEDOCS"/class*_1_1"$1.html" ]; then
        kfmclient exec "$KDEDOCS"/class*_1_1"$1.html"
      elif [ -f "$KDEDOCS"/*/html/class*_1_1"$1.html" ]; then
        kfmclient exec "$KDEDOCS"/*/html/class*_1_1"$1.html"
      else
        echo "No class $1 in $KDEDOCS/*"
        exit 1
      fi
    fi
  elif [ -e "$KDEDOCS/kdecore/index.html" ]; then
    # Docs are laid out in kdoc style.
    if [ -f "$KDEDOCS"/*/"$1.html" ]; then
      kfmclient exec "$KDEDOCS"/*/"$1.html"
    else
      echo "No class $1 in $KDEDOCS/*"
      exit 1
    fi
  else
    echo "$KDEDOCS does not appear to contain your KDE docs."
    exit 1
  fi
else
  echo "Usage : $0 <classname>"
  exit 1
fi