Explicit code blocks in docs

This commit is contained in:
Manuel Ebert 2017-03-09 12:40:38 -08:00
parent 7003b3d13a
commit 7f5564c63c
7 changed files with 99 additions and 38 deletions

View file

@ -10,7 +10,9 @@ We intentionally break a convention on command line arguments: all arguments sta
Listing Journals
----------------
You can list the journals accessible by jrnl::
You can list the journals accessible by jrnl
.. code-block:: sh
jrnl -ls
@ -19,7 +21,9 @@ The journals displayed correspond to those specified in the jrnl configuration f
Composing Entries
-----------------
Composing mode is entered by either starting ``jrnl`` without any arguments -- which will prompt you to write an entry or launch your editor -- or by just writing an entry on the prompt, such as::
Composing mode is entered by either starting ``jrnl`` without any arguments -- which will prompt you to write an entry or launch your editor -- or by just writing an entry on the prompt, such as
.. code-block:: sh
jrnl today at 3am: I just met Steve Buscemi in a bar! He looked funny.
@ -28,7 +32,9 @@ Composing mode is entered by either starting ``jrnl`` without any arguments -- w
Most shell contains a certain number of reserved characters, such as ``#`` and ``*``. Unbalanced quotes, parenthesis, and so on will also get into the way of your editing. For writing longer entries, just enter ``jrnl`` and hit ``return``. Only then enter the text of your journal entry. Alternatively, :doc:`use an external editor <advanced>`).
You can also import an entry directly from a file::
You can also import an entry directly from a file
.. code-block:: sh
jrnl < my_entry.txt
@ -48,7 +54,9 @@ Timestamps that work:
Starring entries
~~~~~~~~~~~~~~~~
To mark an entry as a favourite, simply "star" it::
To mark an entry as a favourite, simply "star" it
.. code-block:: sh
jrnl last sunday *: Best day of my life.
@ -65,30 +73,42 @@ If you don't want to add a date (ie. your entry will be dated as now), The follo
Viewing
-------
::
.. code-block:: sh
jrnl -n 10
will list you the ten latest entries (if you're lazy, ``jrnl -10`` will do the same), ::
will list you the ten latest entries (if you're lazy, ``jrnl -10`` will do the same),
.. code-block:: sh
jrnl -from "last year" -until march
everything that happened from the start of last year to the start of last march. To only see your favourite entries, use ::
everything that happened from the start of last year to the start of last march. To only see your favourite entries, use
.. code-block:: sh
jrnl -starred
Using Tags
----------
Keep track of people, projects or locations, by tagging them with an ``@`` in your entries ::
Keep track of people, projects or locations, by tagging them with an ``@`` in your entries
.. code-block:: sh
jrnl Had a wonderful day on the @beach with @Tom and @Anna.
You can filter your journal entries just like this: ::
You can filter your journal entries just like this:
.. code-block:: sh
jrnl @pinkie @WorldDomination
Will print all entries in which either ``@pinkie`` or ``@WorldDomination`` occurred. ::
Will print all entries in which either ``@pinkie`` or ``@WorldDomination`` occurred.
.. code-block:: sh
jrnl -n 5 -and @pineapple @lubricant
@ -101,7 +121,9 @@ the last five entries containing both ``@pineapple`` **and** ``@lubricant``. You
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 :doc:`advanced usage <advanced>`)::
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 :doc:`advanced usage <advanced>`)
.. code-block:: sh
jrnl -until 1950 @texas -and @history --edit
@ -109,7 +131,9 @@ Will open your editor with all entries tagged with ``@texas`` and ``@history`` b
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::
You can also use this feature for deleting entries from your journal
.. code-block:: sh
jrnl @girlfriend -until 'june 2012' --edit