commit 762dd308ca108e9f38bd5d03654ea22ca1f6dd22
parent ec9b7c46cfb3f4004566d89aad562e01b230d305
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 15 Apr 2021 09:18:30 +0200
Write the atrri man page
Diffstat:
3 files changed, 92 insertions(+), 7 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -86,6 +86,29 @@ if(NOT NO_TEST)
endif()
################################################################################
+# Man page
+###############################################################################
+find_program(A2X NAMES a2x a2x.py)
+if(NOT A2X)
+ message(WARNING
+ "The `a2x' program is missing. "
+ "The atrri man page cannot be generated.")
+else()
+ set(_src ${PROJECT_SOURCE_DIR}/../doc/atrri.5.txt)
+ set(_txt ${CMAKE_CURRENT_BINARY_DIR}/atrri.5.txt)
+ add_custom_command(
+ OUTPUT atrri.5
+ COMMAND ${CMAKE_COMMAND} -E copy ${_src} ${_txt}
+ COMMAND ${A2X} -dmanpage -fmanpage ${_txt}
+ DEPENDS ${_src}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Buid ROFF man page atrri.5"
+ VERBATIM)
+ add_custom_target(man-roff ALL DEPENDS atrri.5)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/atrri.5 DESTINATION share/man/man5)
+endif()
+
+################################################################################
# Define output & install directories
################################################################################
install(TARGETS atrri
diff --git a/doc/atrri b/doc/atrri
@@ -1,7 +0,0 @@
-<atrri> ::= <refractive-index>
- [ <refractive-index> ... ]
-<refractive-index> ::= <wavelength> <n> <kappa>
-<wavelength> ::= <double> # In nanometers
-<n> ::= <double> # Real part of the refractive index
-<kappa> ::= <double> # Imaginary part of the refractive index
-
diff --git a/doc/atrri.5.txt b/doc/atrri.5.txt
@@ -0,0 +1,69 @@
+// Copyright (C) 2021 CNRS
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+:toc:
+
+atrri(5)
+=======
+
+NAME
+----
+atrri - AsToRia: Refractive Index
+
+DESCRIPTION
+-----------
+
+*atrri* is a plain text file format for storing a list of refractive indices
+that vary spectrally. Each refractive index is defined by 3 double precision
+floating point numbers: the wavelength in nanometers at which the index is
+set, followed by the real part and the imaginary part of the refractive index
+itself. Note that the listed refractive indices should be sorted in ascending
+order relative to their wavelength.
+
+
+Characters behind the pound sign (#) are considered comments and are therefore
+ignored. Empty lines, that is, lines without characters or consisting only of
+spaces and tabs, are simply skipped.
+
+GRAMMAR
+-------
+
+[verse]
+-------
+<atrri> ::= <refractive-index>
+ [ <refractive-index> ... ]
+
+<refractive-index> ::= <wavelength> <n> <kappa>
+
+<wavelength> ::= <double> # In nm
+<n> ::= <double> # Real part
+<kappa> ::= <double> # Imaginary part
+-------
+
+EXAMPLE
+-------
+
+# Wavelength in nm real part imaginary part
+
+ 300.000011921 1.740000010 0.469999999
+ 310.000002384 1.741990328 0.469004273
+ 319.999992847 1.743917465 0.468010038
+ 329.999983311 1.745785475 0.467014253
+ 339.999973774 1.748130083 0.465993971
+ 349.999964237 1.750000000 0.464985400
+ 359.999954700 1.750000000 0.463959038
+ 369.999945164 1.750000000 0.462961257
+ 379.999935627 1.750000000 0.461990029
+ 389.999926090 1.750000000 0.460981935
+ 399.999916553 1.750000000 0.459957659