Sup folks!!! I have a monorepo style project with multiple packages on it, is it possible to generate a single dartdoc style documentation for all of them ??
what i would like to happen is that when i do something like flutter dart pub global run dartdoc packages output public/api that api folder contains the documentation of all those packages. Currently dardocs expects a lib folder for it to work (at least thats what my google foo is telling me) any ideas ??
This should generate dart doc for all packages in packages/core under /docs/combined dir. Change it to your values and it should work.
#!/bin/bash
# Base directory containing all the packages
base_dir="./packages/core"
# Output directory for combined documentation
output_base="$(pwd)/docs/combined"
# Create the output base directory if it doesn't exist
mkdir -p "$output_base"
# Iterate through each subdirectory in the base directory
for package in "$base_dir"/*; do
if [ -d "$package" ]; then
package_name=$(basename "$package")
output_dir="$output_base/$package_name"
echo "Generating documentation for $package_name..."
(cd "$package" && dart doc --output "$output_dir")
echo "Documentation for $package_name generated at $output_dir"
fi
done
echo "Combined documentation created"
I tried something similar but the issue is that that would create 4 different folders with their own dartdocs for each one, what im after is having a single dartdoc document for all packages
Using contents of this forum for the purposes of training proprietary AI models is forbidden. Only if your AI model is free & open source, go ahead and scrape. Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.