summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/CMakeLists.txt89
-rw-r--r--doc/Doxyfile.in (renamed from doc/Doxyfile)6
-rw-r--r--doc/Makefile17
-rw-r--r--doc/ledger3.texi24
4 files changed, 104 insertions, 32 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index e69de29b..54c58737 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,89 @@
+if (USE_DOXYGEN)
+ find_package(Doxygen)
+ if(NOT DOXYGEN_FOUND)
+ message(FATAL_ERROR "Could not find doxygen. Reference documentation cannot be built.")
+ endif()
+
+ configure_file(Doxyfile.in Doxyfile @ONLY)
+ add_custom_target(doxygen ALL
+ COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
+ SOURCES Doxyfile)
+endif(USE_DOXYGEN)
+
+########################################################################
+
+if(NOT BUILD_DOCS)
+ return()
+endif()
+
+set(info_files ledger.texi ledger3.texi)
+
+find_program(MAKEINFO makeinfo)
+find_program(TEXI2PDF texi2pdf)
+find_program(MAN2HTML man2html)
+
+########################################################################
+
+foreach(file ${info_files})
+ get_filename_component(file_base ${file} NAME_WE)
+ if(BUILD_WEB_DOCS)
+ if(NOT MAKEINFO)
+ message(FATAL_ERROR "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}
+ VERBATIM)
+ list(APPEND ledger_doc_files ${file_base}.html)
+ endif(BUILD_WEB_DOCS)
+
+ if(NOT TEXI2PDF)
+ mesage(WARNING "Could not find texi2pdf. PDF version of documentation will not be built.")
+ else()
+ add_custom_command(OUTPUT ${file_base}.pdf
+ COMMAND texi2pdf -b -q --tidy -o ${file_base}.pdf ${CMAKE_CURRENT_SOURCE_DIR}/${file}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
+ VERBATIM)
+ list(APPEND ledger_doc_files ${file_base}.pdf)
+ endif()
+endforeach()
+
+########################################################################
+
+if(BUILD_WEB_DOCS)
+ include(FindUnixCommands)
+ 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.")
+ endif()
+
+ add_custom_command(OUTPUT ledger.1.html
+ COMMAND ${BASH} -c "man2html $<1: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)
+
+########################################################################
+
+add_custom_target(doc ALL DEPENDS ${ledger_doc_files})
+
+########################################################################
+
+include(GNUInstallDirs)
+
+if(CMAKE_INSTALL_MANDIR)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ledger.1
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc)
+endif(CMAKE_INSTALL_MANDIR)
+
+if(CMAKE_INSTALL_DOCDIR)
+ foreach(file ${info_files})
+ get_filename_component(file_base ${file} NAME_WE)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file_base}.pdf
+ DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc OPTIONAL)
+ endforeach()
+endif(CMAKE_INSTALL_DOCDIR)
diff --git a/doc/Doxyfile b/doc/Doxyfile.in
index d59d3f82..734eb8df 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile.in
@@ -38,7 +38,7 @@ PROJECT_NUMBER = 3.0
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
-OUTPUT_DIRECTORY = %builddir%/doc
+OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
@@ -124,7 +124,7 @@ FULL_PATH_NAMES = NO
# If left blank the directory from which doxygen is run is used as the
# path to strip.
-STRIP_FROM_PATH = %srcdir%/src/
+STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/src/
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
# the path mentioned in the documentation of a class, which tells
@@ -564,7 +564,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = src
+INPUT = @PROJECT_SOURCE_DIR@/src
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644
index 64a271fa..00000000
--- a/doc/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# quick doc-building makefile used by website
-# requires: man2html, texinfo
-
-docs: ledger.1.html ledger.html ledger.pdf ledger3.html ledger3.pdf
-
-%.1.html: %.1
- -man2html $< | tail -n+3 >$@
-
-%.html: %.texi
- -makeinfo --force --html --no-split -o $@ $<
-
-%.pdf: %.texi
- -texi2pdf -b -q $<
- rm -f $*.aux $*.cp $*.fn $*.ky $*.log $*.pg $*.toc $*.tp $*.vr
-
-clean:
- rm -rf ledger.1.html ledger.html ledger3.html ledger.pdf ledger3.pdf
diff --git a/doc/ledger3.texi b/doc/ledger3.texi
index 1c588636..b8aaa49b 100644
--- a/doc/ledger3.texi
+++ b/doc/ledger3.texi
@@ -1312,9 +1312,9 @@ your opening balance entry could look like this:
Assets:Joint Checking $800.14
Assets:Other Checking $63.44
Assets:Savings $2805.54
- Assets:Investments:401K:Deferred 100.0000 VIFSX @ $80.5227
- Assets:Investments:401K:Matching 50.0000 VIFSX @ $83.7015
- Assets:Investments:IRA 250.0000 VTHRX @ $20.5324
+ Assets:Investments:401K:Deferred 100.0000 VIFSX @@ $80.5227
+ Assets:Investments:401K:Matching 50.0000 VIFSX @@ $83.7015
+ Assets:Investments:IRA 250.0000 VTHRX @@ $20.5324
Liabilities:Mortgage $-175634.88
Liabilities:Car Loan $-3494.26
Liabilities:Visa -$1762.44
@@ -2970,12 +2970,12 @@ resulting posting cost is $50.00 per share.
@node Explicit posting costs, Posting cost expressions, Posting cost, Transactions
@section Explicit posting costs
-You can make any posting's cost explicit using the @ symbol after the amount
+You can make any posting's cost explicit using the @@ symbol after the amount
or amount expression:
@smallexample
2012-03-10 My Broker
- Assets:Brokerage 10 AAPL @ $50.00
+ Assets:Brokerage 10 AAPL @@ $50.00
Assets:Brokerage:Cash $-500.00
@end smallexample
@@ -2984,7 +2984,7 @@ the first posting's cost, you can elide the other amount:
@smallexample
2012-03-10 My Broker
- Assets:Brokerage 10 AAPL @ $50.00
+ Assets:Brokerage 10 AAPL @@ $50.00
Assets:Brokerage:Cash
@end smallexample
@@ -3029,7 +3029,7 @@ You can even have both:
@node Total posting costs, Virtual posting costs, Posting cost expressions, Transactions
@section Total posting costs
-The cost figure following the @ character specifies the @emph{per-unit} price for
+The cost figure following the @@ character specifies the @emph{per-unit} price for
the commodity being transferred. If you'd like to specify the total cost
instead, use @@@@:
@@ -3149,7 +3149,7 @@ Plus, it comes with dangers. This works fine:
@smallexample
2012-04-10 My Broker
- Assets:Brokerage 10 AAPL @ $50.00
+ Assets:Brokerage 10 AAPL @@ $50.00
Assets:Brokerage:Cash $750.00
2012-04-10 My Broker
@@ -3167,7 +3167,7 @@ Plus, it comes with dangers. This works fine:
@smallexample
2012-04-10 My Broker
- Assets:Brokerage 10 AAPL @ $50.00
+ Assets:Brokerage 10 AAPL @@ $50.00
Assets:Brokerage:Cash $750.00
2012-04-10 My Broker
@@ -3192,7 +3192,7 @@ following two transactions are equivalent:
@smallexample
2012-04-10 My Broker
- Assets:Brokerage 10 AAPL @ $50.00
+ Assets:Brokerage 10 AAPL @@ $50.00
Assets:Brokerage:Cash $750.00
2012-04-10 My Broker
@@ -3257,7 +3257,7 @@ that dates are parsed in value expressions):
You can also associate arbitrary notes for your own record keeping in
parentheses, and reveal them with --lot-notes. One caveat is that the note
-cannot begin with an @ character, as that would indicate a virtual cost:
+cannot begin with an @@ character, as that would indicate a virtual cost:
@smallexample
2012-04-10 My Broker
@@ -4914,7 +4914,7 @@ model transaction:
--- Context is first posting of the following transaction ---
2004/05/27 Book Store
; This note applies to all postings. :SecondTag:
- Expenses:Books 20 BOOK @ $10
+ Expenses:Books 20 BOOK @@ $10
; Metadata: Some Value
; Typed:: $100 + $200
; :ExampleTag: