Skip to content

Commit

Permalink
Conversion of existing documentation to LaTeX sources (#438)
Browse files Browse the repository at this point in the history
* initial work in converting existing documentation to LaTeX sources

* added alert and code blocks

* >> added cover logo

>> further work in document structure

* further work in demonstrating original document reproduction

* improvements and additions to common packages

* further document conversion work

* added more packages and code keywords

* further document conversion work

* further document conversion work

* further document conversion work

* added "MESH code" language, for styling purposes

* further document conversion work

* further document conversion work

* further document conversion work

* Added advanced mesh rendering details and 2D graphics details.

* Starting Atlantis Manual

* further document conversion work

* further document conversion work

* Almost there...

* further document conversion work

* Atlantis Manual finished.

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* further document conversion work

* initial work in updating cmake files

* corrected silly typo and added missing argument

* deleting old doc files

* updating cmake file with deleted folder

* another cmake update

---------

Co-authored-by: GLS-SSV <GLS-SSV@users.noreply.github.com>
Co-authored-by: jarmonik <jnikkanen@kymp.net>
Co-authored-by: jarmonik <88397245+jarmonik@users.noreply.github.com>
  • Loading branch information
4 people authored May 17, 2024
1 parent 4a00732 commit 948638a
Show file tree
Hide file tree
Showing 545 changed files with 13,566 additions and 1,082 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ Sound/XRSound/**/Release-with-OrbiterRelease/
[Bb]uild/

Extern/irrKlang

Doc/**/*.log
Doc/**/*.pdf
Doc/**/*.gz
76 changes: 0 additions & 76 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,88 +283,12 @@ if(ORBITER_BUILD_D3D9CLIENT)
endif()
endif()

if (ORBITER_MAKE_DOC)

find_program(ODT_TO_PDF_COMPILER
soffice
HINTS "/Program Files/LibreOffice/program"
)

set(ODT_TO_PDF_FLAGS
"--headless --convert-to pdf --outdir <outdir> <infile>"
CACHE
STRING
"Compiler options for the OdtToPdfCompiler"
)

find_program(DOC_TO_PDF_COMPILER
soffice
HINTS "/Program Files/LibreOffice/program"
)

set(DOC_TO_PDF_FLAGS
"--headless --convert-to pdf --outdir <outdir> <infile>"
CACHE
STRING
"Compiler options for the DocToPdfCompiler"
)

endif()

# Enable Address SANitizer
include(cmake/sanitizer.cmake)
if (ORBITER_SANITIZER AND MSVC)
enable_sanitizer(${ORBITER_SANITIZER})
endif()

# For a given argument string template (odt_to_pdf_arglist) and source file name (infile)
# return the explicit argument string (arglist), full source path (source_path) and full target path (target_path)
# to invoke the ODT to PDF conversion tool

function(odt_to_pdf_arglist infile arglist source_path target_path)
string(REPLACE
"<outdir>" "${CMAKE_CURRENT_BINARY_DIR}"
tmp1_string
${ODT_TO_PDF_FLAGS}
)
string(REPLACE
"<infile>" "${CMAKE_CURRENT_SOURCE_DIR}/${infile}.odt"
tmp2_string
${tmp1_string}
)
separate_arguments(odt_arg
WINDOWS_COMMAND
${tmp2_string}
)
set(${arglist} ${odt_arg} PARENT_SCOPE)
set(${source_path} "${CMAKE_CURRENT_SOURCE_DIR}/${infile}.odt" PARENT_SCOPE)
set(${target_path} "${CMAKE_CURRENT_BINARY_DIR}/${infile}.pdf" PARENT_SCOPE)
endfunction()


# For a given argument string template (odt_to_pdf_arglist) and source file name (infile)
# return the explicit argument string (arglist), full source path (source_path) and full target path (target_path)
# to invoke the DOC to PDF conversion tool

function(doc_to_pdf_arglist infile arglist source_path target_path)
string(REPLACE
"<outdir>" "${CMAKE_CURRENT_BINARY_DIR}"
tmp1_string
${DOC_TO_PDF_FLAGS}
)
string(REPLACE
"<infile>" "${CMAKE_CURRENT_SOURCE_DIR}/${infile}.doc"
tmp2_string
${tmp1_string}
)
separate_arguments(doc_arg
WINDOWS_COMMAND
${tmp2_string}
)
set(${arglist} ${doc_arg} PARENT_SCOPE)
set(${source_path} "${CMAKE_CURRENT_SOURCE_DIR}/${infile}.doc" PARENT_SCOPE)
set(${target_path} "${CMAKE_CURRENT_BINARY_DIR}/${infile}.pdf" PARENT_SCOPE)
endfunction()

# Given a source directory (srcdir) and a target root directory (tgtroot),
# generate a list of all files found in srcdir (srclist) and a list of output files
Expand Down
94 changes: 3 additions & 91 deletions Doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,91 +1,3 @@
# Orbiter.pdf ------------------------------------------------------------

odt_to_pdf_arglist("Orbiter" arglist src out)
add_custom_command(
OUTPUT ${out}
COMMAND ${ODT_TO_PDF_COMPILER} ${arglist}
DEPENDS ${src}
JOB_POOL soffice
)
add_custom_target(OrbiterDoc
DEPENDS ${out}
)
add_dependencies(${OrbiterTgt}
OrbiterDoc
)
set_target_properties(OrbiterDoc
PROPERTIES
FOLDER Doc
)
install(FILES ${out}
DESTINATION ${ORBITER_INSTALL_DOC_DIR}
)

# OrbiterConfig.pdf ------------------------------------------------------

odt_to_pdf_arglist("OrbiterConfig" arglist src out)
add_custom_command(
OUTPUT ${out}
COMMAND ${ODT_TO_PDF_COMPILER} ${arglist}
DEPENDS ${src}
JOB_POOL soffice
)
add_custom_target(OrbiterConfigDoc
DEPENDS ${out}
)
add_dependencies(${OrbiterTgt}
OrbiterConfigDoc
)
set_target_properties(OrbiterConfigDoc
PROPERTIES
FOLDER Doc
)
install(FILES ${out}
DESTINATION ${ORBITER_INSTALL_DOC_DIR}
)

# PlanetTextures.pdf -----------------------------------------------------

odt_to_pdf_arglist("PlanetTextures" arglist src out)
add_custom_command(
OUTPUT ${out}
COMMAND ${ODT_TO_PDF_COMPILER} ${arglist}
DEPENDS ${src}
JOB_POOL soffice
)
add_custom_target(PlanetTexturesDoc
DEPENDS ${out}
)
add_dependencies(${OrbiterTgt}
PlanetTexturesDoc
)
set_target_properties(PlanetTexturesDoc
PROPERTIES
FOLDER Doc
)
install(FILES ${out}
DESTINATION ${ORBITER_INSTALL_DOC_DIR}
)

# Credit.pdf -------------------------------------------------------------

doc_to_pdf_arglist("Credit" arglist src out)
add_custom_command(
OUTPUT ${out}
COMMAND ${DOC_TO_PDF_COMPILER} ${arglist}
DEPENDS ${src}
JOB_POOL soffice
)
add_custom_target(OrbiterCreditDoc
DEPENDS ${out}
)
add_dependencies(OrbiterDoc
OrbiterCreditDoc
)
install(FILES ${out}
DESTINATION ${ORBITER_INSTALL_DOC_DIR}
)

# Technotes --------------------------------------------------------------

add_subdirectory(Technotes)
add_subdirectory("Orbiter Developer Manual")
add_subdirectory("Orbiter Technical Reference")
add_subdirectory("Orbiter User Manual")
Binary file removed Doc/Credit.doc
Binary file not shown.
Binary file removed Doc/D3D9Client.pdf
Binary file not shown.
29 changes: 29 additions & 0 deletions Doc/Orbiter Developer Manual/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
set(name "Orbiter Developer Manual")

set(src_path ${CMAKE_CURRENT_SOURCE_DIR}/${name}.tex)
set(out_path ${CMAKE_CURRENT_BINARY_DIR}/${name}.pdf)
set(pdflatex_cmd ${PDFLATEX_COMPILER} --synctex=1 -output-directory=${CMAKE_CURRENT_BINARY_DIR} ${src_path})
set(bibtex_cmd ${BIBTEX_COMPILER} ${CMAKE_CURRENT_BINARY_DIR}/${name})

add_custom_command(
OUTPUT ${out_path}
COMMAND ${pdflatex_cmd}
COMMAND ${bibtex_cmd}
COMMAND ${pdflatex_cmd}
DEPENDS ${src_path}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
JOB_POOL latex
)
add_custom_target(OrbiterDeveloperManual
DEPENDS ${out_path}
)
add_dependencies(${OrbiterTgt}
OrbiterDeveloperManual
)
set_target_properties(OrbiterDeveloperManual
PROPERTIES
FOLDER Doc
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pdf
DESTINATION ${ORBITER_INSTALL_ROOT_DIR}/Doc
)
Loading

0 comments on commit 948638a

Please sign in to comment.