docs: Make group for module documentation

This change extracts module documentation deps into their own GN group
usable by downstream projects.

Change-Id: I49eb211cbbf13bb105a739729e64cebf73722d26
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17623
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
diff --git a/docs/BUILD.gn b/docs/BUILD.gn
index 0d5bdbb..739a981 100644
--- a/docs/BUILD.gn
+++ b/docs/BUILD.gn
@@ -45,21 +45,8 @@
   ]
 }
 
-pw_doc_gen("docs") {
-  conf = "conf.py"
-  sources = [
-    "../CODE_OF_CONDUCT.md",
-    "../CONTRIBUTING.md",
-    "../README.md",
-    "build_system.rst",
-    "index.rst",
-    "module_guides.rst",
-    "targets.rst",
-  ]
-  output_directory = target_gen_dir
+group("module_docs") {
   deps = [
-    ":core_docs",
-    ":target_docs",
     "$dir_docker:docs",
     "$dir_pw_allocator:docs",
     "$dir_pw_assert:docs",
@@ -117,3 +104,22 @@
     "$dir_pw_web_ui:docs",
   ]
 }
+
+pw_doc_gen("docs") {
+  conf = "conf.py"
+  sources = [
+    "../CODE_OF_CONDUCT.md",
+    "../CONTRIBUTING.md",
+    "../README.md",
+    "build_system.rst",
+    "index.rst",
+    "module_guides.rst",
+    "targets.rst",
+  ]
+  output_directory = target_gen_dir
+  deps = [
+    ":core_docs",
+    ":module_docs",
+    ":target_docs",
+  ]
+}