From 89bc1335c5c6f9ccf0dfb07b4d7b23d663d8496f Mon Sep 17 00:00:00 2001 From: exceptionfactory Date: Fri, 22 Nov 2024 11:04:30 -0600 Subject: [PATCH] NIFI-14040 Added Additional Details for Component Documentation --- .gitignore | 1 + prebuild.sh | 3 +- prebuild/assets/additional-details-header.md | 6 +++ prebuild/layouts/index.html | 42 ++++++++++++++++++++ themes/nifi/layouts/partials/component.html | 14 +++++++ themes/nifi/static/css/main.css | 6 +++ 6 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 prebuild/assets/additional-details-header.md diff --git a/.gitignore b/.gitignore index e12f7329..3d7bb5a5 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ nifi-runtime-manifest.json /.hugo_build.lock /prebuild/public /prebuild/.hugo_build.lock +/prebuild/assets/docs diff --git a/prebuild.sh b/prebuild.sh index 6fcc2549..7f38b8b3 100644 --- a/prebuild.sh +++ b/prebuild.sh @@ -10,6 +10,7 @@ MAVEN_BASE_URL=https://repo1.maven.org/maven2 MANIFEST_JAR_URL="$MAVEN_BASE_URL/org/apache/nifi/nifi-runtime-manifest/$CURRENT_VERSION/nifi-runtime-manifest-$CURRENT_VERSION.jar" MANIFEST_JAR_PATH=$RESOURCES_DIR/nifi-runtime-manifest.jar MANIFEST_JSON=nifi-runtime-manifest.json +MANIFEST_DOCS_DIR=docs NIFI_DOCS_ZIP_URL="$MAVEN_BASE_URL/org/apache/nifi/nifi-docs/$CURRENT_VERSION/nifi-docs-$CURRENT_VERSION-resources.zip" NIFI_DOCS_ZIP_PATH=$RESOURCES_DIR/nifi-docs-resources.zip @@ -22,7 +23,7 @@ fi # Download Runtime Manifest JAR and extract JSON to prebuild echo "Downloading $MANIFEST_JAR_URL" curl -o $MANIFEST_JAR_PATH $MANIFEST_JAR_URL -unzip -q -o -d $PREBUILD_DIR/assets $MANIFEST_JAR_PATH $MANIFEST_JSON +unzip -q -o -d $PREBUILD_DIR/assets $MANIFEST_JAR_PATH $MANIFEST_JSON $MANIFEST_DOCS_DIR # Download Documentation Resources and extract to prebuild echo "Downloading $NIFI_DOCS_ZIP_URL" diff --git a/prebuild/assets/additional-details-header.md b/prebuild/assets/additional-details-header.md new file mode 100644 index 00000000..4971ff43 --- /dev/null +++ b/prebuild/assets/additional-details-header.md @@ -0,0 +1,6 @@ +--- +build: + list: never + publishResources: false + render: never +--- diff --git a/prebuild/layouts/index.html b/prebuild/layouts/index.html index 0059840d..2db7d518 100644 --- a/prebuild/layouts/index.html +++ b/prebuild/layouts/index.html @@ -7,6 +7,8 @@ not found {{ end }} +{{ $detailsHeader := resources.Get "additional-details-header.md" }} + {{ range $manifest.bundles }} {{ range .componentManifest.controllerServices }} {{ $simpleClassName := replaceRE `.+?\.?([^\.]+)$` "$1" .type }} @@ -15,6 +17,14 @@ {{ $filename := printf "components/%s/_index.md" .type }} {{ $resource := resources.FromString $filename $string }} {{ $file := $resource.RelPermalink }} + + {{ if .additionalDetails }} + {{ $detailsMarkdownPath := printf "docs/%s/%s/%s/%s/additionalDetails.md" .group .artifact .version .type }} + {{ $detailsResource := resources.Get $detailsMarkdownPath }} + {{ $componentDetailsPath := printf "components/%s/additional-details.md" .type }} + {{ $componentDetailsResource := slice $detailsHeader $detailsResource | resources.Concat $componentDetailsPath }} + {{ $componentDetailsResource.Publish }} + {{ end }} {{ end }} {{ range .componentManifest.processors }} {{ $simpleClassName := replaceRE `.+?\.?([^\.]+)$` "$1" .type }} @@ -23,6 +33,14 @@ {{ $filename := printf "components/%s/_index.md" .type }} {{ $resource := resources.FromString $filename $string }} {{ $file := $resource.RelPermalink }} + + {{ if .additionalDetails }} + {{ $detailsMarkdownPath := printf "docs/%s/%s/%s/%s/additionalDetails.md" .group .artifact .version .type }} + {{ $detailsResource := resources.Get $detailsMarkdownPath }} + {{ $componentDetailsPath := printf "components/%s/additional-details.md" .type }} + {{ $componentDetailsResource := slice $detailsHeader $detailsResource | resources.Concat $componentDetailsPath }} + {{ $componentDetailsResource.Publish }} + {{ end }} {{ end }} {{ range .componentManifest.reportingTasks }} {{ $simpleClassName := replaceRE `.+?\.?([^\.]+)$` "$1" .type }} @@ -31,6 +49,14 @@ {{ $filename := printf "components/%s/_index.md" .type }} {{ $resource := resources.FromString $filename $string }} {{ $file := $resource.RelPermalink }} + + {{ if .additionalDetails }} + {{ $detailsMarkdownPath := printf "docs/%s/%s/%s/%s/additionalDetails.md" .group .artifact .version .type }} + {{ $detailsResource := resources.Get $detailsMarkdownPath }} + {{ $componentDetailsPath := printf "components/%s/additional-details.md" .type }} + {{ $componentDetailsResource := slice $detailsHeader $detailsResource | resources.Concat $componentDetailsPath }} + {{ $componentDetailsResource.Publish }} + {{ end }} {{ end }} {{ range .componentManifest.parameterProviders }} {{ $simpleClassName := replaceRE `.+?\.?([^\.]+)$` "$1" .type }} @@ -39,6 +65,14 @@ {{ $filename := printf "components/%s/_index.md" .type }} {{ $resource := resources.FromString $filename $string }} {{ $file := $resource.RelPermalink }} + + {{ if .additionalDetails }} + {{ $detailsMarkdownPath := printf "docs/%s/%s/%s/%s/additionalDetails.md" .group .artifact .version .type }} + {{ $detailsResource := resources.Get $detailsMarkdownPath }} + {{ $componentDetailsPath := printf "components/%s/additional-details.md" .type }} + {{ $componentDetailsResource := slice $detailsHeader $detailsResource | resources.Concat $componentDetailsPath }} + {{ $componentDetailsResource.Publish }} + {{ end }} {{ end }} {{ range .componentManifest.flowAnalysisRules }} {{ $simpleClassName := replaceRE `.+?\.?([^\.]+)$` "$1" .type }} @@ -47,5 +81,13 @@ {{ $filename := printf "components/%s/_index.md" .type }} {{ $resource := resources.FromString $filename $string }} {{ $file := $resource.RelPermalink }} + + {{ if .additionalDetails }} + {{ $detailsMarkdownPath := printf "docs/%s/%s/%s/%s/additionalDetails.md" .group .artifact .version .type }} + {{ $detailsResource := resources.Get $detailsMarkdownPath }} + {{ $componentDetailsPath := printf "components/%s/additional-details.md" .type }} + {{ $componentDetailsResource := slice $detailsHeader $detailsResource | resources.Concat $componentDetailsPath }} + {{ $componentDetailsResource.Publish }} + {{ end }} {{ end }} {{ end }} diff --git a/themes/nifi/layouts/partials/component.html b/themes/nifi/layouts/partials/component.html index b057a43b..59374853 100644 --- a/themes/nifi/layouts/partials/component.html +++ b/themes/nifi/layouts/partials/component.html @@ -22,6 +22,20 @@

{{ .Params.title }} {{ .Params.version }}

{{ .Params.supportsSensitiveDynamicProperties }}
+{{ if .Params.additionalDetails }} + +{{ $detailsPage := .GetPage "additional-details" }} + + +{{ end }} +
Properties
diff --git a/themes/nifi/static/css/main.css b/themes/nifi/static/css/main.css index 3bcd153b..9ab5101c 100644 --- a/themes/nifi/static/css/main.css +++ b/themes/nifi/static/css/main.css @@ -374,6 +374,12 @@ footer h3 { font-size: 16px; } +.uk-accordion > .additional-details { + margin: 0px; + padding: 10px; + border: 1px solid #eee; +} + .uk-accordion > .property-descriptor { margin: 0px; padding: 10px;