diff --git a/_sources/advanced.txt b/_sources/advanced.txt index 6e49ea11..b00c4525 100644 --- a/_sources/advanced.txt +++ b/_sources/advanced.txt @@ -6,12 +6,12 @@ Advanced Usage Configuration File ------------------- -You can configure the way jrnl behaves in a configuration file. By default, this is `~/.jrnl_conf`. If you have the `XDG_CONFIG_HOME` variable set, the configuration file will be saved under `$XDG_CONFIG_HOME/jrnl`. The configuration file is a simple JSON file with the following options. +You can configure the way jrnl behaves in a configuration file. By default, this is ``~/.jrnl_conf``. If you have the ``XDG_CONFIG_HOME`` variable set, the configuration file will be saved under ``$XDG_CONFIG_HOME/jrnl``. The configuration file is a simple JSON file with the following options. - ``journals`` paths to your journal files - ``editor`` - if set, executes this command to launch an external editor for writing your entries, e.g. ``vim`` or ``subl -w`` (note the ``-w`` flag to make sure _jrnl_ waits for Sublime Text to close the file before writing into the journal. If you're using MacVim, that would be ``mvim -f``). + if set, executes this command to launch an external editor for writing your entries, e.g. ``vim`` or ``subl -w`` (note the ``-w`` flag to make sure *jrnl* waits for Sublime Text to close the file before writing into the journal. If you're using MacVim, that would be ``mvim -f``). - ``encrypt`` if ``true``, encrypts your journal using AES. - ``tagsymbols`` @@ -51,6 +51,7 @@ Using your DayOne journal instead of a flat text file is dead simple -- instead * ``~/Library/Mobile Documents/5U8NS4GX82~com~dayoneapp~dayone/Documents/`` if you're syncing with iCloud. Instead of all entries being in a single file, each entry will live in a separate `plist` file. + Multiple journal files ---------------------- diff --git a/_sources/export.txt b/_sources/export.txt index 4a040b09..e017951d 100644 --- a/_sources/export.txt +++ b/_sources/export.txt @@ -15,6 +15,8 @@ you'll get a list of all tags you used in your journal, sorted by most frequent. List of all entries ------------------- +:: + jrnl --short Will only display the date and title of each entry. diff --git a/_sources/overview.txt b/_sources/overview.txt index 532fde36..726fbcf1 100644 --- a/_sources/overview.txt +++ b/_sources/overview.txt @@ -15,5 +15,9 @@ Optionally, your journal can be encrypted using the `256-bit AES `):: + + jrnl -until 1950 @texas -and @history --edit + +Will open your editor with all entries tagged with ``@texas`` and ``@history`` before 1950. You can make any changes to them you want; after you save the file and close the editor, your journal will be updated. + +Of course, if you are using multiple journals, you can also edit e.g. the latest entry of your work journal with ``jrnl work -n 1 --edit``. In any case, this will bring up your editor and save (and, if applicable, encrypt) your edited journal after you save and exit the editor. + +You can also use this feature for deleting entries from your journal:: + + jrnl @girlfriend -until 'june 2012' --edit + +Just select all text, press delete, and everything is gone... + +Editing DayOne Journals +~~~~~~~~~~~~~~~~~~~~~~~ + +DayOne journals can be edited exactly the same way, however the output looks a little bit different because of the way DayOne stores its entries: + +.. code-block:: output + + # af8dbd0d43fb55458f11aad586ea2abf + 2013-05-02 15:30 I told everyone I built my @robot wife for sex. + But late at night when we're alone we mostly play Battleship. + + # 2391048fe24111e1983ed49a20be6f9e + 2013-08-10 03:22 I had all kinds of plans in case of a @zombie attack. + I just figured I'd be on the other side. + +The long strings starting with hash symbol are the so-called UUIDs, unique identifiers for each entry. Don't touch them. If you do, then the old entry would get deleted and a new one written, which means that you could DayOne loose data that jrnl can't handle (such as as the entry's geolocation). diff --git a/advanced.html b/advanced.html index b3a9408b..95265292 100644 --- a/advanced.html +++ b/advanced.html @@ -7,7 +7,7 @@ - Advanced Usage — jrnl 1.6.6 documentation + Advanced Usage — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + @@ -44,7 +44,7 @@

Advanced Usage

Configuration File

-

You can configure the way jrnl behaves in a configuration file. By default, this is ~/.jrnl_conf. If you have the XDG_CONFIG_HOME variable set, the configuration file will be saved under $XDG_CONFIG_HOME/jrnl. The configuration file is a simple JSON file with the following options.

+

You can configure the way jrnl behaves in a configuration file. By default, this is ~/.jrnl_conf. If you have the XDG_CONFIG_HOME variable set, the configuration file will be saved under $XDG_CONFIG_HOME/jrnl. The configuration file is a simple JSON file with the following options.

-

Instead of all entries being in a single file, each entry will live in a separate plist file. -Multiple journal files -———————-

+

Instead of all entries being in a single file, each entry will live in a separate plist file.

+
+
+

Multiple journal files

You can configure _jrnl_ to use with multiple journals (eg. private and work) by defining more journals in your .jrnl_config, for example:

{
 ...
@@ -171,6 +172,7 @@ Multiple journal files
 
  • Advanced Usage
  • FAQ
  • diff --git a/docs/_build/doctrees/advanced.doctree b/docs/_build/doctrees/advanced.doctree index 6bf11233..86bf9201 100644 Binary files a/docs/_build/doctrees/advanced.doctree and b/docs/_build/doctrees/advanced.doctree differ diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index c6c72808..1c640f7a 100644 Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ diff --git a/docs/_build/doctrees/export.doctree b/docs/_build/doctrees/export.doctree index 9af86f81..ade2fef6 100644 Binary files a/docs/_build/doctrees/export.doctree and b/docs/_build/doctrees/export.doctree differ diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree index 3e303c30..a0897baa 100644 Binary files a/docs/_build/doctrees/index.doctree and b/docs/_build/doctrees/index.doctree differ diff --git a/docs/_build/doctrees/overview.doctree b/docs/_build/doctrees/overview.doctree index 296d28d1..db66c7b9 100644 Binary files a/docs/_build/doctrees/overview.doctree and b/docs/_build/doctrees/overview.doctree differ diff --git a/docs/_build/doctrees/usage.doctree b/docs/_build/doctrees/usage.doctree index 35c75855..a9540bc2 100644 Binary files a/docs/_build/doctrees/usage.doctree and b/docs/_build/doctrees/usage.doctree differ diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo index c69487a0..fab40257 100644 --- a/docs/_build/html/.buildinfo +++ b/docs/_build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: cdd3d9dc24c56f542788a30876de826e +config: dba46e56c477091f1d2bb4513e29807e tags: fbb0d17656682115ca4d033fb2f83ba1 diff --git a/docs/_build/html/_sources/advanced.txt b/docs/_build/html/_sources/advanced.txt index 6e49ea11..b00c4525 100644 --- a/docs/_build/html/_sources/advanced.txt +++ b/docs/_build/html/_sources/advanced.txt @@ -6,12 +6,12 @@ Advanced Usage Configuration File ------------------- -You can configure the way jrnl behaves in a configuration file. By default, this is `~/.jrnl_conf`. If you have the `XDG_CONFIG_HOME` variable set, the configuration file will be saved under `$XDG_CONFIG_HOME/jrnl`. The configuration file is a simple JSON file with the following options. +You can configure the way jrnl behaves in a configuration file. By default, this is ``~/.jrnl_conf``. If you have the ``XDG_CONFIG_HOME`` variable set, the configuration file will be saved under ``$XDG_CONFIG_HOME/jrnl``. The configuration file is a simple JSON file with the following options. - ``journals`` paths to your journal files - ``editor`` - if set, executes this command to launch an external editor for writing your entries, e.g. ``vim`` or ``subl -w`` (note the ``-w`` flag to make sure _jrnl_ waits for Sublime Text to close the file before writing into the journal. If you're using MacVim, that would be ``mvim -f``). + if set, executes this command to launch an external editor for writing your entries, e.g. ``vim`` or ``subl -w`` (note the ``-w`` flag to make sure *jrnl* waits for Sublime Text to close the file before writing into the journal. If you're using MacVim, that would be ``mvim -f``). - ``encrypt`` if ``true``, encrypts your journal using AES. - ``tagsymbols`` @@ -51,6 +51,7 @@ Using your DayOne journal instead of a flat text file is dead simple -- instead * ``~/Library/Mobile Documents/5U8NS4GX82~com~dayoneapp~dayone/Documents/`` if you're syncing with iCloud. Instead of all entries being in a single file, each entry will live in a separate `plist` file. + Multiple journal files ---------------------- diff --git a/docs/_build/html/_sources/export.txt b/docs/_build/html/_sources/export.txt index 4a040b09..e017951d 100644 --- a/docs/_build/html/_sources/export.txt +++ b/docs/_build/html/_sources/export.txt @@ -15,6 +15,8 @@ you'll get a list of all tags you used in your journal, sorted by most frequent. List of all entries ------------------- +:: + jrnl --short Will only display the date and title of each entry. diff --git a/docs/_build/html/_sources/overview.txt b/docs/_build/html/_sources/overview.txt index 532fde36..726fbcf1 100644 --- a/docs/_build/html/_sources/overview.txt +++ b/docs/_build/html/_sources/overview.txt @@ -15,5 +15,9 @@ Optionally, your journal can be encrypted using the `256-bit AES `):: + + jrnl -until 1950 @texas -and @history --edit + +Will open your editor with all entries tagged with ``@texas`` and ``@history`` before 1950. You can make any changes to them you want; after you save the file and close the editor, your journal will be updated. + +Of course, if you are using multiple journals, you can also edit e.g. the latest entry of your work journal with ``jrnl work -n 1 --edit``. In any case, this will bring up your editor and save (and, if applicable, encrypt) your edited journal after you save and exit the editor. + +You can also use this feature for deleting entries from your journal:: + + jrnl @girlfriend -until 'june 2012' --edit + +Just select all text, press delete, and everything is gone... + +Editing DayOne Journals +~~~~~~~~~~~~~~~~~~~~~~~ + +DayOne journals can be edited exactly the same way, however the output looks a little bit different because of the way DayOne stores its entries: + +.. code-block:: output + + # af8dbd0d43fb55458f11aad586ea2abf + 2013-05-02 15:30 I told everyone I built my @robot wife for sex. + But late at night when we're alone we mostly play Battleship. + + # 2391048fe24111e1983ed49a20be6f9e + 2013-08-10 03:22 I had all kinds of plans in case of a @zombie attack. + I just figured I'd be on the other side. + +The long strings starting with hash symbol are the so-called UUIDs, unique identifiers for each entry. Don't touch them. If you do, then the old entry would get deleted and a new one written, which means that you could DayOne loose data that jrnl can't handle (such as as the entry's geolocation). diff --git a/docs/_build/html/advanced.html b/docs/_build/html/advanced.html index b3a9408b..95265292 100644 --- a/docs/_build/html/advanced.html +++ b/docs/_build/html/advanced.html @@ -7,7 +7,7 @@ - Advanced Usage — jrnl 1.6.6 documentation + Advanced Usage — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + @@ -44,7 +44,7 @@

    Advanced Usage

    Configuration File

    -

    You can configure the way jrnl behaves in a configuration file. By default, this is ~/.jrnl_conf. If you have the XDG_CONFIG_HOME variable set, the configuration file will be saved under $XDG_CONFIG_HOME/jrnl. The configuration file is a simple JSON file with the following options.

    +

    You can configure the way jrnl behaves in a configuration file. By default, this is ~/.jrnl_conf. If you have the XDG_CONFIG_HOME variable set, the configuration file will be saved under $XDG_CONFIG_HOME/jrnl. The configuration file is a simple JSON file with the following options.

    • journals
      @@ -54,7 +54,7 @@
    • editor
      -

      if set, executes this command to launch an external editor for writing your entries, e.g. vim or subl -w (note the -w flag to make sure _jrnl_ waits for Sublime Text to close the file before writing into the journal. If you’re using MacVim, that would be mvim -f).

      +

      if set, executes this command to launch an external editor for writing your entries, e.g. vim or subl -w (note the -w flag to make sure jrnl waits for Sublime Text to close the file before writing into the journal. If you’re using MacVim, that would be mvim -f).

    • @@ -114,9 +114,10 @@
    • ~/Dropbox/Apps/Day One/ if you’re syncing with Dropbox and
    • ~/Library/Mobile Documents/5U8NS4GX82~com~dayoneapp~dayone/Documents/ if you’re syncing with iCloud.
    -

    Instead of all entries being in a single file, each entry will live in a separate plist file. -Multiple journal files -———————-

    +

    Instead of all entries being in a single file, each entry will live in a separate plist file.

    +
    +
    +

    Multiple journal files

    You can configure _jrnl_ to use with multiple journals (eg. private and work) by defining more journals in your .jrnl_config, for example:

    {
     ...
    @@ -171,6 +172,7 @@ Multiple journal files
     
  • Advanced Usage
  • FAQ
  • diff --git a/docs/_build/html/encryption.html b/docs/_build/html/encryption.html index e3af408a..6d55ff01 100644 --- a/docs/_build/html/encryption.html +++ b/docs/_build/html/encryption.html @@ -7,7 +7,7 @@ - Encryption — jrnl 1.6.6 documentation + Encryption — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + diff --git a/docs/_build/html/export.html b/docs/_build/html/export.html index 6bc00ebd..f08b0817 100644 --- a/docs/_build/html/export.html +++ b/docs/_build/html/export.html @@ -7,7 +7,7 @@ - Import and Export — jrnl 1.6.6 documentation + Import and Export — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + @@ -52,8 +52,9 @@

    List of all entries

    -
    -
    jrnl –short
    +
    jrnl --short
    +
    +

    Will only display the date and title of each entry.

    diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html index 21b80821..7f8abd1e 100644 --- a/docs/_build/html/genindex.html +++ b/docs/_build/html/genindex.html @@ -9,7 +9,7 @@ - Index — jrnl 1.6.6 documentation + Index — jrnl 1.7.2 documentation @@ -17,7 +17,7 @@ - + diff --git a/docs/_build/html/installation.html b/docs/_build/html/installation.html index fd217d9c..096def18 100644 --- a/docs/_build/html/installation.html +++ b/docs/_build/html/installation.html @@ -7,7 +7,7 @@ - Getting started — jrnl 1.6.6 documentation + Getting started — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv index d824b8a4..7ecd92fe 100644 Binary files a/docs/_build/html/objects.inv and b/docs/_build/html/objects.inv differ diff --git a/docs/_build/html/overview.html b/docs/_build/html/overview.html index 22489a56..69c7cde5 100644 --- a/docs/_build/html/overview.html +++ b/docs/_build/html/overview.html @@ -7,7 +7,7 @@ - Overview — jrnl 1.6.6 documentation + Overview — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + @@ -50,7 +50,9 @@

    Why keep a journal?

    -

    Journals aren’t only for 13-year old girls and people who have too much time on their summer vacation. A journal helps you to keep track of the things you get done and how you did them. Your imagination may be limitless, but your memory isn’t. For personal use, make it a good habit to write at least 20 words a day. Just to reflect what made this day special, why you haven’t wasted it. For professional use, consider a text-based journal to be the perfect complement to your GTD todo list - a documentation of what and how you’ve done it.

    +

    Journals aren’t only for 13-year old girls and people who have too much time on their summer vacation. A journal helps you to keep track of the things you get done and how you did them. Your imagination may be limitless, but your memory isn’t.

    +

    For personal use, make it a good habit to write at least 20 words a day. Just to reflect what made this day special, why you haven’t wasted it.

    +

    For professional use, consider a text-based journal to be the perfect complement to your GTD todo list - a documentation of what and how you’ve done it. Or use it as a quick way to keep a change log. Or use it to keep a lab book.

    diff --git a/docs/_build/html/recipes.html b/docs/_build/html/recipes.html index cef4180f..7991cfb4 100644 --- a/docs/_build/html/recipes.html +++ b/docs/_build/html/recipes.html @@ -7,7 +7,7 @@ - FAQ — jrnl 1.6.6 documentation + FAQ — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html index d3799117..f3a1388d 100644 --- a/docs/_build/html/search.html +++ b/docs/_build/html/search.html @@ -7,7 +7,7 @@ - Search — jrnl 1.6.6 documentation + Search — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js index 678c5ffa..8710174b 100644 --- a/docs/_build/html/searchindex.js +++ b/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{},terms:{all:[6,0,4,7,2],default_minut:7,steve:[6,7],follow:[6,7],privat:7,depend:1,"2013_06_03_a":4,readabl:[2,4],yve:3,program:5,alberto:3,under:7,sha256:5,thursdai:7,everi:5,string:6,"3am":6,fals:7,faq:[0,3],veri:7,untouch:5,recip:[0,3],flatmat:3,level:7,did:2,list:[6,0,4,2],vector:5,dayon:[0,7,2],timeformat:7,initialis:5,ten:6,sync:[2,7],sign:6,pass:7,what:[0,2],access:7,melo:3,"new":[5,1],ever:5,told:1,hash:5,gener:4,chang:[6,5,3,7],decid:5,bodi:1,met:6,path:7,valu:7,wait:7,convers:5,vacat:2,prior:3,behav:7,chcp:3,implement:7,control:[6,7],linewrap:7,apr:6,app:7,vim:7,ask:[5,1],xdg_config_hom:7,instal:[0,3,1],txt:[6,5,7],mobil:7,quickstart:[0,1],from:[6,2,7],would:7,memori:2,doubl:6,two:6,todai:6,websit:7,live:7,call:1,type:[1,7],until:[6,3,1],more:7,sort:4,flat:7,python:[5,7],henc:7,flag:7,known:[0,3],word:2,hous:1,gabriel:4,work:[6,3,7],can:[1,5,3,4,2,6,7],meet:7,overrid:7,prompt:[6,1,7],fabul:2,tag:[6,0,3,4,7],want:[6,5,3,1,7],plist:7,gcc:1,multipl:7,anoth:5,occur:[6,3,4],write:[6,5,1,7,2],how:[6,2,3,7],instead:7,beach:6,after:7,sundai:6,reflect:2,befor:[6,3,7],beauti:4,mai:2,end:7,"short":[3,4],issu:[0,3],"switch":6,environ:3,jrnl:[0,1,2,3,4,5,6,7],enter:[6,5],exclus:6,frontend:7,help:2,becaus:6,cyan:7,still:2,digest:5,perfect:2,gtd:2,thank:3,fix:3,window:3,drawback:7,requir:1,them:[6,2],good:2,"return":1,food:7,timestamp:[6,0,7],dai:[6,2,4,7],initi:5,"break":6,mention:3,macvim:7,now:[6,7],choic:6,name:4,simpl:[2,4,7],crypto:5,separ:7,mode:6,each:[3,4,7],januari:3,unicod:3,my_entri:[6,4],mean:[6,3,7],compil:1,replac:5,individu:[4,7],timelin:4,meta:7,year:[6,2],our:7,girl:2,todo:2,special:[6,2],out:3,variabl:7,mere:7,content:[0,4],print:[6,3,4],lubric:6,occurr:[0,3],advanc:[0,7],given:6,reason:[6,1],base:2,releas:0,"byte":5,bash:7,launch:[6,7],put:2,keep:[6,0,2],filter:[6,0,3],thing:[2,3],isn:2,summari:3,imposs:7,frequent:4,first:[5,3,1,7],origin:5,directli:[6,2],mvim:7,wast:2,date:[6,4,7],alreadi:5,done:2,open:5,fanci:2,differ:7,convent:6,start:[6,0,1,7],top:7,least:[2,7],too:2,tom:6,"final":3,store:[0,2,5],shell:[6,3,7],option:[6,2,3,1,7],specifi:[6,5,4,7],github:4,haven:2,ipad:2,hashlib:5,grep:3,whenev:[6,5],charact:[3,7],project:6,sai:7,comput:5,ani:[6,5],dash:6,packag:3,have:[5,1,7,2],seem:7,imagin:2,built:7,equival:6,note:[6,1,7],also:[6,5,1,7,2],exampl:[4,7],which:[6,3],combin:[6,0,3],singl:[6,7],sure:[6,7],unless:1,track:[6,2],favourit:[6,3],who:2,most:[6,3,4,7],render:4,cipher:5,icloud:7,why:[0,4,2],don:[6,5,7],doc:7,later:5,doe:[3,7],pipe:3,"10am":7,clean:1,pouplard:3,summer:2,text:[2,0,4,7,5],find:3,current:5,onli:[6,2,3,4],explicitli:1,locat:[6,7],execut:7,pretti:4,configur:[6,0,1,7],should:[5,1],jan:3,folder:[2,7],hit:1,"2013_06_07_dinner":4,get:[0,1,2,3,4,7],jrnl_conf:7,endless:7,bar:6,sha:5,integr:[0,7],contain:[6,3],buscemi:6,where:[3,1],view:[6,0],set:7,habit:2,see:[6,7],result:[1,7],close:7,best:6,wonder:6,profession:2,someth:3,sublim:7,won:[5,7],"import":[6,0,4,5],kei:[5,7],complement:2,entir:4,solv:3,both:[6,3,7],instant:2,howev:7,forgotten:2,pdf:4,com:7,comment:7,assur:2,simpli:[6,5],point:[5,7],overview:[0,2],arbitrarili:6,dayoneapp:7,suppli:[6,7],my_recip:7,assum:6,stamp:1,quotat:7,three:7,mark:[6,1,7],json:[0,4,7],much:2,interpret:[1,7],basic:[6,0],my_journ:5,life:6,wish:1,pycyrypto:1,argument:[6,4],"5u8ns4gx82":7,last:[6,7],present:7,look:[6,4,1,7],jrnl_config:7,plain:[5,2],plain_text_copi:5,defin:7,"while":7,abov:4,"_no_":6,pinki:6,readm:4,non:3,ascii:3,sever:4,make:[6,4,1,7,2],format:[4,7],same:[5,3,4],funni:6,html:4,sentenc:1,document:[2,7],extern:[1,7],yesterdai:[6,1],recent:3,off:7,entri:[0,1,3,4,6,7],markup:4,well:1,spent:1,person:2,without:6,command:[6,0,4,7,2],thi:[1,5,3,4,2,6,7],choos:5,everyth:[6,1,7],latest:6,load:7,just:[6,2,1,7],codepag:3,rest:1,markdown:[0,4],human:[2,4],languag:4,had:6,add:6,other:4,input:[6,7],save:7,smart:[6,0],applic:[2,7],march:6,mayb:5,read:[5,2],intuit:7,five:6,bit:2,password:[0,5],like:[6,4,3,1,7],specif:7,filenam:5,whitespac:6,manual:[0,1,7,5],either:6,output:[4,7],old:2,often:3,some:3,dead:7,"export":[6,0,4],librari:[1,7],noon:6,leav:5,anna:6,refer:7,limitless:2,run:[5,3,1],journal:[0,1,2,3,4,5,6,7],usag:[6,0,7],tagsymbol:7,although:[6,7],"_jrnl_":[3,7],"6am":6,plai:2,surround:6,chop:7,consid:2,within:3,encod:3,compos:[6,0,1,7],wrap:7,my_password:5,subl:7,your:[0,1,2,4,5,6,7],wai:[6,7],aren:2,support:[5,7],"long":[2,7],width:7,reli:3,editor:[6,1,7],keychain:[0,5],mode_cbc:5,line:[6,0,3,7,2],"true":7,count:4,made:2,pycrypto:[3,1],whether:[5,1,7],worlddomin:6,displai:[6,3,4,7],below:7,highlight:7,problem:3,default_hour:7,creat:[4,1,7],decrypt:[0,7,5],exist:5,file:[0,1,2,4,5,6,7],pip:1,happen:6,again:5,mutual:6,encrypt:[0,1,2,3,5,7],titl:[4,1],when:[5,2],virtual:3,"default":7,book:1,sick:1,peopl:[6,2],you:[1,5,3,4,2,6,7],intention:6,nice:[2,4],pineappl:6,star:[6,0,3],symbol:[6,7],asterisk:6,mondai:6,dropbox:[2,7],algorithm:5,directori:4,scroll:7,time:[1,5,4,2,6,7],avoid:7},objtypes:{},titles:["jrnl: The command-line journal","Getting started","Overview","FAQ","Import and Export","Encryption","Basic Usage","Advanced Usage"],objnames:{},filenames:["index","installation","overview","recipes","export","encryption","usage","advanced"]}) \ No newline at end of file +Search.setIndex({objects:{},terms:{all:[6,0,4,7,5],default_minut:7,steve:[6,7],follow:[6,7],privat:7,depend:1,"2013_06_03_a":4,readabl:[5,4],yve:3,program:2,alberto:3,under:7,leav:2,sha256:2,thursdai:7,everi:2,string:6,"3am":6,fals:7,faq:[0,3],veri:7,cyan:7,recip:[0,3],flatmat:3,level:7,did:5,list:[6,0,4,5],vector:2,dayon:[6,0,7,5],timeformat:7,initialis:2,ten:6,sync:[5,7],sign:6,geoloc:6,pass:7,what:[0,5],access:7,delet:6,melo:3,"new":[6,2,1],ever:2,told:[6,1],hash:[6,2],gener:4,chang:[6,5,3,7,2],decid:2,bodi:1,met:6,path:7,valu:7,wait:7,convers:2,vacat:5,everyon:6,prior:3,behav:7,chcp:3,implement:7,control:[6,7],linewrap:7,apr:6,app:7,vim:7,releas:0,xdg_config_hom:7,instal:[0,3,1],txt:[6,2,7],mobil:7,select:6,quickstart:[0,1],from:[6,5,7],would:[6,7],memori:5,doubl:6,two:6,todai:6,websit:7,live:7,call:[6,1],type:[1,7],until:[6,3,1],more:7,sort:4,flat:7,readm:4,flag:7,known:[0,3],word:5,hous:1,gabriel:4,work:[6,3,7],uniqu:6,histori:6,can:[1,5,3,4,2,6,7],meet:7,overrid:7,prompt:[6,1,7],fabul:5,tag:[6,0,3,4,7],want:[6,2,3,1,7],plist:7,gcc:1,cours:6,multipl:[6,0,7],anoth:2,occur:[6,3,4],write:[6,5,1,7,2],how:[6,5,3,7],instead:7,simpl:[5,4,7],updat:6,after:[6,7],sundai:6,lab:5,reflect:5,befor:[6,3,7],beauti:4,date:[6,4,7],end:7,data:6,github:4,read:[5,2],robot:6,issu:[0,3],"switch":6,combin:[6,0,3],jrnl:[0,1,2,3,4,5,6,7],enter:[6,2],exclus:6,frontend:7,help:5,becaus:6,untouch:2,still:5,digest:2,perfect:5,gtd:5,thank:3,funni:6,fix:3,late:6,window:3,html:4,requir:1,them:[6,5],good:5,"return":1,food:7,timestamp:[6,0,7],dai:[6,5,4,7],initi:2,"break":6,mention:3,macvim:7,now:[6,7],choic:6,name:4,edit:[6,0],beach:6,crypto:2,separ:7,mode:6,each:[6,3,4,7],januari:3,unicod:3,my_entri:[6,4],side:6,mean:[6,3,7],compil:1,replac:2,individu:[4,7],timelin:4,meta:7,year:[6,5],our:7,girl:5,todo:5,special:[6,5],out:3,variabl:7,encod:3,load:7,your:[0,1,2,4,5,6,7],content:[0,4],print:[6,3,4],lubric:6,occurr:[0,3],advanc:[6,0,7],given:6,quick:5,reason:[6,1],base:5,zombi:6,ask:[2,1],"byte":2,bash:7,launch:[6,7],could:6,put:5,keep:[6,0,5],filter:[6,0,3],thing:[5,3],isn:5,view:[6,0],imposs:7,frequent:4,first:[2,3,1,7],origin:2,directli:[6,5],mvim:7,wast:5,mai:5,alreadi:2,done:5,open:[6,2],fanci:5,differ:[6,7],convent:6,width:7,top:7,least:[5,7],attack:6,too:5,tom:6,"final":3,store:[6,0,2,5],shell:[6,3,7],option:[6,5,3,1,7],specifi:[6,2,4,7],"short":[3,4],mostli:6,exactli:6,haven:5,ipad:5,kind:6,grep:3,whenev:[6,2],charact:[3,7],project:6,sai:7,comput:2,ani:[6,2],dash:6,packag:3,have:[6,5,1,7,2],need:6,seem:7,imagin:5,built:[6,7],equival:6,note:[6,1,7],also:[6,5,1,7,2],without:6,which:[6,3],environ:3,singl:[6,7],sure:[6,7],unless:1,track:[6,5],favourit:[6,3],who:5,most:[6,3,4,7],render:4,cipher:2,plan:6,icloud:7,why:[0,4,5],don:[6,2,7],doc:7,later:2,doe:[3,7],pipe:3,"10am":7,clean:1,pouplard:3,text:[0,2,4,5,6,7],bring:6,particularli:6,texa:6,find:3,current:2,onli:[6,5,3,4],explicitli:1,locat:[6,7],just:[6,5,1,7],pretti:4,configur:[6,0,1,7],figur:6,should:[2,1],jan:3,folder:[5,7],codepag:3,hit:1,"2013_06_07_dinner":4,get:[0,1,5,3,4,6,7],hashlib:2,jrnl_conf:7,endless:7,bar:6,noon:6,sha:2,integr:[0,7],contain:[6,3],buscemi:6,where:[3,1],wrote:6,summari:3,set:7,habit:5,sex:6,see:[6,7],result:[1,7],close:[6,7],best:6,wonder:6,someth:3,sublim:7,won:[2,7],"import":[6,0,4,2],kei:[2,7],complement:5,entir:4,solv:3,uuid:6,both:[6,3,7],instant:5,howev:[6,7],alon:6,af8dbd0d43fb55458f11aad586ea2abf:6,forgotten:5,pdf:4,com:7,comment:7,assur:5,simpli:[6,2],point:[2,7],overview:[0,5],arbitrarili:6,dayoneapp:7,written:6,suppli:[6,7],my_recip:7,assum:6,stamp:1,quotat:7,three:7,mark:[6,1,7],json:[0,4,7],much:5,interpret:[1,7],basic:[6,0],my_journ:2,life:6,decrypt:[0,7,2],argument:[6,4],"5u8ns4gx82":7,last:[6,7],present:7,"case":6,look:[6,4,1,7],jrnl_config:7,plain:[5,2],plain_text_copi:2,defin:7,"while":7,abov:4,"_no_":[],loos:6,pinki:6,henc:7,non:3,pip:1,ascii:3,sever:4,make:[6,5,4,1,7],mayb:2,same:[6,2,3,4],python:[2,7],drawback:7,sentenc:1,document:[5,7],extern:[1,7],yesterdai:[6,1],recent:3,off:7,older:[6,0],entri:[0,1,3,4,6,7],markup:4,well:1,spent:1,person:5,exampl:[4,7],command:[6,0,4,7,5],thi:[1,5,3,4,2,6,7],choos:2,everyth:[6,1,7],latest:6,summer:5,identifi:6,execut:7,battleship:6,rest:1,markdown:[0,4],human:[5,4],touch:6,languag:4,had:6,littl:6,add:6,book:[5,1],input:[6,7],save:[6,7],smart:[6,0],applic:[6,5,7],march:6,format:[4,7],handl:6,intuit:7,five:6,press:6,bit:[6,5],password:[0,2],like:[6,4,3,1,7],specif:7,filenam:2,whitespac:6,manual:[0,1,7,2],either:6,night:6,output:[6,4,7],old:[6,5],often:3,some:3,dead:7,"export":[6,0,4],worlddomin:6,librari:[1,7],avoid:7,exit:6,anna:6,refer:7,limitless:5,run:[2,3,1],asterisk:6,journal:[0,1,2,3,4,5,6,7],usag:[6,0,7],tagsymbol:7,although:[6,7],"_jrnl_":[3,7],"6am":6,plai:[6,5],surround:6,chop:7,mondai:6,within:3,profession:5,compos:[6,0,1,7],wrap:7,my_password:2,subl:7,mere:7,log:5,wai:[6,5,7],aren:5,support:[2,7],"long":[6,5,7],start:[6,0,1,7],reli:3,editor:[6,1,7],keychain:[0,2],mode_cbc:2,line:[6,0,3,7,5],"true":7,"2391048fe24111e1983ed49a20be6f9":6,count:4,made:5,algorithm:2,whether:[2,1,7],wish:1,displai:[6,3,4,7],below:7,highlight:7,problem:3,default_hour:7,gone:6,featur:6,creat:[4,1,7],pycyrypto:1,exist:2,file:[0,1,2,4,5,6,7],girlfriend:6,happen:6,again:2,mutual:6,encrypt:[0,1,2,3,5,6,7],titl:[4,1],when:[6,5,2],virtual:3,"default":7,other:[6,4],sick:1,peopl:[6,5],you:[1,5,3,4,2,6,7],intention:6,nice:[5,4],pineappl:6,star:[6,0,3],symbol:[6,7],june:6,consid:5,dropbox:[5,7],pycrypto:[3,1],wife:6,directori:4,time:[1,5,4,2,6,7],scroll:7},objtypes:{},titles:["jrnl: The command-line journal","Getting started","Encryption","FAQ","Import and Export","Overview","Basic Usage","Advanced Usage"],objnames:{},filenames:["index","installation","encryption","recipes","export","overview","usage","advanced"]}) \ No newline at end of file diff --git a/docs/_build/html/usage.html b/docs/_build/html/usage.html index 0aeb93f1..84d7b64d 100644 --- a/docs/_build/html/usage.html +++ b/docs/_build/html/usage.html @@ -7,7 +7,7 @@ - Basic Usage — jrnl 1.6.6 documentation + Basic Usage — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + @@ -109,7 +109,32 @@

    the last five entries containing both @pineapple and @lubricant. You can change which symbols you’d like to use for tagging in the configuration.

    Note

    -

    jrnl @pinkie @WorldDomination will switch to viewing mode because although _no_ command line arguments are given, all the input strings look like tags - jrnl will assume you want to filter by tag.

    +

    jrnl @pinkie @WorldDomination will switch to viewing mode because although no command line arguments are given, all the input strings look like tags - jrnl will assume you want to filter by tag.

    +
    +
    +
    +

    Editing older entries

    +

    You can edit selected entries after you wrote them. This is particularly useful when your journal file is encrypted or if you’re using a DayOne journal. To use this feature, you need to have an editor configured in your journal configuration file (see advanced usage):

    +
    jrnl -until 1950 @texas -and @history --edit
    +
    +

    Will open your editor with all entries tagged with @texas and @history before 1950. You can make any changes to them you want; after you save the file and close the editor, your journal will be updated.

    +

    Of course, if you are using multiple journals, you can also edit e.g. the latest entry of your work journal with jrnl work -n 1 --edit. In any case, this will bring up your editor and save (and, if applicable, encrypt) your edited journal after you save and exit the editor.

    +

    You can also use this feature for deleting entries from your journal:

    +
    jrnl @girlfriend -until 'june 2012' --edit
    +
    +

    Just select all text, press delete, and everything is gone...

    +
    +

    Editing DayOne Journals

    +

    DayOne journals can be edited exactly the same way, however the output looks a little bit different because of the way DayOne stores its entries:

    +
    # af8dbd0d43fb55458f11aad586ea2abf
    +2013-05-02 15:30 I told everyone I built my @robot wife for sex.
    +But late at night when we're alone we mostly play Battleship.
    +
    +# 2391048fe24111e1983ed49a20be6f9e
    +2013-08-10 03:22 I had all kinds of plans in case of a @zombie attack.
    +I just figured I'd be on the other side.
    +
    +

    The long strings starting with hash symbol are the so-called UUIDs, unique identifiers for each entry. Don’t touch them. If you do, then the old entry would get deleted and a new one written, which means that you could DayOne loose data that jrnl can’t handle (such as as the entry’s geolocation).

    @@ -132,6 +157,10 @@
  • Viewing
  • Using Tags
  • +
  • Editing older entries +
  • Encryption
  • diff --git a/docs/advanced.rst b/docs/advanced.rst index 6e49ea11..b00c4525 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -6,12 +6,12 @@ Advanced Usage Configuration File ------------------- -You can configure the way jrnl behaves in a configuration file. By default, this is `~/.jrnl_conf`. If you have the `XDG_CONFIG_HOME` variable set, the configuration file will be saved under `$XDG_CONFIG_HOME/jrnl`. The configuration file is a simple JSON file with the following options. +You can configure the way jrnl behaves in a configuration file. By default, this is ``~/.jrnl_conf``. If you have the ``XDG_CONFIG_HOME`` variable set, the configuration file will be saved under ``$XDG_CONFIG_HOME/jrnl``. The configuration file is a simple JSON file with the following options. - ``journals`` paths to your journal files - ``editor`` - if set, executes this command to launch an external editor for writing your entries, e.g. ``vim`` or ``subl -w`` (note the ``-w`` flag to make sure _jrnl_ waits for Sublime Text to close the file before writing into the journal. If you're using MacVim, that would be ``mvim -f``). + if set, executes this command to launch an external editor for writing your entries, e.g. ``vim`` or ``subl -w`` (note the ``-w`` flag to make sure *jrnl* waits for Sublime Text to close the file before writing into the journal. If you're using MacVim, that would be ``mvim -f``). - ``encrypt`` if ``true``, encrypts your journal using AES. - ``tagsymbols`` @@ -51,6 +51,7 @@ Using your DayOne journal instead of a flat text file is dead simple -- instead * ``~/Library/Mobile Documents/5U8NS4GX82~com~dayoneapp~dayone/Documents/`` if you're syncing with iCloud. Instead of all entries being in a single file, each entry will live in a separate `plist` file. + Multiple journal files ---------------------- diff --git a/docs/export.rst b/docs/export.rst index 4a040b09..e017951d 100644 --- a/docs/export.rst +++ b/docs/export.rst @@ -15,6 +15,8 @@ you'll get a list of all tags you used in your journal, sorted by most frequent. List of all entries ------------------- +:: + jrnl --short Will only display the date and title of each entry. diff --git a/docs/overview.rst b/docs/overview.rst index 532fde36..726fbcf1 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -15,5 +15,9 @@ Optionally, your journal can be encrypted using the `256-bit AES `):: + + jrnl -until 1950 @texas -and @history --edit + +Will open your editor with all entries tagged with ``@texas`` and ``@history`` before 1950. You can make any changes to them you want; after you save the file and close the editor, your journal will be updated. + +Of course, if you are using multiple journals, you can also edit e.g. the latest entry of your work journal with ``jrnl work -n 1 --edit``. In any case, this will bring up your editor and save (and, if applicable, encrypt) your edited journal after you save and exit the editor. + +You can also use this feature for deleting entries from your journal:: + + jrnl @girlfriend -until 'june 2012' --edit + +Just select all text, press delete, and everything is gone... + +Editing DayOne Journals +~~~~~~~~~~~~~~~~~~~~~~~ + +DayOne journals can be edited exactly the same way, however the output looks a little bit different because of the way DayOne stores its entries: + +.. code-block:: output + + # af8dbd0d43fb55458f11aad586ea2abf + 2013-05-02 15:30 I told everyone I built my @robot wife for sex. + But late at night when we're alone we mostly play Battleship. + + # 2391048fe24111e1983ed49a20be6f9e + 2013-08-10 03:22 I had all kinds of plans in case of a @zombie attack. + I just figured I'd be on the other side. + +The long strings starting with hash symbol are the so-called UUIDs, unique identifiers for each entry. Don't touch them. If you do, then the old entry would get deleted and a new one written, which means that you could DayOne loose data that jrnl can't handle (such as as the entry's geolocation). diff --git a/encryption.html b/encryption.html index e3af408a..6d55ff01 100644 --- a/encryption.html +++ b/encryption.html @@ -7,7 +7,7 @@ - Encryption — jrnl 1.6.6 documentation + Encryption — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + diff --git a/export.html b/export.html index 6bc00ebd..f08b0817 100644 --- a/export.html +++ b/export.html @@ -7,7 +7,7 @@ - Import and Export — jrnl 1.6.6 documentation + Import and Export — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + @@ -52,8 +52,9 @@

    List of all entries

    -
    -
    jrnl –short
    +
    jrnl --short
    +
    +

    Will only display the date and title of each entry.

    diff --git a/genindex.html b/genindex.html index 21b80821..7f8abd1e 100644 --- a/genindex.html +++ b/genindex.html @@ -9,7 +9,7 @@ - Index — jrnl 1.6.6 documentation + Index — jrnl 1.7.2 documentation @@ -17,7 +17,7 @@ - + diff --git a/installation.html b/installation.html index fd217d9c..096def18 100644 --- a/installation.html +++ b/installation.html @@ -7,7 +7,7 @@ - Getting started — jrnl 1.6.6 documentation + Getting started — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + diff --git a/jrnl/Entry.py b/jrnl/Entry.py index 4948cc1d..142286ed 100644 --- a/jrnl/Entry.py +++ b/jrnl/Entry.py @@ -9,10 +9,11 @@ class Entry: def __init__(self, journal, date=None, title="", body="", starred=False): self.journal = journal # Reference to journal mainly to access it's config self.date = date or datetime.now() - self.title = title.strip() - self.body = body.strip() + self.title = title.strip("\n ") + self.body = body.strip("\n ") self.tags = self.parse_tags() self.starred = starred + self.modified = False def parse_tags(self): fulltext = " ".join([self.title, self.body]).lower() @@ -67,6 +68,18 @@ class Entry: def __repr__(self): return "".format(self.title.strip(), self.date.strftime("%Y-%m-%d %H:%M")) + def __eq__(self, other): + if not isinstance(other, Entry) \ + or self.title.strip() != other.title.strip() \ + or self.body.strip() != other.body.strip() \ + or self.date != other.date \ + or self.starred != other.starred: + return False + return True + + def __ne__(self, other): + return not self.__eq__(other) + def to_dict(self): return { 'title': self.title.strip(), diff --git a/jrnl/Entry.pyc b/jrnl/Entry.pyc index 657775de..4b5765b8 100644 Binary files a/jrnl/Entry.pyc and b/jrnl/Entry.pyc differ diff --git a/jrnl/Journal.py b/jrnl/Journal.py index 41d7a225..8da83dd3 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -11,6 +11,7 @@ try: import parsedatetime.parsedatetime_consts as pdt except ImportError: import parsedatetime.parsedatetime as pdt import re from datetime import datetime +import dateutil import time import sys try: @@ -50,9 +51,11 @@ class Journal(object): self.search_tags = None # Store tags we're highlighting self.name = name - journal_txt = self.open() - self.entries = self.parse(journal_txt) - self.sort() + self.open() + + def __len__(self): + """Returns the number of entries""" + return len(self.entries) def _colorize(self, string): if colorama: @@ -115,9 +118,10 @@ class Journal(object): else: with codecs.open(filename, "r", "utf-8") as f: journal = f.read() - return journal + self.entries = self._parse(journal) + self.sort() - def parse(self, journal): + def _parse(self, journal_txt): """Parses a journal that's stored in a string and returns a list of entries""" # Entries start with a line that looks like 'date title' - let's figure out how @@ -128,7 +132,7 @@ class Journal(object): entries = [] current_entry = None - for line in journal.splitlines(): + for line in journal_txt.splitlines(): try: # try to parse line as date => new entry begins line = line.strip() @@ -184,7 +188,7 @@ class Journal(object): def write(self, filename=None): """Dumps the journal into the config file, overwriting it""" filename = filename or self.config['journal'] - journal = "\n".join([e.__unicode__() for e in self.entries]) + journal = u"\n".join([e.__unicode__() for e in self.entries]) if self.config['encrypt']: journal = self._encrypt(journal) with open(filename, 'wb') as journal_file: @@ -249,7 +253,12 @@ class Journal(object): elif isinstance(date_str, datetime): return date_str - date, flag = self.dateparse.parse(date_str) + try: + date = dateutil.parser.parse(date_str) + flag = 1 if date.hour == 0 and date.minute == 0 else 2 + date = date.timetuple() + except: + date, flag = self.dateparse.parse(date_str) if not flag: # Oops, unparsable. try: # Try and parse this as a single year @@ -281,20 +290,15 @@ class Journal(object): raw = raw.replace('\\n ', '\n').replace('\\n', '\n') starred = False # Split raw text into title and body - title_end = len(raw) - for separator in ["\n", ". ", "? ", "! "]: - sep_pos = raw.find(separator) - if 1 < sep_pos < title_end: - title_end = sep_pos - title = raw[:title_end+1] - body = raw[title_end+1:].strip() + sep = re.search("[\n!?.]+", raw) + title, body = (raw[:sep.end()], raw[sep.end():]) if sep else (raw, "") starred = False if not date: - if title.find(":") > 0: - starred = "*" in title[:title.find(":")] - date = self.parse_date(title[:title.find(":")]) + if title.find(": ") > 0: + starred = "*" in title[:title.find(": ")] + date = self.parse_date(title[:title.find(": ")]) if date or starred: # Parsed successfully, strip that from the raw text - title = title[title.find(":")+1:].strip() + title = title[title.find(": ")+1:].strip() elif title.strip().startswith("*"): starred = True title = title[1:].strip() @@ -304,25 +308,36 @@ class Journal(object): if not date: # Still nothing? Meh, just live in the moment. date = self.parse_date("now") entry = Entry.Entry(self, date, title, body, starred=starred) + entry.modified = True self.entries.append(entry) if sort: self.sort() return entry + def editable_str(self): + """Turns the journal into a string of entries that can be edited + manually and later be parsed with eslf.parse_editable_str.""" + return u"\n".join([e.__unicode__() for e in self.entries]) + + def parse_editable_str(self, edited): + """Parses the output of self.editable_str and updates it's entries.""" + mod_entries = self._parse(edited) + # Match those entries that can be found in self.entries and set + # these to modified, so we can get a count of how many entries got + # modified and how many got deleted later. + for entry in mod_entries: + entry.modified = not any(entry == old_entry for old_entry in self.entries) + self.entries = mod_entries class DayOne(Journal): """A special Journal handling DayOne files""" def __init__(self, **kwargs): self.entries = [] + self._deleted_entries = [] super(DayOne, self).__init__(**kwargs) def open(self): - files = [os.path.join(self.config['journal'], "entries", f) for f in os.listdir(os.path.join(self.config['journal'], "entries"))] - return files - - def parse(self, filenames): - """Instead of parsing a string into an entry, this method will take a list - of filenames, interpret each as a plist file and create a new entry from that.""" + filenames = [os.path.join(self.config['journal'], "entries", f) for f in os.listdir(os.path.join(self.config['journal'], "entries"))] self.entries = [] for filename in filenames: with open(filename, 'rb') as plist_entry: @@ -333,34 +348,97 @@ class DayOne(Journal): timezone = pytz.timezone(util.get_local_timezone()) date = dict_entry['Creation Date'] date = date + timezone.utcoffset(date) - entry = self.new_entry(raw=dict_entry['Entry Text'], date=date, sort=False) - entry.starred = dict_entry["Starred"] + raw = dict_entry['Entry Text'] + sep = re.search("[\n!?.]+", raw) + title, body = (raw[:sep.end()], raw[sep.end():]) if sep else (raw, "") + entry = Entry.Entry(self, date, title, body, starred=dict_entry["Starred"]) entry.uuid = dict_entry["UUID"] entry.tags = dict_entry.get("Tags", []) - # We're using new_entry to create the Entry object, which adds the entry - # to self.entries already. However, in the original Journal.__init__, this - # method is expected to return a list of newly created entries, which is why - # we're returning the obvious. - return self.entries + self.entries.append(entry) + self.sort() def write(self): """Writes only the entries that have been modified into plist files.""" for entry in self.entries: - # Assumption: since jrnl can not manipulate existing entries, all entries - # that have a uuid will be old ones, and only the one that doesn't will - # have a new one! - if not hasattr(entry, "uuid"): + if entry.modified: + if not hasattr(entry, "uuid"): + entry.uuid = uuid.uuid1().hex utc_time = datetime.utcfromtimestamp(time.mktime(entry.date.timetuple())) - new_uuid = uuid.uuid1().hex - filename = os.path.join(self.config['journal'], "entries", new_uuid+".doentry") + filename = os.path.join(self.config['journal'], "entries", entry.uuid+".doentry") entry_plist = { 'Creation Date': utc_time, 'Starred': entry.starred if hasattr(entry, 'starred') else False, 'Entry Text': entry.title+"\n"+entry.body, 'Time Zone': util.get_local_timezone(), - 'UUID': new_uuid, + 'UUID': entry.uuid, 'Tags': [tag.strip(self.config['tagsymbols']) for tag in entry.tags] } - # print entry_plist - plistlib.writePlist(entry_plist, filename) + for entry in self._deleted_entries: + filename = os.path.join(self.config['journal'], "entries", entry.uuid+".doentry") + os.remove(filename) + + def editable_str(self): + """Turns the journal into a string of entries that can be edited + manually and later be parsed with eslf.parse_editable_str.""" + return u"\n".join(["# {0}\n{1}".format(e.uuid, e.__unicode__()) for e in self.entries]) + + def parse_editable_str(self, edited): + """Parses the output of self.editable_str and updates it's entries.""" + # Method: create a new list of entries from the edited text, then match + # UUIDs of the new entries against self.entries, updating the entries + # if the edited entries differ, and deleting entries from self.entries + # if they don't show up in the edited entries anymore. + date_length = len(datetime.today().strftime(self.config['timeformat'])) + + # Initialise our current entry + entries = [] + current_entry = None + + for line in edited.splitlines(): + # try to parse line as UUID => new entry begins + line = line.strip() + m = re.match("# *([a-f0-9]+) *$", line.lower()) + if m: + if current_entry: + entries.append(current_entry) + current_entry = Entry.Entry(self) + current_entry.modified = False + current_entry.uuid = m.group(1).lower() + else: + try: + new_date = datetime.strptime(line[:date_length], self.config['timeformat']) + if line.endswith("*"): + current_entry.starred = True + line = line[:-1] + current_entry.title = line[date_length+1:] + current_entry.date = new_date + except ValueError: + if current_entry: + current_entry.body += line + "\n" + + # Append last entry + if current_entry: + entries.append(current_entry) + + # Now, update our current entries if they changed + for entry in entries: + entry.parse_tags() + matched_entries = [e for e in self.entries if e.uuid.lower() == entry.uuid] + if matched_entries: + # This entry is an existing entry + match = matched_entries[0] + if match != entry: + self.entries.remove(match) + entry.modified = True + self.entries.append(entry) + else: + # This entry seems to be new... save it. + entry.modified = True + self.entries.append(entry) + # Remove deleted entries + edited_uuids = [e.uuid for e in entries] + self._deleted_entries = [e for e in self.entries if e.uuid not in edited_uuids] + self.entries[:] = [e for e in self.entries if e.uuid in edited_uuids] + return entries + diff --git a/jrnl/Journal.pyc b/jrnl/Journal.pyc index 2654d742..651164f2 100644 Binary files a/jrnl/Journal.pyc and b/jrnl/Journal.pyc differ diff --git a/jrnl/__init__.py b/jrnl/__init__.py index ca25074f..001bf160 100644 --- a/jrnl/__init__.py +++ b/jrnl/__init__.py @@ -7,7 +7,7 @@ jrnl is a simple journal application for your command line. """ __title__ = 'jrnl' -__version__ = '1.6.6' +__version__ = '1.7.2' __author__ = 'Manuel Ebert' __license__ = 'MIT License' __copyright__ = 'Copyright 2013 Manuel Ebert' diff --git a/jrnl/__init__.pyc b/jrnl/__init__.pyc index 20782e0b..93f02e63 100644 Binary files a/jrnl/__init__.pyc and b/jrnl/__init__.pyc differ diff --git a/jrnl/cli.py b/jrnl/cli.py index b53d7b33..20e39f9a 100644 --- a/jrnl/cli.py +++ b/jrnl/cli.py @@ -20,8 +20,6 @@ except (SystemError, ValueError): import install import jrnl import os -import tempfile -import subprocess import argparse import sys @@ -51,7 +49,7 @@ def parse_args(args=None): exporting.add_argument('-o', metavar='OUTPUT', dest='output', help='The output of the file can be provided when using with --export', default=False, const=None) exporting.add_argument('--encrypt', metavar='FILENAME', dest='encrypt', help='Encrypts your existing journal with a new password', nargs='?', default=False, const=None) exporting.add_argument('--decrypt', metavar='FILENAME', dest='decrypt', help='Decrypts your journal and stores it in plain text', nargs='?', default=False, const=None) - exporting.add_argument('--delete-last', dest='delete_last', help='Deletes the last entry from your journal file.', action="store_true") + exporting.add_argument('--edit', dest='edit', help='Opens your editor to edit the selected entries.', action="store_true") return parser.parse_args(args) @@ -59,7 +57,7 @@ def guess_mode(args, config): """Guesses the mode (compose, read or export) from the given arguments""" compose = True export = False - if args.decrypt is not False or args.encrypt is not False or args.export is not False or any((args.short, args.tags, args.delete_last)): + if args.decrypt is not False or args.encrypt is not False or args.export is not False or any((args.short, args.tags, args.edit)): compose = False export = True elif any((args.start_date, args.end_date, args.limit, args.strict, args.starred)): @@ -71,20 +69,6 @@ def guess_mode(args, config): return compose, export -def get_text_from_editor(config): - tmpfile = os.path.join(tempfile.gettempdir(), "jrnl") - subprocess.call(config['editor'].split() + [tmpfile]) - if os.path.exists(tmpfile): - with open(tmpfile) as f: - raw = f.read() - os.remove(tmpfile) - else: - util.prompt('[Nothing saved to file]') - raw = '' - - return raw - - def encrypt(journal, filename=None): """ Encrypt into new file. If filename is not set, we encrypt the journal file itself. """ password = util.getpass("Enter new password: ") @@ -164,11 +148,10 @@ def run(manual_args=None): else: journal = Journal.Journal(journal_name, **config) + # How to quit writing? if "win32" in sys.platform: - # for Windows systems _exit_multiline_code = "on a blank line, press Ctrl+Z and then Enter" else: - # for *nix systems (and others?) _exit_multiline_code = "press Ctrl+D" if mode_compose and not args.text: @@ -176,7 +159,7 @@ def run(manual_args=None): # Piping data into jrnl raw = util.py23_read() elif config['editor']: - raw = get_text_from_editor(config) + raw = util.get_text_from_editor(config) else: raw = util.py23_read("[Compose Entry; " + _exit_multiline_code + " to finish writing]\n") if raw: @@ -193,6 +176,7 @@ def run(manual_args=None): util.prompt("[Entry added to {0} journal]".format(journal_name)) journal.write() else: + old_entries = journal.entries journal.filter(tags=args.text, start_date=args.start_date, end_date=args.end_date, strict=args.strict, @@ -231,10 +215,20 @@ def run(manual_args=None): update_config(original_config, {"encrypt": False}, journal_name, force_local=True) install.save_config(original_config, config_path=CONFIG_PATH) - elif args.delete_last: - last_entry = journal.entries.pop() - util.prompt("[Deleted Entry:]") - print(last_entry.pprint()) + elif args.edit: + other_entries = [e for e in old_entries if e not in journal.entries] + # Edit + old_num_entries = len(journal) + edited = util.get_text_from_editor(config, journal.editable_str()) + journal.parse_editable_str(edited) + num_deleted = old_num_entries - len(journal) + num_edited = len([e for e in journal.entries if e.modified]) + prompts = [] + if num_deleted: prompts.append("{0} entries deleted".format(num_deleted)) + if num_edited: prompts.append("{0} entries modified".format(num_edited)) + if prompts: + util.prompt("[{0}]".format(", ".join(prompts).capitalize())) + journal.entries += other_entries journal.write() if __name__ == "__main__": diff --git a/jrnl/cli.pyc b/jrnl/cli.pyc index 6cd70fe2..8e6e8a93 100644 Binary files a/jrnl/cli.pyc and b/jrnl/cli.pyc differ diff --git a/jrnl/exporters.pyc b/jrnl/exporters.pyc index 5248c742..e1b447bd 100644 Binary files a/jrnl/exporters.pyc and b/jrnl/exporters.pyc differ diff --git a/jrnl/install.pyc b/jrnl/install.pyc index 12020452..10848da8 100644 Binary files a/jrnl/install.pyc and b/jrnl/install.pyc differ diff --git a/jrnl/jrnl.pyc b/jrnl/jrnl.pyc index 777405c1..a403b474 100644 Binary files a/jrnl/jrnl.pyc and b/jrnl/jrnl.pyc differ diff --git a/jrnl/util.py b/jrnl/util.py index d461015b..e1766c9d 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -9,6 +9,9 @@ import pytz try: import simplejson as json except ImportError: import json import re +import tempfile +import subprocess +import codecs PY3 = sys.version_info[0] == 3 PY2 = sys.version_info[0] == 2 @@ -121,3 +124,19 @@ def load_and_fix_json(json_path): prompt("[Entry was NOT added to your journal]") sys.exit(1) +def get_text_from_editor(config, template=""): + tmpfile = os.path.join(tempfile.gettempdir(), "jrnl") + if template: + with codecs.open(tmpfile, 'w', "utf-8") as f: + f.write(template) + subprocess.call(config['editor'].split() + [tmpfile]) + if os.path.exists(tmpfile): + with codecs.open(tmpfile, "r", "utf-8") as f: + raw = f.read() + os.remove(tmpfile) + else: + prompt('[Nothing saved to file]') + raw = '' + + return raw + diff --git a/jrnl/util.pyc b/jrnl/util.pyc index bee5ff86..b179fca2 100644 Binary files a/jrnl/util.pyc and b/jrnl/util.pyc differ diff --git a/objects.inv b/objects.inv index d824b8a4..7ecd92fe 100644 Binary files a/objects.inv and b/objects.inv differ diff --git a/overview.html b/overview.html index 22489a56..69c7cde5 100644 --- a/overview.html +++ b/overview.html @@ -7,7 +7,7 @@ - Overview — jrnl 1.6.6 documentation + Overview — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + @@ -50,7 +50,9 @@

    Why keep a journal?

    -

    Journals aren’t only for 13-year old girls and people who have too much time on their summer vacation. A journal helps you to keep track of the things you get done and how you did them. Your imagination may be limitless, but your memory isn’t. For personal use, make it a good habit to write at least 20 words a day. Just to reflect what made this day special, why you haven’t wasted it. For professional use, consider a text-based journal to be the perfect complement to your GTD todo list - a documentation of what and how you’ve done it.

    +

    Journals aren’t only for 13-year old girls and people who have too much time on their summer vacation. A journal helps you to keep track of the things you get done and how you did them. Your imagination may be limitless, but your memory isn’t.

    +

    For personal use, make it a good habit to write at least 20 words a day. Just to reflect what made this day special, why you haven’t wasted it.

    +

    For professional use, consider a text-based journal to be the perfect complement to your GTD todo list - a documentation of what and how you’ve done it. Or use it as a quick way to keep a change log. Or use it to keep a lab book.

    diff --git a/recipes.html b/recipes.html index cef4180f..7991cfb4 100644 --- a/recipes.html +++ b/recipes.html @@ -7,7 +7,7 @@ - FAQ — jrnl 1.6.6 documentation + FAQ — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + diff --git a/search.html b/search.html index d3799117..f3a1388d 100644 --- a/search.html +++ b/search.html @@ -7,7 +7,7 @@ - Search — jrnl 1.6.6 documentation + Search — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + diff --git a/searchindex.js b/searchindex.js index 678c5ffa..8710174b 100644 --- a/searchindex.js +++ b/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{},terms:{all:[6,0,4,7,2],default_minut:7,steve:[6,7],follow:[6,7],privat:7,depend:1,"2013_06_03_a":4,readabl:[2,4],yve:3,program:5,alberto:3,under:7,sha256:5,thursdai:7,everi:5,string:6,"3am":6,fals:7,faq:[0,3],veri:7,untouch:5,recip:[0,3],flatmat:3,level:7,did:2,list:[6,0,4,2],vector:5,dayon:[0,7,2],timeformat:7,initialis:5,ten:6,sync:[2,7],sign:6,pass:7,what:[0,2],access:7,melo:3,"new":[5,1],ever:5,told:1,hash:5,gener:4,chang:[6,5,3,7],decid:5,bodi:1,met:6,path:7,valu:7,wait:7,convers:5,vacat:2,prior:3,behav:7,chcp:3,implement:7,control:[6,7],linewrap:7,apr:6,app:7,vim:7,ask:[5,1],xdg_config_hom:7,instal:[0,3,1],txt:[6,5,7],mobil:7,quickstart:[0,1],from:[6,2,7],would:7,memori:2,doubl:6,two:6,todai:6,websit:7,live:7,call:1,type:[1,7],until:[6,3,1],more:7,sort:4,flat:7,python:[5,7],henc:7,flag:7,known:[0,3],word:2,hous:1,gabriel:4,work:[6,3,7],can:[1,5,3,4,2,6,7],meet:7,overrid:7,prompt:[6,1,7],fabul:2,tag:[6,0,3,4,7],want:[6,5,3,1,7],plist:7,gcc:1,multipl:7,anoth:5,occur:[6,3,4],write:[6,5,1,7,2],how:[6,2,3,7],instead:7,beach:6,after:7,sundai:6,reflect:2,befor:[6,3,7],beauti:4,mai:2,end:7,"short":[3,4],issu:[0,3],"switch":6,environ:3,jrnl:[0,1,2,3,4,5,6,7],enter:[6,5],exclus:6,frontend:7,help:2,becaus:6,cyan:7,still:2,digest:5,perfect:2,gtd:2,thank:3,fix:3,window:3,drawback:7,requir:1,them:[6,2],good:2,"return":1,food:7,timestamp:[6,0,7],dai:[6,2,4,7],initi:5,"break":6,mention:3,macvim:7,now:[6,7],choic:6,name:4,simpl:[2,4,7],crypto:5,separ:7,mode:6,each:[3,4,7],januari:3,unicod:3,my_entri:[6,4],mean:[6,3,7],compil:1,replac:5,individu:[4,7],timelin:4,meta:7,year:[6,2],our:7,girl:2,todo:2,special:[6,2],out:3,variabl:7,mere:7,content:[0,4],print:[6,3,4],lubric:6,occurr:[0,3],advanc:[0,7],given:6,reason:[6,1],base:2,releas:0,"byte":5,bash:7,launch:[6,7],put:2,keep:[6,0,2],filter:[6,0,3],thing:[2,3],isn:2,summari:3,imposs:7,frequent:4,first:[5,3,1,7],origin:5,directli:[6,2],mvim:7,wast:2,date:[6,4,7],alreadi:5,done:2,open:5,fanci:2,differ:7,convent:6,start:[6,0,1,7],top:7,least:[2,7],too:2,tom:6,"final":3,store:[0,2,5],shell:[6,3,7],option:[6,2,3,1,7],specifi:[6,5,4,7],github:4,haven:2,ipad:2,hashlib:5,grep:3,whenev:[6,5],charact:[3,7],project:6,sai:7,comput:5,ani:[6,5],dash:6,packag:3,have:[5,1,7,2],seem:7,imagin:2,built:7,equival:6,note:[6,1,7],also:[6,5,1,7,2],exampl:[4,7],which:[6,3],combin:[6,0,3],singl:[6,7],sure:[6,7],unless:1,track:[6,2],favourit:[6,3],who:2,most:[6,3,4,7],render:4,cipher:5,icloud:7,why:[0,4,2],don:[6,5,7],doc:7,later:5,doe:[3,7],pipe:3,"10am":7,clean:1,pouplard:3,summer:2,text:[2,0,4,7,5],find:3,current:5,onli:[6,2,3,4],explicitli:1,locat:[6,7],execut:7,pretti:4,configur:[6,0,1,7],should:[5,1],jan:3,folder:[2,7],hit:1,"2013_06_07_dinner":4,get:[0,1,2,3,4,7],jrnl_conf:7,endless:7,bar:6,sha:5,integr:[0,7],contain:[6,3],buscemi:6,where:[3,1],view:[6,0],set:7,habit:2,see:[6,7],result:[1,7],close:7,best:6,wonder:6,profession:2,someth:3,sublim:7,won:[5,7],"import":[6,0,4,5],kei:[5,7],complement:2,entir:4,solv:3,both:[6,3,7],instant:2,howev:7,forgotten:2,pdf:4,com:7,comment:7,assur:2,simpli:[6,5],point:[5,7],overview:[0,2],arbitrarili:6,dayoneapp:7,suppli:[6,7],my_recip:7,assum:6,stamp:1,quotat:7,three:7,mark:[6,1,7],json:[0,4,7],much:2,interpret:[1,7],basic:[6,0],my_journ:5,life:6,wish:1,pycyrypto:1,argument:[6,4],"5u8ns4gx82":7,last:[6,7],present:7,look:[6,4,1,7],jrnl_config:7,plain:[5,2],plain_text_copi:5,defin:7,"while":7,abov:4,"_no_":6,pinki:6,readm:4,non:3,ascii:3,sever:4,make:[6,4,1,7,2],format:[4,7],same:[5,3,4],funni:6,html:4,sentenc:1,document:[2,7],extern:[1,7],yesterdai:[6,1],recent:3,off:7,entri:[0,1,3,4,6,7],markup:4,well:1,spent:1,person:2,without:6,command:[6,0,4,7,2],thi:[1,5,3,4,2,6,7],choos:5,everyth:[6,1,7],latest:6,load:7,just:[6,2,1,7],codepag:3,rest:1,markdown:[0,4],human:[2,4],languag:4,had:6,add:6,other:4,input:[6,7],save:7,smart:[6,0],applic:[2,7],march:6,mayb:5,read:[5,2],intuit:7,five:6,bit:2,password:[0,5],like:[6,4,3,1,7],specif:7,filenam:5,whitespac:6,manual:[0,1,7,5],either:6,output:[4,7],old:2,often:3,some:3,dead:7,"export":[6,0,4],librari:[1,7],noon:6,leav:5,anna:6,refer:7,limitless:2,run:[5,3,1],journal:[0,1,2,3,4,5,6,7],usag:[6,0,7],tagsymbol:7,although:[6,7],"_jrnl_":[3,7],"6am":6,plai:2,surround:6,chop:7,consid:2,within:3,encod:3,compos:[6,0,1,7],wrap:7,my_password:5,subl:7,your:[0,1,2,4,5,6,7],wai:[6,7],aren:2,support:[5,7],"long":[2,7],width:7,reli:3,editor:[6,1,7],keychain:[0,5],mode_cbc:5,line:[6,0,3,7,2],"true":7,count:4,made:2,pycrypto:[3,1],whether:[5,1,7],worlddomin:6,displai:[6,3,4,7],below:7,highlight:7,problem:3,default_hour:7,creat:[4,1,7],decrypt:[0,7,5],exist:5,file:[0,1,2,4,5,6,7],pip:1,happen:6,again:5,mutual:6,encrypt:[0,1,2,3,5,7],titl:[4,1],when:[5,2],virtual:3,"default":7,book:1,sick:1,peopl:[6,2],you:[1,5,3,4,2,6,7],intention:6,nice:[2,4],pineappl:6,star:[6,0,3],symbol:[6,7],asterisk:6,mondai:6,dropbox:[2,7],algorithm:5,directori:4,scroll:7,time:[1,5,4,2,6,7],avoid:7},objtypes:{},titles:["jrnl: The command-line journal","Getting started","Overview","FAQ","Import and Export","Encryption","Basic Usage","Advanced Usage"],objnames:{},filenames:["index","installation","overview","recipes","export","encryption","usage","advanced"]}) \ No newline at end of file +Search.setIndex({objects:{},terms:{all:[6,0,4,7,5],default_minut:7,steve:[6,7],follow:[6,7],privat:7,depend:1,"2013_06_03_a":4,readabl:[5,4],yve:3,program:2,alberto:3,under:7,leav:2,sha256:2,thursdai:7,everi:2,string:6,"3am":6,fals:7,faq:[0,3],veri:7,cyan:7,recip:[0,3],flatmat:3,level:7,did:5,list:[6,0,4,5],vector:2,dayon:[6,0,7,5],timeformat:7,initialis:2,ten:6,sync:[5,7],sign:6,geoloc:6,pass:7,what:[0,5],access:7,delet:6,melo:3,"new":[6,2,1],ever:2,told:[6,1],hash:[6,2],gener:4,chang:[6,5,3,7,2],decid:2,bodi:1,met:6,path:7,valu:7,wait:7,convers:2,vacat:5,everyon:6,prior:3,behav:7,chcp:3,implement:7,control:[6,7],linewrap:7,apr:6,app:7,vim:7,releas:0,xdg_config_hom:7,instal:[0,3,1],txt:[6,2,7],mobil:7,select:6,quickstart:[0,1],from:[6,5,7],would:[6,7],memori:5,doubl:6,two:6,todai:6,websit:7,live:7,call:[6,1],type:[1,7],until:[6,3,1],more:7,sort:4,flat:7,readm:4,flag:7,known:[0,3],word:5,hous:1,gabriel:4,work:[6,3,7],uniqu:6,histori:6,can:[1,5,3,4,2,6,7],meet:7,overrid:7,prompt:[6,1,7],fabul:5,tag:[6,0,3,4,7],want:[6,2,3,1,7],plist:7,gcc:1,cours:6,multipl:[6,0,7],anoth:2,occur:[6,3,4],write:[6,5,1,7,2],how:[6,5,3,7],instead:7,simpl:[5,4,7],updat:6,after:[6,7],sundai:6,lab:5,reflect:5,befor:[6,3,7],beauti:4,date:[6,4,7],end:7,data:6,github:4,read:[5,2],robot:6,issu:[0,3],"switch":6,combin:[6,0,3],jrnl:[0,1,2,3,4,5,6,7],enter:[6,2],exclus:6,frontend:7,help:5,becaus:6,untouch:2,still:5,digest:2,perfect:5,gtd:5,thank:3,funni:6,fix:3,late:6,window:3,html:4,requir:1,them:[6,5],good:5,"return":1,food:7,timestamp:[6,0,7],dai:[6,5,4,7],initi:2,"break":6,mention:3,macvim:7,now:[6,7],choic:6,name:4,edit:[6,0],beach:6,crypto:2,separ:7,mode:6,each:[6,3,4,7],januari:3,unicod:3,my_entri:[6,4],side:6,mean:[6,3,7],compil:1,replac:2,individu:[4,7],timelin:4,meta:7,year:[6,5],our:7,girl:5,todo:5,special:[6,5],out:3,variabl:7,encod:3,load:7,your:[0,1,2,4,5,6,7],content:[0,4],print:[6,3,4],lubric:6,occurr:[0,3],advanc:[6,0,7],given:6,quick:5,reason:[6,1],base:5,zombi:6,ask:[2,1],"byte":2,bash:7,launch:[6,7],could:6,put:5,keep:[6,0,5],filter:[6,0,3],thing:[5,3],isn:5,view:[6,0],imposs:7,frequent:4,first:[2,3,1,7],origin:2,directli:[6,5],mvim:7,wast:5,mai:5,alreadi:2,done:5,open:[6,2],fanci:5,differ:[6,7],convent:6,width:7,top:7,least:[5,7],attack:6,too:5,tom:6,"final":3,store:[6,0,2,5],shell:[6,3,7],option:[6,5,3,1,7],specifi:[6,2,4,7],"short":[3,4],mostli:6,exactli:6,haven:5,ipad:5,kind:6,grep:3,whenev:[6,2],charact:[3,7],project:6,sai:7,comput:2,ani:[6,2],dash:6,packag:3,have:[6,5,1,7,2],need:6,seem:7,imagin:5,built:[6,7],equival:6,note:[6,1,7],also:[6,5,1,7,2],without:6,which:[6,3],environ:3,singl:[6,7],sure:[6,7],unless:1,track:[6,5],favourit:[6,3],who:5,most:[6,3,4,7],render:4,cipher:2,plan:6,icloud:7,why:[0,4,5],don:[6,2,7],doc:7,later:2,doe:[3,7],pipe:3,"10am":7,clean:1,pouplard:3,text:[0,2,4,5,6,7],bring:6,particularli:6,texa:6,find:3,current:2,onli:[6,5,3,4],explicitli:1,locat:[6,7],just:[6,5,1,7],pretti:4,configur:[6,0,1,7],figur:6,should:[2,1],jan:3,folder:[5,7],codepag:3,hit:1,"2013_06_07_dinner":4,get:[0,1,5,3,4,6,7],hashlib:2,jrnl_conf:7,endless:7,bar:6,noon:6,sha:2,integr:[0,7],contain:[6,3],buscemi:6,where:[3,1],wrote:6,summari:3,set:7,habit:5,sex:6,see:[6,7],result:[1,7],close:[6,7],best:6,wonder:6,someth:3,sublim:7,won:[2,7],"import":[6,0,4,2],kei:[2,7],complement:5,entir:4,solv:3,uuid:6,both:[6,3,7],instant:5,howev:[6,7],alon:6,af8dbd0d43fb55458f11aad586ea2abf:6,forgotten:5,pdf:4,com:7,comment:7,assur:5,simpli:[6,2],point:[2,7],overview:[0,5],arbitrarili:6,dayoneapp:7,written:6,suppli:[6,7],my_recip:7,assum:6,stamp:1,quotat:7,three:7,mark:[6,1,7],json:[0,4,7],much:5,interpret:[1,7],basic:[6,0],my_journ:2,life:6,decrypt:[0,7,2],argument:[6,4],"5u8ns4gx82":7,last:[6,7],present:7,"case":6,look:[6,4,1,7],jrnl_config:7,plain:[5,2],plain_text_copi:2,defin:7,"while":7,abov:4,"_no_":[],loos:6,pinki:6,henc:7,non:3,pip:1,ascii:3,sever:4,make:[6,5,4,1,7],mayb:2,same:[6,2,3,4],python:[2,7],drawback:7,sentenc:1,document:[5,7],extern:[1,7],yesterdai:[6,1],recent:3,off:7,older:[6,0],entri:[0,1,3,4,6,7],markup:4,well:1,spent:1,person:5,exampl:[4,7],command:[6,0,4,7,5],thi:[1,5,3,4,2,6,7],choos:2,everyth:[6,1,7],latest:6,summer:5,identifi:6,execut:7,battleship:6,rest:1,markdown:[0,4],human:[5,4],touch:6,languag:4,had:6,littl:6,add:6,book:[5,1],input:[6,7],save:[6,7],smart:[6,0],applic:[6,5,7],march:6,format:[4,7],handl:6,intuit:7,five:6,press:6,bit:[6,5],password:[0,2],like:[6,4,3,1,7],specif:7,filenam:2,whitespac:6,manual:[0,1,7,2],either:6,night:6,output:[6,4,7],old:[6,5],often:3,some:3,dead:7,"export":[6,0,4],worlddomin:6,librari:[1,7],avoid:7,exit:6,anna:6,refer:7,limitless:5,run:[2,3,1],asterisk:6,journal:[0,1,2,3,4,5,6,7],usag:[6,0,7],tagsymbol:7,although:[6,7],"_jrnl_":[3,7],"6am":6,plai:[6,5],surround:6,chop:7,mondai:6,within:3,profession:5,compos:[6,0,1,7],wrap:7,my_password:2,subl:7,mere:7,log:5,wai:[6,5,7],aren:5,support:[2,7],"long":[6,5,7],start:[6,0,1,7],reli:3,editor:[6,1,7],keychain:[0,2],mode_cbc:2,line:[6,0,3,7,5],"true":7,"2391048fe24111e1983ed49a20be6f9":6,count:4,made:5,algorithm:2,whether:[2,1,7],wish:1,displai:[6,3,4,7],below:7,highlight:7,problem:3,default_hour:7,gone:6,featur:6,creat:[4,1,7],pycyrypto:1,exist:2,file:[0,1,2,4,5,6,7],girlfriend:6,happen:6,again:2,mutual:6,encrypt:[0,1,2,3,5,6,7],titl:[4,1],when:[6,5,2],virtual:3,"default":7,other:[6,4],sick:1,peopl:[6,5],you:[1,5,3,4,2,6,7],intention:6,nice:[5,4],pineappl:6,star:[6,0,3],symbol:[6,7],june:6,consid:5,dropbox:[5,7],pycrypto:[3,1],wife:6,directori:4,time:[1,5,4,2,6,7],scroll:7},objtypes:{},titles:["jrnl: The command-line journal","Getting started","Encryption","FAQ","Import and Export","Overview","Basic Usage","Advanced Usage"],objnames:{},filenames:["index","installation","encryption","recipes","export","overview","usage","advanced"]}) \ No newline at end of file diff --git a/usage.html b/usage.html index 0aeb93f1..84d7b64d 100644 --- a/usage.html +++ b/usage.html @@ -7,7 +7,7 @@ - Basic Usage — jrnl 1.6.6 documentation + Basic Usage — jrnl 1.7.2 documentation @@ -15,7 +15,7 @@ - + @@ -109,7 +109,32 @@

    the last five entries containing both @pineapple and @lubricant. You can change which symbols you’d like to use for tagging in the configuration.

    Note

    -

    jrnl @pinkie @WorldDomination will switch to viewing mode because although _no_ command line arguments are given, all the input strings look like tags - jrnl will assume you want to filter by tag.

    +

    jrnl @pinkie @WorldDomination will switch to viewing mode because although no command line arguments are given, all the input strings look like tags - jrnl will assume you want to filter by tag.

    +
    + +
    +

    Editing older entries

    +

    You can edit selected entries after you wrote them. This is particularly useful when your journal file is encrypted or if you’re using a DayOne journal. To use this feature, you need to have an editor configured in your journal configuration file (see advanced usage):

    +
    jrnl -until 1950 @texas -and @history --edit
    +
    +

    Will open your editor with all entries tagged with @texas and @history before 1950. You can make any changes to them you want; after you save the file and close the editor, your journal will be updated.

    +

    Of course, if you are using multiple journals, you can also edit e.g. the latest entry of your work journal with jrnl work -n 1 --edit. In any case, this will bring up your editor and save (and, if applicable, encrypt) your edited journal after you save and exit the editor.

    +

    You can also use this feature for deleting entries from your journal:

    +
    jrnl @girlfriend -until 'june 2012' --edit
    +
    +

    Just select all text, press delete, and everything is gone...

    +
    +

    Editing DayOne Journals

    +

    DayOne journals can be edited exactly the same way, however the output looks a little bit different because of the way DayOne stores its entries:

    +
    # af8dbd0d43fb55458f11aad586ea2abf
    +2013-05-02 15:30 I told everyone I built my @robot wife for sex.
    +But late at night when we're alone we mostly play Battleship.
    +
    +# 2391048fe24111e1983ed49a20be6f9e
    +2013-08-10 03:22 I had all kinds of plans in case of a @zombie attack.
    +I just figured I'd be on the other side.
    +
    +

    The long strings starting with hash symbol are the so-called UUIDs, unique identifiers for each entry. Don’t touch them. If you do, then the old entry would get deleted and a new one written, which means that you could DayOne loose data that jrnl can’t handle (such as as the entry’s geolocation).

    @@ -132,6 +157,10 @@
  • Viewing
  • Using Tags
  • +
  • Editing older entries +
  • Encryption