| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function texinfo_createChapter { |
| |
| |
| |
| |
| |
| |
| if [[ -d $MANUAL_CHAPTER_DIR ]];then |
| return |
| else |
| cli_printMessage "`gettext "The following documentation chapter will be created:"`" |
| cli_printMessage "${MANUAL_CHAPTER_DIR}" --as-response-line |
| cli_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line |
| fi |
| |
| |
| local MANUAL_CHAPTER_NODE='' |
| local MANUAL_CHAPTER_TITLE='' |
| local MANUAL_CHAPTER_CIND='' |
| |
| |
| cli_printMessage "`gettext "Chapter Title"`" --as-request-line |
| read MANUAL_CHAPTER_TITLE |
| |
| |
| MANUAL_CHAPTER_NODE=$(texinfo_getEntryNode "$MANUAL_CHAPTER_NAME") |
| MANUAL_CHAPTER_CIND=$(texinfo_getEntryIndex "$MANUAL_CHAPTER_TITLE") |
| MANUAL_CHAPTER_TITLE=$(texinfo_getEntryTitle "$MANUAL_CHAPTER_TITLE") |
| |
| |
| cli_printMessage "-" --as-separator-line |
| cli_printMessage "`gettext "Creating chapter files."`" --as-response-line |
| |
| |
| |
| local FILE='' |
| local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}/Chapters" \ |
| --maxdepth='1' \ |
| --pattern="chapter(-menu|-nodes)?\.${MANUAL_EXTENSION}") |
| |
| |
| |
| if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then |
| svn mkdir ${MANUAL_CHAPTER_DIR} --quiet |
| fi |
| |
| |
| for FILE in $FILES;do |
| |
| |
| |
| |
| |
| cli_checkFiles ${FILE} -wn |
| |
| |
| svn cp ${FILE} ${MANUAL_CHAPTER_DIR} --quiet |
| |
| done |
| |
| |
| |
| |
| |
| MANUAL_CHAPTER_NODE=$(echo "$MANUAL_CHAPTER_NODE" | sed -r 's/\//\\\//g') |
| MANUAL_CHAPTER_CIND=$(echo "$MANUAL_CHAPTER_CIND" | sed -r 's/\//\\\//g') |
| MANUAL_CHAPTER_TITLE=$(echo "$MANUAL_CHAPTER_TITLE" | sed -r 's/\//\\\//g') |
| MANUAL_CHAPTER_NAME=$(echo "$MANUAL_CHAPTER_NAME" | sed -r 's/\//\\\//g') |
| |
| |
| sed -i -r \ |
| -e "s/=CHAPTER_NODE=/${MANUAL_CHAPTER_NODE}/" \ |
| -e "s/=CHAPTER_TITLE=/${MANUAL_CHAPTER_TITLE}/" \ |
| -e "s/=CHAPTER_CIND=/${MANUAL_CHAPTER_CIND}/" \ |
| -e "s/=CHAPTER_NAME=/${MANUAL_CHAPTER_NAME}/" \ |
| ${MANUAL_CHAPTER_DIR}/chapter.${MANUAL_EXTENSION} |
| |
| |
| |
| |
| |
| |
| |
| echo "" > ${MANUAL_CHAPTER_DIR}/chapter-nodes.${MANUAL_EXTENSION} |
| |
| |
| cli_printMessage "`gettext "Updating chapter menu and nodes inside manual structure."`" --as-response-line |
| |
| |
| |
| texinfo_updateChapterMenu |
| texinfo_updateChapterNodes |
| |
| } |