merge in develop branch

This commit is contained in:
Jonathan Wren 2023-02-25 13:20:10 -08:00
commit 4a7aeec6fc
No known key found for this signature in database
11 changed files with 1753 additions and 1493 deletions

View file

@ -17,6 +17,8 @@
- Templated entries should not be saved if the raw text is identical to the original template [\#1652](https://github.com/jrnl-org/jrnl/issues/1652) - Templated entries should not be saved if the raw text is identical to the original template [\#1652](https://github.com/jrnl-org/jrnl/issues/1652)
- jrnl does not update version key in config file [\#1638](https://github.com/jrnl-org/jrnl/issues/1638) - jrnl does not update version key in config file [\#1638](https://github.com/jrnl-org/jrnl/issues/1638)
- jrnl should not create 0-length "encrypted" file on startup [\#1493](https://github.com/jrnl-org/jrnl/issues/1493)
- Save empty journal on install instead of just creating a zero-length file [\#1690](https://github.com/jrnl-org/jrnl/pull/1690) ([micahellison](https://github.com/micahellison))
- Don't save templated journal entries if the received raw text is the same as the template itself [\#1653](https://github.com/jrnl-org/jrnl/pull/1653) ([Briscoooe](https://github.com/Briscoooe)) - Don't save templated journal entries if the received raw text is the same as the template itself [\#1653](https://github.com/jrnl-org/jrnl/pull/1653) ([Briscoooe](https://github.com/Briscoooe))
- Add tag to XML file when edited DayOne entry and is searchable afterward [\#1648](https://github.com/jrnl-org/jrnl/pull/1648) ([jonakeys](https://github.com/jonakeys)) - Add tag to XML file when edited DayOne entry and is searchable afterward [\#1648](https://github.com/jrnl-org/jrnl/pull/1648) ([jonakeys](https://github.com/jonakeys))
- Update version key in config file after version changes [\#1646](https://github.com/jrnl-org/jrnl/pull/1646) ([jonakeys](https://github.com/jonakeys)) - Update version key in config file after version changes [\#1646](https://github.com/jrnl-org/jrnl/pull/1646) ([jonakeys](https://github.com/jonakeys))
@ -34,7 +36,12 @@
**Documentation:** **Documentation:**
- Document template extension behavior [\#1677](https://github.com/jrnl-org/jrnl/issues/1677)
- Visual Studio Code may store unencrypted temporary files [\#1675](https://github.com/jrnl-org/jrnl/issues/1675)
- Documentation Change [\#1651](https://github.com/jrnl-org/jrnl/issues/1651) - Documentation Change [\#1651](https://github.com/jrnl-org/jrnl/issues/1651)
- Support mkdocs 1.4.2 and fix its missing breadcrumb [\#1691](https://github.com/jrnl-org/jrnl/pull/1691) ([micahellison](https://github.com/micahellison))
- Document temporary file extension behavior when using template [\#1686](https://github.com/jrnl-org/jrnl/pull/1686) ([micahellison](https://github.com/micahellison))
- Update documentation about privacy and security in VSCode [\#1680](https://github.com/jrnl-org/jrnl/pull/1680) ([giuseppedandrea](https://github.com/giuseppedandrea))
- Update documentation on temporary files naming [\#1673](https://github.com/jrnl-org/jrnl/pull/1673) ([giuseppedandrea](https://github.com/giuseppedandrea)) - Update documentation on temporary files naming [\#1673](https://github.com/jrnl-org/jrnl/pull/1673) ([giuseppedandrea](https://github.com/giuseppedandrea))
- Update docs to include time and title in arguments with `--edit` [\#1657](https://github.com/jrnl-org/jrnl/pull/1657) ([pconrad-fb](https://github.com/pconrad-fb)) - Update docs to include time and title in arguments with `--edit` [\#1657](https://github.com/jrnl-org/jrnl/pull/1657) ([pconrad-fb](https://github.com/pconrad-fb))
- Fix markup in "Advanced Usage" doc [\#1655](https://github.com/jrnl-org/jrnl/pull/1655) ([multani](https://github.com/multani)) - Fix markup in "Advanced Usage" doc [\#1655](https://github.com/jrnl-org/jrnl/pull/1655) ([multani](https://github.com/multani))

View file

@ -67,6 +67,22 @@ Windows doesn't log history to disk, but it does keep it in your command prompt
session. Close the command prompt or press `Alt`+`F7` to clear your history session. Close the command prompt or press `Alt`+`F7` to clear your history
after journaling. after journaling.
## Files in transit from editor to jrnl
When creating or editing an entry, `jrnl` uses a unencrypted temporary file on
disk in order to give your editor access to your journal. After you close your
editor, `jrnl` then deletes this temporary file.
So, if you have saved a journal entry but haven't closed your editor yet, the
unencrypted temporary remains on your disk. If your computer were to shut off
during this time, or the `jrnl` process were killed unexpectedly, then the
unencrypted temporary file will remain on your disk. You can mitigate this
issue by only saving with your editor right before closing it. You can also
manually delete these files from your temporary folder. By default, they
are named `jrnl*.jrnl`, but if you use a
[template](reference-config-file.md#template), they will have the same
extension as the template.
## Editor history ## Editor history
Some editors keep usage history stored on disk for future use. This can be a Some editors keep usage history stored on disk for future use. This can be a
@ -83,7 +99,8 @@ the `workbench.localHistory.enabled` setting in the
Alternatively, you can disable this feature for specific files by configuring a Alternatively, you can disable this feature for specific files by configuring a
[pattern](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options) [pattern](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options)
in the `workbench.localHistory.exclude` setting. To exclude unencrypted temporary files generated in the `workbench.localHistory.exclude` setting. To exclude unencrypted temporary files generated
by `jrnl`, you can set the `**/jrnl*.jrnl` pattern for the `workbench.localHistory.exclude` setting by `jrnl`, you can set the `**/jrnl*.jrnl` (unless you are using a
[template](reference-config-file.md#template)) pattern for the `workbench.localHistory.exclude` setting
in the [Settings editor](https://code.visualstudio.com/docs/getstarted/settings#_settings-editor). in the [Settings editor](https://code.visualstudio.com/docs/getstarted/settings#_settings-editor).
!!! note !!! note
@ -129,7 +146,11 @@ autocommand can be used. Place this in your `~/.vimrc`:
autocmd BufNewFile,BufReadPre *.jrnl setlocal viminfo= noswapfile noundofile nobackup nowritebackup noshelltemp history=0 nomodeline secure autocmd BufNewFile,BufReadPre *.jrnl setlocal viminfo= noswapfile noundofile nobackup nowritebackup noshelltemp history=0 nomodeline secure
``` ```
Please see `:h <option>` in Vim for more information about the options mentioned. !!! note
If you're using a [template](reference-config-file.md#template), you will
have to use the template's file extension instead of `.jrnl`.
See `:h <option>` in Vim for more information about the options mentioned.
### Neovim ### Neovim
@ -171,22 +192,12 @@ vim.api.nvim_create_autocmd( {"BufNewFile","BufReadPre" }, {
}) })
``` ```
!!! note
If you're using a [template](reference-config-file.md#template), you will
have to use the template's file extension instead of `.jrnl`.
Please see `:h <option>` in Neovim for more information about the options mentioned. Please see `:h <option>` in Neovim for more information about the options mentioned.
## Files in transit from editor to jrnl
When creating or editing an entry, `jrnl` uses a unencrypted temporary file on
disk in order to give your editor access to your journal. After you close your
editor, `jrnl` then deletes this temporary file.
So, if you have saved a journal entry but haven't closed your editor yet, the
unencrypted temporary remains on your disk. If your computer were to shut off
during this time, or the `jrnl` process were killed unexpectedly, then the
unencrypted temporary file will remain on your disk. You can mitigate this
issue by only saving with your editor right before closing it. You can also
manually delete these files (i.e. files named `jrnl*.jrnl`) from your temporary
folder.
## Plausible deniability ## Plausible deniability
You may be able to hide the contents of your journal behind a layer of encryption, You may be able to hide the contents of your journal behind a layer of encryption,

View file

@ -59,7 +59,9 @@ value for journals that already have data in them.
### template ### template
The path to a text file to use as a template for new entries. Only works when you The path to a text file to use as a template for new entries. Only works when you
have the `editor` field configured. have the `editor` field configured. If you use a template, the editor's
[temporary files](privacy-and-security.md#files-in-transit-from-editor-to-jrnl)
will have the same extension as the template.
### tagsymbols ### tagsymbols
Symbols to be interpreted as tags. Symbols to be interpreted as tags.

View file

@ -118,7 +118,7 @@ div.rst-content {
background-size: 100%; background-size: 100%;
} }
a.icon-home:before { .wy-side-nav-search a.icon-home:before {
display: block; display: block;
width: 84px; width: 84px;
height: 70px; height: 70px;

View file

@ -0,0 +1,49 @@
<!--
Copied from https://github.com/mkdocs/mkdocs/blob/master/mkdocs/themes/readthedocs/breadcrumbs.html
Then lightly modified for accessibility
-->
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="{{ nav.homepage.url|url }}" class="icon icon-home" aria-label="{% trans %}Docs{% endtrans %}"></a> &raquo;</li>
{%- if page %}
{%- for doc in page.ancestors[::-1] %}
{%- if doc.link %}
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
{%- else %}
<li>{{ doc.title }} &raquo;</li>
{%- endif %}
{%- endfor %}
<li>{{ page.title }}</li>
{%- endif %}
<li class="wy-breadcrumbs-aside">
{%- block repo %}
{%- if page and page.edit_url %}
{%- if config.repo_name|lower == 'github' %}
<a href="{{ page.edit_url }}" class="icon icon-github"> {% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %}</a>
{%- elif config.repo_name|lower == 'bitbucket' %}
<a href="{{ page.edit_url }}" class="icon icon-bitbucket"> {% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %}</a>
{%- elif config.repo_name|lower == 'gitlab' %}
<a href="{{ page.edit_url }}" class="icon icon-gitlab"> {% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %}</a>
{%- elif config.repo_name %}
<a href="{{ page.edit_url }}">{% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %}</a>
{%- else %}
<a href="{{ page.edit_url }}">{% trans %}Edit{% endtrans %}</a>
{%- endif %}
{%- endif %}
{%- endblock %}
</li>
</ul>
{%- if config.theme.prev_next_buttons_location|lower in ['top', 'both']
and page and (page.next_page or page.previous_page) %}
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="{% trans %}Breadcrumb Navigation{% endtrans %}">
{%- if page.previous_page %}
<a href="{{ page.previous_page.url|url }}" class="btn btn-neutral float-left" title="{{ page.previous_page.title }}"><span class="icon icon-circle-arrow-left" aria-hidden="true"></span> {% trans %}Previous{% endtrans %}</a>
{%- endif %}
{%- if page.next_page %}
<a href="{{ page.next_page.url|url }}" class="btn btn-neutral float-right" title="{{ page.next_page.title }}">{% trans %}Next{% endtrans %} <span class="icon icon-circle-arrow-right" aria-hidden="true"></span></a>
{%- endif %}
</div>
{%- endif %}
<hr/>
</div>

View file

@ -1,2 +1,2 @@
mkdocs==1.2.4 mkdocs>=1.4
jinja2==3.1.2 jinja2==3.1.2

View file

@ -123,6 +123,7 @@ class Journal:
}, },
) )
) )
self.write()
text = self._load(filename) text = self._load(filename)
text = self._decrypt(text) text = self._decrypt(text)

View file

@ -5,6 +5,9 @@ theme:
custom_dir: docs_theme custom_dir: docs_theme
static_templates: static_templates:
- index.html - index.html
watch:
- docs
- docs_theme
extra_css: extra_css:
- https://fonts.googleapis.com/css?family=Open+Sans:300,600 - https://fonts.googleapis.com/css?family=Open+Sans:300,600
- assets/colors.css - assets/colors.css

3117
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -51,7 +51,7 @@ flake8-type-checking = ">=2.2.0"
flake8-simplify = ">=0.19" flake8-simplify = ">=0.19"
ipdb = "*" ipdb = "*"
isort = ">=5.10" isort = ">=5.10"
mkdocs = ">=1.0,<1.3" mkdocs = ">=1.4"
poethepoet = "*" poethepoet = "*"
pytest = ">=6.2" pytest = ">=6.2"
pytest-bdd = ">=4.0.1,<6.0" pytest-bdd = ">=4.0.1,<6.0"

View file

@ -74,3 +74,19 @@ Feature: Installing jrnl
date: none date: none
tags: none tags: none
title: none title: none
Scenario: Install jrnl with encrypted default journal with no entries
Given we use no config
And we use the password "test" if prompted
When we run "jrnl -1" and enter
encrypted.txt
y
n
Then the error output should contain "Journal will be encrypted"
And the default journal "encrypted.txt" should be in the "." directory
And the config should contain "encrypt: true"
And the version in the config file should be up-to-date
When we run "jrnl -1"
Then we should be prompted for a password
And the error output should contain "no entries found"
And the error output should not contain "Wrong password, try again"