Merge pull request #4466 from eileenmcnaughton/master
[civicrm-core.git] / tools / bin / scripts / createdoc.sh
1 #!/usr/bin/env bash -v
2
3 # Where are we called from?
4 P=`dirname $0`
5
6 # Current dir
7 ORIGPWD=`pwd`
8
9 # Function to Create Folder where documentation will be generated.
10 create_doc_folder()
11 {
12 cd $ORIGPWD/../
13
14 if [ ! -d "Documentation" ] ; then
15 mkdir Documentation
16 fi
17 }
18
19 create_documentation()
20 {
21 #
22 # folder to be parsed
23 #
24 PARSE_FOLDER=$ORIGPWD/../
25
26 #
27 # target folder (documents will be generated in this folder)
28 #
29 TARGET_FOLDER=$ORIGPWD/../Documentation
30
31 #
32 # title of generated documentation
33 #
34 TITLE="CiviCRM"
35
36 #
37 # parse @internal and elements marked private with @access
38 #
39 PRIVATE=on
40
41 #
42 # JavaDoc-compliant description parsing
43 #
44 JAVADOC_STYLE=off
45
46 #
47 # parse a PEAR-style repository
48 #
49 PEAR_STYLE=on
50
51 #
52 # generate highlighted sourcecode for every parced file
53 #
54 SOURCECODE=on
55
56 #
57 # output information (output:converter:templatedir)
58 #
59 OUTPUT=HTML:frames:phpedit
60
61 phpdoc -t $TARGET_FOLDER -o $OUTPUT -d $PARSE_FOLDER -ti "$TITLE" -pp $PRIVATE -j $JAVADOC_STYLE -p $PEAR_STYLE -s $SOURCECODE
62 }
63
64 # Main Execution Starts Here.
65
66 create_doc_folder
67
68 create_documentation