Skip to content

Commit

Permalink
ENH: Support specifying screenshot url extension metadata as string o…
Browse files Browse the repository at this point in the history
…r list
  • Loading branch information
jcfr committed Apr 23, 2024
1 parent d573c60 commit e6151f3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Extensions/CMake/SlicerFunctionGenerateExtensionDescription.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ function(slicerFunctionGenerateExtensionDescription)
EXTENSION_HOMEPAGE
EXTENSION_ICONURL
EXTENSION_NAME
EXTENSION_SCREENSHOTURLS
EXTENSION_STATUS
EXTENSION_WC_REVISION
EXTENSION_WC_ROOT
Expand All @@ -52,6 +51,7 @@ function(slicerFunctionGenerateExtensionDescription)
)
set(multiValueArgs
EXTENSION_DEPENDS
EXTENSION_SCREENSHOTURLS
)
cmake_parse_arguments(MY "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

Expand All @@ -74,6 +74,15 @@ function(slicerFunctionGenerateExtensionDescription)
# description: Replace newlines with "<br>"
string(REPLACE "\n" "<br>" MY_EXTENSION_DESCRIPTION "${MY_EXTENSION_DESCRIPTION}")

# screenshoturls: Remove newlines
string(REPLACE "\n" "" MY_EXTENSION_SCREENSHOTURLS "${MY_EXTENSION_SCREENSHOTURLS}")
# screenshoturls: Strip contiguous spaces
string(REGEX REPLACE " +" " " MY_EXTENSION_SCREENSHOTURLS "${MY_EXTENSION_SCREENSHOTURLS}")
# screenshoturls: Strip leading and trailing spaces
string(STRIP "${MY_EXTENSION_SCREENSHOTURLS}" MY_EXTENSION_SCREENSHOTURLS)
# screenshoturls: Convert to space separated list
list_to_string(" " "${MY_EXTENSION_SCREENSHOTURLS}" MY_EXTENSION_SCREENSHOTURLS)

# depends: Convert to space separated list
list_to_string(" " "${MY_EXTENSION_DEPENDS}" MY_EXTENSION_DEPENDS)

Expand Down Expand Up @@ -138,7 +147,9 @@ This is a line of text.<br>And another one."
EXTENSION_HOMEPAGE "https://www.slicer.org/w/index.php/Documentation/Nightly/Extensions/SlicerToKiwiExporter"
EXTENSION_ICONURL "https://www.slicer.org/w/images/6/64/SlicerToKiwiExporterLogo.png"
EXTENSION_NAME "SlicerToKiwiExporter"
EXTENSION_SCREENSHOTURLS "https://www.slicer.org/w/images/9/9e/SlicerToKiwiExporter_Kiwiviewer_8.PNG https://www.slicer.org/w/images/a/ab/SlicerToKiwiExporter_Kiwiviewer_9.PNG https://www.slicer.org/w/images/9/9a/SlicerToKiwiExporter_SaveDialog_Select-file-format_1.png"
EXTENSION_SCREENSHOTURLS "https://www.slicer.org/w/images/9/9e/SlicerToKiwiExporter_Kiwiviewer_8.PNG \
https://www.slicer.org/w/images/a/ab/SlicerToKiwiExporter_Kiwiviewer_9.PNG"
"https://www.slicer.org/w/images/9/9a/SlicerToKiwiExporter_SaveDialog_Select-file-format_1.png"
EXTENSION_STATUS "Development"
EXTENSION_WC_REVISION "9d7341e978df954a2c875240290833d7528ef29c"
EXTENSION_WC_ROOT "https://github.com/jcfr/SlicerToKiwiExporter.git"
Expand Down

0 comments on commit e6151f3

Please sign in to comment.