From 0c999e87f7e6fbd609edd1b55bf9ec24171dfa78 Mon Sep 17 00:00:00 2001 From: EMaksy Date: Tue, 18 Nov 2025 11:04:19 +0100 Subject: [PATCH 1/5] Add local docs build --- docker-compose.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d37e92e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: "3.9" + +services: + trento-docs: + image: node:20-bullseye + volumes: + - .:/workspace + - trento-docs-node_modules:/workspace/trento-docs-site/node_modules + working_dir: /workspace/trento-docs-site + command: > + bash -lc " + npm install --no-save antora http-server && + npx antora antora-playbook.yml && + npx http-server build/trento-docs-site-public/ -c-1 -p 3000 + " + ports: + - "3000:3000" + +volumes: + trento-docs-node_modules: \ No newline at end of file From c0f1c7c4e0b64dfb766bc4f9a679c5f59416c916 Mon Sep 17 00:00:00 2001 From: EMaksy Date: Tue, 18 Nov 2025 15:26:19 +0100 Subject: [PATCH 2/5] Fix selinux permission --- docker-compose.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d37e92e..72d6152 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,8 @@ -version: "3.9" - services: trento-docs: image: node:20-bullseye volumes: - - .:/workspace + - .:/workspace:z - trento-docs-node_modules:/workspace/trento-docs-site/node_modules working_dir: /workspace/trento-docs-site command: > From bc379cfee097e65d79237c941a73f8da6807de84 Mon Sep 17 00:00:00 2001 From: EMaksy Date: Tue, 18 Nov 2025 15:43:11 +0100 Subject: [PATCH 3/5] Add workflow guide --- .../preview-docs-with-docker.adoc | 37 +++++++++++++++++++ .../modules/developer/nav_developer.adoc | 1 + 2 files changed, 38 insertions(+) create mode 100644 content/trento-docs-site/preview-docs-with-docker.adoc diff --git a/content/trento-docs-site/preview-docs-with-docker.adoc b/content/trento-docs-site/preview-docs-with-docker.adoc new file mode 100644 index 0000000..d1eac91 --- /dev/null +++ b/content/trento-docs-site/preview-docs-with-docker.adoc @@ -0,0 +1,37 @@ +== Local Documentation Preview with Docker + +Easy way to locally preview documentation changes without installing repository dependencies (like Node.js or Antora) on your host machine. You only need Docker or Podman. + +=== Prerequisites + +* Docker Engine (or Podman) installed. +* Docker Compose installed. + +=== Workflow + +. **Start the Preview** ++ +Navigate to the root directory of the repository and run the following command. This starts the build process inside a container: ++ +[source,bash] +---- +docker compose up +---- ++ + + +. **Check the Docs** ++ +Once the build is complete and the server starts, open your browser and navigate to: ++ +http://localhost:3000 + +. **Review and Rebuild** ++ +The container builds the site and serves it. To view new changes: ++ +* Stop the container (press `Ctrl+C`). +* Make your changes to the source files. +* Run `docker compose up` again. ++ +The container will rebuild the documentation with your new changes for preview. \ No newline at end of file diff --git a/trento-docs-site/modules/developer/nav_developer.adoc b/trento-docs-site/modules/developer/nav_developer.adoc index 8c66267..f0c1342 100644 --- a/trento-docs-site/modules/developer/nav_developer.adoc +++ b/trento-docs-site/modules/developer/nav_developer.adoc @@ -41,6 +41,7 @@ ** Trento Documentation Page *** xref:trento-docs-site/README.adoc[Documentation Page] +*** xref:trento-docs-site/preview-docs-with-docker.adoc[Local Documentation Preview with Docker] *** xref:trento-docs-site/contribution-upstream/components-nav-guide.adoc[Component Documentation Navigation Guide] *** xref:trento-docs-site/collaboration-docs-team/docs-git-workflow.adoc[Git Workflow for Trento Documentation] *** xref:trento-docs-site-ui/README.adoc[Documentation Page UI] From 4c398b79c4f79a7ace6ee284478555596a2bad5f Mon Sep 17 00:00:00 2001 From: EMaksy Date: Tue, 18 Nov 2025 15:50:51 +0100 Subject: [PATCH 4/5] improve format --- content/trento-docs-site/preview-docs-with-docker.adoc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/content/trento-docs-site/preview-docs-with-docker.adoc b/content/trento-docs-site/preview-docs-with-docker.adoc index d1eac91..542d425 100644 --- a/content/trento-docs-site/preview-docs-with-docker.adoc +++ b/content/trento-docs-site/preview-docs-with-docker.adoc @@ -1,11 +1,11 @@ == Local Documentation Preview with Docker -Easy way to locally preview documentation changes without installing repository dependencies (like Node.js or Antora) on your host machine. You only need Docker or Podman. +Easy way to locally preview documentation changes without installing repository dependencies (like Node.js or Antora) on your host machine. === Prerequisites -* Docker Engine (or Podman) installed. -* Docker Compose installed. +* Docker Engine (or Podman). +* Docker Compose. === Workflow @@ -19,7 +19,6 @@ docker compose up ---- + - . **Check the Docs** + Once the build is complete and the server starts, open your browser and navigate to: From 913b260bd639ec72eda14e3b748f50f6b4380332 Mon Sep 17 00:00:00 2001 From: EMaksy Date: Tue, 18 Nov 2025 16:25:23 +0100 Subject: [PATCH 5/5] improve wording --- content/trento-docs-site/preview-docs-with-docker.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/trento-docs-site/preview-docs-with-docker.adoc b/content/trento-docs-site/preview-docs-with-docker.adoc index 542d425..5bd74e1 100644 --- a/content/trento-docs-site/preview-docs-with-docker.adoc +++ b/content/trento-docs-site/preview-docs-with-docker.adoc @@ -11,7 +11,7 @@ Easy way to locally preview documentation changes without installing repository . **Start the Preview** + -Navigate to the root directory of the repository and run the following command. This starts the build process inside a container: +To start the build process inside a container, navigate to the root directory of the repository and run the following command: + [source,bash] ----