Commit Graph

246 Commits

Author SHA1 Message Date
Simon Michael
fead7c5138 cli, ui, web: make -NUM a shortcut for --depth NUM 2017-09-22 16:14:30 -10:00
Jakub Zárybnický
13a6584440 ui, web: Enable --pivot and --anon in ui and web (#474) 2017-09-04 20:45:31 -07:00
Simon Michael
7e896572a7 make --help and -h the same, drop --man and --info for now (#579) 2017-07-07 02:08:34 +01:00
Simon Michael
b402fc7e7d lib: optserror -> usageError, consolidate with other error functions (#529) 2017-03-29 08:00:51 -07:00
Simon Michael
1bcc091a44 web: add --host, rename --server to --serve (#429)
This came up in the context of Docker, but it seems it wasn't possible
for hledger-web to serve remote clients directly (without a proxy)
because of 127.0.0.1 being hardcoded ? Now that can be
changed with --host=IPADDR. The default base url also
uses this address, rather than "localhost" being hardcoded.

Also, the --server flag sounded too close in meaning to --host so
I've renamed it to --serve. The old spelling is still accepted,
at least through the next major release I suppose.
2016-11-21 07:38:58 -08:00
Simon Michael
b7071dee84 lib: use Data.Default directly, not via cmdargs 2016-07-29 10:15:48 -07:00
Simon Michael
739c8dc4cc web: preserve initial query when journal changes (#314)
The initial query specified by command line arguments is now preserved
when the journal is reloaded. This does not appear in the web UI, it's
like an invisible extra filter.
2016-04-28 21:48:30 -07:00
Simon Michael
df1040014e web: exit if an instance is already running (#226)
Also
- pause for 0.1s before opening the browser, to ensure the app is ready
- don't open a browser if the app fails to start
- terminate the server thread more carefully on exit, may resolve some
  lingering background thread issues eg on windows
2016-04-22 11:21:33 -07:00
Simon Michael
42c12fe631 cli, ui, web, api: --info, --man, info & man cmds 2016-04-19 19:21:29 -07:00
Simon Michael
f9362707b6 ui, web, api: fix -h, --help 2016-04-18 16:43:51 -07:00
Simon Michael
b4a72da355 web: fix stack ghci duplicate main error 2016-04-18 15:26:54 -07:00
Simon Michael
6fb76d979f web: fix typo in "-f -" warning 2016-01-25 09:07:37 -08:00
Simon Michael
09430f09da web: fix --file-url option (#285)
Finish the rename begun by 3fb5e25.
2015-09-28 10:06:36 -10:00
Simon Michael
2c3f1b672e web: disallow -f- which doesn't work (fixes #202)
hledger-web -f- gives

[Error#yesod-core] <stdin>: hGetContents: illegal operation (handle is closed)

and I can't see why. Just disallow it.
2015-09-27 08:17:12 -10:00
Simon Michael
3fa3926ee9 web: clarify which libs we are calling to start up 2015-09-27 08:16:30 -10:00
Simon Michael
74512814ec cli/ui/web: rename X.Options modules to X.XOptions
Make these modules' names more like the heavily-used types they
define (CliOpts, UIOpts, WebOpts). This is consistent with
RawOptions and ReportOptions, and helps with code navigation.
2015-08-28 12:43:51 -07:00
Simon Michael
f3dd5eb830 fix options breakage with GHC < 7.10 2015-08-28 11:17:49 -07:00
Simon Michael
2af8d7598e cli, web: fix options breakage 2015-08-28 10:49:43 -07:00
Simon Michael
0de0f6ab01 group related imports 2015-06-04 09:45:43 -07:00
Simon Michael
bb8918a709 web: fix build breakage from #165 (fixes #268) 2015-06-04 09:44:58 -07:00
Simon Michael
83209b862c tools: fix overuse of -XCPP breaking make test etc. 2015-04-07 19:28:57 -07:00
Simon Michael
ebba1b09f2 web: fix more ghc 7.10 import warnings (#239) 2015-04-07 18:49:33 -07:00
Simon Michael
b0d71e3ccc web: declare a bunch of language pragmas
Makes the code more declarative, and makes building without cabal easier.
2015-04-07 18:35:41 -07:00
gwern
d1618aaca8 strip trailing whitespace from all Haskell files 2014-10-14 18:48:24 -07:00
Simon Michael
f30deee197 web: fix compilation after recent lib changes 2014-07-03 09:37:02 -07:00
Simon Michael
702f900ec0 web: fix warnings 2014-05-23 09:02:20 -07:00
Ryan Desfosses
b60da51386 made the following changes to resolve deprecated warnings:
replaced hamletToRepHtml with giveUrlRenderer
  updated type RepHtml to Html
  replaced settingsPort with setPort
2014-05-21 07:30:54 -04:00
Simon Michael
e6a1339370 cli: options help polish 2014-05-01 07:22:44 -07:00
Simon Michael
3fb5e25fd4 web: rename --static-root to --file-url 2014-04-30 08:48:23 -07:00
Simon Michael
a9c83f0ce1 web: add Peter Simons' patch fixing Data.Conduit.Network HostIPv4 error (#171)
(cherry picked from commit 993cae3a74)

Conflicts:
	hledger-web/Hledger/Web/Main.hs
2014-04-17 12:35:42 -07:00
Xinruo Sun
0275485bf9 web: add a --static-root option to customize static files root 2013-12-15 12:20:07 +08:00
Simon Michael
02fea186a3 web: fix debug option breakage in Main 2013-12-08 19:48:51 -08:00
Simon Michael
a66a715eeb command line options API updates, possibly fixing hledger-web build 2013-09-22 22:31:06 -07:00
Simon Michael
080eb866ec web: clean up language extensions a bit, make autoweb works again 2013-06-04 18:23:55 -07:00
Simon Michael
c744451dfa web: loosen "starting web browser" message for servers 2013-06-01 11:40:00 -07:00
Simon Michael
8873ffbe77 web: fix auto-exit in local mode, clarify startup messages 2013-05-01 12:02:47 -07:00
Simon Michael
c9b6dd8819 web: --server flag re-enables long-running, request-logging mode; output cleanups 2013-05-01 07:23:59 -07:00
Simon Michael
0a47715b17 web: also launch a browser at startup; auto-terminate after 2m or on enter
We're now using the wai-handler-launch middleware. This injects a
script in each page that pings the server repeatedly, and terminates
the server if it gets no pings (ie there are no browser tabs
displaying the app) for two minutes. The server can also be easily
terminated at the console by pressing enter, yesod devel style.
2013-04-20 20:02:50 -07:00
Simon Michael
0a77eba02e web: try using wai-launch-handler.. not working yet 2013-04-20 10:03:15 -07:00
Simon Michael
d5e575c862 web: remove io-storage 2013-04-09 12:53:21 -07:00
Simon Michael
0df4a235af web: set up journal for yesod devel, store it in App (fixes #101)
The web app's journal state is now kept in the yesod App as an IORef,
instead of using io-storage.
yesod devel now works; it uses the journal file specified by
$LEDGER_FILE, or ~/.hledger.journal.

web: update journal state handling, fix yesod devel - WIP
2013-04-09 12:41:22 -07:00
Simon Michael
3d33673b25 web: obey command-line query options at startup again 2012-11-15 17:53:10 +00:00
Simon Michael
cfbd8bb956 web: update for yesod 1.1.3
Build with latest yesod. Also reorganise to conform more closely with
yesod's standard scaffold layout to reduce upgrade effort.
2012-11-15 17:48:48 +00:00
Simon Michael
f441bbd946 web: add missing CPP pragma 2012-10-13 14:57:42 +00:00
Simon Michael
00f22819ae balance report speedup
This refactoring fixes an O(n^2) slowdown in the balance command with
large numbers of accounts. It's now speedy, and the implementation is
clearer. To facilitate this, the Account type now represents a tree of
accounts which can easily be traversed up or down (and/or flattened
into a list).

Benchmark on a 2010 macbook:

    +-------------------------------------------++--------------+------------+--------+
    |                                           || before:      | after:     |        |
    |                                           || hledger-0.18 | hledgeropt | ledger |
    +===========================================++==============+============+========+
    | -f data/100x100x10.journal     balance    ||         0.21 |       0.07 |   0.09 |
    | -f data/1000x1000x10.journal   balance    ||        10.13 |       0.47 |   0.62 |
    | -f data/1000x10000x10.journal  balance    ||        40.67 |       0.67 |   1.01 |
    | -f data/10000x1000x10.journal  balance    ||        15.01 |       3.22 |   2.36 |
    | -f data/10000x1000x10.journal  balance aa ||         4.77 |       4.40 |   2.33 |
    +-------------------------------------------++--------------+------------+--------+
2012-10-21 17:18:18 +00:00
Simon Michael
f03b020e2f set version with CPP instead of cabal-file-th; make building more robust
hledger and hledger-web were reading their version number (and program
name) from their cabal files at compile time using cabal-file-th,
which allowed the version number be maintained in one place (per
package).

This meant you had to be in same directory as the cabal file when
building, which made life more complicated, eg emacs compilation mode
could not jump to errors. Also, it slowed down building slightly, and
is a factor in hledger Debian packages being unavailable on a number
of platforms (we also use TH for report templates).

Now, the build version is set with a CPP VERSION flag, which seems
simpler overall. For cabal builds, this needs to be configured
manually in a few more places in each cabal file. For makefile builds,
it is set it to the name of the most recent darcs tag (which should be
more useful than the old behaviour). If not set, it defaults to the
blank string, useful eg for haddock. And, all makefile builds now run
from the top directory.
2012-10-13 19:21:17 +00:00
Simon Michael
155cb0eafe web: fix compilation error with -fblaze_html_0_5 flag 2012-07-08 00:18:39 +00:00
Simon Michael
4b11890e02 web: fix a build error 2012-03-07 16:42:35 +00:00
Simon Michael
28d86aca53 web: fix excess angle bracket in add form 2012-04-01 21:07:01 +00:00
Simon Michael
25b514b721 web: fix js error breaking second use of add form (#72) 2012-04-01 21:08:30 +00:00
Simon Michael
bb131f1b8c web: add closing angle brackets which yesod 1.0 requires 2012-04-01 20:30:44 +00:00
Simon Michael
296a4d1bb2 web: better hamlet override 2012-04-03 17:53:12 +00:00
Simon Michael
64b6316785 web: revert unintended hunk in Settings.hs 2012-04-03 17:43:49 +00:00
Simon Michael
acc5139c54 tools: makefile updates 2012-04-03 17:12:47 +00:00
Simon Michael
f298aac874 web: fix account balance rendering 2012-05-29 03:18:24 +00:00
Simon Michael
f35b961c86 web: update for yesod 1.0 2012-05-29 02:53:33 +00:00
Simon Michael
98274b481d more build warnings 2012-05-06 20:44:23 +00:00
Simon Michael
88f69e12e2 fix Dates exports for hledger-web 2012-04-16 17:09:27 +00:00
Simon Michael
93dd7bd064 web: simplify ifdef 2012-05-29 16:43:13 +00:00
Simon Michael
b4514cc37d web: don't munge static file names in dev mode 2012-05-29 03:09:43 +00:00
Simon Michael
f6f615196f web: define our own hamlet so it can be tweaked for debugging 2012-04-01 20:49:36 +00:00
Simon Michael
cfa59cc4f8 web: Hledger.Web api cleanup, haddocks 2012-04-01 20:29:10 +00:00
Simon Michael
2912a11929 web: officially drop GHC 6.12 support, fix build warnings with 7.0, 7.2, 7.4 2012-03-29 23:24:48 +00:00
Simon Michael
7f3b990394 docs: fix api docs 2012-03-07 16:05:04 +00:00
Simon Michael
5b749ab8a2 web: work around static file problem by skipping etag parameter 2012-05-29 16:45:24 +00:00
Simon Michael
88212f26e8 simplify journal parser names 2012-05-09 15:34:05 +00:00
Simon Michael
e1b1b8bce8 rename Matcher to Query, simplify constructors 2012-05-16 07:12:49 +00:00
Simon Michael
0c73d91f94 web: fix static file embedding in non-dev builds 2012-03-09 18:52:31 +00:00
Simon Michael
a27eb7c29f more matcher -> query renaming 2012-05-16 07:37:24 +00:00
Simon Michael
c27707f578 web: bump version, upgrade to yesod 0.10 2012-03-05 07:52:36 +00:00
Simon Michael
6eb7ad28e1 refactor/beef up readJournal/readJournalFile 2012-03-23 16:21:41 +00:00
Simon Michael
48460b0130 fix missing chart regression (#72) 2012-01-03 13:00:28 +00:00
Simon Michael
03359b48d3 web: prevent flot js error which broke add form fields after adding a transaction (#72) 2012-01-03 12:14:22 +00:00
Simon Michael
7f60e3504c web: fix $ quoting 2012-01-03 10:46:39 +00:00
Simon Michael
fd22dde57b web: needed to escape literal dollar signs in hamlet templates 2012-01-02 13:19:12 +00:00
Simon Michael
015dacb0d7 web: add form should reject blank account names (#81) 2012-01-04 11:35:39 +00:00
Simon Michael
0bd7fffaf7 web: dodge a yesod-core regression breaking add form redirect (#53) 2012-01-12 15:44:32 +00:00
Simon Michael
1b834afb20 web: avoid problematic redirect after submitting the add form 2012-01-03 12:43:30 +00:00
Simon Michael
c686645fab refactor: update version number handling 2012-01-31 06:01:31 +00:00
Simon Michael
9040821e8d web: fix ghc 6.12 incompatibility in Settings.hs 2011-10-26 17:30:17 +00:00
Simon Michael
db7f4d1b3d use cabal-file-th to get executable name and version from cabal files 2011-10-19 19:53:42 +00:00
Simon Michael
959d8a4591 web: clean up name clash with Yesod.Core 2011-10-19 19:57:12 +00:00
Simon Michael
9347f3169d bump hledger-web version 2011-10-05 00:49:06 +00:00
Simon Michael
bcc616823d bump just hledger-web version 2011-10-05 00:28:18 +00:00
Simon Michael
5c07a465da web: simplify static path definitions 2011-10-04 22:44:39 +00:00
Simon Michael
7f91a97d19 fix yesod haddock breakage 2011-09-14 02:42:18 +00:00
Simon Michael
187a7a1cc7 web: obey at least some command-line options, like --cost
Report filtering options like --period, and filter pattern arguments, are still ignored.
2011-09-14 19:53:05 +00:00
Simon Michael
4ca655b6a0 web: follow yesod file naming more closely 2011-09-12 23:37:55 +00:00
Simon Michael
4c52dd5b76 web: production build now has all web content embedded, dev build uses ./static (#63) 2011-09-12 23:30:29 +00:00
Simon Michael
c7c67efc1c web: adjust --help to indicate command-line arguments are not expected
Arguments are still accepted and ignored, since I can't see how to disallow them with cmdargs
2011-09-14 22:53:29 +00:00
Simon Michael
f6e15a2a80 fix warning 2011-09-19 03:25:19 +00:00
Simon Michael
fda4085e80 clarification 2011-09-20 15:23:08 +00:00
Simon Michael
15c39ac6c9 web: prevent an infinite redirect when custom base url has a trailing slash 2011-09-20 15:23:55 +00:00
Simon Michael
85b2307e78 web: modify the default base url when a custom port is specified 2011-09-19 03:25:12 +00:00
Simon Michael
2b5bd268b9 web: hide old title and search form when adding/editing 2011-09-21 22:42:06 +00:00
Simon Michael
0311595d3b web: editform title 2011-09-21 22:42:15 +00:00
Simon Michael
7bc67a7f00 web: update for yesod 0.9 2011-09-12 18:41:43 +00:00
Simon Michael
6f0f1acf7e fix hledger-web build error 2011-09-27 16:29:43 +00:00
Simon Michael
9b2a5f56e1 only the add and web commands auto-create the journal file 2011-09-23 03:53:14 +00:00
Simon Michael
27e4fec943 web: fix some invalid html 2011-09-10 19:52:35 +00:00
Simon Michael
23200cdd87 web: fix journal edit form 2011-09-10 20:03:59 +00:00
Simon Michael
1c3a5da1fa web: better settings for wai-handler-devel 2011-06-03 23:11:53 +00:00
Simon Michael
5106938b4b web: stay on add form; format errors/added transaction a little better 2011-06-14 21:12:24 +00:00
Simon Michael
6efe8fb30b web: indent accounts more than "all accounts" in sidebar 2011-06-14 21:32:01 +00:00
Simon Michael
9d00eeec23 haddock fix in EmbeddedFiles 2011-06-17 18:15:10 +00:00
Simon Michael
a62c51eff6 web: hide postings in a simpler way not requiring a special style 2011-07-17 16:00:34 +00:00
Simon Michael
613001a468 web: add a missing css class to balance report total 2011-07-17 16:01:14 +00:00
Simon Michael
464d8d4bcb hledger now detects and runs hledger-* add-ons found in path; many options cleanups 2011-08-22 14:55:39 +00:00
Simon Michael
059825a9b2 optionsgeddon.. port to cmdargs and a fully modal cli 2011-08-15 22:50:09 +00:00
Simon Michael
774434fcf2 web: always show empty and boring accounts too 2011-06-14 19:39:49 +00:00
Simon Michael
95f461fc94 web: make view data a little easier to construct and customise 2011-07-17 16:03:23 +00:00
Simon Michael
cd0c945454 web: move code to Hledger.Web for importability, consistency 2011-08-05 23:55:57 +00:00
Simon Michael
dc6c3dec76 web: more yesod 0.8 migration; adopt the scaffolding app's layout, slightly simplified 2011-05-24 04:27:37 +00:00
Simon Michael
274d072c4d web: show a clearer "hledger-web" in header 2011-04-23 14:46:05 +00:00
Simon Michael
024cfdb7b1 web: upgrade to yesod 0.8 2011-05-21 02:52:42 +00:00
Simon Michael
6a845eb5e4 i18n: always read and write UTF-8, ignoring current locale (#34)
Also remove a bunch of CPP conditions.
Uses the GHC-version-independent UTF-8 layer from pandoc.
2011-01-21 01:24:51 +00:00
Simon Michael
ce4347a2be move hidden add/edit/import forms below main content to help text-mode browsers a bit (#33) 2011-01-21 02:57:06 +00:00
Simon Michael
ad4ae66d28 make edit form more cross-browser compatible, fixing it in firefox (#38) 2011-01-21 02:54:42 +00:00
Simon Michael
961a6f09eb docs: update copyright dates 2011-04-18 17:36:28 +00:00
Simon Michael
811e71aba7 price precisions don't influence display precision; balancing is based on display precision (#23)
Like ledger, price amounts are now "unobserved", ie their precision does
not affect the canonical display precisions used when displaying amounts,
and transaction balancing is done based on display precision, ie amounts
are considered to balance if their sum appears to be zero when using the
canonical display precision.
2010-11-14 22:44:37 +00:00
Simon Michael
a3a7a346ac uniquify reader module names 2010-11-15 07:01:46 +00:00
Simon Michael
4e672f1722 comments 2010-11-19 17:25:39 +00:00
Simon Michael
4a7ad12271 web: hide run-time hamlet experiments for now 2010-11-27 01:08:22 +00:00
Simon Michael
d00ae908de web: cleanup, hide unused support files 2010-11-27 00:36:30 +00:00
Simon Michael
8740fec8aa web: update to current yesod (0.6.1.2) 2010-11-15 23:25:55 +00:00
Simon Michael
577b7fabff web: fix add/edit forms 2010-11-29 00:01:52 +00:00
Simon Michael
27ad4d7efe briefer, more informative usage error messages 2010-11-29 01:08:19 +00:00
Simon Michael
93b1f2b0ca more correct args parsing, fix account filtering in hledger-web 2010-11-29 00:37:21 +00:00
Simon Michael
c6a85c4b88 packagegeddon: make usage and version messages specific to each add-on program
All this stuff has been split up, except for the moment it's still
necessary to define all option constructors in Hledger.Cli.Options.
2010-11-26 19:14:09 +00:00
Simon Michael
f58ce26407 fix haddock breakage 2010-11-19 20:14:48 +00:00
Simon Michael
fd10736373 refactor: consistent main modules in add-ons 2010-11-25 07:10:38 +00:00
Simon Michael
1127c3f52f flatten modules a little 2010-11-15 06:48:49 +00:00
Simon Michael
b5e1c42cc4 web: auto-create all required support files in ./.hledger/web at startup
This is a compromise to ease deployment and satisfy hamlet's requirements.
See the Hledger.Web.Files module for more info. Currently we exit after
creating the missing files since they are not created early enough for
hamlet.
2010-11-18 00:53:41 +00:00
Simon Michael
e04d44a745 web: disable persistence/authentication support for now 2010-11-15 23:25:32 +00:00
Simon Michael
8dd52decb2 web: simplify support files layout, look for them in ./.hledger/web/ 2010-11-16 17:13:32 +00:00
Simon Michael
4e0df9daa8 web: flatten image dir 2010-09-12 02:21:41 +00:00
Simon Michael
f2f27dbd5f web: make accounts heading and "show more" links more styleable 2010-12-05 20:10:08 +00:00
Simon Michael
c3c20492bf web: more robust layout with wide content, style cleanups 2010-11-28 14:57:23 +00:00
Simon Michael
e1bd767f61 web: refactor: begin layout cleanup 2010-11-27 22:11:12 +00:00
Simon Michael
6aff8134b6 web: allow single- or double-quoted filter patterns containing spaces 2010-12-05 20:11:55 +00:00
Simon Michael
dbba128f29 web: sync with recent refactoring 2010-11-15 23:01:47 +00:00
Simon Michael
355b09e5e3 web: handle multiple account filter patterns correctly 2010-11-29 16:33:05 +00:00
Simon Michael
7714bab58d web: offer a choice of files to edit when there are multiple (included) files 2010-09-24 01:56:11 +00:00
Simon Michael
96036e56a0 docs: comments 2010-09-22 21:51:25 +00:00
Simon Michael
63531f8adc web: update for cassius, julius, template reloading, authentication, persistence 2010-09-11 01:47:46 +00:00
Simon Michael
9cb716d002 packagegeddon.. split off web/chart/vty, move hledger to a subdir 2010-09-09 22:54:34 +00:00