diff --git a/docs/manuals/en/new_main_reference/convert.sh b/docs/manuals/en/new_main_reference/convert.sh new file mode 100755 index 00000000000..e07287ae86f --- /dev/null +++ b/docs/manuals/en/new_main_reference/convert.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# pandoc - convert tex to rst + +./tex2rst.sh + +# sed - replace raw-latex with rst + +./replace.sh + +exit diff --git a/docs/manuals/en/new_main_reference/replace.sh b/docs/manuals/en/new_main_reference/replace.sh new file mode 100755 index 00000000000..8aa6e819eec --- /dev/null +++ b/docs/manuals/en/new_main_reference/replace.sh @@ -0,0 +1,136 @@ +#!/bin/bash + +WORKING_DIR="./source/" + +cd $WORKING_DIR + +echo '============================' +echo 'REPLACING RAW-LATEX WITH RST' +echo '============================' + +############################################################################### +# +# Substitutions +# +############################################################################### + +# +# DROP SOME STUFF WHICH IS NO LONGER NEEDED +# + +sed -i 's|:raw-latex:`\\footnotesize`||g' *.rst +sed -i 's|:raw-latex:`\\normalsize`||g' *.rst +sed -i 's|:raw-latex:`\\hfill`||g' *.rst + +# +# General substitutions +# + +sed -i 's#:raw-latex:`\\bareosFd`# \|bareosFd\| #g' *.rst +sed -i 's#:raw-latex:`\\bareosSd`# \|bareosSd\| #g' *.rst +sed -i 's#:raw-latex:`\\bareosDir`# \|bareosDir\| #g' *.rst +sed -i 's#:raw-latex:`\\bareosTraymonitor`# \|bareosTraymonitor\| #g' *.rst +sed -i 's#:raw-latex:`\\bareosWebui`# \|bareosWebui\| #g' *.rst + +sed -i 's#:raw-latex:`\\mysql`# \|mysql\| #g' *.rst +sed -i 's#:raw-latex:`\\postgresql`# \|postgresql\| #g' *.rst +sed -i 's#:raw-latex:`\\sqlite`# \|sqlite\| #g' *.rst +sed -i 's#:raw-latex:`\\vmware`# \|vmware\| #g' *.rst +sed -i 's#:raw-latex:`\\vSphere`# \|vsphere\| #g' *.rst + +# +# Bareos path and filenames +# + +sed -i 's#:raw-latex:`\\fileStoragePath`#*/var/lib/bareos/storage/*#g' *.rst +sed -i 's#:raw-latex:`\\scriptPathUnix`#*/usr/lib/bareos/scripts/*#g' *.rst +sed -i 's#:raw-latex:`\\configPathUnix`#*/etc/bareos/*#g' *.rst +sed -i 's#:raw-latex:`\\configFileDirUnix`#*/etc/bareos/bareos-dir.conf*#g' *.rst +sed -i 's#:raw-latex:`\\configFileSdUnix`#*/etc/bareos/bareos-sd.conf*#g' *.rst +sed -i 's#:raw-latex:`\\configFileFdUnix}`#*/etc/bareos/bareos-fd.conf*#g' *.rst +sed -i 's#:raw-latex:`\\configFileBconsoleUnix}`#*/etc/bareos/bconsole.conf*#g' *.rst +sed -i 's#:raw-latex:`\\configFileTrayMonitorUnix`#*/etc/bareos/tray-monitor.conf*#g' *.rst +sed -i 's#:raw-latex:`\\configFileBatUnix`#*/etc/bareos/bat.conf*#g' *.rst +sed -i 's#:raw-latex:`\\configDirectoryDirUnix`#*/etc/bareos/bareos-dir.d/*#g' *.rst +sed -i 's#:raw-latex:`\\configDirectorySdUnix`#*/etc/bareos/bareos-sd.d/*#g' *.rst +sed -i 's#:raw-latex:`\\configDirectoryFdUnix`#*/etc/bareos/bareos-fd.d/*#g' *.rst +sed -i 's#:raw-latex:`\\configDirectoryBconsoleUnix`#*/etc/bareos/bconsole.d/*#g' *.rst +sed -i 's#:raw-latex:`\\configDirectoryTrayMonitorUnix`#*/etc/bareos/tray-monitor.d/*#g' *.rst +sed -i 's#:raw-latex:`\\logfileUnix`#*/var/log/bareos/bareos.log*#g' *.rst +sed -i 's#:raw-latex:`\\yeno`#yes\\|no#g' *.rst + +# +# General +# + +sed -i 's|:raw-latex:`\\command{bconsole}`|:command:`bconsole`|g' *.rst +sed -i -E 's|:raw-latex:`\\command\{(.*)\}`|:command:`\1`|g' *.rst +sed -i -E 's|:raw-latex:`\\bcommand\{(.*)\}\{(.*)\}`|:command:`\1 \2`|g' *.rst + +sed -i -E 's|:raw-latex:`\\file\{(.*)\}`|*\1*|g' *.rst +sed -i -E 's|:raw-latex:`\\directory\{(.*)\}`|*\1*|g' *.rst +#sed -i -E 's#:raw-latex:`\\path\|(.*)\|`#*\1*#g' *.rst + +sed -i 's/:raw-latex:`\\textbar`/ \\| /g' *.rst +sed -i 's/:raw-latex:`\\textbar{}`/ \\| /g' *.rst + +sed -i -E 's|:raw-latex:`\\user\{(.*)\}`|**\1**|g' *.rst +sed -i -E 's|:raw-latex:`\\group\{(.*)\}`|**\1**|g' *.rst + +sed -i -E 's|:raw-latex:`\\parameter\{(.*)\}`|**\1**|g' *.rst +sed -i -E 's|:raw-latex:`\\argument\{(.*)\}`|**\1**|g' *.rst +sed -i -E 's|:raw-latex:`\\variable\{(.*)\}`|**\1**|g' *.rst + + +sed -i -E 's|:raw-latex:`\\sinceVersion\{(.*)\}\{(.*)\}\{(.*)\}`|\3|g' *.rst + +sed -i -E 's|:raw-latex:`\\job\{(.*)\}`|**\1**|g' *.rst +sed -i -E 's|:raw-latex:`\\fileset\{(.*)\}`|**\1**|g' *.rst + +sed -i -E 's|:raw-latex:`\\name\{(.*)\}`|**\1**|g' *.rst + +sed -i -E 's|:raw-latex:`\\host\{(.*)\}`|**\1**|g' *.rst + +sed -i -E 's|:raw-latex:`\\email\{(.*)\}`|**\1**|g' *.rst + +sed -i -E 's|:raw-latex:`\\package\{(.*)\}`|**\1**|g' *.rst + +sed -i -E 's|:raw-latex:`\\pool\{(.*)\}`|**\1**|g' *.rst +sed -i -E 's|:raw-latex:`\\volumestatus\{(.*)\}`|**\1**|g' *.rst + +sed -i -E 's|:raw-latex:`\\trademark\{(.*)\}`|*\1*|g' *.rst + +# +# INDEX +# + +sed -i -E 's|:raw-latex:`\\index\[general\]\{(.*)!(.*)\}`|\n.. index:: \n triple: General; \1; \2|g' *.rst +sed -i -E 's|:raw-latex:`\\index\[general\]\{(.*)\}`|.. index:: General; \1 |g' *.rst +sed -i -E 's|:raw-latex:`\\index\[sd\]\{(.*)\}`|.. index:: SD; \1 |g' *.rst + +# +# LABEL AND REFERENCES +# + +sed -i -E 's|:raw-latex:`\\label\{(.*)\}`|.. _\1: \1|g' *.rst + +sed -i -E 's|:raw-latex:`\\nameref\{(.*)\}`|:ref:`\1`|g' *.rst + +sed -i -E 's|:raw-latex:`\\elink\{(.*)\}\{(.*)\}`|:ref:`\1 \2`|g' *.rst + +sed -i -E 's|:raw-latex:`\\ilink\{(.*)\}\{(.*)\}`|:ref:`\2 \1`|g' *.rst + +# +# Warnings +# + +sed -i -E 's|:raw-latex:`\\warning\{(.*)\}`|\n.. warning:: \n \1|g' *.rst + +# +# IMAGES (JUST A FEW, SO MAYBE MANUALLY) +# + +echo "DONE!!" + +exit + diff --git a/docs/manuals/en/new_main_reference/tex2rst.sh b/docs/manuals/en/new_main_reference/tex2rst.sh new file mode 100755 index 00000000000..dd1901bd960 --- /dev/null +++ b/docs/manuals/en/new_main_reference/tex2rst.sh @@ -0,0 +1,198 @@ +#!/bin/bash + +ORIGIN_DIR="../main/" +TARGET_DIR="./source/" + +echo '===========================' +echo 'Converting tex files to rst' +echo '===========================' + +############################################################################### +# +# Prepare tex files to avoid pandoc errors +# +############################################################################### + +# todo (maybe) + +############################################################################### +# +# CONVERT +# +############################################################################### + +### INTRODUCTION AND TUTORIAL + +echo 'general.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}general.tex -o ${TARGET_DIR}general.rst + +echo 'state.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}state.tex -o ${TARGET_DIR}state.rst + +echo 'install.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}install.tex -o ${TARGET_DIR}install.rst + +echo 'webui.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}webui.tex -o ${TARGET_DIR}webui.rst + +echo 'update.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}update.tex -o ${TARGET_DIR}update.rst + +echo 'quickstart.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}quickstart.tex -o ${TARGET_DIR}quickstart.rst + +echo 'tutorial.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}tutorial.tex -o ${TARGET_DIR}tutorial.rst + +echo 'critical.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}critical.tex -o ${TARGET_DIR}critical.rst + +### CONFIGURATION + +echo 'configure.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}configure.tex -o ${TARGET_DIR}configure.rst + +echo 'dirdconf.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}dirdconf.tex -o ${TARGET_DIR}dirdconf.rst + +echo 'storedconf.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}storedconf.tex -o ${TARGET_DIR}storedconf.rst + +echo 'filedconf.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}filedconf.tex -o ${TARGET_DIR}filedconf.rst + +echo 'messagesres.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}messagesres.tex -o ${TARGET_DIR}messagesres.rst + +echo 'consoleconf.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}consoleconf.tex -o ${TARGET_DIR}consoleconf.rst + +echo 'monitorconf.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}monitorconf.tex -o ${TARGET_DIR}monitorconf.rst + +### TASKS AND CONCEPTS + +echo 'bconsole.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}bconsole.tex -o ${TARGET_DIR}bconsole.rst + +echo 'restore.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}restore.tex -o ${TARGET_DIR}restore.rst + +### VOLUME MANAGEMENT + +echo 'disk.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}disk.tex -o ${TARGET_DIR}disk.rst + +echo 'recycling.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}recycling.tex -o ${TARGET_DIR}recycling.rst + +echo 'pools.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}pools.tex -o ${TARGET_DIR}pools.rst + +echo 'autochangers.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}autochangers.tex -o ${TARGET_DIR}autochangers.rst + +echo 'tape-without-autochanger.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}tape-without-autochanger.tex -o ${TARGET_DIR}tape-without-autochanger.rst + +echo 'spooling.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}spooling.tex -o ${TARGET_DIR}spooling.rst + +echo 'migration.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}migration.tex -o ${TARGET_DIR}migration.rst + +echo 'always-incremental.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}always-incremental.tex -o ${TARGET_DIR}always-incremental.rst + +echo 'basejob.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}basejob.tex -o ${TARGET_DIR}basejob.rst + +echo 'plugin.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}plugins.tex -o ${TARGET_DIR}plugins.rst + +echo 'win32.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}win32.tex -o ${TARGET_DIR}win32.rst + +### NETWORK SETUP + +echo 'client-initiated-connection.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}client-initiated-connection.tex -o ${TARGET_DIR}client-initiated-connection.rst + +echo 'passiveclient.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}passiveclient.tex -o ${TARGET_DIR}passiveclient.rst + +echo 'lanaddress.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}lanaddress.tex -o ${TARGET_DIR}lanaddress.rst + +echo 'tls.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}tls.tex -o ${TARGET_DIR}tls.rst + +echo 'dataencryption.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}dataencryption.tex -o ${TARGET_DIR}dataencryption.rst + +### NDMP BACKUPS WITH BAREOS + +echo 'ndmp.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}ndmp.tex -o ${TARGET_DIR}ndmp.rst + +echo 'catmaintenance.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}catmaintenance.tex -o ${TARGET_DIR}catmaintenance.rst + +echo 'security.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}security.tex -o ${TARGET_DIR}security.rst + +### APPENDIX + +# A +echo 'requirements.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}requirements.tex -o ${TARGET_DIR}requirements.rst + +# B +echo 'supportedoses.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}supportedoses.tex -o ${TARGET_DIR}supportedoses.rst + +# C +echo 'programs.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}programs.tex -o ${TARGET_DIR}programs.rst + +# D +echo 'bootstrap.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}bootstrap.tex -o ${TARGET_DIR}bootstrap.rst + +# E +echo 'verify.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}verify.tex -o ${TARGET_DIR}verify.rst + +# F +echo 'backward-compability.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}backward-compability.tex -o ${TARGET_DIR}backward-compatibility.rst + +# G +echo 'tables.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}tables.tex -o ${TARGET_DIR}tables.rst + +# H +echo 'howto.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}howto.tex -o ${TARGET_DIR}howto.rst + +# I +echo 'rescue.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}rescue.tex -o ${TARGET_DIR}rescue.rst + +# J +echo 'troubleshooting.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}troubleshooting.tex -o ${TARGET_DIR}troubleshooting.rst + +# K +echo 'debug.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}debug.tex -o ${TARGET_DIR}debug.rst + +# L +echo 'releasenotes.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}releasenotes.tex -o ${TARGET_DIR}releasenotes.rst + +# M +echo 'license.tex' +pandoc --verbose -f latex+raw_tex -t rst ${ORIGIN_DIR}license.tex -o ${TARGET_DIR}license.rst + +exit