diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000000..6790a75e768 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,17 @@ +## What Changed? + +Please list, at a high level, what changed in your branch. If you changed content, include the product, guide, and version as applicable. + +**Examples** +- Fixed typo in EPAS 13 epas_inst_linux guide +- Added more detail to ARK 3.5 getting started guide introduction +- Fixed broken link on `/supported-open-source/pgbackrest/05-retention_policy/` page + +## Checklist + +Please check all boxes that apply (`[ ]` is unchecked, `[x]` is checked) + +**Content** +- [ ] This PR adds new content +- [ ] This PR changes existing content +- [ ] This PR removes existing content diff --git a/.github/workflows/deploy-develop.yml b/.github/workflows/deploy-develop.yml index 08139803103..4fb3d49e81f 100644 --- a/.github/workflows/deploy-develop.yml +++ b/.github/workflows/deploy-develop.yml @@ -26,16 +26,16 @@ jobs: env: NODE_ENV: ${{ secrets.NODE_ENV }} - - name: Checking Gatsby cache - id: gatsby-cache-build - uses: actions/cache@v2 - with: - path: | - public - .cache - key: ${{ runner.os }}-gatsby-build-develop-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-gatsby-build-develop- + # - name: Checking Gatsby cache + # id: gatsby-cache-build + # uses: actions/cache@v2 + # with: + # path: | + # public + # .cache + # key: ${{ runner.os }}-gatsby-build-develop-${{ github.run_id }} + # restore-keys: | + # ${{ runner.os }}-gatsby-build-develop- - name: Fix mtimes run: yarn fix-mtimes --force diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index 59b7cf8b129..bb1003d4540 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -26,16 +26,16 @@ jobs: env: NODE_ENV: ${{ secrets.NODE_ENV }} - - name: Checking Gatsby cache - id: gatsby-cache-build - uses: actions/cache@v2 - with: - path: | - public - .cache - key: ${{ runner.os }}-gatsby-build-main-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-gatsby-build-main- + # - name: Checking Gatsby cache + # id: gatsby-cache-build + # uses: actions/cache@v2 + # with: + # path: | + # public + # .cache + # key: ${{ runner.os }}-gatsby-build-main-${{ github.run_id }} + # restore-keys: | + # ${{ runner.os }}-gatsby-build-main- - name: Fix mtimes run: yarn fix-mtimes --force diff --git a/.github/workflows/update-pdfs-on-develop.yml b/.github/workflows/update-pdfs-on-develop.yml index 2a62393007f..b6ea601dd9e 100644 --- a/.github/workflows/update-pdfs-on-develop.yml +++ b/.github/workflows/update-pdfs-on-develop.yml @@ -32,7 +32,7 @@ jobs: sudo apt-get install ./wkhtmltopdf.deb - name: Build all pdfs - run: npm run build-all-pdfs + run: npm run build-all-pdfs-ci - run: git status - run: git pull diff --git a/README.md b/README.md index f568760d0f6..ba26dbb28f5 100644 --- a/README.md +++ b/README.md @@ -40,13 +40,9 @@ We recommend using MacOS to work with the EDB Docs application. ### Installation of PDF / Doc Conversion Tools (optional) -If you need to build PDFs locally, or run parts of the RST to MDX conversion pipeline, you'll need a couple more tools installed. +If you need to build PDFs locally, you'll need to install Docker via Homebrew: `brew install docker`. -1. Install `wkhtmltopdf`, a tool that converts html documents to pdf documents. You can install this with `brew install wkhtmltopdf`. Currently we are using version `0.12.6` - you can check the installed version with `wkhtmltopdf -V`. Newer versions are likely to work fine as well. - -1. Install `pandoc`, a general purpose document conversion tool. This can also be installed with homebrew - `brew install pandoc`. - -1. To confirm that both tools are working, you can trying building a PDF. `yarn build-pdf product_docs/docs/epas/13/` will build `epas_v13_documentation.pdf` in the `epas/13/` folder. You may see a few warnings, but the process should finish with `✨ Done in 43.25s.` or similar. +If you need to run parts of the RST to MDX conversion pipeline, you'll need to install `pandoc`, a general purpose document conversion tool. This can also be installed with homebrew - `brew install pandoc`. ## Windows Installation diff --git a/advocacy_docs/supported-open-source/barman/index.mdx b/advocacy_docs/supported-open-source/barman/index.mdx index 737b15afbb6..04c9f3ef2e1 100644 --- a/advocacy_docs/supported-open-source/barman/index.mdx +++ b/advocacy_docs/supported-open-source/barman/index.mdx @@ -2,7 +2,6 @@ title: Barman navTitle: Barman description: EDB supports Barman. -product: barman tags: - barman - backup @@ -12,6 +11,7 @@ tags: - postgresql directoryDefaults: iconName: coffee + product: barman --- Barman (Backup and Recovery Manager) is an open-source administration tool for remote backups and disaster recovery of PostgreSQL servers in business-critical environments. It relies on PostgreSQL’s robust and reliable Point In Time Recovery technology, allowing DBAs to remotely manage a complete catalogue of backups and the recovery phase of multiple remote servers – all from one location. Barman is distributed under GNU GPL 3 and maintained by EDB. diff --git a/advocacy_docs/supported-open-source/barman/single-server-streaming/index.mdx b/advocacy_docs/supported-open-source/barman/single-server-streaming/index.mdx index 5783fa77556..34ec48a4b2b 100644 --- a/advocacy_docs/supported-open-source/barman/single-server-streaming/index.mdx +++ b/advocacy_docs/supported-open-source/barman/single-server-streaming/index.mdx @@ -2,8 +2,6 @@ title: "Backup and Recovery: Single-Server Streaming with Barman" description: "A quick demonstration of Barman installation, configuration, and basic backup and restore operations" navTitle: "Demo: Single-Server Streaming" -product: barman -platform: ubuntu tags: - ubuntu - barman @@ -12,6 +10,7 @@ tags: - live-demo iconName: coffee directoryDefaults: + platform: ubuntu prevNext: true --- @@ -22,4 +21,4 @@ This section demonstrates setting up a backup and recovery scenario using a Barm 3. Running a full backup 4. Restoring a full backup -Each of these steps is interactive, with the prerequisites and results of the previous step captured in a Docker image. You can work through the entire scenario in order, or skip to the step that interests you. \ No newline at end of file +Each of these steps is interactive, with the prerequisites and results of the previous step captured in a Docker image. You can work through the entire scenario in order, or skip to the step that interests you. diff --git a/advocacy_docs/supported-open-source/barman/single-server-streaming/step02-backup-setup.mdx b/advocacy_docs/supported-open-source/barman/single-server-streaming/step02-backup-setup.mdx index 1fc4f639829..288e80db538 100644 --- a/advocacy_docs/supported-open-source/barman/single-server-streaming/step02-backup-setup.mdx +++ b/advocacy_docs/supported-open-source/barman/single-server-streaming/step02-backup-setup.mdx @@ -2,8 +2,6 @@ title: "Backup and Recovery: Single-Server Streaming - Installing and Configuring Barman" description: "Installing Barman on an Ubuntu-based backup server, creating a configuration file and testing the connection" navTitle: "Barman Installation & Configuration" -product: barman -platform: ubuntu tags: - ubuntu - barman diff --git a/advocacy_docs/supported-open-source/barman/single-server-streaming/step03-backup.mdx b/advocacy_docs/supported-open-source/barman/single-server-streaming/step03-backup.mdx index f52aa151afb..717b37b8da8 100644 --- a/advocacy_docs/supported-open-source/barman/single-server-streaming/step03-backup.mdx +++ b/advocacy_docs/supported-open-source/barman/single-server-streaming/step03-backup.mdx @@ -2,8 +2,6 @@ title: "Backup and Recovery: Single-Server Streaming - Running a Base Backup" description: "Running a full backup using Barman" navTitle: "Base Backup" -product: barman -platform: ubuntu tags: - ubuntu - barman diff --git a/advocacy_docs/supported-open-source/barman/single-server-streaming/step04-restore.mdx b/advocacy_docs/supported-open-source/barman/single-server-streaming/step04-restore.mdx index a7e7162aeb2..9a045e5e367 100644 --- a/advocacy_docs/supported-open-source/barman/single-server-streaming/step04-restore.mdx +++ b/advocacy_docs/supported-open-source/barman/single-server-streaming/step04-restore.mdx @@ -2,8 +2,6 @@ title: "Backup and Recovery: Single-Server Streaming - Recovery" description: "Recovering from data loss by using Barman to restore a full backup remotely" navTitle: "Restore" -product: barman -platform: ubuntu tags: - ubuntu - barman diff --git a/advocacy_docs/supported-open-source/pgadmin/index.mdx b/advocacy_docs/supported-open-source/pgadmin/index.mdx index b086e2a8b6d..a949058eb2e 100644 --- a/advocacy_docs/supported-open-source/pgadmin/index.mdx +++ b/advocacy_docs/supported-open-source/pgadmin/index.mdx @@ -2,9 +2,9 @@ title: pgAdmin navTitle: pgAdmin description: EDB supports pgAdmin. -product: pgAdmin directoryDefaults: iconName: postgresql + product: pgAdmin --- pgAdmin is an open source, multi-platform console for PostgreSQL management and administration. diff --git a/advocacy_docs/supported-open-source/pgbackrest/02-installation.mdx b/advocacy_docs/supported-open-source/pgbackrest/02-installation.mdx index 7fd18821b7a..9736290998d 100644 --- a/advocacy_docs/supported-open-source/pgbackrest/02-installation.mdx +++ b/advocacy_docs/supported-open-source/pgbackrest/02-installation.mdx @@ -1,7 +1,6 @@ --- title: 'Installation' description: 'Instructions for installing pgBackRest on supported systems, including EDB Postgres Advanced Server' -product: 'pgBackRest' tags: - installation - EPAS diff --git a/advocacy_docs/supported-open-source/pgbackrest/03-quick_start.mdx b/advocacy_docs/supported-open-source/pgbackrest/03-quick_start.mdx index 0e966764235..fd3a34b67c6 100644 --- a/advocacy_docs/supported-open-source/pgbackrest/03-quick_start.mdx +++ b/advocacy_docs/supported-open-source/pgbackrest/03-quick_start.mdx @@ -1,7 +1,6 @@ --- title: 'Quick Start' description: "A walkthrough: configuring pgBackRest, then running, examining and restoring a backup of a database cluster" -product: 'pgBackRest' tags: - configuration - backup diff --git a/advocacy_docs/supported-open-source/pgbackrest/04-recommended_settings.mdx b/advocacy_docs/supported-open-source/pgbackrest/04-recommended_settings.mdx index e6e46372997..2ba5ddab616 100644 --- a/advocacy_docs/supported-open-source/pgbackrest/04-recommended_settings.mdx +++ b/advocacy_docs/supported-open-source/pgbackrest/04-recommended_settings.mdx @@ -1,7 +1,6 @@ --- title: 'Recommended Settings' description: "Recommendations & rationale for pgBackRest configuration settings" -product: 'pgBackRest' --- This section walks you through the recommended settings while using pgBackRest. diff --git a/advocacy_docs/supported-open-source/pgbackrest/05-retention_policy.mdx b/advocacy_docs/supported-open-source/pgbackrest/05-retention_policy.mdx index b3fc095a650..5c700dbb666 100644 --- a/advocacy_docs/supported-open-source/pgbackrest/05-retention_policy.mdx +++ b/advocacy_docs/supported-open-source/pgbackrest/05-retention_policy.mdx @@ -1,7 +1,6 @@ --- title: 'Retention Policy' description: "Configuration options and considerations for the removal of obsolete backups and WAL archives" -product: 'pgBackRest' --- Setting retention policy options allows to remove obsolete backups. Those settings will then be a trade-off between saving space and data retention. diff --git a/advocacy_docs/supported-open-source/pgbackrest/06-use_case_1.mdx b/advocacy_docs/supported-open-source/pgbackrest/06-use_case_1.mdx index c1b8066f44a..a2e960f23fb 100644 --- a/advocacy_docs/supported-open-source/pgbackrest/06-use_case_1.mdx +++ b/advocacy_docs/supported-open-source/pgbackrest/06-use_case_1.mdx @@ -2,7 +2,6 @@ title: 'Use Case 1: Running pgBackRest Locally on the Database Host' navTitle: 'Use Case 1' description: "Examines a configuration used to run pgBackRest locally, on the database host" -product: 'pgBackRest' tags: - configuration - pgBackRest diff --git a/advocacy_docs/supported-open-source/pgbackrest/07-use_case_2.mdx b/advocacy_docs/supported-open-source/pgbackrest/07-use_case_2.mdx index 2512d08c2e1..13413e7c4c0 100644 --- a/advocacy_docs/supported-open-source/pgbackrest/07-use_case_2.mdx +++ b/advocacy_docs/supported-open-source/pgbackrest/07-use_case_2.mdx @@ -2,7 +2,6 @@ title: 'Use Case 2: Running pgBackRest from a Dedicated Repository Host' navTitle: 'Use Case 2' description: "Examines a configuration used to run pgBackRest from a dedicated repository host" -product: 'pgBackRest' tags: - configuration - pgBackRest diff --git a/advocacy_docs/supported-open-source/pgbackrest/98-appendix.mdx b/advocacy_docs/supported-open-source/pgbackrest/98-appendix.mdx index 9f10300490c..cbfd00afe50 100644 --- a/advocacy_docs/supported-open-source/pgbackrest/98-appendix.mdx +++ b/advocacy_docs/supported-open-source/pgbackrest/98-appendix.mdx @@ -1,7 +1,6 @@ --- title: 'Appendix' description: "Definitions for terms and concepts used in this guide, along with notes on configuration terminology" -product: 'pgBackRest' --- ### Concepts diff --git a/advocacy_docs/supported-open-source/pgbackrest/99-faq.mdx b/advocacy_docs/supported-open-source/pgbackrest/99-faq.mdx index ec09355c8b0..216b6a869c4 100644 --- a/advocacy_docs/supported-open-source/pgbackrest/99-faq.mdx +++ b/advocacy_docs/supported-open-source/pgbackrest/99-faq.mdx @@ -2,7 +2,6 @@ title: 'Frequently Asked Questions' navTitle: 'FAQ' description: 'Answers to Frequently Asked Questions' -product: 'pgBackRest' --- - Why do we have to specify the `--stanza` option even if only one stanza is defined in the configuration file? diff --git a/advocacy_docs/supported-open-source/pgbackrest/index.mdx b/advocacy_docs/supported-open-source/pgbackrest/index.mdx index ef175664d6b..9959f3011f7 100644 --- a/advocacy_docs/supported-open-source/pgbackrest/index.mdx +++ b/advocacy_docs/supported-open-source/pgbackrest/index.mdx @@ -1,7 +1,6 @@ --- title: 'pgBackRest' description: 'Introduction to pgBackRest, a reliable PostgreSQL backup & restore tool' -product: 'pgBackRest' tags: - backup - restore @@ -10,6 +9,7 @@ tags: indexCards: simple directoryDefaults: iconName: 'postgressupport' + product: 'pgBackRest' --- pgBackRest is an easy-to-use backup and restore tool that aims to enable your organization to implement disaster recovery solutions for PostgreSQL databases. diff --git a/advocacy_docs/supported-open-source/postgresql/index.mdx b/advocacy_docs/supported-open-source/postgresql/index.mdx index 888dd628bc7..2f61c4e068a 100644 --- a/advocacy_docs/supported-open-source/postgresql/index.mdx +++ b/advocacy_docs/supported-open-source/postgresql/index.mdx @@ -2,9 +2,9 @@ title: PostgreSQL navTitle: PostgreSQL description: EDB supports PostgreSQL. -product: PostgreSQL directoryDefaults: iconName: postgresql + product: PostgreSQL --- PostgreSQL is a popular, free, open-source relational database management system (RDBMS). It has earned a reputation for reliability, performance, and extensibility, with a robust feature set to securely store and scale even the most complex workloads. diff --git a/advocacy_docs/supported-open-source/postgresql/installer/01_requirements_overview.mdx b/advocacy_docs/supported-open-source/postgresql/installer/01_requirements_overview.mdx index fb9871df86b..db06e8ae87b 100644 --- a/advocacy_docs/supported-open-source/postgresql/installer/01_requirements_overview.mdx +++ b/advocacy_docs/supported-open-source/postgresql/installer/01_requirements_overview.mdx @@ -1,6 +1,5 @@ --- title: "Requirements Overview" -product: PostgreSQL legacyRedirects: - "/edb-docs/d/postgresql/installation-getting-started/installation-guide/13.0/requirements_overview.html" --- diff --git a/advocacy_docs/supported-open-source/postgresql/installer/02_installing_postgresql_with_the_graphical_installation_wizard/01_invoking_the_graphical_installer.mdx b/advocacy_docs/supported-open-source/postgresql/installer/02_installing_postgresql_with_the_graphical_installation_wizard/01_invoking_the_graphical_installer.mdx index d0c83d0b192..b12378b3e3b 100644 --- a/advocacy_docs/supported-open-source/postgresql/installer/02_installing_postgresql_with_the_graphical_installation_wizard/01_invoking_the_graphical_installer.mdx +++ b/advocacy_docs/supported-open-source/postgresql/installer/02_installing_postgresql_with_the_graphical_installation_wizard/01_invoking_the_graphical_installer.mdx @@ -1,6 +1,5 @@ --- title: "Invoking the Graphical Installer" -product: PostgreSQL legacyRedirects: - "/edb-docs/d/postgresql/installation-getting-started/installation-guide/13.0/invoking_the_graphical_installer.html" --- diff --git a/advocacy_docs/supported-open-source/postgresql/installer/02_installing_postgresql_with_the_graphical_installation_wizard/index.mdx b/advocacy_docs/supported-open-source/postgresql/installer/02_installing_postgresql_with_the_graphical_installation_wizard/index.mdx index 6e70d837050..c57b55df2c6 100644 --- a/advocacy_docs/supported-open-source/postgresql/installer/02_installing_postgresql_with_the_graphical_installation_wizard/index.mdx +++ b/advocacy_docs/supported-open-source/postgresql/installer/02_installing_postgresql_with_the_graphical_installation_wizard/index.mdx @@ -1,6 +1,5 @@ --- title: "Installing PostgreSQL with the Graphical Installation Wizard" -product: PostgreSQL legacyRedirects: - "/edb-docs/d/postgresql/installation-getting-started/installation-guide/13.0/installing_postgresql_with_the_graphical_installation_wizard.html" --- diff --git a/advocacy_docs/supported-open-source/postgresql/installer/03_using_stackbuilder.mdx b/advocacy_docs/supported-open-source/postgresql/installer/03_using_stackbuilder.mdx index d961fcc1e3e..5f9474b83aa 100644 --- a/advocacy_docs/supported-open-source/postgresql/installer/03_using_stackbuilder.mdx +++ b/advocacy_docs/supported-open-source/postgresql/installer/03_using_stackbuilder.mdx @@ -1,6 +1,5 @@ --- title: "Using Stack Builder" -product: PostgreSQL legacyRedirects: - "/edb-docs/d/postgresql/installation-getting-started/installation-guide/13.0/using_stackbuilder.html" --- diff --git a/advocacy_docs/supported-open-source/postgresql/installer/04_installation_troubleshooting.mdx b/advocacy_docs/supported-open-source/postgresql/installer/04_installation_troubleshooting.mdx index fecced7a294..a442fda7a35 100644 --- a/advocacy_docs/supported-open-source/postgresql/installer/04_installation_troubleshooting.mdx +++ b/advocacy_docs/supported-open-source/postgresql/installer/04_installation_troubleshooting.mdx @@ -1,6 +1,5 @@ --- title: "Installation Troubleshooting" -product: PostgreSQL legacyRedirects: - "/edb-docs/d/postgresql/installation-getting-started/installation-guide/13.0/installation_troubleshooting.html" --- diff --git a/advocacy_docs/supported-open-source/postgresql/installer/05_uninstalling_postgresql.mdx b/advocacy_docs/supported-open-source/postgresql/installer/05_uninstalling_postgresql.mdx index 0eb8d968085..b218c633aa4 100644 --- a/advocacy_docs/supported-open-source/postgresql/installer/05_uninstalling_postgresql.mdx +++ b/advocacy_docs/supported-open-source/postgresql/installer/05_uninstalling_postgresql.mdx @@ -1,6 +1,5 @@ --- title: "Uninstalling PostgreSQL" -product: PostgreSQL legacyRedirects: - "/edb-docs/d/postgresql/installation-getting-started/installation-guide/13.0/uninstalling_postgresql.html" --- diff --git a/advocacy_docs/supported-open-source/postgresql/installer/index.mdx b/advocacy_docs/supported-open-source/postgresql/installer/index.mdx index 6446a4a5e66..19542aa4447 100644 --- a/advocacy_docs/supported-open-source/postgresql/installer/index.mdx +++ b/advocacy_docs/supported-open-source/postgresql/installer/index.mdx @@ -1,7 +1,6 @@ --- title: "EDB Installers" description: "The PostgreSQL installers created by EnterpriseDB are designed to make it quick and simple to install PostgreSQL on your computer." -product: PostgreSQL --- The PostgreSQL installers created by EnterpriseDB are designed to make it quick and simple to install PostgreSQL on your computer. The installer provides: diff --git a/docker/docker-compose.build-pdf.yaml b/docker/docker-compose.build-pdf.yaml new file mode 100644 index 00000000000..99f7040d3c6 --- /dev/null +++ b/docker/docker-compose.build-pdf.yaml @@ -0,0 +1,13 @@ +version: '3.8' + +services: + pdf-builder: + build: + context: ../ + dockerfile: docker/images/Dockerfile.pdf-builder + image: edb/x-docs-pdf-builder + container_name: pdf-builder + hostname: pdf-builder + working_dir: /app + volumes: + - ../:/app diff --git a/docker/images/Dockerfile.pdf-builder b/docker/images/Dockerfile.pdf-builder new file mode 100644 index 00000000000..2153b725871 --- /dev/null +++ b/docker/images/Dockerfile.pdf-builder @@ -0,0 +1,27 @@ +FROM ubuntu:focal + +ARG PANDOC_VERSION=2.12 +ARG PANDOC_DEB=pandoc-2.12-1-amd64.deb +ARG WKHTML_TO_PDF_VERSION=0.12.6-1 +ARG WKHTML_TO_PDF_DEB=wkhtmltox_${WKHTML_TO_PDF_VERSION}.focal_amd64.deb + +RUN apt-get update && apt-get install --no-install-recommends -y \ + python3 \ + wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Install Pandoc +RUN wget --no-check-certificate -P /tmp https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/${PANDOC_DEB} \ + && apt-get install --no-install-recommends -y /tmp/${PANDOC_DEB} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* + +# Install wkhtmltopdf +RUN wget --no-check-certificate -P /tmp https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTML_TO_PDF_VERSION}/${WKHTML_TO_PDF_DEB} \ + && apt-get update \ + && apt-get install --no-install-recommends -y /tmp/${WKHTML_TO_PDF_DEB} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* diff --git a/gatsby-config.js b/gatsby-config.js index 2b8dce18413..037e816aa2b 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -11,7 +11,7 @@ const ANSI_STOP = '\033[0m'; const isBuild = process.env.NODE_ENV === 'production'; const isProduction = process.env.APP_ENV === 'production'; -const algoliaIndex = process.env.ALGOLIA_INDEX_NAME || 'edb-docs-staging'; +const algoliaIndex = process.env.ALGOLIA_INDEX_NAME || 'edb-docs-test'; /******** Sourcing *********/ const sourceFilename = isBuild ? 'build-sources.json' : 'dev-sources.json'; @@ -111,6 +111,10 @@ const indexQuery = ` product platform tags + directoryDefaults { + product + platform + } } id fields { diff --git a/gatsby-node.js b/gatsby-node.js index d77f483bffd..155d888ecea 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -104,6 +104,8 @@ exports.createPages = async ({ actions, graphql, reporter }) => { description prevNext iconName + product + platform } } fields { diff --git a/package.json b/package.json index 5bfb9fb440a..928bf142fd1 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,9 @@ "build": "gatsby build --prefix-paths", "serve-build": "gatsby serve --prefix-paths", "update-icons": "git submodule update --init --remote && node scripts/createIconTypes.js && node scripts/createIconNames.js", - "build-pdf": "python3 scripts/pdf/generate_pdf.py", - "build-all-pdfs": "for i in product_docs/docs/**/*/ ; do echo \"$i\"; python3 scripts/pdf/generate_pdf.py ${i%} || exit 1; done", + "build-pdf": "docker-compose -f docker/docker-compose.build-pdf.yaml run --rm --entrypoint scripts/pdf/generate_pdf.py pdf-builder", + "build-all-pdfs": "for i in product_docs/docs/**/*/ ; do echo \"$i\"; yarn build-pdf ${i%} || exit 1; done", + "build-all-pdfs-ci": "for i in product_docs/docs/**/*/ ; do echo \"$i\"; python3 scripts/pdf/generate_pdf.py ${i%} || exit 1; done", "fix-mtimes": "python3 scripts/source/git-restore-mtime.py", "count": "find product_docs/docs/ advocacy_docs/ external_sources/ -name '*.mdx' | wc -l", "heroku-postbuild": "gatsby build", diff --git a/product_docs/docs/epas/13/epas_compat_reference/02_the_sql_language/03_functions_and_operators/07_data_type_formatting_functions.mdx b/product_docs/docs/epas/13/epas_compat_reference/02_the_sql_language/03_functions_and_operators/07_data_type_formatting_functions.mdx index 2dc615baf75..d6495a81cff 100644 --- a/product_docs/docs/epas/13/epas_compat_reference/02_the_sql_language/03_functions_and_operators/07_data_type_formatting_functions.mdx +++ b/product_docs/docs/epas/13/epas_compat_reference/02_the_sql_language/03_functions_and_operators/07_data_type_formatting_functions.mdx @@ -10,17 +10,17 @@ legacyRedirectsGenerated: The Advanced Server formatting functions described in the following table provide a powerful set of tools for converting various data types (date/time, integer, floating point, numeric) to formatted strings and for converting from formatted strings to specific data types. These functions all follow a common calling convention: the first argument is the value to be formatted and the second argument is a string template that defines the output or input format. -| Function | Return Type | Description | Example | Result | -| ----------------------------------- | ------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | --------------------------- | -| `TO_CHAR(DATE [, format ])` | `VARCHAR2` | Convert a date/time to a string with output, `format`. If omitted default format is DD-MON-YY. | `TO_CHAR(SYSDATE, 'MM/DD/YYYY HH12:MI:SS AM')` | `07/25/2007 09:43:02 AM` | -| `TO_CHAR(TIMESTAMP [, format ])` | `VARCHAR2` | Convert a timestamp to a string with output, `format`. If omitted default format is DD-MON-YY. | `TO_CHAR (CURRENT_TIMESTAMP, 'MM/DD/YYYY HH12:MI:SS AM')` | `08/13/2015 08:55:22 PM` | -| `TO_CHAR(INTEGER [, format ])` | `VARCHAR2` | Convert an integer to a string with output, `format` | `TO_CHAR(2412, '999,999S')` | `2,412+` | -| `TO_CHAR(NUMBER [, format ])` | `VARCHAR2` | Convert a decimal number to a string with output, `format` | `TO_CHAR(10125.35, '999,999.99')` | `10,125.35` | -| `TO_CHAR(DOUBLE PRECISION, format)` | `VARCHAR2` | Convert a floating-point number to a string with output, `format` | `TO_CHAR (CAST(123.5282 AS REAL), '999.99')` | `123.53` | -| `TO_DATE(string [, format ])` | `DATE` | Convert a date formatted string to a `DATE` data type | `TO_DATE('2007-07-04 13:39:10', 'YYYY-MM-DD HH24:MI:SS')` | `04-JUL-07` | -| `TO_NUMBER(string [, format ])` | `NUMBER` | Convert a number formatted string to a `NUMBER` data type | `TO_NUMBER('2,412-', '999,999S')` | `-2412` | -| `TO_TIMESTAMP(string, format)` | `TIMESTAMPTZ` | Convert a timestamp formatted string to a `TIMESTAMPTZ` data type | `TO_TIMESTAMP('05 Dec 2000 08:30:25 pm', 'DD Mon YYYY hh12:mi:ss pm')` | `05-DEC-00 20:30:25 +05:30` | -| `TO_TIMESTAMP_TZ(string, format)` | `TIMESTAMPTZ` | Convert a timestamp formatted string to a `TIMESTAMPTZ` data type | `TO_TIMESTAMP_TZ ('2003/12/13 10:13:18 -8:00', 'YYYY/MM/DD HH:MI:SS TZH:TZM')` | `13-DEC-03 23:43:18 +05:30` | +| Function | Return Type | Description | Example | Result | +| ----------------------------------- | ------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | +| `TO_CHAR(DATE [, format ])` | `VARCHAR2` | Convert a date/time to a string with output, `format`. If omitted default format is DD-MON-YY. | `TO_CHAR(SYSDATE, 'MM/DD/YYYY HH12:MI:SS AM')` | `07/25/2007 09:43:02 AM` | +| `TO_CHAR(TIMESTAMP [, format ])` | `VARCHAR2` | Convert a timestamp to a string with output, `format`. If omitted default format is DD-MON-YY. | `TO_CHAR (CURRENT_TIMESTAMP, 'MM/DD/YYYY HH12:MI:SS AM')` | `08/13/2015 08:55:22 PM` | +| `TO_CHAR(INTEGER [, format ])` | `VARCHAR2` | Convert an integer to a string with output, `format` | `TO_CHAR(2412, '999,999S')` | `2,412+` | +| `TO_CHAR(NUMBER [, format ])` | `VARCHAR2` | Convert a decimal number to a string with output, `format` | `TO_CHAR(10125.35, '999,999.99')` | `10,125.35` | +| `TO_CHAR(DOUBLE PRECISION, format)` | `VARCHAR2` | Convert a floating-point number to a string with output, `format` | `TO_CHAR (CAST(123.5282 AS REAL), '999.99')` | `123.53` | +| `TO_DATE(string [, format ])` | `TIMESTAMP` | Convert a date or timestamp formatted string to a `TIMESTAMP` data type | `TO_DATE('2007-07-04 13:39:10', 'YYYY-MM-DD HH24:MI:SS')`

`TO_DATE('2007-07-04','YYYY-MM-DD')` | `04-JUL-07 13:39:10`

`04-JUL-07 00:00:00` | +| `TO_NUMBER(string [, format ])` | `NUMBER` | Convert a number formatted string to a `NUMBER` data type | `TO_NUMBER('2,412-', '999,999S')` | `-2412` | +| `TO_TIMESTAMP(string, format)` | `TIMESTAMPTZ` | Convert a timestamp formatted string to a `TIMESTAMPTZ` data type | `TO_TIMESTAMP('05 Dec 2000 08:30:25 pm', 'DD Mon YYYY hh12:mi:ss pm')` | `05-DEC-00 20:30:25 +05:30` | +| `TO_TIMESTAMP_TZ(string, format)` | `TIMESTAMPTZ` | Convert a timestamp formatted string to a `TIMESTAMPTZ` data type | `TO_TIMESTAMP_TZ ('2003/12/13 10:13:18 -8:00', 'YYYY/MM/DD HH:MI:SS TZH:TZM')` | `13-DEC-03 23:43:18 +05:30` | ## TO_CHAR, TO_DATE, TO_TIMESTAMP, and TO_TIMESTAMP_TZ diff --git a/product_docs/docs/epas/13/language_pack/01_supported_database_server_versions.mdx b/product_docs/docs/epas/13/language_pack/01_supported_database_server_versions.mdx index 203a6f8f2ab..ca058e9b8a3 100644 --- a/product_docs/docs/epas/13/language_pack/01_supported_database_server_versions.mdx +++ b/product_docs/docs/epas/13/language_pack/01_supported_database_server_versions.mdx @@ -10,15 +10,15 @@ legacyRedirectsGenerated: -Language Pack installers are version and platform specific; select the Language Pack installer that corresponds to your EDB Postgres Advanced Server or PostgreSQL server version that are installed through interactive installer. +Language Pack installers are version and platform specific. Select the Language Pack installer that corresponds to your EDB Postgres Advanced Server or PostgreSQL server version that are installed through interactive installer. -| Operating System | Product and Version | Language Pack Version | Procedural Language Version | -| ----------------- | ----------------------------------------------------- | ----------------------| ------------------------------------ | -| Linux | EDB Postgres Advanced Server `9.6`,`10` | 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.6` | -| Linux | PostgreSQL `9.6`, `10` | 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.6` | -| MacOS | PostgreSQL `9.6`,`10`,`11`,`12`,`13` | 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.6` | -| Windows (32-bit) | PostgreSQL `9.6`,`10` | 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.6` | -| Windows (64-bit) | PostgreSQL `9.6`,`10`,`11`,`12`,`13` | 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.8` | -| Windows (64-bit) | EDB Postgres Advanced Server `9.6`,`10`,`11`,`12`,`13`| 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.6` | +| Operating System | Product and Version | Language Pack Version | Procedural Language Version | +| ----------------- | ----------------------------------------------------- | ----------------------| ------------------------------------ | +| Linux (64-bit) | EDB Postgres Advanced Server `9.6`,`10` | 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.6` | +| Linux (32-bit/64-bit)| PostgreSQL `9.6`, `10` | 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.6` | +| MacOS | PostgreSQL `9.6`,`10`,`11`,`12`,`13` | 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.6` | +| Windows (32-bit) | PostgreSQL `9.6`,`10` | 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.6` | +| Windows (64-bit) | PostgreSQL `9.6`,`10`,`11`,`12`,`13` | 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.8` | +| Windows (64-bit) | EDB Postgres Advanced Server `9.6`,`10`,`11`,`12`,`13`| 1.0 | Perl `5.26`, Python `3.7`, Tcl `8.6` | For detailed information, please see the EDB Postgres Advanced Server Installation Guide for Linux, available at the [EDB website](/epas/latest/). diff --git a/product_docs/docs/migration_portal/3.0.1/01_whats_new.mdx b/product_docs/docs/migration_portal/3.0.1/01_whats_new.mdx deleted file mode 100644 index e34a477ac06..00000000000 --- a/product_docs/docs/migration_portal/3.0.1/01_whats_new.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "What's New" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-migration-portal/user-guides/user-guide/3.0.1/whats_new.html" ---- - - - -The following enhancements are added to the Migration Portal for this release: - -- Made minor UI enhancements for better user experience. diff --git a/product_docs/docs/migration_portal/3.0.1/02_supported_versions.mdx b/product_docs/docs/migration_portal/3.0.1/02_supported_platforms.mdx similarity index 100% rename from product_docs/docs/migration_portal/3.0.1/02_supported_versions.mdx rename to product_docs/docs/migration_portal/3.0.1/02_supported_platforms.mdx diff --git a/product_docs/docs/migration_portal/3.0.1/04_mp_migrating_database/01_mp_schema_extraction.mdx b/product_docs/docs/migration_portal/3.0.1/04_mp_migrating_database/01_mp_schema_extraction.mdx index 4a0204bd71b..a2be57e7b0a 100644 --- a/product_docs/docs/migration_portal/3.0.1/04_mp_migrating_database/01_mp_schema_extraction.mdx +++ b/product_docs/docs/migration_portal/3.0.1/04_mp_migrating_database/01_mp_schema_extraction.mdx @@ -12,7 +12,8 @@ legacyRedirectsGenerated: Before extracting a schema, you must download the latest EDB DDL Extractor script from the Migration Portal `Projects` page or from the link provided in the DDL Extractor guide in the Portal Wiki. The script can be run in SQL Developer or SQL\*Plus. It uses Oracle’s `DBMS_METADATA` built-in package to extract DDLs for different objects under schemas (specified while running the script). The EDB DDL extractor creates the DDL file that will be uploaded to the portal and analyzed for EDB Postgres compatibility. -!!! Note +**Note** + You must have CONNECT and SELECT_CATALOG_ROLE roles and CREATE TABLE privilege. **For SQL\*Plus** @@ -23,7 +24,8 @@ Before extracting a schema, you must download the latest EDB DDL Extractor scrip 2. Provide the schema name and the path or directory in which the extractor will store the extracted DDL. When extracting multiple schemas, use a comma (‘,’) as a delimiter. -!!! Note +**Note** + If you want to extract all the user schemas from the current database, do not mention any schema names while extracting. However, it is recommended to mention the schema names that you would like to extract. 3. If you want to extract dependent objects from other schemas, enter `yes` or `no`. diff --git a/product_docs/docs/migration_portal/3.0.1/04_mp_migrating_database/03_mp_schema_migration.mdx b/product_docs/docs/migration_portal/3.0.1/04_mp_migrating_database/03_mp_schema_migration.mdx index a3d1d9ab729..256b915506b 100644 --- a/product_docs/docs/migration_portal/3.0.1/04_mp_migrating_database/03_mp_schema_migration.mdx +++ b/product_docs/docs/migration_portal/3.0.1/04_mp_migrating_database/03_mp_schema_migration.mdx @@ -10,32 +10,33 @@ legacyRedirectsGenerated: After resolving errors in your schemas, you can use the schemas with a client application such as pgAdmin, ToadEdge, or the PSQL client, or migrate the schema to an EDB Postgres Advanced Server. -!!! Note +**Note** + For more information about using Toad Edge with EDB Postgres Advanced Server, see Toad Edge for Postgres. You can choose one of the following options for migrating schemas; migrate to an: -- Existing on-premise EDB Postgres Advanced Server -- New on-premise EDB Postgres Advanced Server +- Existing on-premises EDB Postgres Advanced Server +- New on-premises EDB Postgres Advanced Server - EDB Postgres Advanced Server on Cloud ![Schema migration home page](../images/mp_schema_migration_home.png) *Schema migration home page* - + -## Migrating to an Existing On-Premise EDB Postgres Advanced Server Host +## Migrating to an Existing On-Premises EDB Postgres Advanced Server Host -You can migrate schemas to an existing on-premise EDB Postgres Advanced Server on Windows or Linux platforms. +You can migrate schemas to an existing on-premises EDB Postgres Advanced Server on Windows or Linux platforms. ### Migrating Schemas on Windows -1. Select the `Existing on-premise EDB Postgres Postgres Advanced Server` option: +1. Select the `Existing on-premises EDB Postgres Postgres Advanced Server` option: -![Existing on-premise EDB Postgres Advanced Server home page](../images/mp_schema_migration_existing_epas.png) +![Existing on-premises EDB Postgres Advanced Server home page](../images/mp_schema_migration_existing_epas.png) -*Existing on-premise EDB Postgres Advanced Server home page* +*Existing on-premises EDB Postgres Advanced Server home page* 2. Select one or more schemas to migrate to EDB Postgres Advanced Server: @@ -43,7 +44,8 @@ You can migrate schemas to an existing on-premise EDB Postgres Advanced Server o *Selecting schemas for migration* -!!! Note +**Note** + If your schemas are not 100% compatible, a banner will be displayed as shown; complete the `Contact Us` form for any assistance required. ![The Contact Us form](../images/mp_schema_mig_exist_epas_contact_us.png) @@ -76,7 +78,8 @@ You can migrate schemas to an existing on-premise EDB Postgres Advanced Server o edb-psql -f .sql ``` -!!! Note +**Note** + You can also use `pgAdmin` instead. The converted schemas are migrated to the target server. @@ -87,13 +90,13 @@ The converted schemas are migrated to the target server. ### Migrating Schemas on Linux -To migrate schemas to an existing on-premise EDB Postgres Advanced Server on Linux, complete the following steps: +To migrate schemas to an existing on-premises EDB Postgres Advanced Server on Linux, complete the following steps: -1. Click the `Existing on-premise EDB Postgres Advanced Server` option: +1. Click the `Existing on-premises EDB Postgres Advanced Server` option: -![Existing on-premise EDB Postgres Advanced Server home page](../images/mp_schema_migration_existing_epas.png) +![Existing on-premises EDB Postgres Advanced Server home page](../images/mp_schema_migration_existing_epas.png) -*Existing on-premise EDB Postgres Advanced Server home page* +*Existing on-Premises EDB Postgres Advanced Server home page* 2. Select one or more schemas to migrate to EDB Postgres Advanced Server: @@ -123,7 +126,8 @@ To migrate schemas to an existing on-premise EDB Postgres Advanced Server on Lin \\i .sql ``` -!!! Note +**Note** + You can optionally use the `pgAdmin` client for the import. The converted schemas are migrated to the target server. @@ -132,21 +136,21 @@ The converted schemas are migrated to the target server. *A successful schema migration* - + -## Migrating to a New On-Premise EDB Postgres Advanced Server Installation +## Migrating to a New On-Premises EDB Postgres Advanced Server Installation -You can install new EDB Postgres Advanced Server on-premise on Windows or Linux platforms and migrate the schemas. +You can install new EDB Postgres Advanced Server on-premises on Windows or Linux platforms and migrate the schemas. ### Migrating Schemas on Windows -To migrate schemas to a new on-premise EDB Postgres Advanced Server on Windows, complete the following steps: +To migrate schemas to a new on-premises EDB Postgres Advanced Server on Windows, complete the following steps: -1. Click `New on-premise EDB Postgres Postgres Advanced Server` option. +1. Click `New on-premises EDB Postgres Postgres Advanced Server` option. -![New on-premise EDB Postgres Advanced Server home page](../images/mp_schema_migration_home_new.png) +![New on-premises EDB Postgres Advanced Server home page](../images/mp_schema_migration_home_new.png) -*New on-premise EDB Postgres Advanced Server home page* +*New on-premises EDB Postgres Advanced Server home page* 2. Select one or more schemas to migrate on EDB Postgres Advanced Server. @@ -203,9 +207,9 @@ The schemas are migrated to the target server. ### Migrating Schemas on Linux -To migrate schemas to an on-premise EDB Postgres Advanced Server on Linux, complete the following steps: +To migrate schemas to an on-premises EDB Postgres Advanced Server on Linux, complete the following steps: -1. Click `New On-premise EDB Postgres Advanced Server` option. +1. Click `New On-premises EDB Postgres Advanced Server` option. ![Migrating schemas home page](../images/mp_schema_migration_home_new.png) @@ -303,7 +307,8 @@ Or, if you have an existing cluster running, click `Next`. *Connecting to the cloud cluster* -!!! Note +**Note** + You can click `Edit Connection` to make changes to the connection details and retest the connection details. 7. Click `Test Connection` to verify the connection details: diff --git a/product_docs/docs/slony/1.0/01_installation/01_installing_slony_on_a_linux_or_centos_host.mdx b/product_docs/docs/slony/1.0/01_installation/01_installing_slony_on_a_linux_or_centos_host.mdx index 761b5bbb251..9f35c40091e 100644 --- a/product_docs/docs/slony/1.0/01_installation/01_installing_slony_on_a_linux_or_centos_host.mdx +++ b/product_docs/docs/slony/1.0/01_installation/01_installing_slony_on_a_linux_or_centos_host.mdx @@ -76,7 +76,7 @@ Follow the steps given below to install Slony Replication: Where <xx> is the Slony version you want to install. - To install Slony 2.2.8 on CentOS 8 for EDB Advanced Server version 13, the command is: + To install Slony 2.2.10 on CentOS 8 for EDB Postgres Advanced Server version 13, the command is: ```text dnf -y install edb-as13-slony-replication @@ -164,7 +164,7 @@ Follow the steps given below to install Slony Replication: Where <xx> is the Slony version you want to install. - To install Slony 2.2.8 on RHEL 8 for EDB Advanced Server version 13, use the following command: + To install Slony 2.2.10 on RHEL 8 for EDB Postgres Advanced Server version 13, use the following command: ```text dnf -y install edb-as13-slony-replication @@ -176,7 +176,7 @@ Follow the steps given below to install Slony Replication: | --------------------- | ------------------------------------------------------------ | -------------------------- | --------------------------------------------------------------------------------------------- | | `RHEL/CentOS 7 and 8` | `/usr/lib/systemd/system/edb-slony-replication-.service` | `/usr/edb/as` | The configuration file `slony-replication.ini` is located in `/etc/edb/slony-replication` | -In the above table, <xx> represents the Advanced Server version. +In the above table, <xx> represents the EDB Postgres Advanced Server version. diff --git a/product_docs/docs/slony/1.0/01_installation/02_installing_slony_on_a_debian_or_ubuntu_host.mdx b/product_docs/docs/slony/1.0/01_installation/02_installing_slony_on_a_debian_or_ubuntu_host.mdx index 5c73025d918..bc64468d9e6 100644 --- a/product_docs/docs/slony/1.0/01_installation/02_installing_slony_on_a_debian_or_ubuntu_host.mdx +++ b/product_docs/docs/slony/1.0/01_installation/02_installing_slony_on_a_debian_or_ubuntu_host.mdx @@ -8,7 +8,7 @@ legacyRedirectsGenerated: -You must install Advanced Server before installing Slony Replication. For details about installing and configuring Advanced Server, see the *EDB Advanced Server Installation Guide* available at the [EDB website](/epas/latest/). To install a package on a Debian or Ubuntu host, you must have credentials to access the EnterpriseDB repository. If you need EnterpriseDB credentials, visit the [EDB website](https://www.enterprisedb.com/user). +You must install EDB Postgres Advanced Server before installing Slony Replication. For details about installing and configuring EDB Postgres Advanced Server, see the *EDB Postgres Advanced Server Installation Guide* available at the [EDB website](/epas/latest/). To install a package on a Debian or Ubuntu host, you must have credentials to access the EnterpriseDB repository. If you need EnterpriseDB credentials, visit the [EDB website](https://www.enterprisedb.com/user). The following steps will walk you through using the EnterpriseDB repository to install a DEB package. When using the commands, replace the `username` and `password` with the credentials provided by EnterpriseDB. @@ -64,9 +64,9 @@ The following steps will walk you through using the EnterpriseDB repository to i apt-get -y install edb-as-slony-replication ``` - where <xx> is the Advanced Server version. + where <xx> is the EDB Postgres Advanced Server version. - For example, to install Slony Replication for Advanced Server version 13, execute the following command: + For example, to install Slony Replication for EDB Postgres Advanced Server version 13, execute the following command: ```text apt-get -y install edb-as13-slony-replication @@ -78,4 +78,4 @@ The following steps will walk you through using the EnterpriseDB repository to i | ---------------------------------------------------------- | -------------------------- | --------------------------------------------------------------------------------------------------- | | `/lib/systemd/system/edb-as-slony-replication.service` | `/usr/lib/edb-as/` | The configuration file named `slony-replication.ini` is located in `/etc/edb/slony-replication` | -Where <xx> represents the Advanced Server version. +Where <xx> represents the EDB Postgres Advanced Server version. diff --git a/product_docs/docs/slony/1.0/01_installation/03_installing_slony_on_a_windows_host.mdx b/product_docs/docs/slony/1.0/01_installation/03_installing_slony_on_a_windows_host.mdx index 1d4ec7c0b26..dcc6393bf4b 100644 --- a/product_docs/docs/slony/1.0/01_installation/03_installing_slony_on_a_windows_host.mdx +++ b/product_docs/docs/slony/1.0/01_installation/03_installing_slony_on_a_windows_host.mdx @@ -8,11 +8,11 @@ legacyRedirectsGenerated: -Graphical installers for Slony Replication are available via StackBuilder Plus (for Advanced Server hosts) or Stack Builder (on PostgreSQL hosts). +Graphical installers for Slony Replication are available via StackBuilder Plus (for EDB Postgres Advanced Server hosts) or Stack Builder (on PostgreSQL hosts). The following steps walk you through installing Slony Replication via StackBuilder Plus. You can access StackBuilder Plus through your Windows start menu. -1. Open StackBuilder Plus and select your Advanced Server installation from the drop-down list on the `Welcome` window. Click `Next` to continue to the application selection page. +1. Open StackBuilder Plus and select your EDB Postgres Advanced Server installation from the drop-down list on the `Welcome` window. Click `Next` to continue to the application selection page. ![The StackBuilder Plus Welcome window](../images/slony_welcome1.png) diff --git a/product_docs/docs/slony/1.0/01_installation/index.mdx b/product_docs/docs/slony/1.0/01_installation/index.mdx index cf32a590e0d..b6cf7fd6fb2 100644 --- a/product_docs/docs/slony/1.0/01_installation/index.mdx +++ b/product_docs/docs/slony/1.0/01_installation/index.mdx @@ -10,17 +10,16 @@ legacyRedirectsGenerated: This section walks you through installing EDB Slony Replication on a RHEL/CentOS host, a Debian/Ubuntu host, and a Windows host. -The EDB Slony Replication version required by your Advanced Server installation is version-specific, but the documented and supported functionality of each version is the same. +The EDB Slony Replication version required by your EDB Postgres Advanced and PostgreSQL Server installation is version-specific, but the documented and supported functionality of each version is the same. -The following table lists the latest Slony Replication versions and their corresponding Advanced Server versions, and platforms supported by Slony Replication. The information in this guide applies to each version listed in the table below. +The following table lists the latest Slony Replication versions and their corresponding Postgres versions, and platforms supported by Slony Replication. The information in this guide applies to each version listed in the table below. -| **Supported Slony Replication Version** | **Supported Advanced Server Version** | **Supported Platforms** | -| --------------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Slony Replication 2.2` | Advanced Server 13 | RHEL 7 - x86_64 RHEL 8 - x86_64 RHEL 7 - ppc64le Debian 9x Stretch Debian 10x Buster Ubuntu 18.04 Bionic Beaver Ubuntu 20.04 LTS Focal Fossa Windows x86_64 | -| `Slony Replication 2.2` | Advanced Server 12 | RHEL 7 - x86_64 RHEL 8 - x86_64 RHEL 7 - ppc64le Debian 9x Stretch Debian 10x Buster Ubuntu 18.04 Bionic Beaver Windows x86_64 | -| `Slony Replication 2.2` | Advanced Server 11 | RHEL 7 - x86_64 RHEL 7 - ppc64le Debian 9x Stretch Ubuntu 18.04 Bionic Beaver | -| `Slony Replication 2.2` | Advanced Server 10 | RHEL 7 - x86_64 RHEL 7 - ppc64le Windows x86_64 Linux graphical installer | -| `Slony Replication 2.2` | Advanced Server 9.6 | RHEL 7 - x86_64 RHEL 7 - ppc64le Windows x86_64 Linux graphical installer | | +| **Supported Slony Replication Version** | **Supported Postgres Version** | **Supported Platforms** | +| --------------------------------------- | -------------------------------------------------------| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Slony Replication 2.2` | EDB Postgres Advanced and PostgreSQL Server 13 | RHEL 7 - x86_64 and RHEL 8 - x86_64
RHEL 7 - ppc64le
Debian 9x Stretch and Debian 10x Buster
Ubuntu 18.04 Bionic Beaver and Ubuntu 20.04 LTS Focal Fossa
Windows x86_64 | +| `Slony Replication 2.2` | EDB Postgres Advanced and PostgreSQL Server 12 | RHEL 7 - x86_64 and RHEL 8 - x86_64
RHEL 7 - ppc64le
Debian 9x Stretch and Debian 10x Buster
Ubuntu 18.04 Bionic Beaver
Windows x86_64 | +| `Slony Replication 2.2` | EDB Postgres Advanced and PostgreSQL Server 11 | RHEL and RHEL 8 x86_64
RHEL 7 - ppc64le
Debian 9x Stretch
Ubuntu 18.04 Bionic Beaver
Windows x86_64 | +| `Slony Replication 2.2` | EDB Postgres Advanced and PostgreSQL Server 10 and 9.6 | RHEL 7 - x86_64
RHEL 7 - ppc64le
Windows x86_64 and Linux graphical installer |
diff --git a/product_docs/docs/slony/1.0/02_configuration_and_usage.mdx b/product_docs/docs/slony/1.0/02_configuration_and_usage.mdx index 7b2b5967f1d..51830a7cf02 100644 --- a/product_docs/docs/slony/1.0/02_configuration_and_usage.mdx +++ b/product_docs/docs/slony/1.0/02_configuration_and_usage.mdx @@ -8,9 +8,9 @@ legacyRedirectsGenerated: -On a CentOS and Debian host, the configuration file (`slony-replication.ini`) is located in the `/etc/edb/slony-replication` directory and the ppas95-replication configuration file (`ppas95-replication.ini`) is located in the `/etc/ppas95-replication` directory. Use the configuration file to specify connection information for the master and standby nodes. +On a CentOS and Debian host, the configuration file (`slony-replication.ini`) is located in the `/etc/edb/slony-replication` directory. Use the configuration file to specify connection information for the master and standby nodes. -On a Windows host, the configuration files are named `master.conf.sample` and `slave.conf.sample`, and are located in the `/etc` directory, under the Advanced Server installation; before configuring Slony Replication, you must rename the configuration files to `master.conf` and `slave.conf`. +On a Windows host, the configuration files are named `master.conf.sample` and `slave.conf.sample`, and are located in the `/etc` directory, under the EDB Postgres Advanced Server installation; before configuring Slony Replication, you must rename the configuration files to `master.conf` and `slave.conf`. For information about configuring a Slony Replication environment, please refer to the [Slony official project documentation](https://www.slony.info/adminguide/2.2/doc/adminguide/slony.pdf). diff --git a/product_docs/docs/slony/1.0/03_upgrade.mdx b/product_docs/docs/slony/1.0/03_upgrade.mdx index 28186d61691..fd35cf164c3 100644 --- a/product_docs/docs/slony/1.0/03_upgrade.mdx +++ b/product_docs/docs/slony/1.0/03_upgrade.mdx @@ -16,9 +16,9 @@ Assume identity of the root user and invoke the following command: yum upgrade edb-as-slony-replication* ``` -where <xx> is the Advanced Server version. +where <xx> is the EDB Postgres Advanced Server version. -For example, to upgrade Slony Replication for Advanced Server version 9.6, you need to execute the command: +For example, to upgrade Slony Replication for EDB Postgres Advanced Server version 9.6, you need to execute the command: ```text yum upgrade epas96-replication diff --git a/product_docs/docs/slony/1.0/04_uninstallation.mdx b/product_docs/docs/slony/1.0/04_uninstallation.mdx index 2e5d59c98ff..e4f4096786b 100644 --- a/product_docs/docs/slony/1.0/04_uninstallation.mdx +++ b/product_docs/docs/slony/1.0/04_uninstallation.mdx @@ -18,7 +18,7 @@ On RHEL/CentOS 7: yum remove edb-as-slony-replication* ``` -where <xx> is the Advanced Server version. +where <xx> is the EDB Postgres Advanced Server version. On RHEL/CentOS 8: @@ -34,7 +34,7 @@ To uninstall Slony Replication on a Debian or Ubuntu host, invoke the following apt-get remove edb-as-slony-replication* ``` -where <xx> is the Advanced Server version. +where <xx> is the EDB Postgres Advanced Server version. ## Uninstalling Slony Replication on a Windows Host diff --git a/scripts/pdf/Signika-Bold.ttf b/scripts/pdf/Signika-Bold.ttf deleted file mode 100755 index e0e72efb455..00000000000 Binary files a/scripts/pdf/Signika-Bold.ttf and /dev/null differ diff --git a/scripts/pdf/Signika-Light-modified.ttf b/scripts/pdf/Signika-Light-modified.ttf new file mode 100644 index 00000000000..d516397b2b6 Binary files /dev/null and b/scripts/pdf/Signika-Light-modified.ttf differ diff --git a/scripts/pdf/SourceCodePro-Italic.ttf b/scripts/pdf/SourceCodePro-Italic.ttf deleted file mode 100755 index 91a2a44fd31..00000000000 Binary files a/scripts/pdf/SourceCodePro-Italic.ttf and /dev/null differ diff --git a/scripts/pdf/generate_pdf.py b/scripts/pdf/generate_pdf.py old mode 100644 new mode 100755 index c599d1190e9..f9082851c7b --- a/scripts/pdf/generate_pdf.py +++ b/scripts/pdf/generate_pdf.py @@ -1,20 +1,26 @@ +#!/usr/bin/env python3 + import os import re import sys -import datetime -import pathlib +from datetime import datetime +from itertools import chain +from pathlib import Path +from subprocess import run + +BASE_DIR = Path(__file__).resolve().parent -basePath = pathlib.Path(__file__).parent.absolute() +ANSI_STOP = "\033[0m" +ANSI_BLUE = "\033[34m" +ANSI_GREEN = "\033[32m" +ANSI_YELLOW = "\033[33m" +ANSI_RED = "\033[31m" -ANSI_STOP = '\033[0m' -ANSI_BLUE = '\033[34m' -ANSI_GREEN = '\033[32m' -ANSI_YELLOW = '\033[33m' -ANSI_RED = '\033[31m' # magic snippet for inline repl # import code; code.interact(local=dict(globals(), **locals())) + class ToCItem: def __init__(self, filename, chapter): self.filename = filename @@ -22,36 +28,43 @@ def __init__(self, filename, chapter): self.title = "" self.anchor = "" + def putIndexFirst(e): return e.filename.replace("index.mdx", "00_index.mdx") + def putIndexFirst2(e): return e.replace("index.mdx", "00_index.mdx") + def getFilename(file): - return file.filename + return file.filename + def filterList(filename): - if '.png' in filename or 'images' in filename or '.DS_Store' in filename: + if ".png" in filename or "images" in filename or ".DS_Store" in filename: return False else: return True + def getTitle(dirName): - indexPath = dirName + '/index.mdx' + indexPath = dirName + "/index.mdx" if os.path.exists(indexPath): - indexFile = open(indexPath, 'r') + indexFile = open(indexPath, "r") for line in indexFile.readlines(): - if 'title: ' in line: - return stripQuotes(line.replace('title: ', '')) + if "title: " in line: + return stripQuotes(line.replace("title: ", "")) return None + def stripQuotes(str): return str.strip().strip("'").strip('"') + def getListOfFiles(dirName, parentChapter): - # create a list of file and sub directories - # names in the given directory + # create a list of file and sub directories + # names in the given directory listOfFiles = list(filter(filterList, os.listdir(dirName))) listOfFiles.sort(key=putIndexFirst2) allFiles = list() @@ -61,34 +74,37 @@ def getListOfFiles(dirName, parentChapter): for entry in listOfFiles: # Create full path fullPath = os.path.join(dirName, entry) - # If entry is a directory then get the list of files in this directory + # If entry is a directory then get the list of files in this directory if os.path.isdir(fullPath): - allFiles = allFiles + getListOfFiles(fullPath, parentChapter + str(chapter) + ".") - elif '.mdx' in entry or '.md' in entry: + allFiles = allFiles + getListOfFiles( + fullPath, parentChapter + str(chapter) + "." + ) + elif ".mdx" in entry or ".md" in entry: allFiles.append(ToCItem(fullPath, parentChapter + str(chapter))) - + chapter += 1 return allFiles - + + def main(): - dirName = '' + dirName = "" try: dirName = sys.argv[1] - dirName = re.sub(r'\/$', '', dirName) - except: - print('directory not passed in') - print('if running from yarn use `yarn build-pdf directory/path/here`') + dirName = re.sub(r"\/$", "", dirName) + except BaseException: + print("directory not passed in") + print("if running from yarn use `yarn build-pdf directory/path/here`") sys.exit(1) openPdf = False html = False try: - html = (sys.argv[2] == '--html') - openPdf = (sys.argv[2] == '--open') - except: + html = sys.argv[2] == "--html" + openPdf = sys.argv[2] == "--open" + except BaseException: pass - splitDirName = dirName.split('/') + splitDirName = dirName.split("/") product = splitDirName[2] version = splitDirName[3] @@ -98,20 +114,19 @@ def main(): fullProductPdf = False guide = splitDirName[4] - mdxFilePath = "{0}/{1}_v{2}_documentation.mdx".format(dirName, product, version) - htmlFilePath = "{0}/{1}_v{2}_documentation.html".format(dirName, product, version) - coverFilePath = "{0}/{1}_v{2}_documentation_cover.html".format(dirName, product, version) - pdfFilePath = "{0}/{1}_v{2}_{3}documentation.pdf".format( - dirName, - product, - version, - guide + '_' if guide else '' + _file_prefix = f"{dirName}/{product}_v{version}" + _doc_prefix = f"{_file_prefix}_documentation" + mdxFilePath = f"{_doc_prefix}.mdx" + htmlFilePath = f"{_doc_prefix}.html" + coverFilePath = f"{_doc_prefix}_cover.html" + pdfFilePath = f"{_file_prefix}" "_{}documentation.pdf".format( + guide + "_" if guide else "" ) - print(ANSI_BLUE + 'building {}'.format(pdfFilePath) + ANSI_STOP) + print(f"{ANSI_BLUE}building {pdfFilePath}{ANSI_STOP}") if not os.path.exists(dirName): - raise Exception('directory does not exist') + raise Exception("directory does not exist") if os.path.exists(mdxFilePath): os.remove(mdxFilePath) @@ -119,26 +134,25 @@ def main(): # Get the list of all files in directory tree at given path listOfFiles = getListOfFiles(dirName, "") if len(listOfFiles) == 0: - raise Exception('no files in {}'.format(dirName)); + raise Exception(f"no files in {dirName}") if fullProductPdf: - listOfFiles.pop(0) # remove base product index page, which are empty + listOfFiles.pop(0) # remove base product index page, which are empty - toc = list() for elem in listOfFiles: g = open(elem.filename, "r") for line in g.readlines(): if "title: " in line: - elem.title = line[7:].replace('"', '').replace('\n','') + elem.title = line[7:].replace('"', "").replace("\n", "") pattern = re.compile('div id="(.*?)" class="registered_link"') tag = pattern.search(line) if tag and len(elem.anchor) == 0: elem.anchor = tag.group(1) - resourceSearchPaths = { dirName } - + resourceSearchPaths = {dirName} + # Print the files - with open(mdxFilePath, 'w') as fp: + with open(mdxFilePath, "w") as fp: for elem in listOfFiles: g = open(elem.filename, "r") @@ -158,90 +172,113 @@ def main(): if frontmatterCount == 0: fp.write(newLine) if "title: " in line: - newLine = re.sub(r'\.0', '', elem.chapter) + (" " * 10) + stripQuotes(line[7:]) + "\n" + newLine = ( + re.sub(r"\.0", "", elem.chapter) + + (" " * 10) + + stripQuotes(line[7:]) + + "\n" + ) fp.write(newLine) if "---" in line and frontmatterCount > 0: frontmatterCount -= 1 fp.write(newLine) - fp.write('\n') + fp.write("\n") title = getTitle(dirName) or product - print('generating docs html') - os.system( - "pandoc {0} " \ - "-f gfm " \ - "--self-contained " \ - '--highlight-style tango ' \ - "--css={3}/pdf-styles.css " \ - "--resource-path={2} " \ - "-o {1}".format(mdxFilePath, htmlFilePath, ':'.join(resourceSearchPaths), basePath) + print("generating docs html") + output = run( + [ + "pandoc", + mdxFilePath, + "--from=gfm", + "--self-contained", + "--highlight-style=tango", + f"--css={BASE_DIR / 'pdf-styles.css'}", + f"--resource-path={':'.join(resourceSearchPaths)}", + f"--output={htmlFilePath}", + ] ) + output.check_returncode() if not os.path.exists(htmlFilePath): os.remove(mdxFilePath) - raise Exception("\033[91m html file failed to generate for {} \033[0m".format(mdxFilePath)) + raise Exception( + f"\033[91m html file failed to generate for {mdxFilePath} \033[0m" + ) if html: - os.system("open " + htmlFilePath) + run(["open", htmlFilePath]) else: - print('generating cover page') - os.system( - "sed " \ - "-e \"s/\[PRODUCT\]/{1}/\" " \ - "-e \"s/\[VERSION\]/{2}/\" " \ - "scripts/pdf/cover.html " \ - "> {0}" \ - "".format(coverFilePath, title, version) - ) - - headerFooterOptions = "" \ - "--header-right [doctitle] " \ - "--header-font-name Signika " \ - "--header-font-size 8 " \ - "--header-spacing 7 " \ - "--footer-right [page] " \ - "--footer-left 'Copyright © 2009 - {0} EnterpriseDB Corporation. All rights reserved.' " \ - "--footer-font-name Signika " \ - "--footer-font-size 8 " \ - "--footer-spacing 7 ".format(datetime.datetime.now().year) - - print('converting html to pdf') - os.system( - "wkhtmltopdf " \ - "--log-level error " \ - "--title \"{3}\" " \ - "--margin-top 15mm " \ - "--margin-bottom 15mm " \ - "{0} " \ - "--footer-font-name Signika " \ - "--footer-font-size 8 " \ - "--footer-spacing 7 " \ - "--footer-left 'Copyright © 2009 - {6} EnterpriseDB Corporation. All rights reserved.' " \ - "--footer-right 'Built at {5}' " \ - "toc --xsl-style-sheet scripts/pdf/toc-style.xsl " \ - "{4} " \ - "{1} " \ - "{4} " \ - "{2} " \ - "".format( - coverFilePath, - htmlFilePath, - pdfFilePath, - title, - headerFooterOptions, - datetime.datetime.utcnow().isoformat()[0:-7], - datetime.datetime.now().year - ) + print("generating cover page") + with open(BASE_DIR / "cover.html") as source, open( + coverFilePath, "w" + ) as output: + data = source.read() + data = data.replace("[PRODUCT]", title) + data = data.replace("[VERSION]", version) + output.write(data) + + headerFooterCommon = [ + "--header-font-name", + "Signika", + "--header-font-size", + "8", + "--header-spacing", + "7", + "--footer-font-name", + "Signika", + "--footer-font-size", + "8", + "--footer-spacing", + "7", + "--footer-left", + f"Copyright © 2009 - {datetime.now().year} EnterpriseDB Corporation. " + "All rights reserved.", + ] + + headerFooterOptions = [ + "--header-right", + "[doctitle]", + "--footer-right", + "[page]", + ] + + print("converting html to pdf") + output = run( + [ + "wkhtmltopdf", + "--log-level", + "error", + "--title", + title, + "--margin-top", + "15mm", + "--margin-bottom", + "15mm", + *headerFooterCommon, + coverFilePath, + "--footer-right", + f"Built at {datetime.utcnow().replace(microsecond=0).isoformat()}", + "toc", + "--xsl-style-sheet", + "scripts/pdf/toc-style.xsl", + *headerFooterOptions, + htmlFilePath, + *headerFooterOptions, + pdfFilePath, + ] ) + output.check_returncode() if openPdf: - os.system("open " + pdfFilePath) + run(["open", pdfFilePath]) os.remove(mdxFilePath) if not html: os.remove(htmlFilePath) os.remove(coverFilePath) -if __name__ == '__main__': + +if __name__ == "__main__": main() diff --git a/scripts/pdf/pdf-styles.css b/scripts/pdf/pdf-styles.css index 7ab3a40dbea..7ef55ce70bc 100644 --- a/scripts/pdf/pdf-styles.css +++ b/scripts/pdf/pdf-styles.css @@ -1,14 +1,20 @@ @font-face { - font-family: "Signika"; + font-family: "SignikaRegular"; src: url("Signika-Regular.ttf") format("truetype"); font-weight: normal; } -/*@font-face { - font-family: "Signika"; - src: url("Signika-Bold.ttf") format("truetype"); - font-weight: bold; -}*/ +@font-face { + /* + To get multiple Signika fonts to work with wkhtmltopdf, I needed to edit the font + using FontForge. You need to change the "Preferred Family" attribute to be unique, + otherwise wkhtmltopdf will only use one of the fonts. See https://stackoverflow.com/a/45524377 + */ + + font-family: "SignikaLight"; + src: url("Signika-Light-modified.ttf") format("truetype"); + font-weight: 300; +} @font-face { font-family: "Source Code Pro"; @@ -16,24 +22,19 @@ font-style: normal; } -/* Not currently used */ -/*@font-face { - font-family: "Source Code Pro"; - src: url("SourceCodePro-Italic.ttf") format("truetype"); - font-style: italic; -}*/ - body { font-size: 28px; + font-weight: 300; + font-family: SignikaLight; } body::before { content: ' '; /* this is needed to fix some font rendering quirk */ - font-family: sans-serif; + font-family: SignikaLight; } h1, h2, h3, h4, h5, h6, th { - font-family: Signika; + font-family: SignikaRegular; font-weight: normal; } @@ -76,29 +77,29 @@ img { /* Code */ -code { - border-radius: .2rem; +pre, code { + font-family: Source Code Pro; + font-weight: normal; padding: .3rem; - color: #457a00; - background-color: #f0f4f7; - white-space: pre-wrap; + border-radius: .2rem; } -pre code { - color: black; - background-color: #f8f8f8; /* match SourceCode pandoc highlighting colors */ +code { + color: #457a00; + background-color: #f0f4f7; white-space: pre-wrap !important; /* SourceCode pandoc will override otherwise */ } pre { - font-family: Source Code Pro; - font-weight: normal; background-color: #f8f8f8; /* match SourceCode pandoc highlighting colors */ - border-radius: .2rem; - padding: .3rem; margin-bottom: 2rem; } +pre code { + color: black; + background-color: #f8f8f8; /* match SourceCode pandoc highlighting colors */ +} + /* Tables */ table { diff --git a/src/components/top-bar.js b/src/components/top-bar.js index 225c565fbe4..f0d20fd850f 100644 --- a/src/components/top-bar.js +++ b/src/components/top-bar.js @@ -8,12 +8,12 @@ const TopBar = () => { variant="primary" className="topbar m-0 rounded-0 text-center align-middle" > - This is a beta of EDB Docs 2.0. + This is the redesigned EDB Docs site. For older product docs, go to the - Go to EDB Docs 1.0 + EDB Docs Archive ); diff --git a/src/constants/algolia-indexing.js b/src/constants/algolia-indexing.js index 3087775c7a2..949eab8222c 100644 --- a/src/constants/algolia-indexing.js +++ b/src/constants/algolia-indexing.js @@ -1,10 +1,19 @@ const utf8Truncate = require('truncate-utf8-bytes'); - -const transformNodeForAlgolia = (node) => { +const { + mdxNodesToTree, + computeFrontmatterForTreeNode, +} = require('./gatsby-node-utils.js'); + +// this function is weird - note that it's modifying the node in place +// NOT returning a copy of the node +const mdxNodeToAlgoliaNode = (node) => { let newNode = node; + + // base newNode['title'] = node.frontmatter.title; newNode['path'] = node.fields.path; - newNode['type'] = 'guide'; + + // optional if (node.frontmatter.product) { newNode['product'] = node.frontmatter.product; } @@ -12,49 +21,20 @@ const transformNodeForAlgolia = (node) => { newNode['platform'] = node.frontmatter.platform; } + // docType specific if (node.fields.docType == 'doc') { newNode['product'] = node.fields.product; newNode['version'] = node.fields.version; - newNode['productVersion'] = - node.fields.product + ' > ' + node.fields.version; newNode['type'] = 'doc'; + } else { + newNode['type'] = 'guide'; } + // clean up some keys we don't need anymore delete newNode['frontmatter']; delete newNode['fields']; - return newNode; -}; - -const makePathDictionary = (nodes) => { - let dictionary = {}; - for (let node of nodes) { - dictionary[node.fields.path] = node.frontmatter.title; - } - return dictionary; -}; - -const makeBreadcrumbs = (node, dictionary, advocacy = false) => { - let depth = advocacy ? 3 : 4; - let trail = ''; - const path = node.fields.path; - const pathPieces = path.split('/'); - for (let i = depth; i < pathPieces.length; i++) { - let parentPath = pathPieces.slice(0, i).join('/'); - trail += dictionary[parentPath] + ' / '; - } - return trail; -}; -const addBreadcrumbsToNodes = (nodes) => { - const pathDictionary = makePathDictionary(nodes); - let newNodes = []; - for (let node of nodes) { - let newNode = node; - const advocacy = !node.fields.product; - newNode['breadcrumb'] = makeBreadcrumbs(node, pathDictionary, advocacy); - newNodes.push(newNode); - } - return newNodes; + return newNode; }; const mdxTreeToSearchNodes = (rootNode) => { @@ -128,9 +108,11 @@ const trimSpaces = (str) => { return str.replace(/\s+/g, ' ').trim(); }; -const splitNodeContent = (nodes) => { +const buildFinalAlgoliaNodes = (nodes) => { const result = []; for (const node of nodes) { + const algoliaNode = mdxNodeToAlgoliaNode(node); + // skip indexing this content for now if ( node.path.includes('/postgresql_journey/') || @@ -167,11 +149,24 @@ const splitNodeContent = (nodes) => { return result; }; -const algoliaTransformer = ({ data }) => - splitNodeContent( - addBreadcrumbsToNodes(data.allMdx.nodes).map((node) => - transformNodeForAlgolia(node), - ), - ); +const algoliaTransformer = ({ data }) => { + const mdxNodes = []; + + // build tree to compute inherited frontmatter + const treeRoot = mdxNodesToTree(data.allMdx.nodes); + const navStack = [treeRoot]; + let curr = null; + + while (navStack.length > 0) { + curr = navStack.pop(); + curr.children.forEach((child) => navStack.push(child)); + if (!curr.mdxNode) continue; + + curr.mdxNode.frontmatter = computeFrontmatterForTreeNode(curr); + mdxNodes.push(curr.mdxNode); + } + + return buildFinalAlgoliaNodes(mdxNodes); +}; module.exports = algoliaTransformer;