Skip to content

Commit

Permalink
Add boilerplate user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianSipos committed Jan 27, 2025
1 parent c591a62 commit e22c86d
Show file tree
Hide file tree
Showing 9 changed files with 373 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 3.16)
project(bsl-docs LANGUAGES )
set(CMAKE_INSTALL_PREFIX "")

#add_subdirectory(user-guide)
add_subdirectory(user-guide)
add_subdirectory(product-guide)

install(
Expand Down
23 changes: 9 additions & 14 deletions product-guide/docinfo.xml.in
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<subtitle>DOC-005444, Prepared by The Johns Hopkins Applied Physics Laboratory</subtitle>
<!-- <edition>@PROJECT_VERSION@</edition> -->
<subtitle>
DOC-TBA,
Prepared by The Johns Hopkins Applied Physics Laboratory
</subtitle>
<author>
<orgname>
JHU/APL
</orgname>
</author>
<copyright>
<year>2023-2024</year>
<year>2023-2025</year>
<holder>The Johns Hopkins University Applied Physics Laboratory LLC</holder>
</copyright>
<legalnotice>
<title>License</title>
<simpara>
This document is part of the Asynchronous Network Management System (ANMS).
This file is part of the Bundle Protocol Security Library (BSL).
</simpara>
<simpara>
Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -28,22 +30,15 @@ limitations under the License.
This work was performed for the Jet Propulsion Laboratory, California
Institute of Technology, sponsored by the United States Government under
the prime contract 80NM0018D0004 between the Caltech and NASA under
subcontract 1658085.
subcontract 1700763.
</simpara>
</legalnotice>
<revhistory>
<revision>
<revnumber>Initial</revnumber>
<date>30 August 2023</date>
<date>TBD</date>
<revdescription>
Initial issue of document for ANMS v1.0.0
</revdescription>
</revision>
<revision>
<revnumber>A</revnumber>
<date>28 August 2024</date>
<revdescription>
Updates for ANMS v1.1.0
Initial issue of document for BSL v1.0.0
</revdescription>
</revision>
</revhistory>
3 changes: 3 additions & 0 deletions product-guide/manual.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ For details about the application programming interface (API) and workflows of t
[glossary]
Bundle Protocol (BP)::
The overlay network protocol used to transport BPSec blocks and target blocks between nodes.
Bundle Protocol Security (BPSec)::
The mandatory-to-implement security mechanism to protect blocks of a BP bundle.
This is the principal scope of behavior implemented in the BSL.
BP Agent (BPA)::
The instantiation of a BP node with a unique administrative Endpoint ID.
BP Endpoint::
Expand Down
101 changes: 101 additions & 0 deletions user-guide/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#[[
Copyright (c) 2023-2025 The Johns Hopkins University Applied Physics
Laboratory LLC.
This file is part of the Bundle Protocol Security Library (BSL).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This work was performed for the Jet Propulsion Laboratory, California
Institute of Technology, sponsored by the United States Government under
the prime contract 80NM0018D0004 between the Caltech and NASA under
subcontract 1700763.
]]
cmake_minimum_required(VERSION 3.16)
get_filename_component(DIRNAME ${CMAKE_CURRENT_LIST_DIR} NAME)
# No compiler checks
project(${DIRNAME} VERSION 0 LANGUAGES )


# File paths
set(ADOC_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/manual.adoc")


find_program(ASCIIDOC asciidoctor REQUIRED)
set(OUT_DOCINFO "docinfo.xml")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/${OUT_DOCINFO}.in"
"${CMAKE_CURRENT_SOURCE_DIR}/${OUT_DOCINFO}"
@ONLY
)
set(OUT_DBOOK "manual.docbook.xml")
add_custom_command(
OUTPUT ${OUT_DBOOK}
DEPENDS ${ADOC_SOURCE} ${OUT_DOCINFO}
COMMAND
${ASCIIDOC} -v -r asciidoctor-diagram
--base-dir ${CMAKE_CURRENT_SOURCE_DIR}
--destination-dir ${CMAKE_CURRENT_BINARY_DIR}
-o ${OUT_DBOOK}
${ADOC_SOURCE}
)
# Place source images into build directory
set(INSTALL_IMGS ${CMAKE_CURRENT_SOURCE_DIR}/install_imgs.sh)
add_custom_target(
${PROJECT_NAME}-img-bin
DEPENDS ${INSTALL_IMGS} ${OUT_DBOOK}
COMMAND ${INSTALL_IMGS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${OUT_DBOOK}
)

find_program(XSLTPROC xsltproc REQUIRED)
set(HTML_XSLT "${CMAKE_CURRENT_SOURCE_DIR}/xhtml-opts.xsl")
find_program(XMLSTARLET xmlstarlet REQUIRED)
set(OUT_HTML "html/index.html")
set(OUT_CSS "html/docbook.css")
add_custom_command(
OUTPUT ${OUT_HTML}
BYPRODUCTS ${OUT_CSS}
DEPENDS ${OUT_DBOOK} ${HTML_XSLT}
COMMAND ${XSLTPROC} -o ${OUT_HTML} ${HTML_XSLT} ${OUT_DBOOK}
)
# Place needed images into HTML tree
add_custom_target(
${PROJECT_NAME}-img-html
DEPENDS ${INSTALL_IMGS} ${OUT_HTML} ${PROJECT_NAME}-img-bin
COMMAND ${INSTALL_IMGS} ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/html"
)
add_custom_target(
${PROJECT_NAME}-html ALL
DEPENDS ${OUT_HTML} ${PROJECT_NAME}-img-html
)
install(
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html"
DESTINATION ${PROJECT_NAME}
)


find_program(DBLATEX dblatex REQUIRED)
set(PDF_XSLT "${CMAKE_CURRENT_SOURCE_DIR}/pdf-opts.xsl")
set(OUT_PDF "manual.pdf")
add_custom_command(
OUTPUT ${OUT_PDF}
DEPENDS ${OUT_DBOOK} ${PDF_XSLT} ${PROJECT_NAME}-img-bin
COMMAND ${DBLATEX} -o ${OUT_PDF} --xsl-user=${PDF_XSLT} ${OUT_DBOOK}
)
add_custom_target(
${PROJECT_NAME}-pdf ALL
DEPENDS ${OUT_PDF}
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${OUT_PDF}"
DESTINATION ${PROJECT_NAME}
# RENAME "ANMS User Guide v${PROJECT_VERSION}.pdf"
)
44 changes: 44 additions & 0 deletions user-guide/docinfo.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<subtitle>
DOC-TBA,
Prepared by The Johns Hopkins Applied Physics Laboratory
</subtitle>
<author>
<orgname>
JHU/APL
</orgname>
</author>
<copyright>
<year>2023-2025</year>
<holder>The Johns Hopkins University Applied Physics Laboratory LLC</holder>
</copyright>
<legalnotice>
<title>License</title>
<simpara>
This file is part of the Bundle Protocol Security Library (BSL).
</simpara>
<simpara>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</link>.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</simpara>
<simpara>
This work was performed for the Jet Propulsion Laboratory, California
Institute of Technology, sponsored by the United States Government under
the prime contract 80NM0018D0004 between the Caltech and NASA under
subcontract 1700763.
</simpara>
</legalnotice>
<revhistory>
<revision>
<revnumber>Initial</revnumber>
<date>TBD</date>
<revdescription>
Initial issue of document for BSL v1.0.0
</revdescription>
</revision>
</revhistory>
30 changes: 30 additions & 0 deletions user-guide/install_imgs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
SRCDIR=$1
OUTDIR=$2
DBOOKFILE=$3

if [ -z "${DBOOKFILE}" ]
then
FILENAMES=""
for HTMLFILE in ${OUTDIR}/*.html
do
echo "Scanning ${HTMLFILE}"
THESENAMES=$(xmlstarlet sel -N xhtml=http://www.w3.org/1999/xhtml -t -v '//xhtml:img/@src' -n "${HTMLFILE}")
FILENAMES="${FILENAMES} ${THESENAMES}"
done
else
FILENAMES=$(xmlstarlet sel -N db=http://docbook.org/ns/docbook -t -v '//db:imagedata/@fileref' -n "${DBOOKFILE}")
fi

for FN in ${FILENAMES}
do
SRCFN="${SRCDIR}/${FN}"
if [ ! -f "${SRCFN}" ]
then
continue
fi

DSTFN="${OUTDIR}/${FN}"
echo "Install to ${DSTFN}"
install -Dp -m644 "${SRCFN}" "${DSTFN}"
done
Loading

0 comments on commit e22c86d

Please sign in to comment.