From 2b4ff03bffef1ce9d3d81ece8cd6f236036f0c66 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 12 Sep 2021 07:01:58 -0400 Subject: [PATCH] docs: translate single-quotes into backticks --- README.md | 30 ++++++++++++++++++------------ bin/generate | 10 +++++++--- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3c0ce32..30dd7a1 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Create a postgres service named lolipop: dokku postgres:create lolipop ``` -You can also specify the image and image version to use for the service. It *must* be compatible with the postgres image. +You can also specify the image and image version to use for the service. It *must* be compatible with the postgres image. ```shell export DATABASE_IMAGE="postgres" @@ -85,7 +85,7 @@ export DATABASE_IMAGE_VERSION="${PLUGIN_IMAGE_VERSION}" dokku postgres:create lolipop ``` -You can also specify custom environment variables to start the postgres service in semi-colon separated form. +You can also specify custom environment variables to start the postgres service in semi-colon separated form. ```shell export DATABASE_CUSTOM_ENV="USER=alpha;HOST=beta" @@ -181,7 +181,7 @@ flags: - `-a|--alias "BLUE_DATABASE"`: an alternative alias to use for linking to an app via environment variable - `-q|--querystring "pool=5"`: ampersand delimited querystring arguments to append to the service link -A postgres service can be linked to a container. This will use native docker links via the docker-options plugin. Here we link it to our 'playground' app. +A postgres service can be linked to a container. This will use native docker links via the docker-options plugin. Here we link it to our `playground` app. > NOTE: this will restart your app @@ -206,13 +206,13 @@ The following will be set on the linked application by default: DATABASE_URL=postgres://lolipop:SOME_PASSWORD@dokku-postgres-lolipop:5432/lolipop ``` -The host exposed here only works internally in docker containers. If you want your container to be reachable from outside, you should use the 'expose' subcommand. Another service can be linked to your app: +The host exposed here only works internally in docker containers. If you want your container to be reachable from outside, you should use the `expose` subcommand. Another service can be linked to your app: ```shell dokku postgres:link other_service playground ``` -It is possible to change the protocol for `DATABASE_URL` by setting the environment variable `POSTGRES_DATABASE_SCHEME` on the app. Doing so will after linking will cause the plugin to think the service is not linked, and we advise you to unlink before proceeding. +It is possible to change the protocol for `DATABASE_URL` by setting the environment variable `POSTGRES_DATABASE_SCHEME` on the app. Doing so will after linking will cause the plugin to think the service is not linked, and we advise you to unlink before proceeding. ```shell dokku config:set playground POSTGRES_DATABASE_SCHEME=postgres2 @@ -264,13 +264,13 @@ dokku postgres:connect lolipop dokku postgres:enter ``` -A bash prompt can be opened against a running service. Filesystem changes will not be saved to disk. +A bash prompt can be opened against a running service. Filesystem changes will not be saved to disk. ```shell dokku postgres:enter lolipop ``` -You may also run a command directly against the service. Filesystem changes will not be saved to disk. +You may also run a command directly against the service. Filesystem changes will not be saved to disk. ```shell dokku postgres:enter lolipop touch /tmp/test @@ -401,7 +401,7 @@ Service scripting can be executed using the following commands: dokku postgres:app-links ``` -List all postgres services that are linked to the 'playground' app. +List all postgres services that are linked to the `playground` app. ```shell dokku postgres:app-links playground @@ -435,7 +435,7 @@ dokku postgres:clone lolipop lolipop-2 dokku postgres:exists ``` -Here we check if the lolipop postgres service exists. +Here we check if the lolipop postgres service exists. ```shell dokku postgres:exists lolipop @@ -448,7 +448,7 @@ dokku postgres:exists lolipop dokku postgres:linked ``` -Here we check if the lolipop postgres service is linked to the 'playground' app. +Here we check if the lolipop postgres service is linked to the `playground` app. ```shell dokku postgres:linked lolipop playground @@ -461,7 +461,7 @@ dokku postgres:linked lolipop playground dokku postgres:links ``` -List all apps linked to the 'lolipop' postgres service. +List all apps linked to the `lolipop` postgres service. ```shell dokku postgres:links lolipop @@ -566,12 +566,18 @@ flags: - `-u|--use-iam`: use the IAM profile associated with the current server -Backup the 'lolipop' service to the 'my-s3-bucket' bucket on ``AWS`:` +Backup the `lolipop` service to the `my-s3-bucket` bucket on `AWS`:` ```shell dokku postgres:backup lolipop my-s3-bucket --use-iam ``` +Restore a backup file (assuming it was extracted via `tar -xf backup.tgz`): + +```shell +dokku postgres:import lolipop < backup-folder/export +``` + ### sets encryption for all future backups of postgres service ```shell diff --git a/bin/generate b/bin/generate index 2a04b0a..e38a931 100755 --- a/bin/generate +++ b/bin/generate @@ -423,13 +423,13 @@ def command_data(command, service, variable, alias, image, scheme, ports): def process_sentence(sentence_lines): sentence_lines = " ".join(sentence_lines) sentences = ". ".join( - upperfirst(i.strip()) for i in sentence_lines.split(".") + upperfirst(i.strip()) for i in sentence_lines.split(". ") ).strip() if not sentences.endswith(".") and not sentences.endswith(":"): sentences += ":" text = [] - for sentence in sentences.split("."): + for sentence in sentences.split(". "): parts = [] for word in sentence.strip().split(" "): if word.isupper() and len(word) > 1: @@ -444,7 +444,11 @@ def process_sentence(sentence_lines): text = ". ".join(text) # some cleanup - text = text.replace("(0. 0. 0. 0)", "(`0.0.0.0`)") + text = text.replace("(0.0.0.0)", "(`0.0.0.0`)") + text = text.replace("'", "`") + text = text.replace("`s", "'s") + text = text.replace("``", "`") + text = text.strip(" ") return text