diff options
author | Craig Earls <enderw88@gmail.com> | 2014-05-09 20:40:42 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2014-05-09 20:40:42 -0700 |
commit | 20b915668f7e6d4be9993e11dfc04ae1760a36f7 (patch) | |
tree | 668de51ac7625355aaaa8c3c88aed82344c690c3 /doc | |
parent | 2906a2f759b67363c070161202596e746921f09c (diff) | |
parent | dbfbf2bc893de3c44dcc08c33811bc274f647672 (diff) | |
download | fork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.tar.gz fork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.tar.bz2 fork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.zip |
Merge commit 'dbfbf2bc893de3c44dcc08c33811bc274f647672'
Diffstat (limited to 'doc')
-rw-r--r-- | doc/CMakeLists.txt | 62 | ||||
-rw-r--r-- | doc/ledger3.texi | 22 |
2 files changed, 58 insertions, 26 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 2777da68..8a9ba2fd 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -36,17 +36,29 @@ set(info_files ledger3.texi ledger-mode.texi) find_program(MAKEINFO makeinfo) find_program(TEXI2PDF texi2pdf) +find_program(TEX tex) find_program(MAN2HTML man2html) +find_program(GROFF groff) ######################################################################## foreach(file ${info_files}) get_filename_component(file_base ${file} NAME_WE) + + if(NOT MAKEINFO) + message(WARNING "Could not find makeinfo. Info version of documentation cannot be built.") + else() + add_custom_command(OUTPUT ${file_base}.info + COMMAND makeinfo --force --no-split -o ${file_base}.info ${CMAKE_CURRENT_SOURCE_DIR}/${file} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} + VERBATIM) + list(APPEND ledger_doc_files ${file_base}.info) + endif() + if(BUILD_WEB_DOCS) if(NOT MAKEINFO) - message(FATAL_ERROR "Could not find makeinfo. HTML version of documentation cannot be built.") + message(WARNING "Could not find makeinfo. HTML version of documentation cannot be built.") endif() - add_custom_command(OUTPUT ${file_base}.html COMMAND makeinfo --force --html --no-split -o ${file_base}.html ${CMAKE_CURRENT_SOURCE_DIR}/${file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} @@ -54,11 +66,14 @@ foreach(file ${info_files}) list(APPEND ledger_doc_files ${file_base}.html) endif(BUILD_WEB_DOCS) - if(NOT TEXI2PDF) - message(WARNING "Could not find texi2pdf. PDF version of documentation will not be built.") + if(NOT TEXI2PDF OR NOT TEX) + message(WARNING "Could not find texi2pdf or tex. PDF version of documentation will not be built.") else() + if(BUILD_A4_PDF) + set(papersize --texinfo=@afourpaper) + endif() add_custom_command(OUTPUT ${file_base}.pdf - COMMAND texi2pdf -b -q -o ${file_base}.pdf ${CMAKE_CURRENT_SOURCE_DIR}/${file} + COMMAND texi2pdf ${papersize} -b -q -o ${file_base}.pdf ${CMAKE_CURRENT_SOURCE_DIR}/${file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} VERBATIM) list(APPEND ledger_doc_files ${file_base}.pdf) @@ -72,15 +87,21 @@ if(BUILD_WEB_DOCS) if(NOT BASH) message(FATAL_ERROR "Could not find bash. Unable to build documentation.") endif() - if(NOT MAN2HTML) - message(FATAL_ERROR "Could not find man2html. HTML version of man page cannot be built.") + if(MAN2HTML) + add_custom_command(OUTPUT ledger.1.html + COMMAND ${BASH} -c "man2html ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 | tail -n+3 > ledger.1.html" + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 + VERBATIM) + list(APPEND ledger_doc_files ledger.1.html) + elseif(GROFF) + add_custom_command(OUTPUT ledger.1.html + COMMAND ${BASH} -c "groff -mandoc -Thtml ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 > ledger.1.html" + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 + VERBATIM) + list(APPEND ledger_doc_files ledger.1.html) + else() + message(FATAL_ERROR "Could not find man2html or groff. HTML version of man page cannot be built.") endif() - - add_custom_command(OUTPUT ledger.1.html - COMMAND ${BASH} -c "man2html ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 | tail -n+3 > ledger.1.html" - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1 - VERBATIM) - list(APPEND ledger_doc_files ledger.1.html) endif(BUILD_WEB_DOCS) ######################################################################## @@ -99,8 +120,19 @@ endif(CMAKE_INSTALL_MANDIR) foreach(file ${info_files}) get_filename_component(file_base ${file} NAME_WE) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file} + if (CMAKE_SOURCE_DIR STREQUAL BUILD_DIR) + set(doc_dir CMAKE_CURRENT_SOURCE_DIR) + else() + get_filename_component(dir_base ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE) + set(doc_dir "${CMAKE_SOURCE_DIR}/${BUILD_DIR}/${dir_base}") + endif() + + install(FILES ${doc_dir}/${file_base}.info DESTINATION ${CMAKE_INSTALL_INFODIR} COMPONENT doc) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file_base}.pdf + install(FILES ${doc_dir}/${file_base}.pdf DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc OPTIONAL) + if (BUILD_WEB_DOCS) + install(FILES ${doc_dir}/${file_base}.html + DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc) + endif(BUILD_WEB_DOCS) endforeach() diff --git a/doc/ledger3.texi b/doc/ledger3.texi index d5767efa..dfdafc05 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -2693,7 +2693,7 @@ doing it. * Total posting costs:: * Virtual posting costs:: * Commodity prices:: -* Prices vs. costs:: +* Prices versus costs:: * Fixated prices and costs:: * Lot dates:: * Lot notes:: @@ -3296,7 +3296,7 @@ happening in the case of an exceptional transaction, surround the Income:Gifts Received @end smallexample -@node Commodity prices, Prices vs. costs, Virtual posting costs, Transactions +@node Commodity prices, Prices versus costs, Virtual posting costs, Transactions @section Commodity prices @findex --lot-prices @@ -3424,8 +3424,8 @@ And in cases where the amounts do not divide into whole figures and must be rounded, the capital gains figure could be off by a cent. Use with caution. -@node Prices vs. costs, Fixated prices and costs, Commodity prices, Transactions -@section Prices vs. costs +@node Prices versus costs, Fixated prices and costs, Commodity prices, Transactions +@section Prices versus costs Because lot pricing provides enough information to infer the cost, the following two transactions are equivalent: @@ -3445,7 +3445,7 @@ example in the print report. Functionally, however, there is no difference, and neither the register nor the balance report are sensitive to this difference. -@node Fixated prices and costs, Lot dates, Prices vs. costs, Transactions +@node Fixated prices and costs, Lot dates, Prices versus costs, Transactions @section Fixated prices and costs If you buy a stock last year, and ask for its value today, Ledger will @@ -3476,7 +3476,7 @@ fixated prices by way of the cost: @end smallexample This is the same as the previous transaction, with the same caveats -found in @ref{Prices vs. costs}. +found in @ref{Prices versus costs}. @node Lot dates, Lot notes, Fixated prices and costs, Transactions @section Lot dates @@ -8458,13 +8458,13 @@ make sense later. @menu * Basic data traversal:: -* Raw vs. Cooked:: +* Raw versus Cooked:: * Queries:: * Embedded Python:: * Amounts:: @end menu -@node Basic data traversal, Raw vs. Cooked, Extending with Python, Extending with Python +@node Basic data traversal, Raw versus Cooked, Extending with Python, Extending with Python @section Basic data traversal Every interaction with Ledger happens in the context of a Session. @@ -8491,8 +8491,8 @@ for xact in ledger.read_journal("sample.dat").xacts: print "Transferring %s to/from %s" % (post.amount, post.account) @end smallexample -@node Raw vs. Cooked, Queries, Basic data traversal, Extending with Python -@section Raw vs. Cooked +@node Raw versus Cooked, Queries, Basic data traversal, Extending with Python +@section Raw versus Cooked Ledger data exists in one of two forms: raw and cooked. Raw objects are what you get from a traversal like the above, and represent exactly what @@ -8556,7 +8556,7 @@ does it transaction-wise. It relies on the fact that an unsorted report returns postings in the exact order they were parsed from the journal file. -@node Queries, Embedded Python, Raw vs. Cooked, Extending with Python +@node Queries, Embedded Python, Raw versus Cooked, Extending with Python @section Queries The Journal.query() method accepts every argument you can specify on the |