From a6e0482a6fbbfe31cfbb4530ade67231c2b59504 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Tue, 3 Aug 2021 13:42:20 -0700 Subject: [PATCH] Docs: Give the PDF and EPUB guides descriptive filenames. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the document title for our PDF and EPUB filenames under the theory that "Wireshark User’s Guide.pdf" is more obvious than "user-guide.pdf". --- .gitlab-ci.yml | 13 ++++++------- cmake/modules/FindAsciidoctor.cmake | 23 ++++++++++++++--------- docbook/CMakeLists.txt | 20 ++++++++++++-------- 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dcffa8141a..8a4e7129d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -433,11 +433,10 @@ Documentation: - for HTML_DIR in wsug_html wsug_html_chunked wsdg_html wsdg_html_chunked ; do zip -9 -r "$HTML_DIR.zip" "$HTML_DIR" ; done after_script: - mv -v build/docbook/ws[ud]g_html{,_chunked}.zip . - - mv -v build/docbook/{user,developer}-guide.pdf . - - mv -v build/docbook/{user,developer}-guide.epub . + - mv -v build/docbook/Wireshark*Guide.{epub,pdf} . - | if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ] && [ -n "$S3_DESTINATION_DOCS" ] ; then - for DOC_FILE in ws[ud]g_html{,_chunked}.zip {user,developer}-guide.pdf {user,developer}-guide.epub ; do + for DOC_FILE in ws[ud]g_html{,_chunked}.zip Wireshark*Guide.{epub,pdf} ; do aws s3 cp "$DOC_FILE" "$S3_DESTINATION_DOCS/" done fi @@ -447,10 +446,10 @@ Documentation: - wsug_html_chunked.zip - wsdg_html.zip - wsdg_html_chunked.zip - - user-guide.pdf - - developer-guide.pdf - - user-guide.epub - - developer-guide.epub + - "Wireshark User’s Guide.pdf" + - "Wireshark Developer’s Guide.pdf" + - "Wireshark User’s Guide.epub" + - "Wireshark Developer’s Guide.epub" needs: [] diff --git a/cmake/modules/FindAsciidoctor.cmake b/cmake/modules/FindAsciidoctor.cmake index f9d61e5c80..6b43271537 100644 --- a/cmake/modules/FindAsciidoctor.cmake +++ b/cmake/modules/FindAsciidoctor.cmake @@ -151,9 +151,10 @@ if(ASCIIDOCTOR_EXECUTABLE) ${_asciidoctor_common_args} ) - MACRO( ASCIIDOCTOR2PDF _asciidocsource ) + MACRO( ASCIIDOCTOR2PDF _title _asciidocsource ) GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE ) - set( _output_pdf ${_source_base_name}.pdf ) + set(_generate_pdf "generate_${_source_base_name}_pdf") + set(_output_pdf "${_title}.pdf") ADD_CUSTOM_COMMAND( OUTPUT @@ -164,9 +165,11 @@ if(ASCIIDOCTOR_EXECUTABLE) DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource} ${ARGN} + ) - add_custom_target(generate_${_output_pdf} DEPENDS ${_output_pdf}) - set_asciidoctor_target_properties(generate_${_output_pdf}) + add_custom_target(${_generate_pdf} DEPENDS ${_output_pdf}) + set_asciidoctor_target_properties(${_generate_pdf}) + unset(_generate_pdf) unset(_output_pdf) ENDMACRO() @@ -198,9 +201,10 @@ if(ASCIIDOCTOR_EXECUTABLE) ${_asciidoctor_common_args} ) - MACRO(ASCIIDOCTOR2EPUB _asciidocsource) - GET_FILENAME_COMPONENT(_source_base_name ${_asciidocsource} NAME_WE ) - set(_output_epub ${_source_base_name}.epub) + MACRO(ASCIIDOCTOR2EPUB _title _asciidocsource) + GET_FILENAME_COMPONENT(_source_base_name ${_asciidocsource} NAME_WE) + set(_generate_epub "generate_${_source_base_name}_epub") + set(_output_epub "${_title}.epub") ADD_CUSTOM_COMMAND( OUTPUT @@ -212,8 +216,9 @@ if(ASCIIDOCTOR_EXECUTABLE) ${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource} ${ARGN} ) - add_custom_target(generate_${_output_epub} DEPENDS ${_output_epub}) - set_asciidoctor_target_properties(generate_${_output_epub}) + add_custom_target(${_generate_epub} DEPENDS ${_output_epub}) + set_asciidoctor_target_properties(${_generate_epub}) + unset(_generate_epub) unset(_output_epub) ENDMACRO() diff --git a/docbook/CMakeLists.txt b/docbook/CMakeLists.txt index 6ae743c4ed..9640c1ea01 100644 --- a/docbook/CMakeLists.txt +++ b/docbook/CMakeLists.txt @@ -43,6 +43,8 @@ add_custom_target(update_tools_help ) set_docbook_target_properties(update_tools_help) +set(WSUG_TITLE "Wireshark User’s Guide") + set(WSUG_FILES wsug_src/WSUG_app_files.adoc wsug_src/WSUG_app_howitworks.adoc @@ -221,6 +223,8 @@ set(WSUG_GRAPHICS ${COMMON_GRAPHICS} ) +set(WSDG_TITLE "Wireshark Developer’s Guide") + set(WSDG_FILES wsdg_src/WSDG_chapter_asn2wrs.adoc wsdg_src/WSDG_chapter_build_intro.adoc @@ -385,24 +389,24 @@ if(ASCIIDOCTOR_FOUND AND XSLTPROC_EXECUTABLE) endif() if(ASCIIDOCTOR_FOUND AND ASCIIDOCTOR_PDF_EXECUTABLE) - ASCIIDOCTOR2PDF(user-guide.adoc ${WSUG_SOURCE} ${WSUG_BUILT_DEPS}) + ASCIIDOCTOR2PDF(${WSUG_TITLE} user-guide.adoc ${WSUG_SOURCE} ${WSUG_BUILT_DEPS}) add_custom_target( user_guide_pdf DEPENDS - user-guide.pdf + "${WSUG_TITLE}.pdf" ) set_docbook_target_properties(user_guide_pdf) add_dependencies(user_guides user_guide_pdf) endif() if(ASCIIDOCTOR_FOUND AND ASCIIDOCTOR_EPUB_EXECUTABLE) - ASCIIDOCTOR2EPUB(user-guide.adoc ${WSUG_SOURCE} ${WSUG_BUILT_DEPS}) + ASCIIDOCTOR2EPUB(${WSUG_TITLE} user-guide.adoc ${WSUG_SOURCE} ${WSUG_BUILT_DEPS}) add_custom_target( user_guide_epub DEPENDS - user-guide.epub + "${WSUG_TITLE}.epub" ) set_docbook_target_properties(user_guide_epub) add_dependencies(user_guides user_guide_epub) @@ -437,24 +441,24 @@ if(ASCIIDOCTOR_FOUND AND XSLTPROC_EXECUTABLE) endif() if(ASCIIDOCTOR_FOUND AND ASCIIDOCTOR_PDF_EXECUTABLE) - ASCIIDOCTOR2PDF(developer-guide.adoc ${WSDG_SOURCE} ${WSDG_BUILT_DEPS}) + ASCIIDOCTOR2PDF(${WSDG_TITLE} developer-guide.adoc ${WSDG_SOURCE} ${WSDG_BUILT_DEPS}) add_custom_target( developer_guide_pdf DEPENDS - developer-guide.pdf + "${WSDG_TITLE}.pdf" ) set_docbook_target_properties(developer_guide_pdf) add_dependencies(developer_guides developer_guide_pdf) endif() if(ASCIIDOCTOR_FOUND AND ASCIIDOCTOR_EPUB_EXECUTABLE) - ASCIIDOCTOR2EPUB(developer-guide.adoc ${WSDG_SOURCE} ${WSDG_BUILT_DEPS}) + ASCIIDOCTOR2EPUB(${WSDG_TITLE} developer-guide.adoc ${WSDG_SOURCE} ${WSDG_BUILT_DEPS}) add_custom_target( developer_guide_epub DEPENDS - developer-guide.epub + "${WSDG_TITLE}.epub" ) set_docbook_target_properties(developer_guide_epub) add_dependencies(developer_guides developer_guide_epub)