From e8238b130d85e54f5d4f47911f4913740be7e9e4 Mon Sep 17 00:00:00 2001 From: Zhang Huangbin Date: Sun, 21 Sep 2014 12:59:56 +0800 Subject: [PATCH] Generate SUMMARY.md for gitbook.io. --- README.md | 12 ----------- SUMMARY.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ convert.sh | 17 ++++++++++------ 3 files changed, 71 insertions(+), 18 deletions(-) create mode 100644 SUMMARY.md diff --git a/README.md b/README.md index c7e42e50..641184c8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ - # How to - * [Allow user to send email without authentication ](src/default/4-howto/allow.user.to.send.email.without.authentication.md) * [Amavisd + SpamAssassin not working, no mail header (X-Spam-*) inserted.](src/default/4-howto/amavisd.no.x-spam.headers.md) * [Completely disable Amavisd + ClamAV + SpamAssassin](src/default/4-howto/completely.disable.amavisd.clamav.spamassassin.md) @@ -18,26 +16,16 @@ * [SQL: Create an mail alias account with SQL command line ](src/default/4-howto/sql.create.mail.alias.md) * [Store SpamAssassin bayes in SQL](src/default/4-howto/store.spamassassin.bayes.in.sql.md) * [Perform silent/unattended iRedMail installation](src/default/4-howto/unattended.iredmail.installation.md) - # Third-party integrations. - * [How to install SOGo on CentOS 6 with iRedMail (MySQL backend)](src/default/5-integrations/sogo-centos-6-mysql.md) - # Cluster solutions - * [An Ultra-HA, full Mult-Master E-mail cluster with iRedMail, MariaDB, and IPVS ](src/default/6-cluster/full.mult-master.iredmail.cluster.with.mariadb.and.ipvs.md) - # Backup and Restore - * [How to migrate old iRedMail server to the latest stable release](src/default/7-backup-restore/migrate.to.new.iredmail.server.md) - # Troubleshooting and Debug - * [Turn on debug mode in Amavisd ](src/default/9-troubleshooting/turn.on.debug.mode.in.amavisd.md) * [Turn on debug mode in Dovecot](src/default/9-troubleshooting/turn.on.debug.mode.in.dovecot.md) * [Turn on debug mode in OpenLDAP ](src/default/9-troubleshooting/turn.on.debug.mode.in.openldap.md) - # Frequently Asked Questions - * [Password hashes](src/default/99-faq/password.hashes.md) * [Why append timestamp in maildir path](src/default/99-faq/why.append.timestamp.in.maildir.path.md) diff --git a/SUMMARY.md b/SUMMARY.md new file mode 100644 index 00000000..26039721 --- /dev/null +++ b/SUMMARY.md @@ -0,0 +1,60 @@ +# How to +* [Allow user to send email without authentication ](4-howto/allow.user.to.send.email.without.authentication.md) +* [Amavisd + SpamAssassin not working, no mail header (X-Spam-*) inserted.](4-howto/amavisd.no.x-spam.headers.md) +* [Completely disable Amavisd + ClamAV + SpamAssassin](4-howto/completely.disable.amavisd.clamav.spamassassin.md) +* [Configure Thunderbird as mail client (IMAP, SMTP and global ldap address book)](4-howto/configure.thunderbird.md) +* [Disable spam virus scanning for outgoing mails](4-howto/disable.spam.virus.scanning.for.outgoing.mails.md) +* [Enable SMTPS service (SMTP over SSL, port 465)](4-howto/enable.smtps.md) +* [LDAP: Add an alias domain ](4-howto/ldap.add.alias.domain.md) +* [LDAP: Add a mail alias account ](4-howto/ldap.add.mail.alias.md) +* [LDAP: Add a mail list account ](4-howto/ldap.add.mail.list.md) +* [LDAP: User mail forwarding. ](4-howto/ldap.user.mail.forwarding.md) +* [Pipe incoming email for certain user to external script ](4-howto/pipe.incoming.email.for.certain.user.to.external.script.md) +* [Quarantine clean mail into SQL database](4-howto/quarantining.clean.mail.md) +* [Force Dovecot to recalculate mailbox quota ](4-howto/recalculate.mailbox.quota.md) +* [SQL: Create an mail alias account with SQL command line ](4-howto/sql.create.mail.alias.md) +* [Store SpamAssassin bayes in SQL](4-howto/store.spamassassin.bayes.in.sql.md) +* [Perform silent/unattended iRedMail installation](4-howto/unattended.iredmail.installation.md) +# Third-party integrations. +* [How to install SOGo on CentOS 6 with iRedMail (MySQL backend)](5-integrations/sogo-centos-6-mysql.md) +# Cluster solutions +* [An Ultra-HA, full Mult-Master E-mail cluster with iRedMail, MariaDB, and IPVS ](6-cluster/full.mult-master.iredmail.cluster.with.mariadb.and.ipvs.md) +# Backup and Restore +* [How to migrate old iRedMail server to the latest stable release](7-backup-restore/migrate.to.new.iredmail.server.md) +# Troubleshooting and Debug +* [Turn on debug mode in Amavisd ](9-troubleshooting/turn.on.debug.mode.in.amavisd.md) +* [Turn on debug mode in Dovecot](9-troubleshooting/turn.on.debug.mode.in.dovecot.md) +* [Turn on debug mode in OpenLDAP ](9-troubleshooting/turn.on.debug.mode.in.openldap.md) +# Frequently Asked Questions +* [Password hashes](99-faq/password.hashes.md) +* [Why append timestamp in maildir path](99-faq/why.append.timestamp.in.maildir.path.md) +# How to +* [Allow user to send email without authentication ](howto/allow.user.to.send.email.without.authentication.md) +* [Amavisd + SpamAssassin not working, no mail header (X-Spam-*) inserted.](howto/amavisd.no.x-spam.headers.md) +* [Completely disable Amavisd + ClamAV + SpamAssassin](howto/completely.disable.amavisd.clamav.spamassassin.md) +* [Configure Thunderbird as mail client (IMAP, SMTP and global ldap address book)](howto/configure.thunderbird.md) +* [Disable spam virus scanning for outgoing mails](howto/disable.spam.virus.scanning.for.outgoing.mails.md) +* [Enable SMTPS service (SMTP over SSL, port 465)](howto/enable.smtps.md) +* [LDAP: Add an alias domain ](howto/ldap.add.alias.domain.md) +* [LDAP: Add a mail alias account ](howto/ldap.add.mail.alias.md) +* [LDAP: Add a mail list account ](howto/ldap.add.mail.list.md) +* [LDAP: User mail forwarding. ](howto/ldap.user.mail.forwarding.md) +* [Pipe incoming email for certain user to external script ](howto/pipe.incoming.email.for.certain.user.to.external.script.md) +* [Quarantine clean mail into SQL database](howto/quarantining.clean.mail.md) +* [Force Dovecot to recalculate mailbox quota ](howto/recalculate.mailbox.quota.md) +* [SQL: Create an mail alias account with SQL command line ](howto/sql.create.mail.alias.md) +* [Store SpamAssassin bayes in SQL](howto/store.spamassassin.bayes.in.sql.md) +* [Perform silent/unattended iRedMail installation](howto/unattended.iredmail.installation.md) +# Third-party integrations. +* [How to install SOGo on CentOS 6 with iRedMail (MySQL backend)](integrations/sogo-centos-6-mysql.md) +# Cluster solutions +* [An Ultra-HA, full Mult-Master E-mail cluster with iRedMail, MariaDB, and IPVS ](cluster/full.mult-master.iredmail.cluster.with.mariadb.and.ipvs.md) +# Backup and Restore +* [How to migrate old iRedMail server to the latest stable release](backup-restore/migrate.to.new.iredmail.server.md) +# Troubleshooting and Debug +* [Turn on debug mode in Amavisd ](troubleshooting/turn.on.debug.mode.in.amavisd.md) +* [Turn on debug mode in Dovecot](troubleshooting/turn.on.debug.mode.in.dovecot.md) +* [Turn on debug mode in OpenLDAP ](troubleshooting/turn.on.debug.mode.in.openldap.md) +# Frequently Asked Questions +* [Password hashes](faq/password.hashes.md) +* [Why append timestamp in maildir path](faq/why.append.timestamp.in.maildir.path.md) diff --git a/convert.sh b/convert.sh index 2d8191d2..bf66bf52 100644 --- a/convert.sh +++ b/convert.sh @@ -15,6 +15,7 @@ SOURCE_DIR="${PWD}/src" OUTPUT_DIR="${PWD}/html" INDEX_MD="${OUTPUT_DIR}/index.md" README_MD="${PWD}/README.md" +GITBOOK_MD="${PWD}/SUMMARY.md" [ -d ${OUTPUT_DIR} ] || mkdir -p ${OUTPUT_DIR} @@ -63,12 +64,14 @@ for chapter_dir in ${all_chapter_dirs}; do if [ -f ${_title_md} ]; then # generate index info of chapter _chapter_title="$(cat ${_title_md})" - echo -e "\n# ${_chapter_title}\n" >> ${INDEX_MD} - echo -e "\n# ${_chapter_title}\n" >> ${README_MD} + echo -e "# ${_chapter_title}" >> ${INDEX_MD} + echo -e "# ${_chapter_title}" >> ${README_MD} + echo -e "# ${_chapter_title}" >> ${GITBOOK_MD} if [ -f ${_summary_md} ]; then - echo -e "\n\n$(cat ${_title_md})\n\n" >> ${INDEX_MD} - echo -e "\n\n$(cat ${_title_md})\n\n" >> ${README_MD} + echo -e "$(cat ${_title_md})" >> ${INDEX_MD} + echo -e "$(cat ${_title_md})" >> ${README_MD} + echo -e "$(cat ${_title_md})" >> ${GITBOOK_MD} fi fi @@ -84,7 +87,8 @@ for chapter_dir in ${all_chapter_dirs}; do for article_file in ${all_chapter_articles}; do article_file_basename="$(basename ${article_file})" article_html_file="$(strip_name_prefix ${article_file_basename})" - article_file_without_prefix="$(echo ${article_file/#\.\//})" + article_file_without_prefix_path="$(echo ${article_file/#\.\//})" + article_file_without_prefix="$(strip_name_prefix ${article_file})" # Replace '.md' suffix by '.html' article_html_file="$(echo ${article_html_file/%.md/.html})" @@ -96,7 +100,8 @@ for chapter_dir in ${all_chapter_dirs}; do echo "* [${_article_title}](${chapter_dir_in_article}/${article_html_file})" >> ${INDEX_MD} # 'src/default/' is path to view source file on bitbucket.org - echo "* [${_article_title}](src/default/${article_file_without_prefix})" >> ${README_MD} + echo "* [${_article_title}](src/default/${article_file_without_prefix_path})" >> ${README_MD} + echo "* [${_article_title}](${article_file_without_prefix})" >> ${GITBOOK_MD} ${CMD_CONVERT} ${article_file} ${_output_chapter_dir} \ title="${_article_title}" \