Compare commits

...

1201 commits

Author SHA1 Message Date
Jrnl Bot
7923e815f7 Update changelog [ci skip] 2025-04-29 03:08:35 +00:00
Micah Jerome Ellison
72d4968471
Rename Poetry dev dependency group in pyproject.toml (#1995)
* Rename pyproject group to comply with poetry

* Run poetry lock
2025-04-28 20:06:32 -07:00
Jrnl Bot
c286012bef Update changelog [ci skip] 2025-04-29 02:36:25 +00:00
Micah Jerome Ellison
c415c68443
Remove publish-to-homebrew step (#1994) 2025-04-28 19:34:45 -07:00
Jrnl Bot
e5fc8be2a8 Update changelog [ci skip] 2025-04-04 02:17:55 +00:00
renovate[bot]
20a087f64c
Update dependency rich to v14 (#1989)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-03 19:16:22 -07:00
Jrnl Bot
a2eb68963b Update changelog [ci skip] 2025-04-04 02:14:52 +00:00
renovate[bot]
89be61ccf8
Update dependency tox to v4.25.0 (#1986)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-03 19:13:03 -07:00
renovate[bot]
98d0bcac20
Update dependency poethepoet to v0.33.1 (#1982)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-03 19:12:40 -07:00
renovate[bot]
a282440118
Update dependency tzlocal to v5.3.1 (#1984)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-03 19:11:56 -07:00
renovate[bot]
7e72386da1
Update dependency cryptography to v44.0.2 (#1980)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-03 19:11:15 -07:00
renovate[bot]
6f1e8e5853
Update dependency jinja2 to v3.1.6 (#1983)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-03 19:10:43 -07:00
renovate[bot]
906a3fed78
Update dependency pytest to v8.3.5 (#1981)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-03 19:10:15 -07:00
Edoardo Baldi
8329cf5537
Add user-friendly message when missing importer (#1959) 2025-04-03 18:48:04 -07:00
Jrnl Bot
1dd2d48068 Update changelog [ci skip] 2025-04-04 01:35:11 +00:00
renovate[bot]
43310f399d
Update dependency ruff to v0.11.3 (#1978)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-03 18:33:25 -07:00
renovate[bot]
591f2457c3
Update dependency python to 3.13 (#1988)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-03 18:32:32 -07:00
Jrnl Bot
8be5b722aa Update changelog [ci skip] 2025-02-25 05:03:32 +00:00
Jrnl Bot
7249adb232 Increment version to v4.2.1 2025-02-25 05:02:27 +00:00
Jrnl Bot
fbd1b9e78b Update changelog [ci skip] 2025-02-25 05:00:06 +00:00
renovate[bot]
2581c43ae7
Update dependency pytest-bdd to v8.1.0 (#1952)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:58:12 -08:00
renovate[bot]
2035619587
Update dependency poethepoet to v0.32.2 (#1951)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:58:01 -08:00
renovate[bot]
37f634ac80
Update dependency tzlocal to v5.3 (#1972)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:57:21 -08:00
Jrnl Bot
d1e3e546f2 Update changelog [ci skip] 2025-02-25 04:57:00 +00:00
renovate[bot]
f8d80b2877
Update dependency jinja2 to v3.1.5 (#1966)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:55:10 -08:00
Jrnl Bot
8589b2ed65 Update changelog [ci skip] 2025-02-25 04:52:30 +00:00
renovate[bot]
6645b1e36f
Update dependency ruamel.yaml to v0.18.10 (#1967)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:51:02 -08:00
Jrnl Bot
316b9761d5 Update changelog [ci skip] 2025-02-25 04:49:07 +00:00
Jonathan Wren
e2a62e99a0
Update dependency pytest to >=8.1.1 (#1974)
* update pytest in deps

* update lock file

* update lock file
2025-02-24 20:47:32 -08:00
Jrnl Bot
692d0cb132 Update changelog [ci skip] 2025-02-25 04:39:11 +00:00
renovate[bot]
573e34fb48
Update dependency tox to v4.24.1 (#1945)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:36:33 -08:00
renovate[bot]
f2bb5eb501
Update dependency black to v25 (#1973)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:35:42 -08:00
Jrnl Bot
7ad6fca011 Update changelog [ci skip] 2025-02-25 04:32:45 +00:00
renovate[bot]
640150bcbe
Update dependency cryptography to v44 (#1962)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:30:38 -08:00
renovate[bot]
75c98a408c
Update dependency rich to v13.9.4 (#1946)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:30:03 -08:00
renovate[bot]
b8a8de98c3
Update dependency keyring to v25.6.0 (#1948)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:29:02 -08:00
Jrnl Bot
85eb730186 Update changelog [ci skip] 2025-02-25 04:28:43 +00:00
renovate[bot]
024ea00a95
Update dependency ruff to v0.9.7 (#1947)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 20:27:11 -08:00
Carl Smedstad
1530ad39a1
Update pytest-bdd to v8.0 (#1955)
* Encapsulate all multiline strings in triple-quotes in Gherkin files

Since pytest-bdd v8.0.0 uses the official Gherkin parser, multiline
strings must now be encapsulated by triple-quotes.

See:
- https://pytest-bdd.readthedocs.io/en/stable/#id2
- https://pytest-bdd.readthedocs.io/en/stable/#docstrings

* Remove comments in Gherkin files causing test breakage

These comments break the step matching.

* Fix compatibility of step-functions matching on multiple lines

In pytest-bdd v8.0.0 it is no longer possible to match based on multiple
lines, which breaks essentially all steps that support docstrings. Solve
this by adding a wrapper-function for each of these instances, that
matches the docstring step, and calls the original function.

So, what used to be:

    @then(parse("the output should match\n{regex}"))
    @then(parse('the output should match "{regex}"'))
    def output_should_match(regex, cli_run):
        ...

Is now:

    @then(parse("the output should match"))
    def output_should_match_docstring(cli_run, docstring):
        output_should_match(docstring, cli_run)

    @then(parse('the output should match "{regex}"'))
    def output_should_match(regex, cli_run):
        ...

There is possibly a way around this that is much better than what I've
done here, but this is a start at least.

* Update version requirement of pytest-bdd to >=8.0

* Update tox config to match poetry config

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2025-02-24 20:16:54 -08:00
Jrnl Bot
505a9b6846 Update changelog [ci skip] 2025-02-25 03:26:36 +00:00
David Sosa
30c341ef8b
fix typed.js URL (#1970) 2025-02-24 19:25:01 -08:00
Jrnl Bot
ccb64b1721 Update changelog [ci skip] 2025-02-25 03:15:37 +00:00
Jonathan Wren
a1b3a612a5
Remove deprecated command in Poetry >2.0 causing error in CI (#1971)
* remove deprecated flag from install command
* Change poetry install to poetry sync
* Change other poetry install to poetry sync

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2025-02-24 19:14:00 -08:00
Micah Jerome Ellison
247129c760
Fix 4.2 changelog by reverting to cleaned beta changelog (#1960) 2024-11-17 16:12:03 -08:00
Jrnl Bot
bb71dff815 Update changelog [ci skip] 2024-11-17 23:54:47 +00:00
Jrnl Bot
ba18bed4d7 Increment version to v4.2 2024-11-17 23:53:30 +00:00
Jrnl Bot
eb5fe6fef1 Update changelog [ci skip] 2024-10-19 22:06:23 +00:00
Jrnl Bot
16a0f043b1 Increment version to v4.2-beta 2024-10-19 22:04:52 +00:00
Micah Jerome Ellison
b760759906
Changelog cleanup (#1944)
* Sort packages and and remove extraneous entries

* Move docs accessibility issues to docs section
2024-10-19 14:54:41 -07:00
Jrnl Bot
2ce567e495 Update changelog [ci skip] 2024-10-19 21:30:10 +00:00
Micah Jerome Ellison
1143fba023
Force brighter color with XML syntax highlighting (#1943) 2024-10-19 14:28:21 -07:00
renovate[bot]
41279ae943
Update peter-evans/create-pull-request action to v7 (#1929)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 14:27:25 -07:00
Jrnl Bot
985187f866 Update changelog [ci skip] 2024-10-19 21:24:20 +00:00
renovate[bot]
53fef9021d
Update dependency typed.js to v2.1.0 (#1861)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 14:22:53 -07:00
Jrnl Bot
df4a5a5867 Update changelog [ci skip] 2024-10-19 21:20:37 +00:00
renovate[bot]
3f3bf3e77e
Update dependency xmltodict to v0.14.2 (#1940)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 14:19:03 -07:00
Jrnl Bot
1b79f0b340 Update changelog [ci skip] 2024-10-19 21:18:52 +00:00
renovate[bot]
428549778c
Update dependency parse-type to v0.6.4 (#1936)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 14:17:03 -07:00
Jrnl Bot
d9dae7af04 Update changelog [ci skip] 2024-10-19 21:15:48 +00:00
renovate[bot]
5f6be07fbd
Update dependency ruff to v0.7.0 (#1938)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 14:14:22 -07:00
renovate[bot]
a94f7c6161
Update dependency rich to v13.9.2 (#1937)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 14:13:55 -07:00
Jrnl Bot
086c34a6a7 Update changelog [ci skip] 2024-10-19 21:08:27 +00:00
renovate[bot]
0044b2dee8
Update dependency tox to v4.23.0 (#1935)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 14:06:09 -07:00
renovate[bot]
0cc4acd494
Update dependency black to v24.10.0 (#1939)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 14:05:26 -07:00
renovate[bot]
0d5bf1e467
Update dependency cryptography to v43.0.3 (#1942)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 14:05:04 -07:00
Jrnl Bot
85a98afcd9 Update changelog [ci skip] 2024-10-02 03:30:57 +00:00
Micah Jerome Ellison
96d89ca9d5
Add Python 3.13 support (#1930)
* Allow Python 3.13 in pyproject

* Add Python 3.13 to GitHub actions

* Run `poetry update`

* fix failing test

* update poetry.lock

* update poetry.lock again

---------

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2024-10-01 20:29:06 -07:00
Jonathan Wren
de79733957
Add config to pa11y to workaround github actions issue (#1933)
fixes #1932
2024-10-01 20:28:11 -07:00
Jrnl Bot
af1b9f128e Update changelog [ci skip] 2024-10-02 02:17:11 +00:00
renovate[bot]
5145190584
Update dependency tox to v4.21.0 (#1927)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-01 19:15:05 -07:00
renovate[bot]
314576ae13
Update dependency rich to v13.9.1 (#1931)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-01 19:14:38 -07:00
renovate[bot]
87c022780d
Update dependency cryptography to v43 (#1928)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-01 19:14:14 -07:00
Aaron Lichtman
a8bd0bcd44
Add calendar heatmap display format (#1759)
* Add calendar heatmap exporter

Fix #743

* Lint fixes

* More lint fixes

* Surface total number of entries per month in heatmap

* Refactoring

* More refactoring

* Resolve last lint error

* Unbump version

* Add calendar export test scaffolding

* WIP: Test debugging + scaffolding

* Remove broken tests

* Remove args from .vscode/launch.json

* Discard changes to tests/bdd/features/format.feature

* Remove extraneous vscode files

* move NestedDict to utils file

* run formatter

* fix import error

* Address lints

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2024-10-01 18:59:26 -07:00
Jrnl Bot
2f0c5d2eb9 Update changelog [ci skip] 2024-10-01 01:25:58 +00:00
renovate[bot]
ae32ca6917
Update dependency rich to v13.8.1 (#1926)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:24:00 -07:00
renovate[bot]
5856517b0f
Update dependency poethepoet to v0.29.0 (#1925)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:23:21 -07:00
renovate[bot]
1586cc2b49
Update dependency pytest-xdist to v3.6.1 (#1897)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:22:27 -07:00
renovate[bot]
bcf41ddd17
Update dependency parse-type to v0.6.3 (#1922)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:21:23 -07:00
renovate[bot]
4017c4acb5
Update dependency keyring to v25.4.1 (#1924)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:20:46 -07:00
renovate[bot]
a646801c15
Update dependency black to v24.8.0 (#1923)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:19:54 -07:00
renovate[bot]
cb504c4bfb
Update dependency pytest-bdd to v7.3.0 (#1896)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:19:06 -07:00
Jrnl Bot
21e4552360 Update changelog [ci skip] 2024-10-01 01:18:27 +00:00
renovate[bot]
cdb9a220bd
Update dependency python-dateutil to v2.9.0 (#1898)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:16:48 -07:00
renovate[bot]
2d3809e6f7
Update dependency jinja2 to v3.1.4 (#1892)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:15:58 -07:00
renovate[bot]
0ff69bd24c
Update dependency mkdocs to v1.6.1 (#1895)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:15:15 -07:00
renovate[bot]
dec4855816
Update dependency requests to v2.32.3 (#1899)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:14:37 -07:00
renovate[bot]
89eaf3440a
Update dependency cryptography to v42.0.8 (#1904)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 18:13:58 -07:00
Jrnl Bot
7953309c78 Update changelog [ci skip] 2024-10-01 01:12:25 +00:00
renovate[bot]
17e1ba60e5
Update dependency ruff to v0.6.8 (#1900)
* Update dependency ruff to v0.6.8

* Run `ruff check .` instead of `ruff .` due to ruff error

* Preface ruff lint keys with .lint to address ruff deprecation warning

* Changes to appease ruff linter

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2024-09-30 18:10:49 -07:00
Jrnl Bot
4d84c491f1 Update changelog [ci skip] 2024-06-14 02:36:04 +00:00
Micah Jerome Ellison
79cf67eca6
Recommend pipx as easiest installation method for all OSes and remove warning about apt (#1889)
* Remove warning against installing pipx through apt (1886)
* Remove brew recommendation and consolidate pipx instructions (1888)
2024-06-13 19:34:31 -07:00
Jrnl Bot
c8c49b1ba2 Update changelog [ci skip] 2024-05-22 14:36:04 +00:00
renovate[bot]
8f2cb9c355
Update dependency poethepoet to v0.26.1 (#1862)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-22 07:34:33 -07:00
Jrnl Bot
9ac27704fb Update changelog [ci skip] 2024-05-22 14:32:05 +00:00
renovate[bot]
97b39dfd76
Update dependency tox to v4.15.0 (#1860)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-22 07:30:06 -07:00
Jrnl Bot
8fc158e35b Update changelog [ci skip] 2024-05-22 14:04:55 +00:00
renovate[bot]
83d4878044
Update dependency rich to v13.7.1 (#1864)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-22 07:03:04 -07:00
renovate[bot]
c9c71b40ef
Update dependency ruff to v0.4.4 (#1854)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-22 07:02:38 -07:00
Jrnl Bot
8cd4ac24a8 Update changelog [ci skip] 2024-05-22 14:00:33 +00:00
renovate[bot]
ca6b4a08a7
Update dependency cryptography to v42.0.7 (#1857)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-22 06:58:50 -07:00
Jrnl Bot
be9dbf52e0 Update changelog [ci skip] 2024-05-22 13:58:32 +00:00
renovate[bot]
4c4e36a534
Update dependency ruamel.yaml to v0.18.6 (#1855)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-22 06:55:55 -07:00
Jrnl Bot
7c4e3ad76e Update changelog [ci skip] 2024-05-22 13:55:04 +00:00
renovate[bot]
0c2c40d494
Update dependency keyring to v24.3.1 (#1863)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-22 06:53:26 -07:00
Jrnl Bot
ecf5f07dbb Update changelog [ci skip] 2024-05-21 04:18:03 +00:00
Ricardo Ruiz
8957ceb74d
Fix -contains to allow multiple terms with "OR" logic unless -and is added (#1890)
* Store multiple -contains arguments (OR default).

Allow multiple occurrences of the -contains argument
to be stored in a list. Previously, only the last occurrence was
considered. Additionally, the behavior has been modified to default to
OR logic, meaning that if multiple -contains arguments are provided,
entries matching any of them will be included in the results.

* Solved issue #1877 "-and" flag with multiple instances of the -contains option.

* Run poe format

* Fix unit test for contains to allow list instead of single value

* Add BDD tests for multiple contains with and without -and

* Black version updated.

* Revert pyproject.toml to appease poetry

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2024-05-20 21:16:33 -07:00
Jrnl Bot
0deadc03c8 Update changelog [ci skip] 2024-05-20 15:08:46 +00:00
renovate[bot]
d5a5401db9
Update dependency black to v24.4.2 (#1856)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-20 08:07:06 -07:00
Manu Ebert
0aefdb3f21
Begrudgingly, change Twitter references to X (#1884)
Small fix: Change the twitter icon on the Docs landing page to X, and change the verbiage accordingly
2024-04-23 18:27:39 -07:00
Jrnl Bot
9ad1c9f26b Update changelog [ci skip] 2024-03-28 15:10:04 +00:00
Ben Beasley
48b61f6953
Support pytest_bdd 7.1.2 and later (#1878)
* Support pytest_bdd 7.1.2 and later

Fix #1875.

* Prevent use of pytest 8.1 for now due to unrelated error

* poetry lock --no-update

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2024-03-28 08:08:00 -07:00
Jrnl Bot
2af05e4008 Update changelog [ci skip] 2024-02-02 04:07:22 +00:00
renovate[bot]
a13abe446b
Update dependency black to v24 (#1849)
* Update dependency black to v24

* update file to match new formatting from black

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2024-02-01 20:05:39 -08:00
renovate[bot]
5ce9d47126
Update dependency poethepoet to v0.24.4 (#1825)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 20:05:03 -08:00
Jrnl Bot
581af57bfd Update changelog [ci skip] 2024-02-02 03:49:26 +00:00
renovate[bot]
60abba3bfe
Update dependency ruamel.yaml to v0.18.5 (#1822)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:47:52 -08:00
Jrnl Bot
5323ca64fa Update changelog [ci skip] 2024-02-02 03:47:22 +00:00
renovate[bot]
1b2fa594e8
Update dependency ruff to v0.2.0 (#1824)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:45:51 -08:00
Jrnl Bot
36677fdccd Update changelog [ci skip] 2024-02-02 03:45:21 +00:00
renovate[bot]
896be7fb5f
Update dependency pytest-xdist to v3.5.0 (#1829)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:43:59 -08:00
Jrnl Bot
a2a6618959 Update changelog [ci skip] 2024-02-02 03:43:47 +00:00
renovate[bot]
39291bf1ce
Update dependency keyring to v24.3.0 (#1830)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:42:19 -08:00
Jrnl Bot
fbd468e03e Update changelog [ci skip] 2024-02-02 03:42:04 +00:00
renovate[bot]
d91c857fdc
Update dependency cryptography to v42 (#1850)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:40:28 -08:00
renovate[bot]
8eb124b54c
Update peter-evans/create-pull-request action to v6 (#1852)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:40:02 -08:00
Jrnl Bot
f3624a3fa2 Update changelog [ci skip] 2024-02-02 03:38:48 +00:00
renovate[bot]
de4cf5219e
Update nick-invision/retry action to v3 (#1851)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:37:06 -08:00
renovate[bot]
7fdc43b69d
Update dependency pa11y-ci to v3.1.0 (#1831)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:36:08 -08:00
renovate[bot]
df37641fa8
Update actions/setup-python action to v5 (#1848)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:35:05 -08:00
renovate[bot]
8edc14cfe7
Update actions/cache action to v4 (#1847)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:33:29 -08:00
renovate[bot]
8f2ac67659
Update dependency rich to v13.7.0 (#1833)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:32:36 -08:00
renovate[bot]
c5ba4cb198
Update dependency pytest-bdd to v7.0.1 (#1846)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:31:06 -08:00
renovate[bot]
d44515f764
Update dependency pytest to v7.4.4 (#1845)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:30:13 -08:00
Jrnl Bot
ccd68f1e78 Update changelog [ci skip] 2024-02-02 03:23:58 +00:00
renovate[bot]
fc16c6c3e8
Update dependency cryptography to v41.0.7 (#1837)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:22:31 -08:00
Jrnl Bot
b4e8bb0e12 Update changelog [ci skip] 2024-02-02 03:16:52 +00:00
renovate[bot]
5ca5ee6723
Update dependency jinja2 to v3.1.3 (#1844)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:15:11 -08:00
Jrnl Bot
ce50158167 Update changelog [ci skip] 2024-02-02 03:05:47 +00:00
renovate[bot]
d5f7182cf4
Update dependency tox to v4.12.1 (#1838)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 19:04:01 -08:00
Jrnl Bot
9d97df04a7 Update changelog [ci skip] 2024-02-02 02:54:59 +00:00
Micah Jerome Ellison
bf32d59844
Update release process to use Python 3.12 (#1820) 2024-02-01 18:53:27 -08:00
Jrnl Bot
caf3cdea3d Update changelog [ci skip] 2023-11-27 02:14:16 +00:00
utopiatopia
434c32003f
Document security risks of eavesdropping (#1834)
* Add security risks of eavesdropping
* Remove "Limitations" heading and dedent subheadings
* Move Plausible Deniability/Spying/Saved Passwords up above the long Shell History section

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2023-11-26 18:12:26 -08:00
Micah Jerome Ellison
48a31e8154
v4.1 changelog cleanup (#1826)
* Sort packaging deps alphabetically

* De-dupe packaging deps. Only the latest one matters for the changelog

* Add missing PRs and a special thanks note

* Add missing linebreak
2023-11-04 12:58:52 -07:00
Jrnl Bot
3fe3eda27b Update changelog [ci skip] 2023-11-04 19:37:42 +00:00
Jrnl Bot
65070cb675 Increment version to v4.1 2023-11-04 19:35:55 +00:00
Jrnl Bot
311d0b51b6 Update changelog [ci skip] 2023-10-31 01:55:19 +00:00
Jrnl Bot
aca0a185b7 Increment version to v4.1-beta2 2023-10-31 01:53:15 +00:00
Jrnl Bot
14bf9ac55f Update changelog [ci skip] 2023-10-31 01:28:20 +00:00
Micah Jerome Ellison
cf145123f5
Force rich to use color codes when pretty printing (#1821) 2023-10-30 18:25:49 -07:00
Jrnl Bot
c2a97f3100 Update changelog [ci skip] 2023-10-29 20:36:06 +00:00
Jrnl Bot
296c459252 Increment version to v4.1-beta 2023-10-29 20:34:08 +00:00
Jrnl Bot
a176913bda Update changelog [ci skip] 2023-10-29 20:29:54 +00:00
Micah Jerome Ellison
721167a079
Resolve parsedatetime "flag style" DeprecationWarning (#1818)
* Stop ignoring parsedatetime warning flag style warning
* Use new VERSION_CONTEXT_STYLE to bypass parsedatetime flag style warning
* Replace "flag" and its magic numbers with contextual booleans
2023-10-29 13:27:53 -07:00
Jrnl Bot
7e94208574 Update changelog [ci skip] 2023-10-29 16:25:51 +00:00
renovate[bot]
ef016cfb76
Update dependency pytest to v7.4.3 (#1816)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-29 09:22:41 -07:00
renovate[bot]
c2cbf36a87
Update dependency poethepoet to v0.24.1 (#1806)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-29 09:22:21 -07:00
renovate[bot]
6379533065
Update dependency black to v23.10.1 (#1811)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-29 09:22:01 -07:00
renovate[bot]
eec83daaf5
Update dependency ruff to v0.1.3 (#1810)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-29 09:21:45 -07:00
Jrnl Bot
00a6724900 Update changelog [ci skip] 2023-10-29 16:15:25 +00:00
renovate[bot]
69e098d6e5
Update dependency pytest-bdd to v7 (#1807)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-29 09:13:09 -07:00
renovate[bot]
5bf24d6eac
Update dependency tzlocal to v5.2 (#1814)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-29 09:12:29 -07:00
Jrnl Bot
b6f1e76ae4 Update changelog [ci skip] 2023-10-29 16:10:57 +00:00
renovate[bot]
1fdb76008e
Update dependency ruamel.yaml to v0.18.3 (#1813)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-29 09:08:31 -07:00
Jrnl Bot
681b477543 Update changelog [ci skip] 2023-10-29 16:02:23 +00:00
renovate[bot]
c2fa27329c
Update dependency cryptography to v41.0.5 (#1815)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-29 08:59:51 -07:00
Jrnl Bot
299bf090fc Update changelog [ci skip] 2023-10-29 15:45:47 +00:00
Micah Jerome Ellison
a8f5f54a62
Add Python 3.12 support (#1761)
* Add python 3.12 beta to PR tests and testing schedule

* Remove -dev suffix from 3.12 version in test runner and allow pre-releases
Reference: https://github.com/actions/setup-python/releases/tag/v4.6.0

* Run poetry lock to get sub-dependencies to update
2023-10-29 08:43:43 -07:00
Jrnl Bot
75f97ce32f Update changelog [ci skip] 2023-10-17 15:36:22 +00:00
Micah Jerome Ellison
09a96e6db9
Set new required build fields in the ReadTheDocs config file (#1803)
* Set the OS in the ReadTheDocs build process

* Add required tools.python to ReadTheDocs config file

* Change Python version from number to a string
2023-10-17 08:33:58 -07:00
Jrnl Bot
f9558f960a Update changelog [ci skip] 2023-10-06 19:39:42 +00:00
renovate[bot]
1de94ca929
Update dependency ruff to v0.0.292 (#1797)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 12:37:35 -07:00
renovate[bot]
b639915fd4
Update dependency poethepoet to v0.24.0 (#1798)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 12:36:28 -07:00
renovate[bot]
12525e21ec
Update dependency tzlocal to v5.1 (#1804)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 12:35:42 -07:00
Jrnl Bot
3177578c64 Update changelog [ci skip] 2023-10-06 19:22:19 +00:00
renovate[bot]
4ea2fa8c31
Update dependency mkdocs to v1.5.3 (#1795)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 12:19:58 -07:00
Jrnl Bot
a1c24359d2 Update changelog [ci skip] 2023-10-06 18:53:56 +00:00
renovate[bot]
6529fbf211
Update dependency rich to v13.6.0 (#1794)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 11:51:52 -07:00
renovate[bot]
d881880c38
Update dependency ruamel.yaml to v0.17.35 (#1802)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 11:49:55 -07:00
Jrnl Bot
0a01420e9d Update changelog [ci skip] 2023-09-23 17:59:07 +00:00
renovate[bot]
c6f22a2753
Update dependency cryptography to v41.0.4 (#1796)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-23 10:56:52 -07:00
Jrnl Bot
c7b204022a Update changelog [ci skip] 2023-09-16 21:17:56 +00:00
renovate[bot]
1c7ad4d5bb
Update dependency ruff to v0.0.290 (#1792)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-16 14:15:36 -07:00
renovate[bot]
be4cc1abe8
Update dependency black to v23.9.1 (#1791)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-16 14:14:31 -07:00
Jrnl Bot
4969d28988 Update changelog [ci skip] 2023-09-09 22:46:45 +00:00
renovate[bot]
6962c399ea
Update dependency ruff to v0.0.287 (#1778)
* Update dependency ruff to v0.0.287

* add ruff target version to tailor linting to our required python versions

* fix linting issues

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-09-09 15:44:46 -07:00
Jrnl Bot
9533b55d8f Update changelog [ci skip] 2023-09-09 21:10:43 +00:00
renovate[bot]
c4d7f37cc2
Update dependency rich to v13.5.2 (#1776)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-09 14:08:20 -07:00
Micah Jerome Ellison
5c4724d524
Rename readthedocs.yml to .readthedocs.yaml as per current RTD spec (#1781) 2023-09-09 13:55:44 -07:00
Jrnl Bot
dfdd9b69cb Update changelog [ci skip] 2023-09-09 20:45:34 +00:00
renovate[bot]
475923d6d5
Update dependency poethepoet to v0.22.1 (#1785)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-09 13:43:25 -07:00
Jrnl Bot
2674639383 Update changelog [ci skip] 2023-09-09 20:42:04 +00:00
renovate[bot]
d2fc602618
Update dependency pytest to v7.4.2 (#1787)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-09 13:40:07 -07:00
renovate[bot]
85bd7d40a5
Update actions/checkout action to v4 (#1788)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-09 13:39:13 -07:00
Jrnl Bot
303ca98d0b Update changelog [ci skip] 2023-09-09 20:27:19 +00:00
renovate[bot]
c63367b067
Update dependency black to v23.9.0 (#1790)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-09 13:25:11 -07:00
Jrnl Bot
42ac0d33cc Update changelog [ci skip] 2023-09-09 20:17:25 +00:00
renovate[bot]
2a59c708b2
Update dependency tox to v4.11.3 (#1782)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-09 13:15:30 -07:00
Jrnl Bot
75b703d39f Update changelog [ci skip] 2023-08-03 19:18:09 +00:00
renovate[bot]
0f4fdf89b2
Update dependency cryptography to v41.0.3 (#1779)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-03 12:15:51 -07:00
Jrnl Bot
d2756db940 Update changelog [ci skip] 2023-08-03 19:12:35 +00:00
renovate[bot]
cfcbd8e6b7
Update dependency mkdocs to v1.5.2 (#1780)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-03 12:10:30 -07:00
Micah Jerome Ellison
cb69bb474c
Use rich instead of ansiwrap to wrap text (#1693) 2023-07-29 14:36:43 -07:00
Jrnl Bot
525cce3e92 Update changelog [ci skip] 2023-07-29 19:06:39 +00:00
renovate[bot]
cf6aef7ae0
Update dependency parse-type to v0.6.2 (#1762)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 12:04:26 -07:00
Jrnl Bot
b77ea37b2c Update changelog [ci skip] 2023-07-29 19:02:25 +00:00
renovate[bot]
488998cd33
Update dependency cryptography to v41.0.2 (#1770)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 12:00:16 -07:00
renovate[bot]
f5378dea74
Update dependency mkdocs to v1.5.1 (#1774)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 11:59:31 -07:00
Jrnl Bot
23b169708c Update changelog [ci skip] 2023-07-29 18:58:59 +00:00
renovate[bot]
b899130009
Update dependency rich to v13.5.0 (#1775)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 11:56:42 -07:00
Jrnl Bot
bb838ed83a Update changelog [ci skip] 2023-07-29 18:10:56 +00:00
renovate[bot]
4c53cd8830
Update dependency poethepoet to v0.21.1 (#1767)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 11:08:59 -07:00
renovate[bot]
1aa1ac0976
Update dependency black to v23.7.0 (#1769)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 11:08:10 -07:00
Jrnl Bot
f4db877ddd Update changelog [ci skip] 2023-07-29 17:58:19 +00:00
renovate[bot]
0da41a1328
Update dependency ruff to v0.0.280 (#1773)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 10:56:20 -07:00
Jrnl Bot
9970873ff5 Update changelog [ci skip] 2023-07-29 17:45:48 +00:00
renovate[bot]
129428ef80
Update dependency tox to v4.6.4 (#1765)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 10:43:36 -07:00
Jrnl Bot
e1501fd4d1 Update changelog [ci skip] 2023-07-15 19:37:08 +00:00
Micah Jerome Ellison
34c7903300
Replace flake8 and isort with ruff linter and add black --check to linting step (#1763)
* Add ruff

* Add ruff config

* Add ruff rules that look useful and are already passing

* Add more ruff rules after talking with Jonathan

* Add line length exception for acceptably long indented line

* Resolve ruff line length 88 rule in args. Changing small lines but adding a noqa ignore directive to longer lines that look best as they are. Their dedented length is still less than 88

* poe format

* Resolve all remaining ruff line length errors

* Replace flake* and isort with ruff calls

* Add black --check as final lint step. ruff catches most but not all black formatting issues

* Remove unneeded flakeheaven setting

* Remove flake* and isort now that ruff is handling all their business

* Update pyproject, lockfile with latest version of ruff

* Document each ruff rule with comment

* Add black --version call before black --check

* Remove extraneous period
2023-07-15 12:35:10 -07:00
Jrnl Bot
dd09ece4e7 Update changelog [ci skip] 2023-07-15 19:11:58 +00:00
Micah Jerome Ellison
c6b9114c42
Add note about messages going to stderr and the implication for piping (#1768)
* Add note about messages going to STDERR and the implication for piping

* Minor wording change

* Wording and capitalization changes
2023-07-15 12:09:18 -07:00
Jrnl Bot
7a9bc929a5 Update changelog [ci skip] 2023-06-24 18:31:50 +00:00
renovate[bot]
235ba679e3
Update dependency keyring to v24.2.0 (#1760)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-24 11:29:56 -07:00
Jrnl Bot
32f7b9de62 Update changelog [ci skip] 2023-06-24 18:28:06 +00:00
renovate[bot]
9735a60883
Update dependency cryptography to v41 (#1753)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-24 11:25:40 -07:00
renovate[bot]
b4088bf8b8
Update dependency tox to v4.6.3 (#1751)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-24 11:24:15 -07:00
renovate[bot]
a1de9589b5
Update dependency ruamel.yaml to v0.17.32 (#1752)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-24 11:23:01 -07:00
renovate[bot]
875b6d2b35
Update dependency rich to v13.4.2 (#1754)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-24 11:21:28 -07:00
renovate[bot]
12355e087c
Update dependency pytest to v7.4.0 (#1757)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-24 11:21:09 -07:00
renovate[bot]
6e8d6e9aee
Update dependency keyring to v24 (#1758)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-24 11:19:31 -07:00
Jrnl Bot
2a05aad0e9
Update changelog [ci skip] 2023-06-20 16:53:52 -07:00
Jrnl Bot
4f1a21819d Increment version to v4.0.1 2023-06-20 23:39:40 +00:00
Jrnl Bot
12e663ee93 Update changelog [ci skip] 2023-05-27 20:02:06 +00:00
renovate[bot]
9edc7c5cc0
Update dependency ruamel.yaml to v0.17.28 (#1749)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-27 12:59:47 -07:00
Jrnl Bot
793a5e22c5 Update changelog [ci skip] 2023-05-22 20:16:54 +00:00
renovate[bot]
10cf68161e
Update dependency requests to v2.31.0 (#1748)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-22 13:14:18 -07:00
Jrnl Bot
21c4aa0b3a Update changelog [ci skip] 2023-05-20 23:37:04 +00:00
Jrnl Bot
649254d0ac Increment version to v4.0.1-beta 2023-05-20 23:34:50 +00:00
Jrnl Bot
f5dc5fbae0 Update changelog [ci skip] 2023-05-20 23:31:48 +00:00
renovate[bot]
5124a805c8
Update dependency ruamel.yaml to v0.17.26 (#1746)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-20 16:20:47 -07:00
Jrnl Bot
982e597742 Update changelog [ci skip] 2023-05-20 23:15:49 +00:00
Micah Jerome Ellison
4a7057c038
Refactor --template code (#1711)
* Move path concerns to path.py and template concerns to editor.py -- BDD tests are failing
* Move path-related constants from config.py to path.py
* Mock get_templates_path in its new calling file
* Mediate template arg vs. config in controller then read template text in editor and unify those two use cases.
Some tests still failing
* Fix test whose message had changed
* poe format
* Refactor for easier unit testing and add unit tests
* Use path strings instead of Path objects in return values to prevent side effects that caused unit tests to fail on some platforms
* poe format
* Attempt to bypass getcwd errors in CI with patch
* Consistently use strings for paths instead of some strings and some pathlib.Path
* Keep pathlib within a function for readability
* fix for ruamel.yaml versions >=0.17.22
* Run poe format

---------

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-05-20 16:13:24 -07:00
renovate[bot]
78d11d74bd
Update dependency flake8-simplify to v0.20.0 (#1716)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-20 16:12:26 -07:00
Jrnl Bot
b1843ab14b Update changelog [ci skip] 2023-05-20 23:05:54 +00:00
Jonathan Wren
4cb5d1e436
fix some linting issues for failing PR (#1745) 2023-05-20 16:03:46 -07:00
renovate[bot]
959e18ad91
Update peter-evans/create-pull-request action to v5 (#1719)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-20 16:02:35 -07:00
Jrnl Bot
4292d85a22 Update changelog [ci skip] 2023-05-20 22:57:33 +00:00
Jonathan Wren
9f4ca2683f
run pipeline tests weekly (#1744) 2023-05-20 15:55:25 -07:00
Jrnl Bot
3e44027ab5 Update changelog [ci skip] 2023-05-20 22:46:18 +00:00
Jonathan Wren
98d2a3b3ec
fix linting issue from shellcheck (#1743) 2023-05-20 15:43:52 -07:00
Jrnl Bot
0d8fc9028c Update changelog [ci skip] 2023-05-20 22:25:05 +00:00
renovate[bot]
f5e5d817be
Update dependency requests to v2.30.0 (#1728)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-20 15:22:31 -07:00
renovate[bot]
d5f00edb9d
Update dependency rich to v13.3.5 (#1729)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-20 15:20:51 -07:00
renovate[bot]
6e9fade8dd
Update dependency tox to v4.5.1 (#1727)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-20 15:19:30 -07:00
Jrnl Bot
7045e97a24 Update changelog [ci skip] 2023-05-20 22:17:51 +00:00
renovate[bot]
fdc87ff8c4
Update dependency mkdocs to v1.4.3 (#1733)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-20 15:15:42 -07:00
Jrnl Bot
81313c2445 Update changelog [ci skip] 2023-05-20 22:12:36 +00:00
renovate[bot]
0b8b4244bd
Update dependency poethepoet to v0.20.0 (#1735)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-20 15:10:16 -07:00
Jrnl Bot
7a8b86aadb Update changelog [ci skip] 2023-05-20 22:10:01 +00:00
renovate[bot]
1f59c15f5e
Update dependency pytest-xdist to v3.3.1 (#1740)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-20 15:07:47 -07:00
renovate[bot]
da0c49da83
Update dependency tzlocal to v5 (#1741)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-20 15:07:06 -07:00
Micah Jerome Ellison
8f2eb27793
Add flakeheaven_cache/ to gitignore and fix typo in comment (#1731) 2023-05-20 14:57:24 -07:00
Jonathan Wren
a1a68f7eea
clean up changelog a bit 2023-05-20 14:50:41 -07:00
Jrnl Bot
cd850c068d Update changelog [ci skip] 2023-05-20 20:37:30 +00:00
Jrnl Bot
e987e34c78 Increment version to v4.0 2023-05-20 20:35:57 +00:00
Jrnl Bot
53342c944e Update changelog [ci skip] 2023-05-07 00:04:57 +00:00
Jonathan Wren
0b55c477e1
Lock ruamel.yaml version until bug is fixed (#1738) 2023-05-06 17:02:55 -07:00
Jrnl Bot
7e09c4eb66 Update changelog [ci skip] 2023-04-29 22:53:16 +00:00
Jrnl Bot
adeb1acced Increment version to v4.0-beta3 2023-04-29 22:51:01 +00:00
Micah Jerome Ellison
95836a7dd1
Only read text files that look like entries when opening folder journal (#1697)
* Add text file that should be ignored to basic test folder journal. Makes tons of tests fail
* Add additional files that should be ignored by FolderJournal
* Ignore all files in folder journal except year/month/day.txt
* Completely remake get_files in FolderJournal:
- move get_files into FolderJournal class and add underscore prefix
- create iterables to get for year/month folders and day files
- make year/month/day file reading strict: only exact expected months and days out of all possible months and days
* Restore accidentally-deleted self.sort() line
* Use match instead of string comparison to be os-agnostic
* Explicitly declare static methods
* Filter with glob first for max performance
* Explicitly check for valid dates in FolderJournal and add unit test
* Remove unneeded jrnl import
* Clean up method comment and add type hints
* Add is_valid_date unit test
* Elucidate comment

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-04-29 15:49:41 -07:00
Jrnl Bot
88aa2491b0 Update changelog [ci skip] 2023-04-29 18:59:52 +00:00
CoffeeOrDeath
73aa146f8a
Update contributing.md links in documentation (#1726)
* Chore: Update README.md to contribution

Update the contribution link to go directly to the current contribution guide and documentation.

* Update PULL_REQUEST_TEMPLATE.md
2023-04-29 11:57:57 -07:00
Jrnl Bot
7d237c887f Update changelog [ci skip] 2023-04-22 20:49:03 +00:00
Jrnl Bot
8d95e0bfe9 Increment version to v4.0-beta2 2023-04-22 20:46:35 +00:00
Jrnl Bot
bd147fa285 Update changelog [ci skip] 2023-04-22 20:40:18 +00:00
renovate[bot]
ab9128ffb6
Update dependency tox to v4.4.12 (#1712)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-22 13:38:15 -07:00
Jrnl Bot
d2c92511ff Update changelog [ci skip] 2023-04-22 20:37:56 +00:00
renovate[bot]
9bd16473c9
Update dependency rich to v13.3.4 (#1713)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-22 13:35:27 -07:00
renovate[bot]
ad3b8396be
Update dependency flake8-type-checking to v2.4.0 (#1714)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-22 13:34:15 -07:00
Jrnl Bot
8a22f9db56 Update changelog [ci skip] 2023-04-22 20:33:52 +00:00
renovate[bot]
b00f5f1531
Update dependency black to v23.3.0 (#1715)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-22 13:31:16 -07:00
Jrnl Bot
fc83bee80b Update changelog [ci skip] 2023-04-22 20:21:49 +00:00
Zhizhen He
0b64d50f4b
fix typo (#1718) 2023-04-22 13:19:15 -07:00
Jrnl Bot
ea6a5da3eb Update changelog [ci skip] 2023-04-22 19:41:20 +00:00
renovate[bot]
5bcdcdd5c6
Update dependency pytest to v7.3.1 (#1720)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-22 12:39:25 -07:00
renovate[bot]
9581b1b81a
Update dependency flakeheaven to v3.3.0 (#1722)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-22 12:37:48 -07:00
Jrnl Bot
10216988d4 Update changelog [ci skip] 2023-04-22 19:32:57 +00:00
renovate[bot]
745373df6a
Update dependency cryptography to v40.0.2 (#1723)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-22 12:30:17 -07:00
Jrnl Bot
23551a379b Update changelog [ci skip] 2023-03-25 23:06:24 +00:00
Jrnl Bot
deef870213 Increment version to v4.0-beta 2023-03-25 23:04:23 +00:00
Jrnl Bot
37b731ff14 Update changelog [ci skip] 2023-03-25 19:34:32 +00:00
Jonathan Wren
3c923ae943
Allow combinations of --change-time, --delete, and --edit while correctly counting the number of entries affected (#1669)
* Remove search mode conditional that added explicit tag search behavior
* Fix failing change-time test by using same method signature as base journal class
* Fix user input mock - was not appropriately checking return value
* Clean up controller
  - streamline `run` function in `controller.py`
  - add debug logging
  - fix unnecessary import of Journal class (only needed for typing)
  - standardize summary display across different actions
* Add currently-failing test conditions for count messages when changing time and deleting
* Don't show summary if no entries found and prevent extra line break when no entries found by short-circuiting display method
* Track found entry count and remove incorrect modified stat logic
* Track journal entry deletion consistently
* Remove unneeded exception when editor is empty and fix test that was testing incorrect message
* Correct entry edit modified count test
* Track modification of entries with --change-time
* Preserve existing behavior when editor is empty but make the message more clear
* Reconcile tests with new error message when clearing editor in edit mode
* Add found/modified counts to edit tests
* Add tests for found count with -n equivalent argument
* Test combinations of found/deleted messages when using --delete
* Add tests for counting combinations of action arguments (change-time, edit, delete) and for change-time counts. Some are failing and should be investigated
* Remove extraneous comment in test
* Track added/deleted counts in a register in the Journal class instead of attempting to infer it via controller counting
* Add encrypted to more tests
* Fix merge conflict typo
* Change 'write mode' -> 'append mode' in more places

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2023-03-25 12:32:25 -07:00
Jrnl Bot
b3c6f90a35 Update changelog [ci skip] 2023-03-25 18:49:16 +00:00
Aaron Lichtman
a2b217fdfc
Add ability to use template with --template (#1667)
* Add ability to pass template path with --template

Update jrnl/args.py

* Fix tests
2023-03-25 11:47:00 -07:00
Jrnl Bot
0725ea6b87 Update changelog [ci skip] 2023-03-25 18:18:19 +00:00
renovate[bot]
dad2744e71
Update dependency cryptography to v40 (#1710)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-25 11:15:48 -07:00
Jrnl Bot
94f079293b Update changelog [ci skip] 2023-03-25 17:55:18 +00:00
renovate[bot]
55f7328b3e
Update dependency poethepoet to v0.19.0 (#1709)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-25 10:53:19 -07:00
Jrnl Bot
5a74b0e722 Update changelog [ci skip] 2023-03-18 20:00:55 +00:00
renovate[bot]
3764946dfe
Update dependency pytest-xdist to v3.2.1 (#1705)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-18 12:58:47 -07:00
renovate[bot]
1b7afe588b
Update dependency ipdb to v0.13.13 (#1703)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-18 12:57:47 -07:00
renovate[bot]
f7e2a59332
Update dependency flake8-type-checking to v2.3.1 (#1702)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-18 12:56:38 -07:00
renovate[bot]
fc9def0879
Update dependency pytest to v7.2.2 (#1704)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-18 12:56:10 -07:00
renovate[bot]
7cd301fcbf
Update dependency rich to v13.3.2 (#1706)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-18 12:55:42 -07:00
renovate[bot]
16fec7c87f
Update dependency tox to v4.4.7 (#1707)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-18 12:53:56 -07:00
Jrnl Bot
a7021b03e7 Update changelog [ci skip] 2023-03-18 19:47:29 +00:00
renovate[bot]
d24a73e349
Update dependency cryptography to v39.0.2 (#1701)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-18 12:45:21 -07:00
Jrnl Bot
d67310ec90 Update changelog [ci skip] 2023-03-18 19:39:00 +00:00
renovate[bot]
0f203fb198
Update dependency tzlocal to v4.3 (#1708)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-18 12:36:58 -07:00
Jrnl Bot
aa8433f881 Update changelog [ci skip] 2023-03-04 20:53:29 +00:00
Micah Jerome Ellison
e54908be0d
Document -tagged, -not -tagged, and -not -starred in command line reference (#1684) 2023-03-04 12:51:12 -08:00
Jrnl Bot
22bf6595da Update changelog [ci skip] 2023-03-04 20:47:31 +00:00
Micah Jerome Ellison
427485a1d7
Add message with config location and docs location when installation is complete (#1695) 2023-03-04 12:45:37 -08:00
Jrnl Bot
23150ddb31 Update changelog [ci skip] 2023-03-04 20:39:09 +00:00
Micah Jerome Ellison
1a67fd5dec
Use pytest-bdd 6 (#1685)
* update pytest-bdd to 6.0
* update lock file
* fix first test (inject command fixture to request)
* fix some more tests
* fix cli_run fixture
* fix password fixture
* Remove unused import
* Fix greedy should_or_should_not parsing problems while also consolidating its parse/transformation-to-bool code
* Prevent greedy matching in "we run" by using regular expression lookahead
* Add missing "Outline" in scenario outlines with examples
* Split "we use the config" and "we use no config" so pytest won't try to consume config_file as a fixture
* Fix missing ShouldOrShouldNot
* Formatting
* fix get_fixture function
* change output of failing test to be a little more useful
* update lock file
* update type builder to for should/should not to be in it's own file, rename some vars for readability
* add parse-type new dev/testing dependency
* update lock file

---------

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-03-04 12:37:06 -08:00
Micah Jerome Ellison
2d0b15ea7b
Update documentation front page text (#1698)
* Update front page console examples and feature text with more present-day style, brand-agnostic examples, and hopefully a more inclusive tone

* Updating feature blurb text

* Blurb edit

* Update index.html

* Update index.html

* Update index.html

📓🖉 👍

---------

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-03-04 12:20:20 -08:00
Jrnl Bot
611f3af772 Update changelog [ci skip] 2023-02-25 23:32:54 +00:00
Micah Jerome Ellison
e6804f1627
Prompt to include colors in config when first running jrnl (#1687)
* Add prompt to ask user if entries should be formatted with colors when installing jrnl
* Use magenta instead of black for default date color
* Use other default colors and alphabetize color list
* Update tests
* Delete test file
* update lock file
* fix failing test after merge conflict

---------

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-02-25 15:30:25 -08:00
Jrnl Bot
fecd696b2a Update changelog [ci skip] 2023-02-25 20:31:52 +00:00
Micah Jerome Ellison
3c87111710
Save empty journal on install instead of just creating a zero-length file (#1690)
* Add failing test for issue #1493
* Write journal upon creation instead of just creating 0-length file
* Fix test to accommodate current password mocking form
2023-02-25 12:29:43 -08:00
Jrnl Bot
592e7bcf27 Update changelog [ci skip] 2023-02-25 20:18:29 +00:00
Micah Jerome Ellison
d81b5ad955
Support mkdocs 1.4.2 and fix its missing breadcrumb (#1691)
* Use latest mkdocs version 1.4.2
* Add docs_theme to mkdocs watch so it automatically reloads localhost when modifying theme
* Bring in ReadTheDocs breadcrumb theme and fix display issues around "Docs" root breadcrumb
* The problem is CSS, not the breadcrumbs template. Tightly scope offending CSS and remove breadcrumbs template override
* Bring mkdocs ReadTheDocs breadcrumbs theme back in
* Fix pa11y validation issue by replacing breadcrumb a alt attribute with aria-label
* Attribute source of new breadcrumbs file
* Use mkdocs 1.4 or greater with no upper bound
2023-02-25 12:16:33 -08:00
Micah Jerome Ellison
fcac94a30e
Document temporary file extension behavior when using template (#1686)
* Document jrnl's temp file behavior when using templates
* Move up "Files in transit from editor to jrnl" section and add notes about template extension behavior in solutions that reference .jrnl extension
* Update privacy-and-security.md
2023-02-25 12:15:52 -08:00
Giuseppe D'Andrea
18397b13eb
Update documentation about privacy and security in VSCode (#1680)
* docs: vscode file history

* docs: vscode unsaved files

* Edited for tone

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2023-02-21 08:45:53 -08:00
Jrnl Bot
b4da3a51f7 Update changelog [ci skip] 2023-02-11 20:40:50 +00:00
Briscoooe
b41a988d6f
Don't save templated journal entries if the received raw text is the same as the template itself (#1653) 2023-02-11 12:38:21 -08:00
David Isaksson
6c6937c507
Add documentation about information leaks in Vim/Neovim (#1674)
* Add documentation about using Vim/Neovim as editor
* Add documentation about information leaks in editors
* Spelling fix

---------

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-02-11 12:16:31 -08:00
Jrnl Bot
6b179e673b Update changelog [ci skip] 2023-02-11 20:12:27 +00:00
Giuseppe D'Andrea
2d1a52afe5
Update documentation on temporary files naming (#1673) 2023-02-11 12:10:18 -08:00
Jrnl Bot
d4ce2a84cf Update changelog [ci skip] 2023-01-28 19:47:17 +00:00
Ciaran Concannon
7bd15d12ad
Search for entries with no tags or stars with -not -starred and -not -tagged (#1663)
* Allow for `-not -starred` to search for unstarred entries

* Add `-tagged` and `-not -tagged` functionality
2023-01-28 11:45:01 -08:00
Jrnl Bot
17c987c605 Update changelog [ci skip] 2023-01-14 22:44:27 +00:00
Jonathan Wren
fff05eb646
Refactor flow for easier access to some files (avoid things like jrnl.Journal.Journal and jrnl.jrnl co-existing) (#1662)
* run format

* rename cli.py to main.py

* rename jrnl.py to controller.py

* move journal class files into journals dir

* rename start -> run in controller.py
2023-01-14 14:42:29 -08:00
Jrnl Bot
7be67accc1 Update changelog [ci skip] 2023-01-14 21:24:31 +00:00
outa
a13726d4c5
Add more type hints (#1642) 2023-01-14 13:22:31 -08:00
Peter Conrad
9547411390
Update docs to include time and title in arguments with --edit (#1657) 2023-01-07 14:04:33 -08:00
Jrnl Bot
120c54a29e Update changelog [ci skip] 2023-01-07 22:01:41 +00:00
renovate[bot]
a6f2d34b7e
Update dependency rich to v13 (#1654)
* Update dependency rich to v13

* Update pyproject.toml

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-01-07 13:59:40 -08:00
Jonathan Ballet
458faff8a8
Fix markup in "Advanced Usage" doc (#1655)
* Fix YAML indentiation in a configuration example
* Improve Markdown markup
2023-01-07 13:58:49 -08:00
Jrnl Bot
2cec8bdc5b Update changelog [ci skip] 2023-01-07 21:41:17 +00:00
Jonathan Wren
8da6029624
Update copyright notices for 2023 (#1660)
* update copyright notice for 2023

* standardize whitespace after copyright notice
2023-01-07 13:39:07 -08:00
Micah Jerome Ellison
9274ab16ed
Add basic template test (#1659)
* Add very basic test template
* Ensure that templates are copied to temporary test workspace
* Add basic template test
* Update copyright for this new file
2023-01-07 13:37:43 -08:00
Jrnl Bot
d5d39971b4 Update changelog [ci skip] 2023-01-07 20:53:14 +00:00
Jonathan van der Steege
907566b39f
Add tag to XML file when edited DayOne entry and is searchable afterward (#1648)
* Add tag to XML file when edited DayOne entry
* Remove forbidden change
* undo edits
* Tags working for DayOne journal
* Correction doentries to prevent time-error
* Add sorting to tags
* Delete test statements
* Revert time changes
2023-01-07 12:51:07 -08:00
Jrnl Bot
7229d77bda Update changelog [ci skip] 2023-01-07 19:48:26 +00:00
Jonathan van der Steege
d94325127f
Update version key in config file after version changes (#1646) 2023-01-07 11:46:12 -08:00
Jrnl Bot
fe08cfd3ab Update changelog [ci skip] 2022-11-19 21:41:41 +00:00
Jonathan Wren
fcc8d8e3fa
Rework Encryption to enable future support of other encryption methods (#1602)
- initial pass through to rework encryption into separate module
- little more cleanup
- rename function, fix some linting issues
- more cleaning
- fix password bug in encryption
- fix linting issue
- more cleanup
- move prompt into prompt.py
- more cleanup
- update the upgrade process for new encryption classes
- general cleanup
- turn into enum instead of strings
- store status code so tests don't fail
- standardize the load and store methods in journals
- get rid of old PlainJournal class
- typing cleanup
- more cleanup
- format
- fix linting issue
- Fix obscure Windows line ending issue with decode
  See https://bugs.python.org/issue40863
- fix for python 3.11
- add more typing
- don't use class variables because that's not what we want
- fix more type hints
- jrnlv1 encryption doesn't support encryption anymore (it's deprecated)
- keep logic for password attemps inside the class that uses it
- take out old line of code
- add some more logging
- update logging statements
- clean up logging statements
- run linters
- fix typo
- Fix for new test from develop branch
  There was a new test added for re-encrypting a journal. This updates the
  refactor to match the old (previously untested) behavior of jrnl.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-11-19 13:39:39 -08:00
Jrnl Bot
e6e08e5d3e Update changelog [ci skip] 2022-11-05 23:07:28 +00:00
Micah Jerome Ellison
92a8ec4f68
Remove Windows 7 known issue since jrnl no longer supports (#1636) 2022-11-05 16:05:36 -07:00
Jrnl Bot
b7a3110e7e Update changelog [ci skip] 2022-11-05 22:58:54 +00:00
Jonathan Wren
b508ed6c9a
Add simplify plugin to linting checks (#1630)
* add simplify plugin for flakeheaven

* update lock file

* fix linting issues in current codebase
2022-11-05 15:56:46 -07:00
Jrnl Bot
1e69495728 Update changelog [ci skip] 2022-11-05 22:31:41 +00:00
outa
30b41fdb88
Add type hints (#1614)
* Add type hints

* Fix linters

* Add remaining type hints

* Fix type-checking linter

* Update jrnl/DayOneJournal.py

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2022-11-05 15:29:50 -07:00
Jonathan Wren
c1eb0c54a3
Add type-checking plugin to linting checks (#1629)
* add type-checking plugin for flakeheaven

* update lock file

* fix type-checking issues in current codebase

* run linters
2022-11-03 07:18:35 -07:00
Jrnl Bot
cb7e0ed289 Update changelog [ci skip] 2022-11-03 02:55:34 +00:00
Micah Jerome Ellison
e6130dbf4a
Resolve failing GitHub Actions linting by replacing deprecated set-output command (#1632)
* Replace deprecated set-output command
* Resolve SC2086 - double quote to prevent globbing and word splitting
* fix quotes in output command

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2022-11-02 19:53:32 -07:00
Jrnl Bot
8e482321f2 Update changelog [ci skip] 2022-11-01 23:52:21 +00:00
Jonathan Wren
8ad9e2bdd6
Fix bug where changelog is always slightly out of date on release tags (#1631)
* fix issue where changelog is always slightly out of date on release tags

* fix tag step running all the time per CR

* update tag name to use more clear variable name
2022-11-01 16:50:25 -07:00
Jonathan Wren
51e9ce5638
Move existing linting into flakeheaven (#1628)
* add black and isort to flakeheaven

* update lock file

* clean up poe config

* run formta on python blocks in markdown file

* disable code for black being confused about markdown

* add cache timeout for flakeheaven

See: https://github.com/flakeheaven/flakeheaven/issues/71
2022-10-31 09:31:17 -07:00
Jrnl Bot
9150f07984 Update changelog [ci skip] 2022-10-31 15:58:15 +00:00
Jonathan Wren
cd47070894
Add rich handler for better-formatted debug logging (#1627) 2022-10-31 08:55:23 -07:00
Micah Jerome Ellison
44e2ace833
Add double encryption test (#1626) 2022-10-30 13:06:54 -07:00
Jrnl Bot
5cf9311502 Update changelog [ci skip] 2022-10-29 21:39:27 +00:00
Micah Jerome Ellison
74b7ac834e
Drop Python 3.9 and use Python 3.11 official release (#1611)
* Drop Python 3.9 and use Python 3.11 release instead of pre-release
* Run poetry lock
* Fix need for quoted 3.10 string
* Use 3.11.0-rc.2 for Python 3.11 for now
* Update minimum Python version in installation docs
* Change Python 3.11 RC version to 3.11
* Run docs and release workflows on Python 3.11
* Including Python 3.12 in allowable versions
* Restore poetry.lock from develop
* Run poetry lock --no-update
* Retrieve poetry.lock from develop and lock with --no-update
* poetry lock --no-update
2022-10-29 14:36:50 -07:00
Jonathan Wren
a77a3d5a56
Replace flake8 with flakeheaven in linting steps (#1625)
* replace flake8 with flakeheaven

* update pyproject.toml for new flake tool

* update lock file

* change flake8 to flakeheaven in tests

* undo fix for poetry

* remove unused plugin marker for flakeheaven

* remove unused import in markdown file

* Attempt to exclude .venv from flakeheaven runs in CI

* Exclude more dirs from flakeheaven

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-10-29 14:21:11 -07:00
Jonathan Wren
847dadac5d
Manual change to changelog [ci skip]
- Document that v3.0 had breaking changes with emoji for emphasis
2022-10-29 12:40:31 -07:00
Jrnl Bot
60590e0c49 Update changelog [ci skip] 2022-10-29 19:27:02 +00:00
Jrnl Bot
415fc336ec Increment version to v3.3 2022-10-29 19:19:53 +00:00
Jrnl Bot
81771eff4f Update changelog [ci skip] 2022-10-29 19:16:11 +00:00
Micah Jerome Ellison
6f9a3eb536
Document that editors must be blocking processes (#1624)
* Describe blocking processes in External Editors page
* Add documentation about how the editor must be a blocking process
* Add contextual link to external editor site
* Point to micro editor as an example since it's likely less intimidating than vim
2022-10-29 12:14:28 -07:00
Micah Jerome Ellison
c6479c70c1 Add contextual link to external editors page from overview 2022-10-29 11:51:41 -07:00
Jrnl Bot
6cd8c35598 Update changelog [ci skip] 2022-10-22 22:40:26 +00:00
Jrnl Bot
ffdd4f923d Increment version to v3.3-beta2 2022-10-22 22:38:31 +00:00
Jrnl Bot
c32acd0123 Update changelog [ci skip] 2022-10-22 22:36:58 +00:00
Jonathan Wren
63850a33c1
Fix bug for new --list --format options when no default journal is specified (#1621)
* rename test config

* Change journal name validation

Journal name validation used to happen before postconfig commands could
have a chance to run, so now each command is responsible for its own
error-checking of the journal name.

Added a new decorator and function that makes this error-checking easier.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

* fix wrapper function call to be more like original

* change arg names to show which aren't used

* add type hints

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-10-22 15:35:16 -07:00
Jrnl Bot
619de775fd Update changelog [ci skip] 2022-10-22 21:30:18 +00:00
DSiekmeier
48c528d76a
Remove wrong option in configuration file reference (#1618) 2022-10-22 14:28:34 -07:00
Jrnl Bot
52f82fc855 Update changelog [ci skip] 2022-10-08 20:51:42 +00:00
Jrnl Bot
41e5d5ffff Increment version to v3.3-beta 2022-10-08 20:49:59 +00:00
outa
d7242d81a4
Don't create empty file when attempting a YAML export to a non-existing folder (#1600)
* Call `export_journal` before opening file handle
* Use correct exporter class
* Fix unit test
2022-10-08 13:48:29 -07:00
Jrnl Bot
a925c81ba8 Update changelog [ci skip] 2022-10-08 20:43:20 +00:00
Micah Jerome Ellison
ceff398a01
Change default config to use journal key instead of journal name as key for file path (#1594) 2022-10-08 13:41:22 -07:00
Jrnl Bot
dd7f59cef7 Update changelog [ci skip] 2022-10-08 19:42:07 +00:00
Jonathan Wren
ff24ee604d
Update .gitignore (#1604)
* add ignore for directories used by this project

* update name of asdf version file (had a typo)
2022-10-08 12:40:27 -07:00
Jrnl Bot
560d076a5f Update changelog [ci skip] 2022-09-24 19:48:37 +00:00
Kevin
2df7acf488
Add machine readable --list output (#1592)
* Add machine readable --list output

* Refactor list_journals()

Create three new methods for each journal list format.
- JSON, YAML, STDOUT

* Added journal list export test

* Update test regex to handle windows filepaths
2022-09-24 12:46:49 -07:00
dependabot[bot]
057f31407a
Bump mako from 1.2.1 to 1.2.2 (#1598)
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-17 12:04:36 -07:00
Jonathan Wren
e9be61cae2
Change default timestamp to %F %r (#1595)
Fixes #1100
2022-09-17 12:02:52 -07:00
Jrnl Bot
66d26cfed6 Update changelog [ci skip] 2022-09-10 18:50:10 +00:00
Kevin
b5a22379b8
Update YAML export description in docs (#1591) 2022-09-10 11:48:20 -07:00
Jrnl Bot
405e0c2199 Update changelog [ci skip] 2022-09-03 21:23:14 +00:00
Jonathan Wren
bd02c52d5a
Fix Docs Accessibility Testing (#1588)
* update run_shell task to use newer python

* add shell arg back

* make tests run when certain files change
2022-09-03 14:21:27 -07:00
Jrnl Bot
8032aa9f2f Update changelog [ci skip] 2022-09-03 20:25:31 +00:00
renovate[bot]
a95cd333d5
Update dependency typed.js to v2.0.12 (#1578)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-03 13:23:37 -07:00
renovate[bot]
0618ff57e4
Update dependency jinja2 to v3.1.2 (#1579)
* Update dependency jinja2 to v3.1.2

* Remove old unneeded comment from requirements.txt

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-09-03 13:22:46 -07:00
Jrnl Bot
a3ce9bdb55 Update changelog [ci skip] 2022-09-03 20:18:05 +00:00
renovate[bot]
43d7dc026c
Pin dependencies (#1577)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-03 13:16:28 -07:00
renovate[bot]
0d7acafc44
Update actions/checkout action to v3 (#1582)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-03 13:16:18 -07:00
Jrnl Bot
080fcde440 Update changelog [ci skip] 2022-09-03 20:13:58 +00:00
renovate[bot]
adc505cef9
Update peter-evans/create-pull-request action to v4 (#1585)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-03 13:12:12 -07:00
renovate[bot]
cc703ae3c6
Update actions/cache action to v3 (#1581)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-03 13:11:08 -07:00
Jrnl Bot
7b2e2de3df Update changelog [ci skip] 2022-09-03 20:04:21 +00:00
renovate[bot]
06a5dab129
Update actions/setup-python action to v4 (#1583)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-03 13:02:37 -07:00
Jrnl Bot
4d4f328527 Update changelog [ci skip] 2022-09-03 19:51:36 +00:00
Jonathan Wren
49fc1e4e40
Update to use renamed flag for brew bump-formula-pr 2022-09-03 12:49:43 -07:00
Paul Jimenez
b2f53d48f7
Add hint for how to get vi to go to end-of-file (#1563) 2022-09-03 12:48:37 -07:00
Jrnl Bot
75008dcb1a Update changelog [ci skip] 2022-09-03 19:23:33 +00:00
renovate[bot]
37af7b8db6
Replace Dependabot with Renovate (#1575)
* Add renovate.json

* move renovate config file into .github dir

* update config to match dependabot

* remove old dependabot config

* update prhourlylimit setting for renovate

* fix typo

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2022-09-03 12:21:52 -07:00
Jrnl Bot
8a7225a249 Update changelog [ci skip] 2022-09-03 19:09:06 +00:00
Jrnl Bot
55e0162a87 Increment version to v3.2 2022-09-03 19:07:07 +00:00
Jonathan Wren
76392620be
fix typo (#1569) 2022-08-27 14:18:06 -07:00
Jrnl Bot
0e2d16982b Update changelog [ci skip] 2022-08-27 21:12:47 +00:00
Jonathan Wren
fbb819d7a0
Update issue templates from markdown into yaml forms (#1567)
* convert bug report from markdown to yaml

* convert feature request from markdown to yaml

* convert documentation template from markdown to yaml

* convert support request template from markdown to yaml
2022-08-27 14:11:06 -07:00
Jrnl Bot
11119a6143 Update changelog [ci skip] 2022-08-27 20:57:48 +00:00
Micah Jerome Ellison
57adea3cc1
Remove note about gh-pages branch that we no longer use (#1566) 2022-08-27 13:56:03 -07:00
Jrnl Bot
a923be53cd Update changelog [ci skip] 2022-08-27 19:42:54 +00:00
Jrnl Bot
a107c868a0 Increment version to v3.2-beta 2022-08-27 19:40:35 +00:00
Jrnl Bot
3efe09ad72 Update changelog [ci skip] 2022-08-27 19:35:23 +00:00
Micah Jerome Ellison
f65f07dbcb
Suppress "Entry added" message if using default journal (#1561)
* Suppress "Entry added to default journal" message if using default journal
* Replace "Entry added" BDD test steps with "we should get no error" now that the message is suppressed
* Add positive and negative tests for "Entry added" message behavior
2022-08-27 12:33:44 -07:00
Jrnl Bot
bb6491bd06 Update changelog [ci skip] 2022-08-27 19:16:18 +00:00
Kevin
0cc771f633
Add message showing the number of search results (#1524)
* Added message showing the number of search results

Modified _search_journal() to return a bool based upon whether
any filter args were passed to the program.

Added _print_entries_found_count() which prints a message
based upon the number of entries found and prints warnings
if the user was trying to edit or delete.

* Add tests for search results msgs
2022-08-27 12:13:57 -07:00
Jrnl Bot
0fddb07c09 Update changelog [ci skip] 2022-08-27 19:05:08 +00:00
Jonathan Wren
3c50b01c23
take out old help text from pipeline config (#1565)
These used to be needed because the `type` field didn't exist.
2022-08-27 12:03:01 -07:00
Jrnl Bot
72d1a044d9 Update changelog [ci skip] 2022-08-21 22:23:36 +00:00
Jrnl Bot
b26fdb424b Increment version to v3.1 2022-08-21 22:22:00 +00:00
Jrnl Bot
1f58452b76 Update changelog [ci skip] 2022-08-21 21:52:58 +00:00
Janek
5a5d31f213
jrnl/args.py: reformat contributor appreciation (#1556) 2022-08-21 14:51:23 -07:00
Jrnl Bot
8948334d5d Update changelog [ci skip] 2022-08-21 21:19:21 +00:00
Jonathan Wren
4eb9c9fdec
Clean up copyright notices and version screen (#1553)
* update copyright symbols to unicode

* clean up version screen/copyright notice

* small change to make commands more similar

* update imports to appease isort

* fix test

* update one more file merged since PR was open
2022-08-21 14:17:35 -07:00
Jrnl Bot
5dcc721f15 Update changelog [ci skip] 2022-08-21 21:02:05 +00:00
Jonathan Wren
803b3956fa
Add actionlint to testing pipelines (#1555)
* add actionlint for github actions to testing suite

* add quotes around vars per shellcheck

* change expression per shellcheck

* put more quotes around vars per shellcheck

* put quotes around entire string

* use find instead of ls to better handle non-alphanumberic filenames

* update release workflow input types to have actual typese and fix typo
2022-08-21 13:59:45 -07:00
Jrnl Bot
fd981216da Update changelog [ci skip] 2022-08-21 20:49:49 +00:00
Jonathan Wren
671f403602
Fix docs pipeline, make docs tests easier to run locally and on different OSes (#1554)
* update docs pipeline to use poe task runner

* move npm dependency into package.json file instead of hardcoding into pipeline

* replace nix-specific call with python version (for windows compat)

* update commands to use python for win compat

* update lock file

* change deps to take out xq and use xmltodict instead

* move script tasks from pyproject into new tasks.py

* run linting on new tasks.py file

* fix typo

* clean up pyproject to make valid toml

* update docs with correct task runner command

* use npx in case node_modules/.bin isn't in the path

* Run pa11y-ci in cross-platform manner (works on Windows)

* Add node_modules to .gitignore

* clean up poe alias

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-08-21 13:47:25 -07:00
Jrnl Bot
33607acbb6 Update changelog [ci skip] 2022-08-13 21:05:29 +00:00
Jrnl Bot
6f4e669e0d Increment version to v3.1-beta2 2022-08-13 21:03:51 +00:00
Jrnl Bot
a6756ebe0f Update changelog [ci skip] 2022-08-13 20:50:33 +00:00
dependabot[bot]
4b53d16ea0
Bump keyring from 23.7.0 to 23.8.2 (#1551)
Bumps [keyring](https://github.com/jaraco/keyring) from 23.7.0 to 23.8.2.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.7.0...v23.8.2)

---
updated-dependencies:
- dependency-name: keyring
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-13 13:48:38 -07:00
Jrnl Bot
5387763169 Update changelog [ci skip] 2022-08-13 20:04:09 +00:00
Jonathan van der Steege
fb473007da
Export to file(s) when first line/title of an entry is very long (#1527) 2022-08-13 13:02:19 -07:00
Jrnl Bot
c92ee47632 Update changelog [ci skip] 2022-08-13 19:49:55 +00:00
dependabot[bot]
611d6d7b11
Bump pyproject-flake8 from 0.0.1a4 to 0.0.1a5 (#1552)
Bumps [pyproject-flake8](https://github.com/csachs/pyproject-flake8) from 0.0.1a4 to 0.0.1a5.
- [Release notes](https://github.com/csachs/pyproject-flake8/releases)
- [Commits](https://github.com/csachs/pyproject-flake8/compare/v0.0.1a4...v0.0.1a5)

---
updated-dependencies:
- dependency-name: pyproject-flake8
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-13 12:47:57 -07:00
Jrnl Bot
6f4df4b55e Update changelog [ci skip] 2022-07-30 19:52:53 +00:00
Jrnl Bot
6ade0da597 Increment version to v3.1-beta 2022-07-30 19:51:10 +00:00
Jrnl Bot
a78632768c Update changelog [ci skip] 2022-07-30 19:48:19 +00:00
outa
62f65ce3b9
Update tzlocal to v4.x and remove pytz dependency (#1528)
* Update tzlocal to v4.x and remove pytz dependency
* Avoid `unwrap_shim` method
* Remove upper bound of tzlocal version
2022-07-30 12:46:43 -07:00
Jrnl Bot
049d2a72c8 Update changelog [ci skip] 2022-07-30 19:46:19 +00:00
dependabot[bot]
94d126b0c8
Bump poethepoet from 0.15.0 to 0.16.0 (#1542)
Bumps [poethepoet](https://github.com/nat-n/poethepoet) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/nat-n/poethepoet/releases)
- [Commits](https://github.com/nat-n/poethepoet/compare/v0.15.0...v0.16.0)

---
updated-dependencies:
- dependency-name: poethepoet
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-30 12:43:57 -07:00
Jrnl Bot
e233ab4a74 Update changelog [ci skip] 2022-07-30 19:35:48 +00:00
dependabot[bot]
506cc664b2
Bump rich from 12.4.4 to 12.5.1 (#1538)
Bumps [rich](https://github.com/willmcgugan/rich) from 12.4.4 to 12.5.1.
- [Release notes](https://github.com/willmcgugan/rich/releases)
- [Changelog](https://github.com/Textualize/rich/blob/master/CHANGELOG.md)
- [Commits](https://github.com/willmcgugan/rich/compare/v12.4.4...v12.5.1)

---
updated-dependencies:
- dependency-name: rich
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-30 12:34:09 -07:00
Jrnl Bot
2d15a7a5cf Update changelog [ci skip] 2022-07-30 19:23:51 +00:00
Jonathan van der Steege
80bfff384e
Add linewrap option 'auto' (#1507)
* Add linewrap option 'auto'

* Specify the exception thrown

* Add BDD test

* Specify name instead of number

* Create test for linewrap auto and fancy format

* Fix linewrap auto for fancy format
2022-07-30 12:22:04 -07:00
dependabot[bot]
252c63f4dd
Bump yq from 3.0.2 to 3.1.0 (#1546)
Bumps [yq](https://github.com/kislyuk/yq) from 3.0.2 to 3.1.0.
- [Release notes](https://github.com/kislyuk/yq/releases)
- [Changelog](https://github.com/kislyuk/yq/blob/develop/Changes.rst)
- [Commits](https://github.com/kislyuk/yq/compare/v3.0.2...v3.1.0)

---
updated-dependencies:
- dependency-name: yq
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-30 12:20:50 -07:00
Kevin
08c366d950
Fixed index out of range error in fancy exporter (#1522) 2022-07-30 12:16:56 -07:00
Jrnl Bot
7b5106dd08 Update changelog [ci skip] 2022-07-30 19:03:58 +00:00
dependabot[bot]
24ee35b95b
Bump keyring from 23.6.0 to 23.7.0 (#1539)
Bumps [keyring](https://github.com/jaraco/keyring) from 23.6.0 to 23.7.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.6.0...v23.7.0)

---
updated-dependencies:
- dependency-name: keyring
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-30 12:02:02 -07:00
Jonathan Wren
ec8bbd2187
update formatting function to better account for indenting (#1541) 2022-07-16 14:45:13 -07:00
Jrnl Bot
e695180049 Update changelog [ci skip] 2022-07-16 21:22:57 +00:00
Jonathan van der Steege
3a5316cedc
Check for duplicate keys in config file (#1511)
* Check for duplicate keys in config file
* Corrected BDD tests
* Unneeded check removed
* Make use of ruamel DuplicateKeyError exception
* Remove unneeded import and function
* slightly reword warning message
* fix merge conflicts
* update tests

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2022-07-16 14:21:21 -07:00
Jonathan Wren
c45bed7f6c
Disable gherkin reporter to fix failing test suite (#1540) 2022-07-16 14:13:48 -07:00
Jrnl Bot
ca1f2a76d8 Update changelog [ci skip] 2022-07-09 19:03:51 +00:00
Jrnl Bot
50b320063a Increment version to v3.0 2022-07-09 19:02:32 +00:00
Jrnl Bot
bfe58a18e5 Update changelog [ci skip] 2022-07-09 18:56:09 +00:00
Jonathan Wren
db6f80d721
Limit pytest-bdd to <6.0 to temporarily avoid breaking changes (#1536)
This will unblock other tests for now
2022-07-09 11:54:15 -07:00
Jrnl Bot
0279637fe4 Update changelog [ci skip] 2022-06-25 21:47:37 +00:00
Jrnl Bot
97cb7a678e Increment version to v3.0-beta2 2022-06-25 21:46:02 +00:00
Jonathan Wren
0f2962a95f
Add and run isort on Python files (#1520)
* add and run isort

* udpate more import statements

* fix typo
2022-06-25 14:43:32 -07:00
Jonathan Wren
20254f7434
Run tests in parallel (#1519)
* Clean up pyproject file

This reduces the differences between local tasks and tasks run in the CI
pipelines

* remove linting step (it's part of test now)

* remove useless arg

* add xdist for parallel test execution in pytest
2022-06-25 13:12:52 -07:00
Jrnl Bot
3fd109b6cd Update changelog [ci skip] 2022-06-25 19:48:47 +00:00
Kevin
8b955ef002
Add bdd tests for jrnl installation (#1513)
* Added bdd tests for jrnl installation
2022-06-25 12:47:05 -07:00
Jonathan Wren
23bc0f2c8f
Reduce difference between local and CI environments (#1518)
* Clean up pyproject file

This reduces the differences between local tasks and tasks run in the CI
pipelines

* remove linting step (it's part of test now)

* remove useless arg
2022-06-25 12:45:39 -07:00
Jrnl Bot
856f361271 Update changelog [ci skip] 2022-06-25 19:01:37 +00:00
dependabot[bot]
e531d575be
Bump poethepoet from 0.13.1 to 0.14.0 (#1514)
Bumps [poethepoet](https://github.com/nat-n/poethepoet) from 0.13.1 to 0.14.0.
- [Release notes](https://github.com/nat-n/poethepoet/releases)
- [Commits](https://github.com/nat-n/poethepoet/compare/v0.13.1...v0.14.0)

---
updated-dependencies:
- dependency-name: poethepoet
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-25 11:59:41 -07:00
dependabot[bot]
c0ebf12cc8
Bump cryptography from 37.0.2 to 37.0.3 (#1516)
Bumps [cryptography](https://github.com/pyca/cryptography) from 37.0.2 to 37.0.3.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/37.0.2...37.0.3)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-25 11:59:09 -07:00
Kevin
ed4f8eacea
Display message when no edits take place (#1510) 2022-06-25 11:58:31 -07:00
Jonathan Wren
28051046d5
Update maintainer email (#1515) 2022-06-25 11:51:19 -07:00
Jrnl Bot
5fb5e1140a Update changelog [ci skip] 2022-06-18 18:56:04 +00:00
Jonathan Wren
7dccc469b5
Implement Tox for testing (#1504)
* Get rid of `make` in favor of `poe`
This moves the tasks that were previously in Makefile, into
pyproject.toml (with all the other config)

This is also more inclusive of Windows developers since they only need
Python, and no longer have to install make separately.

* update docs
* don't make code blocks also links
* implement tox for testing
* update command to use new task runner
2022-06-18 11:54:28 -07:00
Jonathan Wren
bd590213a1
Stop hardcoding bot info in some pipelines (#1506) 2022-06-18 11:53:20 -07:00
Jonathan Wren
fe2b976849
update cache for accessibility tests (to match other tests) (#1505) 2022-06-18 11:51:51 -07:00
Jrnl Bot
2981de95b0 Update changelog [ci skip] 2022-06-18 18:39:06 +00:00
Jonathan Wren
51ab747019
Replace make with python alternative (poe) (#1503)
* Get rid of `make` in favor of `poe`

This moves the tasks that were previously in Makefile, into
pyproject.toml (with all the other config)

This is also more inclusive of Windows developers since they only need
Python, and no longer have to install make separately.

* udpate docs

* don't make code blocks also links
2022-06-18 11:36:56 -07:00
Jrnl Bot
c1c70e643a Update changelog [ci skip] 2022-06-18 18:32:43 +00:00
Jonathan Wren
f5e052937c
Update copyright year (#1502)
Update copyright year in comment headers and --version output
2022-06-18 11:30:56 -07:00
Jrnl Bot
9639c5386f Update changelog [ci skip] 2022-06-11 21:11:01 +00:00
Jrnl Bot
7e7d374263 Increment version to v3.0-beta 2022-06-11 21:09:10 +00:00
Jrnl Bot
37ef1d9bc6 Update changelog [ci skip] 2022-06-11 21:08:07 +00:00
Micah Jerome Ellison
86bc9bfd80
Add Python 3.11 to PR tests (#1500)
* Add Python 3.11 to PR tests
* Add testing_prs to trigger for testing PRs
2022-06-11 14:06:02 -07:00
Jonathan Wren
f53110c69b
Rework how all output and messaging works in jrnl (#1475)
* fix missed statement from last PR
* replace print statement for adding an entry to a journal
* clean up linting and format
* change print statement over to new print_msg function
* make print_msg always print to stderr
* change print statement over to new print_msg function
* update importer to use new message function
* update yaml format to use new message function
* code cleanup
* update yaml format to use new message function
* update yaml format to use new exception handling
* update Journal class to use new message function
* update install module to use new message function
* update config module to use new message function
* update upgrade module to properly use new message and exception handling
* fix typo
* update upgrade module to use new message handling
* update welcome message to use new handling
* update upgrade module to use new message handling
* update upgrade module journal summaries to use new message handling
* take out old code
* update upgrade module to use new message handling
* update upgrade module to use new message handling
* update more modules to use new message handling
* take out old comment
* update deprecated_cmd to use new message handling
* update text_exporter with new message handling, get rid of old color constants
* get rid of hardcoded text
* whitespace changes
* rework MsgType into MsgStyle so messages can have different styles
* add comment
* Move around code to separate concerns of each function a bit more
* update create_password and yesno prompt functions for new messaging
* fix missing newline for keyboard interrupts
* fix misc linting
* fix bug with panel titles always showing 'error' after one error
* fix missing import
* update debug output after uncaught exception
* update exception for new exception handling
* rewrite yesno function to use new centralized messages
* reduce the debug output slightly
* clean up print_msgs function
* clean up create_password function
* clean up misc linting
* rename screen_input to hide_input to be more clear
* update encrypted journal prompt to use new messaging functionality
* fix typo in message key
* move rich console into function so we can mock properly
* update password mock to use rich console instead of getpass
* add more helpful output to then step
* fix test by updating expected output
* update message to use new functionality
* rework mocks in test suite for new messaging functionality
* fix linting issue
* fix more tests
* fix more tests
* fix more tests
* fix more tests
* fix merge bug
* update prompt_action_entries to use new messaging functionality
* Add new input_method "type"
  This does the same thing as input_method "pipe" but is more clear what
  it's doing (typing text into the builtin composer)
* get rid of old commented code
* get rid of unused code
* move some files around

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-06-11 13:32:11 -07:00
Jrnl Bot
4d683a13c0 Update changelog [ci skip] 2022-06-11 18:41:17 +00:00
dependabot[bot]
e2978029a5
Bump pyxdg from 0.27 to 0.28 (#1497)
Bumps [pyxdg](https://github.com/takluyver/pyxdg) from 0.27 to 0.28.
- [Release notes](https://github.com/takluyver/pyxdg/releases)
- [Changelog](https://github.com/takluyver/pyxdg/blob/master/ChangeLog)
- [Commits](https://github.com/takluyver/pyxdg/compare/rel-0.27...rel-0.28)

---
updated-dependencies:
- dependency-name: pyxdg
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-11 11:39:09 -07:00
Jrnl Bot
024de4d8b3 Update changelog [ci skip] 2022-06-11 18:37:54 +00:00
dependabot[bot]
b66e28faa0
Bump keyring from 23.5.1 to 23.6.0 (#1499)
Bumps [keyring](https://github.com/jaraco/keyring) from 23.5.1 to 23.6.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.5.1...v23.6.0)

---
updated-dependencies:
- dependency-name: keyring
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-11 11:36:20 -07:00
Jrnl Bot
c07cdbed3c Update changelog [ci skip] 2022-06-04 22:15:16 +00:00
Kevin
c043f5058f
Fixed error related to display_format in config file for some values (#1495)
* Fixed error related to display_format in config file
  Now _display_search_results tries to source the export arg from the
  config file before dispaying search results.
* Add BDD test for original bug
* update unit test

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2022-06-04 15:13:30 -07:00
Jonathan van der Steege
e758986985
Create folder if config ends with (back)slash (#1492)
* Check config if FolderJournal and treat as so

* Add test for end of path is slash

* Code format correction

* Requested changes PR 1482

* Add info to doc about path of folder.

* Small addition to doc about folder journal
2022-06-04 13:20:51 -07:00
Jrnl Bot
1c35c6951d Update changelog [ci skip] 2022-06-04 20:10:38 +00:00
Kevin
36121007b1
-not search parameter doesn't open editor (#1490) 2022-06-04 13:09:07 -07:00
Jrnl Bot
19d579fc5c Update changelog [ci skip] 2022-05-28 18:54:06 +00:00
Jonathan van der Steege
bb0a6f5854
Fixed debug TypeError (#1484) 2022-05-28 11:52:10 -07:00
Jrnl Bot
7f91d512b8 Update changelog [ci skip] 2022-05-28 18:45:24 +00:00
dependabot[bot]
de6a90a5ee
Bump keyring from 23.5.0 to 23.5.1 (#1487)
Bumps [keyring](https://github.com/jaraco/keyring) from 23.5.0 to 23.5.1.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.5.0...v23.5.1)

---
updated-dependencies:
- dependency-name: keyring
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-28 11:43:43 -07:00
Jrnl Bot
fd8d64098f Update changelog [ci skip] 2022-05-21 21:14:56 +00:00
Micah Jerome Ellison
11209b4b42
Document --change-time in web-based docs' command line reference (#1471)
* Document change-time in command line reference
* Keep mkdocs version under 1.3 both locally and for readthedocs
2022-05-21 14:13:24 -07:00
Jonathan van der Steege
663f151974
Prompt for password change when using 'jrnl --encrypt' on already encrypted journal (#1477)
* Create new password if journal already encrypted.
* Add test for encrypting already encrypted journal.
2022-05-21 14:11:55 -07:00
Jrnl Bot
7771afc1a7 Update changelog [ci skip] 2022-05-21 21:07:40 +00:00
Kevin
ea6df4705c
Always expand all paths (journals, templates, etc) (#1468)
* Refactored path expansion calls into a new path.py file

This also fixed bugs with relative journal and template paths.

* Update tests for new path functions

Also, make the tests specific to Windows, Mac & Linux

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-05-21 14:06:07 -07:00
Jrnl Bot
1ce7ce8bfc Update changelog [ci skip] 2022-05-21 21:05:09 +00:00
Jonathan van der Steege
86c8466ae4
Show name of journal when creating a password/encrypting (#1478)
* Show name of journal when creating password
2022-05-21 14:03:18 -07:00
Jrnl Bot
55b72a49b6 Update changelog [ci skip] 2022-05-21 19:05:14 +00:00
Richard Schneider
33c9dce80d
Implement --change-time flag (#1452)
* Implement --change-time flag
* Remove todo from --change-time bdd folder journal tests
* Add warning when --change-time used with no matching entries
* Add a test to make sure running --change-time with nothing prints a warning and doesn't change anything
* Add prompt for --change-time
* Don't prompt for --change-time when used with --edit and only one entry
* When using --edit and --change-time, change the time before editing
* Add test for --change-time used with --edit
* Modify failing --change-time test to conform to text in develop branch
2022-05-21 12:03:27 -07:00
Jrnl Bot
e6ed64ac7a Update changelog [ci skip] 2022-05-07 19:21:16 +00:00
Kevin
8458cdb06f
Fixed -not option with no arguments bug (#1466) 2022-05-07 12:19:37 -07:00
Jrnl Bot
4dacd86bc3 Update changelog [ci skip] 2022-05-07 19:15:14 +00:00
Jonathan van der Steege
792f188ecc
Give a proper message when trying to use an empty config file (#1461)
* Added check for empty config file and if so, use default config

* Added check for empty config file and if so, use default config

* Fix and add tests for empty config file

* Exit program with message if config is empty.
bdd-test doesn't add version if file is (and should stay) empty.

* Exit program with message if config is empty.

* bdd-test doesn't add version if file is (and should stay) empty.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-05-07 12:13:36 -07:00
Jrnl Bot
71c1d38d50 Update changelog [ci skip] 2022-05-07 18:12:57 +00:00
Kevin
74200f8dc4
Yaml export errors now don't show stack trace (#1449)
* Yaml export errors now don't show stacktrace

* Add test for user-friendly error when exporting YAML to a nonexistent directory

* Leave partially written to files after export error

* unskip working tests

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2022-05-07 11:11:00 -07:00
Jrnl Bot
048c9d40e7 Update changelog [ci skip] 2022-05-07 17:51:26 +00:00
dependabot[bot]
41e4b81192
Bump cryptography from 37.0.1 to 37.0.2 (#1467)
Bumps [cryptography](https://github.com/pyca/cryptography) from 37.0.1 to 37.0.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/37.0.1...37.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-07 10:49:23 -07:00
Jrnl Bot
6a12853b65 Update changelog [ci skip] 2022-04-30 19:41:10 +00:00
Kevin
d6d6db0aa3
Display "No entry to save, because no text was received" after empty entry on cmdline (#1459)
* Display "Entry not saved" after empty entry on cmdline
* update error message
2022-04-30 12:39:36 -07:00
Jrnl Bot
d21398ee60 Update changelog [ci skip] 2022-04-30 18:30:34 +00:00
dependabot[bot]
2b3cf88097
Bump pytest from 7.1.1 to 7.1.2 (#1458)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.1 to 7.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.1...7.1.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-30 11:29:03 -07:00
dependabot[bot]
e2f0f8cc9b
Bump cryptography from 36.0.2 to 37.0.1 (#1462)
Bumps [cryptography](https://github.com/pyca/cryptography) from 36.0.2 to 37.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/36.0.2...37.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-30 11:28:34 -07:00
Jrnl Bot
97f326a59c Update changelog [ci skip] 2022-04-16 18:31:52 +00:00
dependabot[bot]
4d72f0be62
Bump pyproject-flake8 from 0.0.1a3 to 0.0.1a4 (#1447)
Bumps [pyproject-flake8](https://github.com/csachs/pyproject-flake8) from 0.0.1a3 to 0.0.1a4.
- [Release notes](https://github.com/csachs/pyproject-flake8/releases)
- [Commits](https://github.com/csachs/pyproject-flake8/compare/v0.0.1a3...v0.0.1a4)

---
updated-dependencies:
- dependency-name: pyproject-flake8
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-16 11:29:53 -07:00
Jrnl Bot
3d036256b2 Update changelog [ci skip] 2022-04-09 21:00:41 +00:00
dependabot[bot]
96d45847f9
Bump pyproject-flake8 from 0.0.1a2 to 0.0.1a3 (#1440)
Bumps [pyproject-flake8](https://github.com/csachs/pyproject-flake8) from 0.0.1a2 to 0.0.1a3.
- [Release notes](https://github.com/csachs/pyproject-flake8/releases)
- [Commits](https://github.com/csachs/pyproject-flake8/compare/v0.0.1a2...v0.0.1a3)

---
updated-dependencies:
- dependency-name: pyproject-flake8
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-09 13:58:58 -07:00
dependabot[bot]
026cafad3f
Bump mkdocs from 1.2.3 to 1.3.0 (#1441)
Bumps [mkdocs](https://github.com/mkdocs/mkdocs) from 1.2.3 to 1.3.0.
- [Release notes](https://github.com/mkdocs/mkdocs/releases)
- [Commits](https://github.com/mkdocs/mkdocs/compare/1.2.3...1.3.0)

---
updated-dependencies:
- dependency-name: mkdocs
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-09 13:58:43 -07:00
dependabot[bot]
2c626844ef
Bump black from 22.1.0 to 22.3.0 (#1442)
Bumps [black](https://github.com/psf/black) from 22.1.0 to 22.3.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.1.0...22.3.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-09 13:58:21 -07:00
Jrnl Bot
650aeb387b Update changelog [ci skip] 2022-03-26 18:50:20 +00:00
Micah Jerome Ellison
23839305d8
Pin jinja2 in docs requirements to keep readthedocs builds from failing (#1439)
* Attempt to pin jinja requirement to keep readthedocs from failing
* Change read the docs Python version from 3.7 to 3.10
* Unpin jinja and remove deprecated python version setting
* Try pinning to jinja 3.0.3
* Fix "jinja2" (instead of "jinja")
2022-03-26 11:48:41 -07:00
Jrnl Bot
17e09df050 Update changelog [ci skip] 2022-03-26 18:36:47 +00:00
Micah Jerome Ellison
d405e92292
Remove sample format and its asteval dependency (#1436) 2022-03-26 11:35:14 -07:00
Jrnl Bot
a969f9b3fb Update changelog [ci skip] 2022-03-26 18:25:14 +00:00
dependabot[bot]
a40d4536f6
Bump pytest from 7.0.1 to 7.1.1 (#1430)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.0.1 to 7.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.0.1...7.1.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-26 11:23:28 -07:00
dependabot[bot]
edc2e524f7
Bump pytz from 2021.3 to 2022.1 (#1438)
Bumps [pytz](https://github.com/stub42/pytz) from 2021.3 to 2022.1.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](https://github.com/stub42/pytz/compare/release_2021.3...release_2022.1)

---
updated-dependencies:
- dependency-name: pytz
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-26 11:21:43 -07:00
Jonathan Wren
bc42f74b2b
Reformat additional messages and finish centralizing exception handling (#1424)
* Update and modularize exception handling

cc #1024 #1141

- Stack traces are no longer shown to users unless the --debug flag is
  being used
- Errors, warnings, and other messages contain color as needed
- Converted error messages to Enum
- Adds print_msg function to centralize output (this should replace all
  other output in other modules)

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

* format with black

* add message to catch-all exception block

* Unskip some tests (#1399)

* remove skip_editor test and tag

* remove useless test

* unskip blank input test

* formatting

* rename test so it doesn't overwrite other test

* unskip some dayone tests that now work

* Bump ipython from 7.28.0 to 7.31.1 (#1401)

Bumps [ipython](https://github.com/ipython/ipython) from 7.28.0 to 7.31.1.
- [Release notes](https://github.com/ipython/ipython/releases)
- [Commits](https://github.com/ipython/ipython/compare/7.28.0...7.31.1)

---
updated-dependencies:
- dependency-name: ipython
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update changelog [ci skip]

* Bump asteval from 0.9.25 to 0.9.26 (#1400)

Bumps [asteval](https://github.com/newville/asteval) from 0.9.25 to 0.9.26.
- [Release notes](https://github.com/newville/asteval/releases)
- [Commits](https://github.com/newville/asteval/compare/0.9.25...0.9.26)

---
updated-dependencies:
- dependency-name: asteval
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update changelog [ci skip]

* Bump black from 21.12b0 to 22.1.0 (#1404)

* Bump black from 21.12b0 to 22.1.0

Bumps [black](https://github.com/psf/black) from 21.12b0 to 22.1.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits/22.1.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run make format

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

* Update changelog [ci skip]

* Add reference documentation to docs site and separate out "Tips and Tricks" and "External Editors" from "Recipes" (#1332)

* First draft of command line reference, mostly pulled from help screen

* Add first draft of config file reference, mostly pulled from advanced.md

* Clean up config file doc for readability

* Add --config-file and remove examples from CLI reference

* Add warning about time zone in timeformat

* More small changes, and adding template config keyword

* Cleaning up and re-ordering config file reference

* Clean up reference and anything else from advanced documentation that can live elsewhere and linking to config file reference wherever config file is mentioned

* Fix syntax highlighting in command line reference, clean up content a bit, include --diagnostic

* Mention version config key

* Apply minor changes suggested in PR review

* Rename "recipes" to "Tips and Tricks", pull "External Editors" out of it into its own page, and redirect old recipes link to tips-and-tricks

* Revert broken mkdocs-redirects usage from last commit

* Update changelog [ci skip]

* Add --co alias for --config-override (#1397)

* Add hash as a default tag symbol (#1398)

* Update changelog [ci skip]

* Increment version to v2.8.4-beta2

* Update changelog [ci skip]

* Increment version to v2.8.4

* Update changelog [ci skip]

* Bump pytest from 6.2.5 to 7.0.0 (#1407)

Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.5 to 7.0.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.5...7.0.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update changelog [ci skip]

* Drop support for Python 3.7 and 3.8 (#1412)

* Remove Python 3.7 and 3.8 from github actions workflows

* Update lockfile after running poetry update a couple times

* Update poetry lock

* Remove Python 3.7 and 3.8 from pyproject.toml and run poetry lock

* Update changelog [ci skip]

* Tidy up git ignore (#1414)

* cleaned gitignore and add comments

* removed colon for readbility

* alphabetize files in sections

Co-authored-by: nelnog <nel.nogales@gmail.com>

* fix behavior that was confusing pytest

* update test to match new message

* whitespace change

* clean up error for manually stopping the inline editor

* udpate error to use new exception handling

* move some exceptions and errors to the new exception handling

* add line breaks to keyboard interrupt so it looks more like other exceptions

* add handling for exceptions that happen earlier in the flow

* add new 'NothingToDelete' error to replace old behavior

* get rid of old exception

* add new exception handling to 'nothing saved to file' errors

* move exception for no editor configured into new handling

* move exception for no alt config to new handling

* get rid of old exception handling for encrypted journal

* Move error for too many wrong passwords into new handling

* fix merge errors

* replace sys.exit call with new exception handling

* replace sys.exit call with new exception handling

* replace sys.exit call with new exception handling

* reformat with black

* clean up old code

* clean up old code

* clean up linting issue

* update uncaught exception for new handling

* update test

* fix mangled lock file

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jrnl Bot <jrnl.bot@gmail.com>
Co-authored-by: Nelson <35701520+nelnog@users.noreply.github.com>
Co-authored-by: nelnog <nel.nogales@gmail.com>
2022-03-19 12:30:23 -07:00
Jrnl Bot
a1117918dd Update changelog [ci skip] 2022-03-19 19:09:40 +00:00
dependabot[bot]
7cb8345e85
Bump cryptography from 36.0.1 to 36.0.2 (#1427)
Bumps [cryptography](https://github.com/pyca/cryptography) from 36.0.1 to 36.0.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/36.0.1...36.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-19 12:07:56 -07:00
Jrnl Bot
7a42800168 Update changelog [ci skip] 2022-03-12 21:26:01 +00:00
Micah Jerome Ellison
d3de5b778b
Replace PyYAML with ruamel.yaml (#1416)
* Remove Python 3.7 and 3.8 from github actions workflows

* Update lockfile after running poetry update a couple times

* Update poetry lock

* Remove Python 3.7 and 3.8 from pyproject.toml and run poetry lock

* Switch from pyyaml to ruamel.yaml

* Remove duplicate editor key in config

* Use ruamel.yaml instead of pyyaml in legacy template.py

* Prevent ruamel from collapsing config YAML

* Run make format
2022-03-12 13:24:31 -08:00
Jonathan Wren
e46b5a171f
Fix tests for daylight savings (#1423)
* fix test failing because tomorrow is daylight savings

* add test for newly discovered daylight savings issue (and skip for now)

* whitespace change

* update title of test

* fix copypasta
2022-03-12 13:14:26 -08:00
Jonathan Wren
5273f8769d
Reformat messages and add new centralized exception handling (#1417)
* Update and modularize exception handling

cc #1024 #1141

- Stack traces are no longer shown to users unless the --debug flag is
  being used
- Errors, warnings, and other messages contain color as needed
- Converted error messages to Enum
- Adds print_msg function to centralize output (this should replace all
  other output in other modules)

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-03-12 12:43:26 -08:00
Jrnl Bot
d6ff04cf17 Update changelog [ci skip] 2022-02-26 20:05:39 +00:00
dependabot[bot]
b4e7246526
Bump yq from 2.13.0 to 2.14.0 (#1418)
Bumps [yq](https://github.com/kislyuk/yq) from 2.13.0 to 2.14.0.
- [Release notes](https://github.com/kislyuk/yq/releases)
- [Changelog](https://github.com/kislyuk/yq/blob/develop/Changes.rst)
- [Commits](https://github.com/kislyuk/yq/compare/v2.13.0...v2.14.0)

---
updated-dependencies:
- dependency-name: yq
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-26 12:03:57 -08:00
Nelson
20d6eda1ad
Tidy up git ignore (#1414)
* cleaned gitignore and add comments

* removed colon for readbility

* alphabetize files in sections

Co-authored-by: nelnog <nel.nogales@gmail.com>
2022-02-17 15:38:11 -08:00
Jrnl Bot
2ec4567f69 Update changelog [ci skip] 2022-02-12 22:09:44 +00:00
Micah Jerome Ellison
117e0de5bc
Drop support for Python 3.7 and 3.8 (#1412)
* Remove Python 3.7 and 3.8 from github actions workflows

* Update lockfile after running poetry update a couple times

* Update poetry lock

* Remove Python 3.7 and 3.8 from pyproject.toml and run poetry lock
2022-02-12 14:07:56 -08:00
Jrnl Bot
f9a0695865 Update changelog [ci skip] 2022-02-12 20:53:58 +00:00
dependabot[bot]
c2f1d19eaf
Bump pytest from 6.2.5 to 7.0.0 (#1407)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.5 to 7.0.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.5...7.0.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-12 12:52:14 -08:00
Jrnl Bot
9bceb39e26 Update changelog [ci skip] 2022-02-12 12:50:42 -08:00
Jrnl Bot
72fea986d0 Increment version to v2.8.4 2022-02-12 20:41:34 +00:00
Jrnl Bot
fa874ace12 Update changelog [ci skip] 2022-02-05 21:09:51 +00:00
Jrnl Bot
cfeb9e01b7 Increment version to v2.8.4-beta2 2022-02-05 21:08:19 +00:00
Jrnl Bot
4b6a8efe0f Update changelog [ci skip] 2022-02-05 21:07:34 +00:00
Micah Jerome Ellison
f37062c9b6
Add hash as a default tag symbol (#1398) 2022-02-05 13:06:03 -08:00
Micah Jerome Ellison
cd865e048e
Add --co alias for --config-override (#1397) 2022-02-05 13:04:23 -08:00
Jrnl Bot
f890e2fcd3 Update changelog [ci skip] 2022-02-05 21:01:00 +00:00
Micah Jerome Ellison
972af21bca
Add reference documentation to docs site and separate out "Tips and Tricks" and "External Editors" from "Recipes" (#1332)
* First draft of command line reference, mostly pulled from help screen

* Add first draft of config file reference, mostly pulled from advanced.md

* Clean up config file doc for readability

* Add --config-file and remove examples from CLI reference

* Add warning about time zone in timeformat

* More small changes, and adding template config keyword

* Cleaning up and re-ordering config file reference

* Clean up reference and anything else from advanced documentation that can live elsewhere and linking to config file reference wherever config file is mentioned

* Fix syntax highlighting in command line reference, clean up content a bit, include --diagnostic

* Mention version config key

* Apply minor changes suggested in PR review

* Rename "recipes" to "Tips and Tricks", pull "External Editors" out of it into its own page, and redirect old recipes link to tips-and-tricks

* Revert broken mkdocs-redirects usage from last commit
2022-02-05 12:59:20 -08:00
Jrnl Bot
967ec86d9d Update changelog [ci skip] 2022-02-05 20:05:36 +00:00
dependabot[bot]
a8f0b18219
Bump black from 21.12b0 to 22.1.0 (#1404)
* Bump black from 21.12b0 to 22.1.0

Bumps [black](https://github.com/psf/black) from 21.12b0 to 22.1.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits/22.1.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run make format

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-02-05 12:04:06 -08:00
Jrnl Bot
0773d6b1d3 Update changelog [ci skip] 2022-02-05 19:45:38 +00:00
dependabot[bot]
b1e228ea40
Bump asteval from 0.9.25 to 0.9.26 (#1400)
Bumps [asteval](https://github.com/newville/asteval) from 0.9.25 to 0.9.26.
- [Release notes](https://github.com/newville/asteval/releases)
- [Commits](https://github.com/newville/asteval/compare/0.9.25...0.9.26)

---
updated-dependencies:
- dependency-name: asteval
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-05 11:44:06 -08:00
Jrnl Bot
5463476a00 Update changelog [ci skip] 2022-01-22 18:17:22 +00:00
dependabot[bot]
aa2c77abfc
Bump ipython from 7.28.0 to 7.31.1 (#1401)
Bumps [ipython](https://github.com/ipython/ipython) from 7.28.0 to 7.31.1.
- [Release notes](https://github.com/ipython/ipython/releases)
- [Commits](https://github.com/ipython/ipython/compare/7.28.0...7.31.1)

---
updated-dependencies:
- dependency-name: ipython
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-22 10:15:36 -08:00
Jonathan Wren
1fbb788528
Unskip some tests (#1399)
* remove skip_editor test and tag

* remove useless test

* unskip blank input test

* formatting

* rename test so it doesn't overwrite other test

* unskip some dayone tests that now work
2022-01-15 14:45:00 -08:00
Jrnl Bot
49930e16f7 Update changelog [ci skip] 2022-01-15 20:14:21 +00:00
dependabot[bot]
5555557cec
Bump cryptography from 36.0.0 to 36.0.1 (#1389)
Bumps [cryptography](https://github.com/pyca/cryptography) from 36.0.0 to 36.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/36.0.0...36.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-15 12:12:39 -08:00
Jrnl Bot
d0921fb7b6 Update changelog [ci skip] 2022-01-08 22:52:46 +00:00
Jonathan Wren
e7f24527c3
Fix styling on documentation sidebar (#1395)
* fix sidebar stling in docs theme

* don't display heading levels higher than 3 in sidebar

* update sitemap step for easier debugging

* add matrix so github doesn't get confused
2022-01-08 14:51:02 -08:00
Jrnl Bot
c4c60efab2 Update changelog [ci skip] 2022-01-08 20:44:40 +00:00
dependabot[bot]
bf757bdc90
Bump keyring from 23.4.0 to 23.5.0 (#1392)
Bumps [keyring](https://github.com/jaraco/keyring) from 23.4.0 to 23.5.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.4.0...v23.5.0)

---
updated-dependencies:
- dependency-name: keyring
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-08 12:43:09 -08:00
Jrnl Bot
256aab9877 Update changelog [ci skip] 2022-01-08 20:38:48 +00:00
Micah Jerome Ellison
3b0c7992d2
Add weekly Saturday morning build and prevent Python 3.11 from running on PRs (#1387)
* Add weekly Saturday morning build and prevent Python 3.11 from running on PRs
* Fix extraneous greater than symbol
* Add branches and paths to cron schedule
* Add back missing hyphen before cron
* Trying to fix YAML syntax error
* Remove branches and paths from schedule
* Fix invalid conditional, push 3.11 check down to actual tests like we did with 3.10
* Separate out PR tests and scheduled tests
* Fix YAML syntax
* Fix uses action reference
* Use proper action folder structure
* Check out repo before running local action
* Specify bash shell and remove unneeded if
* Specify shell for each run statement
* Move secret out of composite action since it is not supported directly
* Fix half-fixed previous commit
* Remove extraneous ./
* Fix pathing and name steps
* take out shell key from action
* put back missing git config line in workflows

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2022-01-08 12:36:58 -08:00
Jrnl Bot
bb0d96a005 Update changelog [ci skip] 2021-12-11 20:41:46 +00:00
Jrnl Bot
2244f1ff77 Increment version to v2.8.4-beta1 2021-12-11 20:40:10 +00:00
Jrnl Bot
28b6126853 Update changelog [ci skip] 2021-12-11 20:37:19 +00:00
Jonathan Wren
2ab485de8c
Improve handling of mocking logic in pytest (#1382)
* WIP

* fix handling of user input (stdin, input, getpass)

* take out redundant pytest step

* fix handling of 'we should' statements

* fix test that doesn't use a config file

* fix another test that uses stdin

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

* remove .tool-versions file per PR feedback

* add comment to clarify why disembodied variables are here

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-12-11 12:35:32 -08:00
dependabot[bot]
3518e37087
Bump black from 21.11b1 to 21.12b0 (#1384)
Bumps [black](https://github.com/psf/black) from 21.11b1 to 21.12b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-11 12:02:30 -08:00
dependabot[bot]
e9e75ea36b
Bump keyring from 23.3.0 to 23.4.0 (#1383)
Bumps [keyring](https://github.com/jaraco/keyring) from 23.3.0 to 23.4.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.3.0...v23.4.0)

---
updated-dependencies:
- dependency-name: keyring
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-11 12:02:20 -08:00
Jrnl Bot
4552936e89 Update changelog [ci skip] 2021-12-11 19:57:33 +00:00
dependabot[bot]
bf0a4e0d1a
Bump yq from 2.12.2 to 2.13.0 (#1385)
Bumps [yq](https://github.com/kislyuk/yq) from 2.12.2 to 2.13.0.
- [Release notes](https://github.com/kislyuk/yq/releases)
- [Changelog](https://github.com/kislyuk/yq/blob/develop/Changes.rst)
- [Commits](https://github.com/kislyuk/yq/compare/v2.12.2...v2.13.0)

---
updated-dependencies:
- dependency-name: yq
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-11 11:55:55 -08:00
Jrnl Bot
ba8a59b26f Update changelog [ci skip] 2021-11-27 19:52:07 +00:00
dependabot[bot]
a3aeb38611
Bump cryptography from 35.0.0 to 36.0.0 (#1379)
Bumps [cryptography](https://github.com/pyca/cryptography) from 35.0.0 to 36.0.0.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/35.0.0...36.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-27 11:49:27 -08:00
dependabot[bot]
9e99a2ea96
Bump keyring from 23.2.1 to 23.3.0 (#1381)
Bumps [keyring](https://github.com/jaraco/keyring) from 23.2.1 to 23.3.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.2.1...v23.3.0)

---
updated-dependencies:
- dependency-name: keyring
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-27 11:47:51 -08:00
Jrnl Bot
882721f859 Update changelog [ci skip] 2021-11-20 19:58:26 +00:00
dependabot[bot]
03940ad598
Bump black from 21.10b0 to 21.11b1 (#1375)
Bumps [black](https://github.com/psf/black) from 21.10b0 to 21.11b1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-20 11:56:41 -08:00
Jrnl Bot
a1f6d78e04 Update changelog [ci skip] 2021-11-20 19:49:53 +00:00
Piero Lescano
ba3fd2202f
Add added option to _print_edited_summary (#1366)
* Add added option to _print_edited_summary

* Add tests for counts of entries added, modified, and deleted

* Add test for modifying an entry rather than replacing it

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-11-20 11:47:56 -08:00
Jrnl Bot
ffc8bdd5f1 Update changelog [ci skip] 2021-11-13 22:54:50 +00:00
Micah Jerome Ellison
5e45f305ac
Use full Python version for GitHub Actions cache key (#1373) 2021-11-13 14:52:42 -08:00
dependabot[bot]
55dd9484c9
Bump mkdocs from 1.1 to 1.2.3 in /docs_theme (#1360)
Bumps [mkdocs](https://github.com/mkdocs/mkdocs) from 1.1 to 1.2.3.
- [Release notes](https://github.com/mkdocs/mkdocs/releases)
- [Commits](https://github.com/mkdocs/mkdocs/compare/1.1...1.2.3)

---
updated-dependencies:
- dependency-name: mkdocs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-13 11:48:27 -08:00
Jrnl Bot
bbfa32a115 Update changelog [ci skip] 2021-11-06 21:27:23 +00:00
Jrnl Bot
7a70bbc51e Increment version to v2.8.4-beta 2021-11-06 21:25:54 +00:00
Jrnl Bot
93d59edb67 Update changelog [ci skip] 2021-11-06 21:19:41 +00:00
Micah Jerome Ellison
06ee6db7e7
Use Python 3.10 stable in CI (#1362)
* Remove special case code needed for Python 3.10 pre-release and try to get Python 3.11 pre-release running on CI
* Wrap 3.10 in quotes so it doesn't resolve to 3.1
* Remove pflake --version call that is crashing in Python 3.11-dev
* Run poetry update and restore removed flake8 line
2021-11-06 14:18:00 -07:00
Jrnl Bot
a354b13139 Update changelog [ci skip] 2021-11-06 21:14:16 +00:00
samuelgregorovic
ae009099ed
Add --config-file argument to use alternate config file at runtime (#1290)
* added new CLI argument option --config-file

* pass argument and fetch alt config file if specified

* argparse argument setting update

* argument alias --cf added

* documentation update - usage of CLI argument

* fixed name-clash + unit tests

* feature test added

* #1170-alternate-config-file: Auto stash before rebase of "refs/heads/#1170-alternate-config-file"

* Update docs/advanced.md

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>

* BDD tests added

* Begin migrating/rewording --cf tests in pytest-bdd.

Uses current directory instead of deep directory structure, but requires a given for each config file referenced

* Fix issue where specifying a config-file that needs to be upgraded ended up upgrading the user config file instead

* Uncomment and rework remaining tests for pytest-bdd instead of behave

* Fix copytree for Python 3.7 (which doesn't support dirs_exist_ok)

* Minor fixes to alternative config examples

* Remove behave tests (behave is no longer in use)

* Move config file unit test to unit test dir and use pytext path fixture instead of current directory to find test data

* Use explicit "given the config exists" for copying config files instead of shoehorning in "given we use the config" twice

* Change when/when to when/and

* Clarify scenarios and fix indentation

* Confirm primary config file isn't modified when encrypting/decrypting a journal in an alternate config file

* Remove try/except on copytree since I'm no longer using the same

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-11-06 14:12:34 -07:00
Jrnl Bot
5057c290c1 Update changelog [ci skip] 2021-11-06 20:39:19 +00:00
dependabot[bot]
e242aa4ced
Bump pytest-bdd from 4.1.0 to 5.0.0 (#1368)
Bumps [pytest-bdd](https://github.com/pytest-dev/pytest-bdd) from 4.1.0 to 5.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-bdd/releases)
- [Changelog](https://github.com/pytest-dev/pytest-bdd/blob/master/CHANGES.rst)
- [Commits](https://github.com/pytest-dev/pytest-bdd/compare/4.1.0...5.0.0)

---
updated-dependencies:
- dependency-name: pytest-bdd
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-06 13:37:54 -07:00
Jrnl Bot
e082156779 Update changelog [ci skip] 2021-11-06 20:32:07 +00:00
Ben Beasley
99c19b2a64
Support pytest-bdd 5.x (#1365)
https://github.com/pytest-dev/pytest-bdd/blob/5.0.0/README.rst#migration-of-your-tests-from-versions-4xx
2021-11-06 13:30:25 -07:00
Jrnl Bot
f608e176c1 Update changelog [ci skip] 2021-11-06 20:26:39 +00:00
dependabot[bot]
8cabf0f87a
Bump black from 21.9b0 to 21.10b0 (#1370)
Bumps [black](https://github.com/psf/black) from 21.9b0 to 21.10b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-06 13:24:50 -07:00
Jrnl Bot
b4ccf44d3a Update changelog [ci skip] 2021-10-23 19:19:39 +00:00
Fabian Affolter
c68c13ab6e
Switch to poetry-core (#1359) 2021-10-23 12:17:32 -07:00
Jrnl Bot
54c9a058df Update changelog [ci skip] 2021-10-16 22:23:23 +00:00
Micah Jerome Ellison
b1ba88c138
Migrate contributing.md to docs site (#1266)
* Initial migration of contributing.md to docs site
* Update contributing to include pytest-bdd changes
* add top level section support, and h2 support in sidebar
* Incorporate latest changes to contributing.md, clean up language and formatting, and check/add links as necessary
* Add a link to milestones
* Update CONTRIBUTING.md

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-10-16 15:21:49 -07:00
dependabot[bot]
533d770753 Bump pyyaml from 5.4.1 to 6.0 (#1356)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.4.1 to 6.0.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.4.1...6.0)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-10-16 15:06:11 -07:00
Jrnl Bot
8cc891a77f Update changelog [ci skip] 2021-10-16 21:39:13 +00:00
Gianluca Mondini
156ddee97c
Fix recipe 'Launch a terminal for rapid logging' (#1351) 2021-10-16 14:37:43 -07:00
Jrnl Bot
b93b7cdfd6 Update changelog [ci skip] 2021-10-16 20:53:57 +00:00
Fidel H Viegas
9f5c2f6829
Add recipe for visualizing Markdown in the CLI (#1354)
* Added Recipe for visualizing Markdown in the CLI, fixed some typos and added backticks in all references of jrnl

* mdless recipe changes during review

-condense language
-make it sound less like an endorsement
-add link about less
-minor grammatical change

Co-authored-by: Fidel H Viegas <me@fidelhviegas.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-10-16 13:52:13 -07:00
Jrnl Bot
62dc037d80 Update changelog [ci skip] 2021-10-16 20:22:04 +00:00
dependabot[bot]
ae1ad39806
Bump mkdocs from 1.2.2 to 1.2.3 (#1355)
Bumps [mkdocs](https://github.com/mkdocs/mkdocs) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/mkdocs/mkdocs/releases)
- [Commits](https://github.com/mkdocs/mkdocs/compare/1.2.2...1.2.3)

---
updated-dependencies:
- dependency-name: mkdocs
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-16 13:20:14 -07:00
Jrnl Bot
d347dac19e Update changelog [ci skip] 2021-10-09 19:11:41 +00:00
Jonathan Wren
44edb9bdee
Add more steps to pytest, fully remove behave (#1347)
* update yaml loader to new method

* Add config overrides steps to pytest

This requires some patching around the config object, which now happens
in every test.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

* udpate docs for new tests

* remove behave from deps

* remove feature dir from flake8 checks

* udpate lock file

* disable pip version check (it keeps spamming the pipeline)

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-10-09 12:10:08 -07:00
Jrnl Bot
a98f3f78af Update changelog [ci skip] 2021-10-09 18:45:22 +00:00
dependabot[bot]
1196b05ff6
Bump pytz from 2021.1 to 2021.3 (#1348)
Bumps [pytz](https://github.com/stub42/pytz) from 2021.1 to 2021.3.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](https://github.com/stub42/pytz/compare/release_2021.1...release_2021.3)

---
updated-dependencies:
- dependency-name: pytz
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-09 11:43:43 -07:00
Jonathan Wren
7d8823da6d
Move remaining tests from behave to pytest (#1346)
* add newer tests to pytest (from behave)

* remove 'lib' from gitignore (since we're using it)

* fix capitalization in some steps

* add 'the editor should not have been called' step

* comment out config override step in pytest-bdd since it's not implemented yet

* remove test that didn't really test anything

* implement some missing steps in pytest-bdd

* change comment to match other tests
2021-10-02 13:31:21 -07:00
Jrnl Bot
593245f3fd Update changelog [ci skip] 2021-10-02 19:24:53 +00:00
dependabot[bot]
60c9ed124d
Bump cryptography from 3.4.8 to 35.0.0 (#1345)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.8 to 35.0.0.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.8...35.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-02 12:23:17 -07:00
Micah Jerome Ellison
4c0fb344d1
Add CACHE_STRING secret to bust GitHub Actions python cache (#1344)
* Add CACHE_STRING secret to allow maintainers to bust cache without a commit

* Quick change

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-09-25 11:11:28 -07:00
Jrnl Bot
9f16cc42f5 Update changelog [ci skip] 2021-09-18 23:28:00 +00:00
Micah Jerome Ellison
614be34081
Document journal types (#1331)
* Add docs section for journal types
* Include new journal types docs section in site nav
* Add section on changing a journal type and clean up work from previous commit
2021-09-18 16:26:28 -07:00
Jrnl Bot
b932cfc9ad Update changelog [ci skip] 2021-09-18 19:53:58 +00:00
dependabot[bot]
73806c2d30
Bump keyring from 23.1.0 to 23.2.1 (#1342)
Bumps [keyring](https://github.com/jaraco/keyring) from 23.1.0 to 23.2.1.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.1.0...v23.2.1)

---
updated-dependencies:
- dependency-name: keyring
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-18 12:52:14 -07:00
Jrnl Bot
79e3c94669 Update changelog [ci skip] 2021-09-18 19:51:58 +00:00
dependabot[bot]
f67e8947a5
Bump black from 21.8b0 to 21.9b0 (#1343)
Bumps [black](https://github.com/psf/black) from 21.8b0 to 21.9b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-18 12:50:26 -07:00
Jrnl Bot
d968730adf Update changelog [ci skip] 2021-09-18 19:33:41 +00:00
Micah Jerome Ellison
fabdac887e
Fix splash image for PyPi (I hope) and add changelog badge (#1339) 2021-09-18 12:31:45 -07:00
Jrnl Bot
6f6ee7b54f Update changelog [ci skip] 2021-09-06 19:57:05 +00:00
dependabot[bot]
087b038d77
Bump black from 21.7b0 to 21.8b0 (#1333)
Bumps [black](https://github.com/psf/black) from 21.7b0 to 21.8b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-06 12:55:29 -07:00
Jrnl Bot
73145888e6 Update changelog [ci skip] 2021-09-06 19:55:02 +00:00
dependabot[bot]
3615abd4e2
Bump pytest from 6.2.4 to 6.2.5 (#1334)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.4 to 6.2.5.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.4...6.2.5)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-06 12:53:18 -07:00
Jrnl Bot
72f2d14427 Update changelog [ci skip] 2021-09-06 19:44:30 +00:00
Jrnl Bot
8ccaf4ac1d Increment version to v2.8.3 2021-09-06 19:43:07 +00:00
Jrnl Bot
778c1de6eb Update changelog [ci skip] 2021-08-28 23:00:37 +00:00
Jrnl Bot
a32aefe541 Increment version to v2.8.3-beta 2021-08-28 22:58:59 +00:00
Jrnl Bot
3c561af93d Update changelog [ci skip] 2021-08-28 20:22:11 +00:00
dependabot[bot]
7eaeef821e
Bump cryptography from 3.4.7 to 3.4.8 (#1329)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.7 to 3.4.8.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.7...3.4.8)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-28 13:20:25 -07:00
Jrnl Bot
7030185e4f Update changelog [ci skip] 2021-08-28 20:20:16 +00:00
Micah Jerome Ellison
5abf974682
Fix deletion of entries on folder journal through --delete flag (#1328)
* Re-enable failing folder/DayOne tests
* Disable dayone tests again - out of scope for this problem
* Fix folder journal deletion by tracking which dates are associated with deleted entries
2021-08-28 13:18:34 -07:00
Micah Jerome Ellison
fa146b1434
Warn when DayOne/directory journals have encrypt: true in config (#1325)
* Raise exception when trying to commit folder-based journal (including DayOne)
* Change negative bool name to a positive
* Add test to ensure this doesn't mess with encrypting normal journals
* Consolidate and standardized tests
* Add failing test for new error message about unencryptable journals
* Warn when encrypt is true and journal type is directory/DayOne
2021-08-21 14:47:49 -07:00
Jrnl Bot
c52e878c01 Update changelog [ci skip] 2021-08-21 21:44:38 +00:00
Micah Jerome Ellison
050c17ee06
Allow emoji in config file in Windows by always opening it as unicode (#1313)
* Open config file as utf-8 always
* Add test for journal with emoji name
2021-08-21 14:43:11 -07:00
Micah Jerome Ellison
7109374d42
Fix failure to import into directory journal (#1314)
* Re-enable failing directory journal import tests
* Appropriately track journal name and modified entries in FolderJournal when importing
* Run make format
2021-08-21 14:42:31 -07:00
Jonathan Wren
08350b884b
take out redundant lines from PR template (#1327) 2021-08-21 14:00:31 -07:00
Jrnl Bot
bacbf8109b Update changelog [ci skip] 2021-08-21 20:48:08 +00:00
Micah Jerome Ellison
3e5a55b1e9
Display error when trying to encrypt folder/DayOne journal types (#1315)
* Raise exception when trying to commit folder-based journal (including DayOne)
* Add test to ensure this doesn't mess with encrypting normal journals
* Consolidate and standardized tests
2021-08-21 13:46:29 -07:00
Jrnl Bot
9de723d014 Update changelog [ci skip] 2021-08-21 19:10:25 +00:00
Micah Jerome Ellison
a0a3ef669e
Set bash as default shell (#1324) 2021-08-21 12:08:44 -07:00
Jrnl Bot
1c63d94736 Update changelog [ci skip] 2021-08-17 03:24:18 +00:00
dependabot[bot]
32b5a2b5d0
Bump keyring from 23.0.1 to 23.1.0 (#1318)
Bumps [keyring](https://github.com/jaraco/keyring) from 23.0.1 to 23.1.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.0.1...v23.1.0)

---
updated-dependencies:
- dependency-name: keyring
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-16 20:22:39 -07:00
Jonathan Wren
3b93e92960
take out arg for old plugin from makefile (#1322) 2021-08-16 20:13:44 -07:00
Jrnl Bot
5ec7dec9f0 Update changelog [ci skip] 2021-08-17 02:47:47 +00:00
Jonathan Wren
8a64b77e63
Update build to poetry alpha 2 for python 3.10 (#1320)
* udpate build to poetry alpha 2 for python 3.10

* update testing workflow to run when workflow itself is changed
2021-08-16 19:46:01 -07:00
Jrnl Bot
b23c831da5 Update changelog [ci skip] 2021-07-31 19:11:33 +00:00
Jrnl Bot
eaaa7bb0e1 Increment version to v2.8.2 2021-07-31 19:10:05 +00:00
Jrnl Bot
c49853d724 Update changelog [ci skip] 2021-07-31 18:47:00 +00:00
dependabot[bot]
642155292a
Bump mkdocs from 1.2.1 to 1.2.2 (#1307)
Bumps [mkdocs](https://github.com/mkdocs/mkdocs) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/mkdocs/mkdocs/releases)
- [Commits](https://github.com/mkdocs/mkdocs/compare/1.2.1...1.2.2)

---
updated-dependencies:
- dependency-name: mkdocs
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-31 11:45:19 -07:00
Micah Jerome Ellison
c9c6e7efc1
Fix typo in --help (#1309) 2021-07-31 11:43:19 -07:00
Jrnl Bot
1ba1b756c9 Update changelog [ci skip] 2021-07-17 22:17:56 +00:00
Jrnl Bot
f158d7f266 Increment version to v2.8.2-beta 2021-07-17 22:16:08 +00:00
Jrnl Bot
cef3a98b4e Update changelog [ci skip] 2021-07-17 20:23:48 +00:00
Micah Jerome Ellison
31f782e333
Add documentation about saved passwords in Windows (#1301)
* Add note about saved passwords
* Add missing yq dep back in to allow xq to run in mkdocs CI pipeline
2021-07-17 13:22:01 -07:00
Jrnl Bot
3e95a46bd2 Update changelog [ci skip] 2021-07-17 19:15:00 +00:00
dependabot[bot]
52c0a0ebf3
Bump python-dateutil from 2.8.1 to 2.8.2 (#1302)
Bumps [python-dateutil](https://github.com/dateutil/dateutil) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/dateutil/dateutil/releases)
- [Changelog](https://github.com/dateutil/dateutil/blob/master/NEWS)
- [Commits](https://github.com/dateutil/dateutil/compare/2.8.1...2.8.2)

---
updated-dependencies:
- dependency-name: python-dateutil
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-17 12:13:19 -07:00
Jrnl Bot
b896c85bf0 Update changelog [ci skip] 2021-07-17 19:03:29 +00:00
Micah Jerome Ellison
7b72b24ee2
Add first draft of security.md (#1299) 2021-07-17 12:01:59 -07:00
Jonathan Wren
e771c9da81
Update lock file from poetry stable version (#1298) 2021-07-10 13:53:00 -07:00
Jrnl Bot
9bd395007f Update changelog [ci skip] 2021-07-10 19:14:56 +00:00
Micah Jerome Ellison
2723e1cfb5
Add Python 3.10 support (#1271)
* Add Python 3.10 support

* Change Python 3.10 to 3.10-dev in CI

* Run poetry update

* Turn off fail-fast to troubleshoot

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>

* Add continue-on-error for 3.10

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>

* use prerelease poetry for prerelease python

* fix syntax error

* rename steps to make more sense

* remove dev dependency that breaks with python 3.10

* update tests

* Change test dependencies for minimal breakage on python 3.10

- loosen the test dep requirements (so we get warned about these
  problems sooner)
- add new extras group to provide minimal deps required for testing (we
  don't need to run static analysis again on every version)

* change how we check if deps are installed so test don't run wild

* add setuptools due to poetry bug, clean up other steps

* update lock file

* test

* Revert "test"

This reverts commit 31e538300e.

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-10 12:13:15 -07:00
Jrnl Bot
56df419bea Update changelog [ci skip] 2021-07-03 22:52:14 +00:00
Micah Jerome Ellison
9e3153453e
Change all instances of FullLoader to SafeLoader (#1285) 2021-07-03 15:50:36 -07:00
Jonathan Wren
26484130c3 remove old comment 2021-07-03 15:49:18 -07:00
Jonathan Wren
495956d907 remove init file that is no longer neded 2021-07-03 15:49:18 -07:00
Jonathan Wren
d95dab9f0c add actual lib directory even though it's in gitignore for some reason 2021-07-03 15:49:18 -07:00
Jonathan Wren
f99411f2f9 move some files around because pytest is being weird 2021-07-03 15:49:18 -07:00
Jonathan Wren
cdad0d6289 Replace pyflakes with flake8 for linting 2021-07-03 15:49:18 -07:00
Jonathan Wren
c5a7d7027c Move pytest-bdd code into separate files
Now that all the tests are passing, this breaks them up into a few
different files to make everything more organized.

Note: Pyflakes is complaining about some unused import statements.
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
54e5e96ad2 Force GitHub Actions to preserve line endings
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
fd349fb0fc Implement ExitStack to handle mocks in pytest-bdd
- Fix failing DayOne test
- Make format and clean up extraneous comment

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
0c8efd5331 Cleanup last few tests
- Misc linting issues
- Whitespace cleanup
- Entire test suite is now passing
- Add misc todo items in comments

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
5572833652 Rewrite config checking steps in pytest-bdd
- Take out old type coersion (it was causing needles complexity)
- Take out `read_value_from_string` function
- Use taml parser to parse yaml instead of using custom function
- Update tests to use new implementation

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
b7b7bad2fb Clarify and cleanup tests
- Run formatter
- Take out old tags
- Use new steps on tests

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
44b1762b7d Implement stream redirection in pytest-bdd
- Take out old steps from format and input tests

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
512fb63e1f Implement test to check editor temporary filename
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
5d4d68fe32 Implement directory changing and relative directory test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
7647755e96 Implement journal existence check
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
ef25c50e16 Implement step for directory journals
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
4aabb73847 Implement datetime handling in pytest-bdd
- This was awful and convoluted

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
cda07bf8d9 Make steps use new config file
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
e19fab0615 Add new config file (for use in pytest-bdd)
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
e0980cf396 Update tests to use more scenario outlines
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
3d29b6b6a1 Fix star and tag feature language and add output should be empty test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
8faa3ae32d Update tests to use new steps
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
d15e683955 Update search features to use new steps
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
3ddfb4d594 Implement editor-related steps in pytest-bdd
- Implement mock editor fixture
- Add fixture to keep track of editor state
- Implement various steps to check editor state

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
ce64d7973b Implement @skip_win and @skip_editor
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
36dc01bf30 Fixing custom template test and skipping some broken tests
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
148d3fdb18 Update test w/ new steps
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
a6a4417eff Fix annoying poetry-generated Windows line endings
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
849ed16d67 Install pytest-icdiff and run poetry lock
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
11e0e84dcf Fix test failing from lack of whitespace
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
430182a0a5 Implement JSON tests and remove "node" nomenclature from tests
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
48c9d9fa16 Implement tag tests in JSON
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
3cc3e387c5 Combine JSON and XML parsing tests
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
ef6ed93ecd Add JSON parsing test and combine it with XML parsing test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
3b044e3044 Ignore IO errors on Windows
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
b8c7a7c7e5 Add format tests to pytest-bdd
- Implement cache dir fixture and step
- Implement various steps to check the cache directory (files contained,
  etc)

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
e2bb8cf0de Add encryption test to pytest-bdd
- Clean up some formatting

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
3d3bd91700 Expand "we run" step to handling input better
- Use regex parser in pytest-bdd to support "we run" steps that also
  have user input ("and enter")

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
e720430aa4 Implement "should" and "should not" handling
- Handling should and should not like this should reduce the amount of
  fixtures we need for the test suite
- Add more password tests

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
c76ee8cd4f Add more password tests to pytest-bdd
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
10b604ef89 Add more password tests to pytest-bdd
- Fix some input handling in steps (especially for passwords)
- Fix some formatting issues

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
6b27126c37 Implement password prompt steps in pytest-bdd
- Scaffold some tests that will be added later
- Add fixtures for journal name and keyring type
- Add "we should be prompted for a password" step
- Add "we should not be prompted for a password" step

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
d0f92113f4 Add no keyring encryption test to pytest-bdd
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
fe018ee241 Implement test keyrings and add password tests
- Implement TestKeyring
- Implement NoKeyring
- Implement FailedKeyring
- Copy in `read_value_from_string` function from old tests (will
  probably rewrite this later)
- Add fixtures for keyrings
- Implement "we have a keyring" step
- Implement step to check specific config values for tests

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
1c78a30535 Fix bug in makefile
- Makefile no longer runs on virtual env modules
- Update some function names so pyflakes doesn't error

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
921ebdcdd5 Update mocks in "we run" step
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
5ad5bac786 Standardize line breaks in datetime tests
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
40a1a871cb Migrate the rest of the delete tests from behave to pytest bdd
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
8754837f15 Add some functioning delete tests
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
7ccadebca0 Finish migrating datetime.feature to pytest bdd
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
a529ee5d06 Add another unreadable/readable date test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
0c9b6cf85f Add unreadable date test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
f686e2b9f0 Fix local config overwrite when running pytest bdd
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
7e6dd354cf Add unreadable date test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Micah Jerome Ellison
7d04fb904a Add abbreviated weekday test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
72170304ef Expand "we run" step in pytest-bdd
- Add some necessary fixtures
- Add datetime test
- Implement "the output should not contain" step
- Implement "the output should contain the date" step

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
74ae5f039b Rename test functions for clarity
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
be05f96c26 Implement "the output should be" step
- Add another datetime test

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
6b096761e0 Re-enable test for windows on python 3.9
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
e257194d17 Add scenario outline test to datetime
- Allow config step to support scenario outlines
- Add another datetime test
- Get rid of read journal step since it doesn't work with other journal
  types (we should rely on jrnl knowing how to parse each jrnl type for
  better tests)

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
7974f30261 Make tests move into temp dir as they run
This will prevent any unexpected files from showing up anywhere outside
the temp dir

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
c500730ae6 Implement and add datetime tests
- Deletes most of the datetime tests so that they can be
  re-added as they are implemented in pytest-bdd
- Implements steps that check the journal and output for strings
- Get rid of deployment tag (we're not using it, anyway)

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
7657bd7221 Implement version-checking test
- Add new step definition

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
3055cca767 Add tests for core feature to pytest-bdd
- Implement "the output should contain" step

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
0b50ae1be0 Rename features directory to data
This is more inline with pytest standards

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
530190df7a Implement handling of temp and working dirs
Pytest-bdd uses fixtures to handle most things. This makes a fixture
that will create a temp directory for the tests to run in.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jonathan Wren
1390493a29 Install pytest-bdd (which will eventually replace behave)
- Copy over the current tests from behave into the new directory that
  pytest-bdd will use them in

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Jrnl Bot
ace6b8004c Update changelog [ci skip] 2021-07-03 22:22:37 +00:00
Ben Beasley
a9c539821f
Remove useless shebangs and executable permissions (#1283)
* Remove executable permissions from non-script files

* Remove harmless-but-useless shebang lines
2021-07-03 15:20:52 -07:00
Jrnl Bot
5e87ff1ce6 Update changelog [ci skip] 2021-06-05 20:16:47 +00:00
Micah Jerome Ellison
e84bb603eb
Ensure that line endings in all py files are Linux style instead of Windows (#1250) 2021-06-05 13:15:17 -07:00
dependabot[bot]
6fc252b2c7
Bump black from 21.5b1 to 21.5b2 (#1254)
Bumps [black](https://github.com/psf/black) from 21.5b1 to 21.5b2.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-05 13:14:05 -07:00
Jrnl Bot
104fa2caca Update changelog [ci skip] 2021-05-29 18:48:21 +00:00
dependabot[bot]
17c7f4c648
Bump black from 21.5b0 to 21.5b1 (#1244)
Bumps [black](https://github.com/psf/black) from 21.5b0 to 21.5b1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-29 11:46:46 -07:00
Jrnl Bot
c6815621df Update changelog [ci skip] 2021-05-08 19:40:25 +00:00
dependabot[bot]
b38d765759
Bump black from 20.8b1 to 21.5b0 (#1241)
* Bump black from 20.8b1 to 21.5b0

Bumps [black](https://github.com/psf/black) from 20.8b1 to 21.5b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

* Run make format with latest version of black

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-05-08 12:39:00 -07:00
Jrnl Bot
f99387b3e5 Update changelog [ci skip] 2021-05-08 19:33:41 +00:00
dependabot[bot]
b66ce460b6
Bump pytest from 6.2.3 to 6.2.4 (#1240)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.3 to 6.2.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.3...6.2.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-08 12:32:01 -07:00
Jrnl Bot
36db809588 Update changelog [ci skip] 2021-04-24 18:28:59 +00:00
Jonathan Wren
305127137a
Remove --version from brew release workflow (#1233)
Homebrew doesn't like explicitly declaring a version for a formula (it
prefers to infer it from the url), and will throw an error on PRs. So,
this removes that part of the workflow.
2021-04-24 11:27:32 -07:00
Jrnl Bot
e23909881a Update changelog [ci skip] 2021-04-24 18:09:15 +00:00
Jrnl Bot
0e9ae8ee8a Increment version to v2.8.1 2021-04-24 18:07:52 +00:00
Jrnl Bot
f13a0b5849 Update changelog [ci skip] 2021-04-20 02:26:27 +00:00
Jrnl Bot
a6362a993c Increment version to v2.8.1-beta 2021-04-20 02:24:47 +00:00
Manuel Ebert
4c5d59a5bc
Update index.html (#1229) 2021-04-14 22:47:10 -07:00
Jrnl Bot
192c05ce0d Update changelog [ci skip] 2021-04-10 23:51:26 +00:00
Suhas
dd74b14d76
More graceful handling of low linewrap values (#1219)
* behavior outline

* enforce positive initial linewrap

Check column widths

update gitignore

throw error when linewrap too small

simply check for large enough linewrap value

* delete unused error message

* PR feedback

make exception more informative

update check_linewrap signature in src and test

make check_linewrap a free function

* delete unused function

* delete else..pass block

* newline for make format
2021-04-10 16:49:56 -07:00
Jrnl Bot
1f19bd9f1e Update changelog [ci skip] 2021-04-10 18:52:04 +00:00
dependabot[bot]
202859cea1
Bump pytest from 6.2.2 to 6.2.3 (#1228)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.2 to 6.2.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.2...6.2.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-10 11:50:37 -07:00
Jrnl Bot
eebadd188a Update changelog [ci skip] 2021-03-27 20:42:44 +00:00
dependabot[bot]
002a39db2a
Bump keyring from 23.0.0 to 23.0.1 (#1222)
Bumps [keyring](https://github.com/jaraco/keyring) from 23.0.0 to 23.0.1.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.0.0...v23.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-27 13:41:11 -07:00
dependabot[bot]
1e7d682df5
Bump pyflakes from 2.3.0 to 2.3.1 (#1221)
Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](https://github.com/PyCQA/pyflakes/compare/2.3.0...2.3.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-27 13:40:49 -07:00
Jrnl Bot
e76762dd4d Update changelog [ci skip] 2021-03-27 20:24:44 +00:00
dependabot[bot]
6369026925
Bump cryptography from 3.4.6 to 3.4.7 (#1223)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.6 to 3.4.7.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.6...3.4.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-27 13:23:05 -07:00
Mandar Vaze
b357f935d4
Docs: Add emacs as external editor to recipes (#1220)
Add emacs as external editor to recipes
2021-03-27 13:21:44 -07:00
Jonathan Wren
09bcfa2242
Update brew tap for release pipeline
This was left out of a previous commit.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-03-27 13:11:45 -07:00
Jrnl Bot
50c053cf56
Update changelog [ci skip] 2021-03-27 12:32:38 -07:00
Jrnl Bot
dc95b4c098
Increment version to v2.8 2021-03-27 12:32:37 -07:00
Jrnl Bot
eb0c694cc8
Update changelog [ci skip] 2021-03-27 12:32:36 -07:00
Jonathan Wren
e116a95e34
Change PR steps for brew release
The hub cli tool wasn't working anymore, so we took it out.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-03-27 12:32:31 -07:00
dependabot[bot]
f849805a73
Bump pyflakes from 2.2.0 to 2.3.0 (#1215)
Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](https://github.com/PyCQA/pyflakes/compare/2.2.0...2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-20 10:55:59 -07:00
Jonathan Wren
7bacf4a5f0
Changelog generator fixes
There were several problems that this fixes:
- shallow fetch broke merging to release branch
- bad changelog was only outputting error msg (not exiting)
- latest version being on first line deleted itself and broke the
  changelog updates

This also has manual fixes to the changelog to bring it up to date.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-03-13 13:22:16 -08:00
Jrnl Bot
1c66ac2da2 Increment version to v2.8-beta 2021-03-13 19:29:14 +00:00
dependabot[bot]
98863bcc23
Bump keyring from 22.3.0 to 23.0.0 (#1213)
Bumps [keyring](https://github.com/jaraco/keyring) from 22.3.0 to 23.0.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v22.3.0...v23.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-13 11:09:59 -08:00
Jrnl Bot
1714d1eeef Increment version to v2.7.2-beta 2021-03-06 22:18:39 +00:00
Micah Jerome Ellison
df151d4dbc Add --local flag in git config calls 2021-03-06 14:05:48 -08:00
Micah Jerome Ellison
6639546413 Remove global flag from git config 2021-03-06 14:01:03 -08:00
Micah Jerome Ellison
06e5b4baf6
Fix broken brew release process (#1211)
* Add homebrew symlink for releases
* Fix indentation problem
* Fix bad env var name
* Change filename to formula name
* Fix formula name
* Attempt tap instead of symlink
* Fix formula repo referece
* add tracer
* Attempt working directory fix
* Remove --unshallow
* Use token for remote
* Move set tap directory step
* Remove tracer
* Clean up spacing and wrap quotes to tap directory
2021-03-06 13:47:11 -08:00
Jrnl Bot
c3ddd7f2bf Update changelog [ci skip] 2021-03-06 18:48:31 +00:00
Suhas
a3f4f6b944
Fix bug that prevented --format pretty and --format short from working (#1177) 2021-03-06 10:47:03 -08:00
Jrnl Bot
b9a6d029e2 Update changelog [ci skip] 2021-03-06 15:20:14 +00:00
Micah Jerome Ellison
b9cf470871
Add pypi links for documentation, issue tracking, and funding (#1204) 2021-03-06 07:18:35 -08:00
Jrnl Bot
5a44385a54 Update changelog [ci skip] 2021-03-03 02:51:39 +00:00
dependabot[bot]
0560963c63
Bump keyring from 22.0.1 to 22.3.0 (#1210)
Bumps [keyring](https://github.com/jaraco/keyring) from 22.0.1 to 22.3.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v22.0.1...v22.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-02 18:49:50 -08:00
dependabot[bot]
1d222d67d5
Bump asteval from 0.9.22 to 0.9.23 (#1209)
Bumps [asteval](https://github.com/newville/asteval) from 0.9.22 to 0.9.23.
- [Release notes](https://github.com/newville/asteval/releases)
- [Commits](https://github.com/newville/asteval/compare/0.9.22...0.9.23)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-02 18:49:29 -08:00
Suhas
4f79803885
Allow runtime configuration overrides from the commandline (#1169)
Add --config-override feature

* add test and argument handler for runtime override of configurations.
* identify location to apply override in "main"
* update gitignore
* remove unneeded import
* add jrnl interface test for overriden configurations
* trivial whitespace change
* implement runtime override
* make format
* refactor override unittest
* clean up unused import
* start writing integration test
* add linewrap override scenario
* implement editor override step
* add dev dependencies on pytest -mock and -cov
* make format
* remove unused imports
* make format
* rename --override to --config-override
* move override implementation into own module
* begin TDD of dot notated overrides
* rewrite behavior scenario
* implement recursive config overrides
* clean up unittests
* iterate on behave step
* make format
* cleanup
* move override behave tests out of core
* refactor recursive code
* make format
* code cleanup
* remove unused import
* update test config
* rewrite test for better mock call expect
* make format
* binary search misbehaving windows test
* unittest multiple overrides
* uncomment dot notation unittest
* add multiple override scenario spec
* make format
* make format
* update unittests for new syntax
* update integ tests for new syntax
* update gitignore
* guard override application
* deserialize function as return type
* make format
* organize deserialization unittests
* better, more specific behave tests
* test different editor launch commands
* formatting
* handle datatypes in deserialization and update helptext
* stick to config convention in testbed
* update tests ith better verifications
* make format
* space
* review feedbac
* make format
* skip on win
* update deps
* update tests with better verifications
make format
space
review feedbac
* skip on win
* update deps
* refactor deserialization
organize test_parse_args
make format
* skip on win
* refactor deserialization
organize test_parse_args
make format
* update tests ith better verifications
* make format
* space
* make format
* document apply_overrides
* update gitignore
* document config-override enhancement
* Simplify config override syntax (#5)
* update tests and expected behavior
* clean up arg parsing tests
* update deserialization
* update deserialization
* config argparse action
* update override application logic
* update tests; delete unused imports
* override param must be list
* update docstring
* update test input to SUT
* update remaining override unittests
* make format
* forgot to update CLI syntax
* update documentation to sphinx style
* variable renames
* Lockfile merge (#7)
* Add brew and gitter badges to README
* Update changelog [ci skip]
* Make journal selection behavior more consistent when there's a colon with no date (#1164)
* Simplify config override syntax (#8)
* update tests and expected behavior
* clean up arg parsing tests
* update deserialization
* update deserialization
* config argparse action
* update override application logic
* update tests; delete unused imports
* override param must be list
* update docstring
* update test input to SUT
* update remaining override unittests
* make format
* forgot to update CLI syntax
* formatting
* Update pyproject.toml
* update lockfile to remove pytest-cov and pytest-mock deps
* update docs
* reuse existing mock; delete unneeded code
* move overrides earlier in the execution
use existing configs instead of custom
make format
clean up imports
* update for passworded access
context.parser -> parsed_args
* test that no editor is launched
* remove unnecessary mocks
* rename variable for intent
* reinstate getpass deletion
* update gitignore
* capture failure mode
* remove unneeded imports
* renamed variable
* delete redundant step
* comment on step
* clean up step behavior description
* [WIP] lock down journal access behavior
* skip -> wip
* correct command for overriding journal via dot keys
* update wip test for updating a "temp" journal and then reading baack its entries
* remove "mock" from poetry file
* make CI happy
* complex behavior sequence for default journal override
* separate out smaller pieces of logic
test that apply_overrides acts on base configuration and not the copy
* defer modification of loaded configuration to update_config
remove unused fixtures
delete complicated UT since behavior is covered in overrides.feature integ test
delete redundant UT
* Update .gitignore
* remove skip_win
* forward override unpacking to yaml library
* merge config override step with existing config_var step in core
delete config_override step
unify step description syntax
* delete unused and redundant code
* rebases are hard
* remove wip tag from test
* remove skipped tests for windows
* Address code review
yield -> return
remove needless copy
adjust spacing
re-inline args return
reset packaging info to e6c0a16342
revert package version for this PR
* consolidate imports
* Defer config_override unpacking to dict *after* base config is loaded
store cli overrides without unpacking just yet
move deserialize_config_args to config module
delete custom Action class for config operations
apply [k,v] -> {k, v} for each override
update test data
update import
* rename deserialize_config_args to better express intent
make format
2021-03-02 18:47:57 -08:00
Jrnl Bot
b99cebcee6 Update changelog [ci skip] 2021-02-27 19:05:55 +00:00
Jrnl Bot
2ac4bab4d5 Increment version to v2.7.1 2021-02-27 19:04:21 +00:00
Jrnl Bot
f7c78f63a0 Update changelog [ci skip] 2021-02-27 18:55:07 +00:00
Suhas
67682e7e93
Add per-journal config documentation (#1199)
* update documentation with example config

* make format

* clarify meaning of config
2021-02-27 10:53:21 -08:00
Jrnl Bot
e6c0a16342 Update changelog [ci skip] 2021-02-20 19:52:38 +00:00
Jrnl Bot
021ec61a81 Increment version to v2.7.1-beta 2021-02-20 19:50:52 +00:00
Jrnl Bot
0e90342b02 Update changelog [ci skip] 2021-02-20 19:32:09 +00:00
dependabot[bot]
487b0c44ae
Bump cryptography from 3.4.4 to 3.4.6 (#1195)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.4 to 3.4.6.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.4...3.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-20 11:30:33 -08:00
Jrnl Bot
76fd132409 Update changelog [ci skip] 2021-02-13 19:15:50 +00:00
dependabot[bot]
0d61e102c0
Bump asteval from 0.9.21 to 0.9.22 (#1189)
Bumps [asteval](https://github.com/newville/asteval) from 0.9.21 to 0.9.22.
- [Release notes](https://github.com/newville/asteval/releases)
- [Commits](https://github.com/newville/asteval/compare/0.9.21...0.9.22)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-13 11:14:13 -08:00
dependabot[bot]
3df5c62b5e
Bump cryptography from 3.3.1 to 3.4.4 (#1188)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.3.1 to 3.4.4.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.3.1...3.4.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-13 11:14:03 -08:00
dependabot[bot]
2244672e33
Bump yq from 2.11.1 to 2.12.0 (#1186)
Bumps [yq](https://github.com/kislyuk/yq) from 2.11.1 to 2.12.0.
- [Release notes](https://github.com/kislyuk/yq/releases)
- [Changelog](https://github.com/kislyuk/yq/blob/develop/Changes.rst)
- [Commits](https://github.com/kislyuk/yq/compare/v2.11.1...v2.12.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-13 11:13:24 -08:00
Micah Jerome Ellison
dc776b171a
Fix case on documentation tag in issue template 2021-02-06 14:10:21 -08:00
Jrnl Bot
3f3bdbeeda Update changelog [ci skip] 2021-02-06 20:19:19 +00:00
dependabot[bot]
115f790210
Bump pytz from 2020.5 to 2021.1 (#1174)
Bumps [pytz](https://github.com/stub42/pytz) from 2020.5 to 2021.1.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](https://github.com/stub42/pytz/compare/release_2020.5...release_2021.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-06 12:17:40 -08:00
Jrnl Bot
eca002ac29 Update changelog [ci skip] 2021-01-30 21:49:37 +00:00
dependabot[bot]
6e28b0b4a1
Bump keyring from 21.8.0 to 22.0.1 (#1168)
Bumps [keyring](https://github.com/jaraco/keyring) from 21.8.0 to 22.0.1.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v21.8.0...v22.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-30 13:48:08 -08:00
dependabot[bot]
fbb40b75f6
Bump pytest from 6.2.1 to 6.2.2 (#1167)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.1...6.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-30 13:47:37 -08:00
Jonathan Wren
ea845a8408
Make journal selection behavior more consistent when there's a colon with no date (#1164) 2021-01-30 13:47:26 -08:00
Jrnl Bot
ac0c49918d Update changelog [ci skip] 2021-01-30 21:34:06 +00:00
Micah Jerome Ellison
bd1c5c3f62
Add brew and gitter badges to README 2021-01-30 13:31:24 -08:00
eshrh
8a78c34917
Support title splitting for fullwidth CJK terminals (#1163)
* Split by fullwidth terminals without spaces.
* Add test
* Update write.feature
2021-01-23 15:29:43 -08:00
Jrnl Bot
ef563c807f Update changelog [ci skip] 2021-01-23 22:51:22 +00:00
Jrnl Bot
a32070b08a Increment version to v2.7 2021-01-23 22:49:45 +00:00
Jrnl Bot
9f386163a4 Update changelog [ci skip] 2021-01-23 21:37:04 +00:00
Micah Jerome Ellison
897943857d
Simplify VS Code documentation for all platforms and add note about PATH variable (#1160) 2021-01-23 13:35:32 -08:00
Jrnl Bot
b535782621 Update changelog [ci skip] 2021-01-23 21:29:43 +00:00
dependabot[bot]
ea7357ca26
Bump pyyaml from 5.3.1 to 5.4.1 (#1158)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4.1.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-23 13:27:54 -08:00
Jonathan Wren
f80f033d5d
fix typos 2021-01-17 11:22:02 -08:00
Jrnl Bot
99d0198530 Update changelog [ci skip] 2021-01-17 01:42:03 +00:00
Jonathan Wren
c06b5cf297
Fix homebrew release, add options for relase pipeline (#1154) 2021-01-16 17:40:09 -08:00
Jrnl Bot
2e254d55fb Update changelog [ci skip] 2021-01-16 23:22:56 +00:00
Jrnl Bot
b117c7a260 Increment version to v2.7-beta 2021-01-16 23:20:59 +00:00
Micah Jerome Ellison
9e6cd8820f
Fix OS compatibility issues for editors with spaces, slashes, and quotes (#1153)
* Fix inverted POSIX check, refactor os_compat, and add tests for it
* Fix missing parentheses and remove skip_win on test that is passing in Windows now
* Fix expected quotes in quoted args
* Make  output clearer on failing test
* Bringing skip_win back to test whose failure is a bit more complicated than expected
2021-01-16 15:19:11 -08:00
Jrnl Bot
b6b6e7750e Update changelog [ci skip] 2021-01-16 22:57:15 +00:00
Karim Rahal
f0e8fa2060
Add new -today-in-history, -month, -day, and -year search filters (#1145)
* Introduce -reminisce, -month, -day, and -year
* Update expected_args in parse_args tests
* Add check before creating compare_d
* Misc changes
* Implement testing for -month, -day, -year, and -reminisce
* Compress tests into one Scenario Outline
* Fix failing tests by updating dates_similar journal
* Create 'we set current date and time to' step
* Use time.parse in reminisce
* Update dates_similar journal
* Make 'Searching in a journal' test shorter
* Lint
* Implement reminiscing test
* Add combination tests
* Finalize tests
* Finalize pytests
* Simplify reminisce tests
* Change reminsice help (since it also shows today's entries)
* Re-do tests; use various tests
* Remove old test data
* Better scenario description
* Standardize format for compare_d
* Rename -reminisce to -today-in-history
2021-01-16 14:55:27 -08:00
Jrnl Bot
18058c74e5 Update changelog [ci skip] 2021-01-16 22:52:40 +00:00
Karim Rahal
a6b828e892
Add new date format (--format date) for heatmapping (#1146)
* Create datecount plugin
* Fix plugin import
* Update datecount format
* Create datecount test
* Remove outdated comment
* Remove unnecessary datecount export condition
* Update test config
* Move get_date_counts into DateCountExporter; misc changes
* Use --format instead of --export in datecount test
* Update datecount test to include configs
* Better datecount test
* Remove old tests
* Change 'datecounts' to 'dates'
2021-01-16 14:50:47 -08:00
Seopril
5c0a2d4c4e
Fix YAML export formatting(#1065) (#1150)
* Fix YAML export syntax
* Fix YAML body block indentation
2021-01-16 14:44:55 -08:00
Jrnl Bot
61f8406412 Update changelog [ci skip] 2021-01-09 20:40:42 +00:00
Seopril
dbd12fc500
Clarify installation documentation (#1097) (#1137)
* Clarify installation documentation (#1097)
* Update installation docs
2021-01-09 12:39:06 -08:00
Jrnl Bot
08a0c2d11f Update changelog [ci skip] 2021-01-09 19:08:44 +00:00
Gustavo Matias
6980ed1906
Emphasize installing dependencies before testing (#1148)
As a beginner in Python it wasn't clear that `poetry install` needed to be run before `make test` for instance. That threw a sort of obscure error until I figured it out what the solution was. This is extremely minor, but make sure installing dependencies is the very first instruction can reduce some friction when contributing.
2021-01-09 11:07:03 -08:00
Micah Jerome Ellison
c155bafa84
Notify user when config directory can't be created because there is already a file with the same name (#1134)
* Moving configuration values and methods from install.py to config.py -- everything is broken right now
* Using context to store config path - still lots broken
* Use mocks and context.config_path to store test configs - many tests still broken though
* Update changelog [ci skip]
* Fix jrnl --ls crash
* Fix crash when no editor configured
* Attempt to patch config path with test data - doesn't appear to be working
* Properly use patched config path and add config given to scenario that wasn't using it
* Fix copypasta
* Fix editor test that needed patched config and trapping for system exit
* Add exception and handling for when configuration directory is actually a file
* Remove extraneous comment
* Use more generic JrnlError with messaging switchboard
* Format code a bit nicer
* Remove unnecessary given in diagnostic test
* Ensure full error message is output
* Remove unnecessary whitespace characters
2021-01-02 15:19:44 -08:00
Jrnl Bot
e0c53c28bb Update changelog [ci skip] 2021-01-02 22:55:45 +00:00
Jonathan Wren
f041402533
Add packaging label to included sections in changelog (#1140) 2021-01-02 14:53:54 -08:00
Jrnl Bot
bddec64faa Update changelog [ci skip] 2021-01-02 21:28:22 +00:00
Karim Rahal
57de4f9ba4
Fix keyring error handling (#1138)
* Capture KeyringLocked exception and allow manual password entry
* Create LockedKeyring for steps
* Support types in set_keyring step
* Clarify LockedKeyring docs
* Deal with locked exceptions elsewhere too
* Create behave tests for locked keyring
* Fix linting
* Fix keyring step to allow no type
* Handle all keyring retrieval errors
* Better keyring error handling
* Remove locked keyring for steps; generalize failed keyring
* Finalize tests for keyring handling
* Update set_keyring step
* Make password of failed keyring encryption test more semantic
2021-01-02 13:26:45 -08:00
Jrnl Bot
9f1bef7fde Update changelog [ci skip] 2021-01-02 21:24:55 +00:00
Karim Rahal
e9fd5cdc0e
Allow custom extensions when editing (for easier syntax highlighting) (#1139)
* Create tests and steps for temporary filename suffix
* Have temporary filename suffix be -{template_filename} or .jrnl
* Finalize extension_editor_file
* Make suffix local variable in get_text_from_editor
2021-01-02 13:23:15 -08:00
dependabot[bot]
c47c1e209e
Bump keyring from 21.7.0 to 21.8.0 (#1136)
Bumps [keyring](https://github.com/jaraco/keyring) from 21.7.0 to 21.8.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v21.7.0...v21.8.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-02 12:28:03 -08:00
Jrnl Bot
ada7393979 Update changelog [ci skip] 2021-01-02 20:27:26 +00:00
Jonathan Wren
d4ca29ed2c
Fix broken search bar in docs site (#1135)
* Fixes for search on docs site

We previously didn't include the search results page in our CI testing,
so we missed some issues on that page. This ensures that page is part of
regular testing, and also includes fixes for the issues present.

* fix sidebar contrast
2021-01-02 12:24:21 -08:00
Jonathan Wren
31ada29a37
fix doc site css 2020-12-28 09:55:15 -08:00
Jrnl Bot
4d58bac123 Update changelog [ci skip] 2020-12-26 23:24:54 +00:00
Jonathan Wren
7930d9750a
Fix search on docs site (#1133) 2020-12-26 15:23:01 -08:00
Jrnl Bot
d111b04c14 Update changelog [ci skip] 2020-12-26 21:10:29 +00:00
Jonathan Wren
f8513d3859
Add packaging label to changelog generator config (#1132)
We added dependabot and told it to use a new packaging label. This
change gives that label its own separate section in the changelog.
2020-12-26 13:08:39 -08:00
Jrnl Bot
3bce055c89
Update changelog [ci skip] 2020-12-26 12:08:13 -08:00
dependabot-preview[bot]
8b70497802
Create Dependabot config file (#1131)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-26 11:59:53 -08:00
Jrnl Bot
fc8eafa451 Update changelog [ci skip] 2020-12-26 19:02:42 +00:00
Jonathan Wren
870f9aed17
Fix failing contrast test in accessibility tools on docs site (#1126)
* add background-color as fallback for gradients on docs site

This is both for old browser support, and for accessibility. Some
accessibility tools turn off gradients since they can make text hard to
read for those with visual impairment.

* change mobile header color for docs site

The mobile header was using a light-purple to dark-purple gradient, even
though every other gradient on the site is mid-purple to dark-purple.
This commit changes that both for consistency on the site, and because
light-purple causes an accessibility issue with the white text in the
header (even though the accessibility tools don't notice because of the
gradient).
2020-12-26 11:01:27 -08:00
Jrnl Bot
9a4c3e41a6 Update changelog [ci skip] 2020-12-26 19:00:18 +00:00
Jonathan Wren
37c5b0eb11
Fixes to changelog generator (#1127)
* Fix version header detection in changelog

This updates the regex to find the version header in our changelog.
There was a bug that affected patch, alpha, and beta versions. For
example, if we were looking for "v2.5" we might find "v2.5.1" or
"v2.5.1-alpha" or other versions like that.

This led to the changelog not being cleared properly on update, and old
versions sticking around longer than they should.

* re-add option to include author link for merged PRs in changelog

This option was accidentally left out when migrating the changelog
generator tool to github actions.

* fix conditional in changelog workflow

In github actions, booleans always end up as strings. So, it's not
enough to test `env.FULL_RELEASE` because both 'true' and 'false' will
evaluate as true. This fixes the conditional to check for the string
value 'true' instead of relying on a boolean.
2020-12-26 10:58:23 -08:00
Jrnl Bot
2f4ec7ca98 Update changelog [ci skip] 2020-12-26 18:56:53 +00:00
dependabot-preview[bot]
16e313ab70
Bump pytz from 2020.4 to 2020.5 (#1130)
Bumps [pytz](https://github.com/stub42/pytz) from 2020.4 to 2020.5.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](https://github.com/stub42/pytz/compare/release_2020.4...release_2020.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-26 10:55:19 -08:00
dependabot-preview[bot]
b25ea7409a
Bump keyring from 21.5.0 to 21.7.0 (#1128)
Bumps [keyring](https://github.com/jaraco/keyring) from 21.5.0 to 21.7.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v21.5.0...v21.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-26 10:53:47 -08:00
dependabot-preview[bot]
f999caa3a3
Bump pytest from 6.2.0 to 6.2.1 (#1129)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.0...6.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-26 10:52:55 -08:00
Jrnl Bot
3fb9fe5e28
Update changelog [ci skip] 2020-12-19 22:28:31 -08:00
Jrnl Bot
b0de760621
Increment version to v2.6 2020-12-19 22:28:29 -08:00
Jrnl Bot
7cf977a3cb
Increment version to v2.6-beta5 2020-12-19 22:28:27 -08:00
Jonathan Wren
e1cbce8a08
add more debug data to changelog workflow, update changelog 2020-12-19 22:28:26 -08:00
Jonathan Wren
68cf2d773d
do additional check for json data, and retry for 5-ish minutes on failure (#1125) 2020-12-19 22:28:25 -08:00
Jonathan Wren
2e9e857b7b
standardize version regex in release pipeline (#1124) 2020-12-19 22:28:24 -08:00
Jrnl Bot
3dec22651e
Update changelog [ci skip] 2020-12-19 22:28:23 -08:00
Micah Jerome Ellison
9fe56b9e10
Comply with GPL by acknowledging all authors and including license info in each source file (#1121)
* Update authors to "jrnl contributors" to comply with GPL3
* Include jrnl email address with contributors
* Include GPL notice in jrnl --version
* Apply consistent copyright and license to all Python files
* Add copyright and license to documentation
* Add copyright and license to docs theme
* Wiping poetry cache to try to resolve a test issue
* Testing with Python 3.9.0 in attempt to bypass GitHub Actions failure in 3.9.1
* make format
* Exclude Windows Python 3.9 build which is failing due to a GitHub Actions problem
* Modify testing to get around this 3.9 issue...
* Fix exclude
2020-12-19 22:28:22 -08:00
Jrnl Bot
80bd3f214a
Update changelog [ci skip] 2020-12-19 22:28:21 -08:00
Jonathan Wren
6d339f486e
Small accessibility fixes for docs site (#1122)
* remove old file that was only needed for gh-pages

* fix broken icons on docs home page

* add more contrast to twitter button hover state

* tweak non-accessible color to meet standard

* tweak non-accessible colors to meet standard
2020-12-19 22:28:16 -08:00
Jrnl Bot
867397eccd Update changelog [ci skip] 2020-12-19 20:32:44 +00:00
Jonathan Wren
4adbe5e29a
Add automatic deployment for homebrew releases (and prereleases) (#1111)
This new job will submit a PR to the relevant upstream repo as part of
the release workflow.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2020-12-19 12:31:15 -08:00
Jrnl Bot
b71b6a99f3 Update changelog [ci skip] 2020-12-19 20:05:41 +00:00
Jonathan Wren
243ccd9e37
Fix trigger for changelog (#1114)
The changelog was triggering after each branch create on a repo. That
doesn't happen often on the main repo, but does happen often on
contributor forks. This should stop the rampant GH actions.
2020-12-19 12:04:11 -08:00
Jrnl Bot
7d5d1e0ea9 Update changelog [ci skip] 2020-12-19 20:02:50 +00:00
Jonathan Wren
12e39ffd61
Change approach for docs workflow to use pa11y-ci (#1116)
The previous plugin looked nice with the comments and annotations, but
apparently doesn't work for PRs. It can only run on the pr target (our
branch), which means that the tests are never actually run against the
new code.

As you can guess, this is pretty useless for PRs. So, this PR fixes
that, and uses the very nice pa11y-ci (instead of the normal pa11y).
While it doesn't upload annotations, the output is very readable and
seems like the best we're going to get.
2020-12-19 12:00:59 -08:00
Jrnl Bot
2ac883abb6 Update changelog [ci skip] 2020-12-16 01:51:57 +00:00
Manuel Ebert
e03021a94c
Fixes lone closing parenthesis in docs (#1118)
Look, this might me my least ambitious commit ever, but having mismatched parentheses has crashed the internet before, so let's rather be safe than sorry!
2020-12-15 17:50:00 -08:00
Jrnl Bot
e5fc51213b Update changelog [ci skip] 2020-12-15 19:02:55 +00:00
signal-9
fbad9bf83e
Update output.py (#1117)
Typo, us > use
2020-12-15 11:00:53 -08:00
Jrnl Bot
33b1636229 Update changelog [ci skip] 2020-12-12 22:33:49 +00:00
Jrnl Bot
9122f09dae Increment version to v2.6-beta 2020-12-12 22:32:12 +00:00
Jonathan Wren
cb5bb2e190
Update all dependencies and lock file (#1110)
This also unpins versions of some dependencies where the API is very
stable, or pinning wasn't getting us any additional stability.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2020-12-12 14:30:41 -08:00
Jonathan Wren
eddf37a1b5
Fix readme links (#1109)
* fix links to docs now that we use readthedocs

* fix badge links in readme
2020-12-12 12:41:49 -08:00
Jonathan Wren
ae6041a010
fix readme header (#1108) 2020-12-12 12:33:40 -08:00
Jrnl Bot
b1f936e65c Update changelog [ci skip] 2020-12-12 20:06:56 +00:00
Jonathan Wren
558d331d66
Make docs site (jrnl.sh) fully meet Web Content Accessibility Guidelines (WCAG) 2.1 (#1105)
* add some attribtutes to docs template for accessbility

* fix colors to meet accessibility guidelines (4.5 contrast ratio for text)

* Fix last remaining pa11y error (no button on search form)

This fix required moving the mkdocs theme out of the docs directory.
It's no in the docs_theme directory, and the mkdocs config is updated
accordingly.

* Re-enable accessibility testing for docs sit

Also, move the pa11y script into the gh actions workflow

* clean up linting issues in css

* fix and standardize link colors across site

* fix twitter button opacity making text fail contrast requirements

* move buttons on docs site index nav, tweak font weights

* fix footer opacity, tweak spacing of the now more visible sections of the page

* change font sizes on index page to meet WCAG

* udpate font sizes site-wide for accessibility

* fix sidebar for accessibility (font sizes and color contrasts)

* restyle code blocks to have dark background, and meet accessibility requirements

* standardize (accessible) colors across docs site
2020-12-12 12:05:12 -08:00
Micah Jerome Ellison
42c222a6c8
Update bug_report.md
Fix commented out text appearing in comments
2020-12-12 11:54:20 -08:00
Jrnl Bot
b6d77e4048 Update changelog [ci skip] 2020-12-04 23:15:30 +00:00
Micah Jerome Ellison
48cde1b473
Check for readline module instead of Windows when initializing autocomplete in install (#1104) 2020-12-04 15:13:38 -08:00
Jrnl Bot
bade28a0b0 Update changelog [ci skip] 2020-11-28 22:50:45 +00:00
Jrnl Bot
6e5d43ca78 Increment version to v2.5.1-alpha 2020-11-28 22:49:08 +00:00
Jonathan Wren
c3a8453e94
remove http-basic config for poetry (shouldn't be used anymore) 2020-11-28 14:40:54 -08:00
Jrnl Bot
68e72958b8 Update changelog [ci skip] 2020-11-28 21:22:48 +00:00
Jonathan Wren
45f051f51a
Add fix for changelog conditional always returning false (#1101) 2020-11-28 13:21:16 -08:00
Jonathan Wren
4cad215560
Add a release workflow for PyPI in CI (Github Actions) (#1095)
* Fixes for new CI pipeline (Github Actions)

- Support ci skip tag on commits to avoid build dupes
- Add smarter path detection so we don't spam tons of tests
- Allow steps to cancel if previous steps were cancelled (don't always
  run)
- Separate workflows to be more modular
- Update release workflow to do a few more things
- Add helpful messages
- Be more strict in version checking (now with added regex)
- Make changelog smarter about when to trigger
- Add some functionality for changelog to handle releases and
  prereleases separately
- Better error handling
- Split up the version validation and the release to make way for more
  releases

* add step in workflow to merge to release branch after a release

* add check for git diff so commit doesn't error out constantly
2020-11-28 11:50:13 -08:00
Jrnl Bot
e9d909a3ba Update changelog 2020-11-25 20:35:40 +00:00
Jonathan Wren
4b2645cbae
Update build badge in readme to point at github instead of travis (#1094) 2020-11-25 12:33:38 -08:00
Jrnl Bot
e3aa088fa7 Update changelog 2020-11-22 00:06:47 +00:00
Jonathan Wren
6da3b6dc01
stop changelog update from triggering subsequent ci builds 2020-11-21 16:04:26 -08:00
Jrnl Bot
7f06e11d7a Update changelog 2020-11-21 23:53:06 +00:00
Jonathan Wren
f07774e351
update changelog generator setting to include PRs, and use bot's token 2020-11-21 15:51:10 -08:00
Jrnl Bot
3ad9e37d31 Update changelog 2020-11-21 23:42:08 +00:00
Micah Jerome Ellison
b511461cfa
Fix Unicode encoding failure in directory export when creating filenames from journal titles with certain characters (#1090)
Fix Unicode encoding failure in directory export when creating filenames from journal titles with certain characters
2020-11-21 15:41:08 -08:00
Jrnl Bot
046ebc7514 Update changelog 2020-11-21 23:21:21 +00:00
Jonathan Wren
cfdd05358a
Add ability to put --edit partly through a cli entry to move it to the editor (#1091)
also add some functionality to test suite to see what the editor file contents were and make assertions about it
2020-11-21 15:20:21 -08:00
Jrnl Bot
336936651f Update changelog 2020-11-21 23:19:54 +00:00
Jrnl Bot
09cd77e8dc
Update changelog 2020-11-21 15:18:25 -08:00
Jonathan Wren
d68b9e1ca1
More changelog fixes (#1092)
* add bot token since gh actions doesn't allow pushing to protected branch
* add a max for issues, since we keep getting rate limited
* add jrnl bot username to commit step
* change token for git repo
2020-11-21 15:11:58 -08:00
Jonathan Wren
142e6f597e
Changelog fixes (#1088)
* typo fix

* clean up changelog to match version tags
2020-11-21 11:47:30 -08:00
Jonathan Wren
514ee309b8
Add logo to readme (#1085)
* add logo to readme

* update url for image

* rename file to be more clear about where it goes
2020-11-21 11:22:54 -08:00
Jonathan Wren
e23c4b78b5
Add changelog generation workflow to github actions (#1086)
* Add changelog workflow to github actions, remove old script

This basically takes the exact script, and turns it into a workflow. The
only difference is that the new workflow doesn't detect a release build
like the script did (releases will be a separate workflow).

* remove old config file for changelog generator (it's in workflow now)

* whitespace change

* remove ableist language
2020-11-21 11:21:19 -08:00
Jonathan Wren
8ec661b8a3
get rid of travis and circle configs (in favor of github actions) (#1082)
* get rid of travis and circle configs (in favor of github actions)

* also remove gitlab
2020-11-14 13:54:37 -08:00
Jonathan Wren
616e33d2b4
Make changelog auto exclude stale and wontfix issues (#1081) 2020-11-14 13:15:06 -08:00
Micah Jerome Ellison
e75fa75e65
Wording update on CHANGELOG.md [ci-skip] 2020-11-14 12:56:13 -08:00
Jrnl Bot
96de70704d
Update changelog [ci skip] 2020-11-14 12:42:38 -08:00
Jonathan Wren
4d97110183
Add initial config for Github Actions (#1078)
* Add initial config to test github actions

* remove other CI configs so PR doesn't get bogged down

* add poetry

* skip failing test, update behave output

* add multiple python versions

* add test cache

* try to use matrix for python version

* try to cache pip installation

* add other OSes

* whitespace changes

* skip failing test on windows

* add pip cache

* take out pip cache

* clean up, add linting steps

* add release branch to testing

* clean up

* add initial a11y config for docs site

* take out junit for now

* add junit annotations

* try different junit reporter

* add junit annotations into same workflow

* linter fix

* make junit step always run

* more junit

* clean up

* disable a11y exit code for now (always pass)

* put back travis and circle so we can temporarily run everything in tandem

* fix for issues with secret tokens
2020-11-14 12:42:36 -08:00
Micah Jerome Ellison
a52f46949e
Add PyPI classifiers (#1074) 2020-11-14 12:42:35 -08:00
Micah Jerome Ellison
c38c39efee
Update dependencies - pyxdg, pytest, black (#1076)
* Update version pin on pyxdg and run poetry update
* Update pytest pin and rerun poetry update
* Update black pin to latest version, poetry update, and make format
2020-11-14 12:42:34 -08:00
Jrnl Bot
7a465eabeb
Update changelog [ci skip] 2020-11-14 12:42:31 -08:00
Jrnl Bot
99555c41b5 Increment version to v2.5 2020-11-07 19:34:57 +00:00
Jonathan Wren
b2fc1dcce8
Add mac tests to Circle CI config (#1070) 2020-11-07 11:28:07 -08:00
Micah Jerome Ellison
f25b672a0e
Add note about --debug in bug/support GitHub templates (#1069) 2020-11-06 16:19:36 -08:00
Jrnl Bot
975e4ba7e2 Update changelog [ci skip] 2020-11-01 00:50:24 +00:00
Jonathan Wren
57de3b7d81
Add initial a11y config for docs site (#1067) 2020-10-31 13:59:38 -07:00
Jrnl Bot
b0b98d85fe Update changelog [ci skip] 2020-10-28 20:02:54 +00:00
Jonathan Wren
9e72d10c4c
Add circle ci config file for linux tests (#1063)
* Add circle ci config file for linux tests
* Moved repeated commands into commands section for reuse in jobs
  Circle apparently allows you to separate custom commands into their own
  key, and then reuse them at will in jobs.
* move conditions into individual commands
2020-10-28 12:37:18 -07:00
Jrnl Bot
66d03d133f Update changelog [ci skip] 2020-10-24 23:06:55 +00:00
Micah Jerome Ellison
5b029e6117
Documentation updates (#1032)
* Applying doc changes based on reviews of past several documentation PRs
* Update docs
  Clean up encryption docs
  Clean up security docs
  Delete export.md
  Make new formats.md and add to sidebar. Also add all of the built-in formats, and examples for each.
  Update mkdocs config for new files

* Fix broken docs links
* Correct incomplete sentences and markdown formatting issues
* Make overview a little more concise
* Update some command line arguments to latest version and make it a bit more concise
* Clean up unneeded TOML modifications and other scaffolding not needed for 3.9
* Revert "Clean up unneeded TOML modifications and other scaffolding not needed for 3.9"
  This reverts commit 13b4266ed1.
* Specify that brew is also the easiest way to install jrnl on Linux
* Update docs/security.md
* Update docs/recipes.md
* Doc updates:
- Remove import/export page, fold it into formats
- Rename security to privacy-and-security.md to avoid conflation w/ github security issues
- Various small cleanup and edits from PR review

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-10-24 15:41:58 -07:00
Jrnl Bot
4ee4f388f4 Update changelog [ci skip] 2020-10-18 03:00:49 +00:00
Jonathan Wren
748ad738e2
update changelog generator config to include closed issues 2020-10-17 19:30:18 -07:00
Jrnl Bot
4de3606084 Update changelog [ci skip] 2020-10-18 02:25:36 +00:00
joaquin garmendia
8c2de0e6d7
Add display format option to config file. (#1050)
* Add display format option to config file.
* Add tests.
* Fix `black` error.
* Change nested if to top level.
2020-10-17 18:53:34 -07:00
Micah Jerome Ellison
05d0a0cc83 Fix version number test failing on lack of patch version after change to 2.5 2020-10-17 15:38:06 -07:00
Jrnl Bot
93bcd9bdfe Increment version to v2.5-beta 2020-10-17 22:23:55 +00:00
Jonathan Wren
d916f66dbf
[WIP] Lots of test refactoring (#1042)
* make behave slightly less verbose for use with behave --format progress2
* standardize behave tests
* move tests around to be more behavior driven
* clean up txt file after tests
* add more tests, add more functionality to behave for calling mock editor
* move around behave tests, get rid of regression files
* clean up some code around keyrings
* add more placeholder test scenarios (marked with @todo)
  You can run just these tests with `behave --no-skipped --tags=todo`
* fix "missing_directory" test
  This test was missing the config file it was trying to use. So, it was
  really a very useless, broken test that we absolutely should not have
  approved the PR (#963) for.
* add write tests for each journal type
* update version tests, add new regex match behave step
* add config test outlines
* add journal types to some search tests
* change "basic" config reference to "simple"
* update configs
* add more journal types in search
* fix basic folder journal reference
* add flush output steps to behave, update delete flag tests
* fix failing test with a flush
* update more delete flag tests to include other journal types
* fix file cleanup after failed test with no debug on
* fix password test
* fix DayOne tag sample data, move search/format tag tests, and run them on multiple jrnl types
* added ability to auto-prompt for password for encrypted journals
  Only uses password when prompted, and doesn't get in the way of other
  input prompts. This allows us to run the same scenarios on both
  encrypted journals and other journal types.
* fold encrypted scenarios into the rest of the scenarios where possible
* remove apostrophe that is breaking tests on CI
* add more journal type tests to import feature
* standardize whitespace in behave tests, take out duplicate test
* update handling of cache directories in test suite (easier syntax)
* skip failing YAML exporter emoji test on Windows
* added @todo tags for things that need follow-up

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2020-10-17 15:17:38 -07:00
Jrnl Bot
b76a1c43da Update changelog [ci skip] 2020-10-11 00:58:55 +00:00
micahellison
ebba342779
Add support for Python 3.9 and fix 3.9 build (#1054)
* Support Python 3.9 release in build instead of using 3.9 beta
* Revert Linux and Mac 3.9 definitions since release versions are not working on either
* Run poetry update
* Try out Python 3.10 support on all platforms with allow_failures on
* Adding c:\Python310 path reference for Python 3.10 Windows build
* Clean up unnecessary TOML modification in 3.9 build and always upgrade pyenv in Mac builds
* Clean up unnecessary before_install step on Mac and change 3.9-dev->3.9 definition on Linux
* Reverting Linux Python version to 3.9-dev so that it will run
2020-10-10 17:33:08 -07:00
Jrnl Bot
169e62f1b0 Update changelog [ci skip] 2020-10-10 22:14:23 +00:00
Jonathan Wren
171ce3428d
Disable logging by default (#1053)
* disable logging by default (only enabled if --debug flag is given)

* Run make format

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2020-10-10 14:56:13 -07:00
Jrnl Bot
d20ce3d383 Update changelog [ci skip] 2020-09-11 20:15:44 +00:00
Felix Yan
9ee4c21f6b
Add Ellipsis to SENTENCE_SPLITTER (#1044)
Ellipsis is used to terminal sentences in Chinese and used a lot at end of title.
2020-09-11 12:56:46 -07:00
Jrnl Bot
12e01656f0 Update changelog [ci skip] 2020-09-09 23:58:53 +00:00
matildepark
de6e31582f
mkdocs.yml: change branch URI to develop (#1043) 2020-09-09 16:39:54 -07:00
Jrnl Bot
c93aa02036 Update changelog [ci skip] 2020-09-05 19:26:57 +00:00
Jonathan Wren
ced8d251d9
Change styling of terminal on docs site, small copy changes (#1038)
The terminal now overlaps the header (the purple area at the top of the
page) and the main area (the white area underneath). This draws more
focus to it, and quite literally puts the terminal front and center.

This also fixes a few typos, and updates the commands in the terminal to
match jrnl v2.5 updates.
2020-09-05 12:07:47 -07:00
Jrnl Bot
07f41e8cfa Update changelog [ci skip] 2020-09-05 18:10:34 +00:00
Felix Yan
c9f76e595e
Correct typos in CONTRIBUTING.md (#1040) 2020-09-05 10:53:10 -07:00
Jrnl Bot
5cb8ea2886 Update changelog [ci skip] 2020-08-22 19:32:36 +00:00
Jonathan Wren
29234ddc35
Documentation updates (Thanks @guydebros!) (#1031)
* updated README.md:

- corrected information about encryption
- made additions based on proposed changes to overview.md
- made other changes for clarity and grammar

* ongoing changes to overview.md

* added note that `pycrypto` is required

made other small changes for grammar and clarity

* added new python decryption script to encryption.md

* updated encryption.md to clarify dependencies

other relatively small changes for clarity

straightened quotes

Co-authored-by: Guy B. deBros <guydebros@users.noreply.github.com>
2020-08-22 12:13:36 -07:00
Jrnl Bot
c381d56630 Update changelog [ci skip] 2020-08-22 18:58:37 +00:00
Jonathan Wren
631e08a557
Clean up help screen, get rid of util.py (#1027)
* More refactoring of cli.py

break up code from cli.py (now in jrnl.py) up into smaller functions
get rid of export mode
move --encrypt and --decrypt to commands.py
clean up the help screen even more
update flag name for import

* reorganize code, move around lots of functions

* clean up import statements

* move run function out of cli and into jrnl

* rename confusingly named function

* move editor function into editor file

* rename parse_args.py to args.py to make room for more args functions

* Fix error in test suite for windows

I accidentally flipped the conditional, so this fixes it.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

* Update app description on help screen

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2020-08-22 11:40:39 -07:00
Jrnl Bot
7c3abb2625 Update changelog [ci skip] 2020-08-18 01:08:18 +00:00
micahellison
3c7dcbadbe
Add support for Python 3.9 build testing (#1018)
* First stab at adding Python 3.9 dev Travis builds
* Dynamically replace Python max version for Python 3.9 beta builds
* Fix allow_failures (3.9-dev, not 3.9) and fix Windows find-and-replace command to allow 3.9
* Fix allow_failures to allow all three Python 3.9 builds to fail
* Use platform-independent Python script to allow all Python versions for 3.9 builds
* Format changes and changing before_install to script for 3.9 builds
* Install toml module to make it possible to run version-changing script before install
* Properly populate before_install step with Mac and Windows Python 3.9, and remove extraneous unused python key
* Add refreshenv to get python3 path included in WIndows
* Ensure MacOS pyenv is up to date and attempt to reference Windows python3 directly
* Use bash-friendly paths in Windows and check to see exactly what the Python 3.9 executable is
* Confirm Python version in Windows and attempt to get pip a different way
* Fiddling with Windows python references
* Remove Python3.6 references and check for Python directory in root directory
* Add Python 3.9 path to Windows build
* Remove pip steps that should be unnecessary
* Add upgrade pip to Windows Python 3.9 build
* Attempt to resolve "access denied" error when upgrading pip on Windows
* Use allow_all_python_version TOML script in nightly build instead of sed
2020-08-17 17:46:13 -07:00
Jrnl Bot
6f71c98e13 Update changelog [ci skip] 2020-08-08 19:01:17 +00:00
Jonathan Wren
40a7fcdbeb
Update github issue templates to use new diagnostic command (#1022) 2020-08-08 11:46:16 -07:00
Dacoda Nelson
5eaf94a18f
Updated advanced.md in docs to reflect all four subkeys under colors in the config files. (#1023) 2020-08-08 11:44:50 -07:00
Jonathan Wren
32429933f9 clean up linting issue 2020-08-01 15:54:13 -07:00
Jonathan Wren
971deb387b update python deprecation message 2020-08-01 15:54:13 -07:00
Jonathan Wren
5455158ea0 remove python 3.6 from dependencies 2020-08-01 15:54:13 -07:00
Jonathan Wren
c64a17e97c disable python 3.6 tests 2020-08-01 15:54:13 -07:00
Jonathan Wren
2553c1244d fix typo in test 2020-08-01 15:54:13 -07:00
Jonathan Wren
6b1ac328fd Fix small bug related to starring an entry with a date
If a date was given with an entry, and the star was also was added, the
star wouldn't be recognized if it was at the start of the title.

Example that didn't work, but now works with this fix:
  jrnl "saturday: *Title words."

This is to be consistent in starring functionality with and without a
date in the entry.
2020-08-01 15:54:13 -07:00
Jonathan Wren
bfd1cf5eb8 Fix small bug related to starring an entry with a date
If a date was given with an entry, and the star was also was added, the
star wouldn't be recognized if it was at the start of the title.

Example that didn't work, but now works with this fix:
  jrnl "saturday: *Title words."

This is to be consistent in starring functionality with and without a
date in the entry.
2020-08-01 15:54:13 -07:00
Jonathan Wren
a54ed90259 Move import to be standalone command to reduce clutter in cli.py 2020-08-01 15:54:13 -07:00
Jonathan Wren
ce07fedc06 quick clean of arg parsing function by using default param 2020-08-01 15:54:13 -07:00
Jonathan Wren
3e22bf9292 Move journal_name out of cli and into separate function
It's now part of args, and it's parsed into a function after the config
is available
2020-08-01 15:54:13 -07:00
Jonathan Wren
4fb6263212 short isn't a filter 2020-08-01 15:54:13 -07:00
Jonathan Wren
526867bcdd small code cleanup 2020-08-01 15:54:13 -07:00
Jonathan Wren
66e23d1444 change default logging level so deprecation warnings don't spam users 2020-08-01 15:54:13 -07:00
Jonathan Wren
626a18a6ec Update more arg parsing options and handling 2020-08-01 15:54:13 -07:00
Jonathan Wren
fb184c5f5e Move standalone commands into their own file
Also, cleaned up the way the arg parser handles standalone commands.
Rather than checking individually for each command, you can now register
the command in the proper place, and it will be run with all known
arguments (and cofig if available).
2020-08-01 15:54:13 -07:00
Jonathan Wren
5922ca41ee Update arg parsing to better handle optinal journal name
Fixes #520 -and parameter seems to only work for the default journal
2020-08-01 15:54:13 -07:00
Jonathan Wren
2b2f24449f update tests 2020-08-01 15:54:13 -07:00
Jrnl Bot
0e083ad600 Update changelog [ci skip] 2020-08-01 22:12:20 +00:00
micahellison
64a31e301d
Resolve Travis/Windows/pip issues with upgrade to cryptography 3.0 (#1016)
* add missing dependency
* update cryptography dependency
* Installing poetry with pipx instead of pip
* Fix bad pipx install command
* Remove pipx commands and attempt to solve issue through poetry configuration
* Fix pip install command to include --upgrade as before

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-08-01 14:58:45 -07:00
Jrnl Bot
0a74fe9cef Update changelog [ci skip] 2020-07-31 16:56:22 +00:00
Jrnl Bot
888981c11e Increment version to v2.4.5 2020-07-31 16:39:22 +00:00
Jonathan Wren
832b9229f3
Add missing packaging dependency (#1011) 2020-07-29 15:22:49 -07:00
Jrnl Bot
b509af6798
Increment version to v2.4.4 2020-07-25 16:35:04 -07:00
Jrnl Bot
b2187269d1
Update changelog [ci skip] 2020-07-25 16:34:19 -07:00
Jonathan Wren
40a40af952
Fix readthedocs.io build process (#1004)
* fix readthedocs.io build process
2020-07-25 16:34:17 -07:00
Jrnl Bot
982aad0a16
Update changelog [ci skip] 2020-07-25 16:34:16 -07:00
Jrnl Bot
99e2f7bab8
Increment version to v2.4.4-beta 2020-07-25 16:34:09 -07:00
Jrnl Bot
14bcb2c1af Update changelog [ci skip] 2020-07-18 20:03:04 +00:00
Jonathan Wren
a11aa24c7e Allow editing of DayOne entries (#1001)
* add test to repro issue #955

* Allow editing of DayOne entries

* Add broken test for Dayone

Add test for editing Dayone entries (this test currently fails)

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>

* Fix editing logic for DayOneJournal

DayOneJournal previously reimplemented Journal._parse inside of
DayOneJournal.parse_editable_string, and in doing so caused issues
between itself and the class it was inheriting from. This commit fixes
the issue by moving the UUID to be in the body of the entry, rather than
above it. So, then Journal._parse still finds the correct boundaries
between entries, and DayOneJournal then parses the UUID afterward.

Co-authored-by: MinchinWeb <w_minchin@hotmail.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2020-07-18 12:54:52 -07:00
Jrnl Bot
4c2f2861db Update changelog [ci skip] 2020-07-18 19:17:27 +00:00
Jonathan Wren
6abee8e9d6 fix readme link to submit an issue (#1002) 2020-07-18 12:08:34 -07:00
MinchinWeb
78aa2548ac Update documentation.md (#1003)
Hoping to make the language more positive.
2020-07-17 18:42:45 -07:00
Jrnl Bot
0702e6f2b6 Update changelog [ci skip] 2020-07-12 23:32:19 +00:00
Micah Jerome Ellison
4ca6e3f95f Display warning if Python version is less than 3.7 (#994)
* Add Python version check and faulty test to confirm it's working (should fail on 3.6 build only)
* Apply formatting
* Fix behave Python version test
* Make error message more descriptive and friendly
2020-07-12 16:24:46 -07:00
Jrnl Bot
686fc0cfdf Update changelog [ci skip] 2020-07-11 17:45:37 +00:00
Jonathan Wren
c9fc298317 Add new documentation issue type to github templates (#1000) 2020-07-11 10:34:52 -07:00
Micah Jerome Ellison
f7a49d715e Make behave output more concise when running make test (#988)
Make behave output more concise when running make test

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-06-27 17:51:31 -07:00
Jrnl Bot
89624c155b Update changelog [ci skip] 2020-06-20 21:38:19 +00:00
Micah Jerome Ellison
8d702fee9d Add unit testing via pytest (#987)
* Add pytest to project

Includes a couple sample tests, a note in CONTRIBUTING, and inclusion in the makefile

* Include pytest in Travis build
2020-06-20 14:30:15 -07:00
Jrnl Bot
e4f1453cc9 Update changelog [ci skip] 2020-06-20 21:18:17 +00:00
Jonathan Wren
919ab7902d Rename master branch to release (#985)
It's not our main branch anyway, and "release" makes it more clear what
it's for. There's an industry-wide trend to move away from terms that
invoke master/slave relationships in order to make members of
marginalized populations slightly less uncomfortable.
2020-06-20 14:11:03 -07:00
Jrnl Bot
52a0ccb780 Update changelog [ci skip] 2020-06-20 11:58:21 -07:00
Micah Jerome Ellison
28093894ad Add diagnostic argument #727 (#984) 2020-06-20 11:18:53 -07:00
Jrnl Bot
4238ca57de Update changelog [ci skip] 2020-06-13 19:05:43 +00:00
eshrh
be38cfa87a Add tags to json and xml exporters (#975)
* tag array for json
* add tags to entry in xml
* xml test
* json test
* black
* removed called
2020-06-13 11:58:35 -07:00
Jrnl Bot
c1b93cf81b Update changelog [ci skip] 2020-06-13 18:16:25 +00:00
eshrh
2a3fd820b9 Create journal with absolute path when no path is specified (#972)
* create jrnl with abspath

Co-authored-by: = <esrh@netc.eu>
2020-06-13 11:08:22 -07:00
Eshan
d9951b54c0 Fix typo (#976)
i twitched
2020-06-06 12:56:02 -07:00
Jrnl Bot
9f9c0089c8 Update changelog [ci skip] 2020-06-06 19:55:28 +00:00
Eshan
74724b2185 Create directory if it doesn't exist (#963)
* create dir if it doesn't exist
* switch order of print and creation
* makedirs instead of mkdir and stderr printing
* add test
* black reformatting
2020-06-06 12:46:06 -07:00
Guy B. deBros
ca73c74a8e Extensive modifications to overview.md (#957)
* Extensive modifications to overview.md.

I tried to add clarity and details while maintaining the spirit of the original
document. However, it might be a bit too 'dry' now. I'd be happy to liven it up
a bit. I'm only serious when I feel like I _have_ to be.

One of my opinions (which may be at odds with yours) is that the documentation
should emphasize `jrnl`'s advantages without downplaying any other existing
solutions.

If I have time, I'd like to add more information about the documented benefits
of journaling, particularly the mental health aspects. That will probably need
its own page, but I'm new here, so I don't want to overstay my welcome. :)

* More changes to overview.md in response to feedback

"why keep a journal" section removed -- it could be re-added as its own page,
but it's not front-page material

* More changes to overview.md:
- fixed up the headings
- added information about multi-platform support

This is a work in progress and _not_ ready for prime-time.
- need to add to Command-Line Interface section, among other things

* More changes to overview.md:

- moved "`jrnl` is a simple..." to "Command-Line Interface" section
2020-06-06 12:43:28 -07:00
MinchinWeb
404760876f Add extended metadata support for DayOne Classic (#928)
* Updating changelog [ci skip]

* Incrementing version to v2.4 [ci skip]

* [DayOne] remove extra spaces from the titles of edited DayOne entries

Otherwise, a leading space was being introduced

* [DayOne] maintain existing tags stored in DayOne metadata

* [DayOne] brings back extended DayOne attributes

* [DayOne] maintain metadata on edited entries

Fixes #358, See also #159

* [DayOne Exporter] apply black formatting

* [JSON Exporter] add support for extended DayOne Metadata

* [DayOne] [Tests] test that extended DayOne metadata is added to new entries

Co-authored-by: Jrnl Bot <jrnl.bot@gmail.com>
2020-06-06 12:41:15 -07:00
Jrnl Bot
759c69c497 Increment version to v2.4.3-beta 2020-05-30 19:47:13 +00:00
Eshan
0b9137c17d Fix set_keychain errors (#964)
* fix keyring problems
* black
* remove else and use stderr
* black
* add tests
* black
* change description of nokeyring
* dumb syntax error
2020-05-30 12:43:10 -07:00
Jrnl Bot
ca482b0a46 Update changelog [ci skip] 2020-05-28 01:30:43 +00:00
Jonathan Wren
7c7e2fae82 Fix for hanging Windows tests on Travis (#969) 2020-05-27 18:22:09 -07:00
Jrnl Bot
99711675d4 Update changelog [ci skip] 2020-05-27 21:25:31 +00:00
Eshan
b575174a60 Fix title splitting logic to account for both newlines and periods (#958)
* remove period parsing in title
* fix title splitter
* revert title-body switch
* keep both splitting types
* make black happy
* make it lstrip not strip
* fix title-body order for the last time
* make black happy again
* added test
* second test for single line entry with punctuation
* delete extra blank lines
2020-05-27 14:14:39 -07:00
wotgl
63df95f2ea Speed up jrnl by 10%, improve slow imports (#959)
* Improve slow imports
* Fix codestyle
* fix twice version validation
* Fix a syntax mistake
2020-05-27 14:11:40 -07:00
Micah Jerome Ellison
ef5f0a8331 Ensure test data is always checked out with LF line endings (#965)
* Force *.journal line endings to LF
* Force LF line endings for .feature files
2020-05-27 14:08:48 -07:00
Guy B. deBros
ce0dd6881c Cleaned up usage.md for clarity, formatting, and grammar. (#956)
* Cleaned up usage.md for clarity, formatting, and grammar.

While working on it, I hard-wrapped the lines to 80 characters. Hope that doesn't complicate things.

Note: I changed the Steve Buscemi quote to maintain compliance with the Code of Conduct.

* more changes to the usage page

Includes information about two new functions (`--delete`) and (`-contains`).
It's starting to look quite different from the original...
2020-05-27 14:07:43 -07:00
Jrnl Bot
3550e56273 Update changelog [ci skip] 2020-05-23 23:07:59 +00:00
Jonathan Wren
e37fe2e4ce Clean up templates and issues (#954)
* clean up templates and issues
* fix some title-casing
2020-05-23 15:58:04 -07:00
Jonathan Wren
a4d020423f Fix editor config when an argument with a space is used (#953)
* Fix editor config when an argument with a space is used
* skip broken test on windows
* fix jrnl not behaving nicely with testing suite
* fix argument parsing for test suite
* fix one windows test, disable one windows test
2020-05-23 15:56:31 -07:00
Jrnl Bot
e6f828214b Update changelog [ci skip] 2020-05-22 18:47:28 +00:00
MinchinWeb
13d2b85d27 Update lockbot comment to encourage linking to issue (#941)
* improvements to lockbot for Github comments
* [lockbot] just the comment
2020-05-22 11:39:10 -07:00
Jrnl Bot
7290fa2a01 Update changelog [ci skip] 2020-05-16 20:02:14 +00:00
Olly Britton
7a7818ef24 Ask for password before adding entry instead of after (#951)
* ask for password before adding entry (#799)

This fixes #799 because previously it would allow you to create an
entry using your editor and then attempt to open the journal. This
behaviour is fine for unencrypted journals but with encrypted journals
it means that if you get the password wrong three times then the entry
you just wrote is lost.

Swapping the order around so that the entry is opened first in the code
and then the editor is added means that this can't happen.
2020-05-16 12:55:04 -07:00
Jrnl Bot
b4089c125b Update changelog [ci skip] 2020-05-16 18:38:55 +00:00
Matt Abrams
aad2af1a8d typo in recipes.md (#952)
typo in recipes.md. two verbs in a row. only one is needed :)
cheers
mja
2020-05-16 11:27:52 -07:00
Jrnl Bot
7149a82f66 Update changelog [ci skip] 2020-05-09 15:42:57 -07:00
Micah Jerome Ellison
fcf42e3233 Fix duplicate text in multiple tag search by removing selective coloring on searched tags only #926 (#948) 2020-05-09 15:13:16 -07:00
Jrnl Bot
1f1a57db89 Increment version to v2.4.2 2020-05-09 15:01:54 -07:00
Jonathan Wren
a15e6f7476 update travis config to fix deployment 2020-05-09 15:01:44 -07:00
Jonathan Wren
e5f59d7179 Use gitlab to trigger releases in pipeline (#947) 2020-05-09 14:12:14 -07:00
MinchinWeb
cfadcd39ca Apply isort Mk II (#942)
* Apply isort!
2020-05-09 13:14:43 -07:00
Jrnl Bot
1cc3f80ba9 Updating changelog [ci skip] 2020-05-07 01:25:13 +00:00
Micah Jerome Ellison
4df4e56a96 Improve privacy, security, and encryption documentation #896 (#925)
* Improve privacy, security, and encryption documentation #896
* Use gentler language and ensuring documentation does not read like legal advice
2020-05-06 18:14:44 -07:00
Jonathan Wren
b2c7d29909 add lockbot to lock comments on inactive, closed issues and prs (#938) 2020-05-06 18:14:27 -07:00
Jonathan Wren
ecb4562c29 Make sure testing cleans up after itself (#940)
This adds the ability to run commands in a cache directory without the
test writer knowing where the cache directory is located. This will let
us expand later if we want to start using system temp folders, without
having to rewrite any of our tests.

* clean up extra directories after running behave
* clean up white space issues
* move repeated code into function
* clean up behave code for creating cache directories
* Fix for windows shell parsing in our test suite

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2020-05-06 18:13:36 -07:00
Jrnl Bot
c5f40f1d15 Updating changelog [ci skip] 2020-05-06 20:55:08 +00:00
Micah Jerome Ellison
d9ebfe852b Prevent filtered delete from deleting journal (#935)
* Prevent filtered deletion from deleting entire journal #932 and add lots of deletion tests
* Undo removal of deletion feature
* Use more performant deletion
2020-05-06 13:47:39 -07:00
Jrnl Bot
cfbebe0d38 Updating changelog [ci skip] 2020-05-05 20:02:05 +00:00
Micah Jerome Ellison
683a0bac6c Change github new issue link to issue template chooser (#936) 2020-05-05 12:51:03 -07:00
Micah Jerome Ellison
274d031ee7 Allow most recent pytz version and update dependencies (#937) 2020-05-05 12:49:24 -07:00
Jrnl Bot
dad972a1dd Incrementing version to v2.4.1 [ci skip] 2020-05-02 20:35:15 +00:00
Jrnl Bot
edcc6555ae Updating changelog [ci skip] 2020-05-02 20:33:49 +00:00
Jonathan Wren
6a0ee48f83 Disable --delete due to critical bug (#934) 2020-05-02 13:17:06 -07:00
MinchinWeb
db96ba7fb8 GitHub Pull Request Template Update (#927)
* Improve GitHub PR Template
* suggest running commands with `poetry run ...`

pyflakes here is given only certain subdirectories because `.` will try and run across all packages installed in the virtual environment, if the virtual environment is within the project's root folder (which is my common practice).
2020-05-02 12:06:23 -07:00
Jrnl Bot
7b96169654 Incrementing version to v2.4 [ci skip] 2020-04-29 13:54:46 -07:00
Jrnl Bot
ec213d8185 Updating changelog [ci skip] 2020-04-29 13:54:43 -07:00
Jonathan Wren
fc2b49fbd3 Clean up readme file (#924) 2020-04-25 13:15:55 -07:00
Jrnl Bot
a6568ce0a4 Updating changelog [ci skip] 2020-04-25 17:38:43 +00:00
Epskampie
473187f4b8 Docs: editing config isn't always destructive (#923)
Editing the config file doen't always destroy your journal, luckily :-)
2020-04-25 10:31:38 -07:00
Jrnl Bot
db0caa7b83 Incrementing version to v2.4-beta [ci skip] 2020-04-18 14:48:11 -07:00
Jrnl Bot
61f1627264 Updating changelog [ci skip] 2020-04-18 14:48:07 -07:00
Jonathan Wren
c56dd7eb52 update makefile to match pipeline better 2020-04-18 13:58:57 -07:00
Jrnl Bot
45216b976c Updating changelog [ci skip] 2020-04-18 20:47:45 +00:00
Jonathan Wren
953560ba0a fix typo in poetry config 2020-04-18 13:40:47 -07:00
Jonathan Wren
e57a51ba25 Upgrade license to GPLv3 (#918)
The MIT license is a bit outdated, and doesn't provide the protections
we'd like in a modern open-source application.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2020-04-18 13:31:25 -07:00
jess
6198604045 Add Open Collective information to README (#916)
* Added financial contributors to the README
2020-04-18 12:35:46 -07:00
Jrnl Bot
b29314f6bc Updating changelog [ci skip] 2020-04-18 12:35:46 -07:00
MinchinWeb
587de366fb Update Windows Python versions (#910)
* [Travis] update Windows Python versions
* Update Python versions to be uniform across the board

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-04-18 12:35:46 -07:00
Jrnl Bot
9a56cc8a09 Updating changelog [ci skip] 2020-04-18 12:35:46 -07:00
Jonathan Wren
a5450b21cd fix import issues (from pyflakes merge) 2020-04-18 12:35:46 -07:00
MinchinWeb
68ad5c0c1a Ensure exported entries end in a newline for Markdown and YAML exporters (#908)
* [Markdown Exporter] [YAML Exporter] Ensure exported entires end in a newline

Fixes #768, Fixes #881.

If the exported entry does not have a final empty line, this will add one on export. Some Markdown parsers get picky about not having a empty line above a heading....

* fix black formatting issues
* explicitly sort filenames

to deal with inconsistent default file ordering on different OS's
* Update .gitignore
* Update test for typo fix

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-04-18 12:35:46 -07:00
Jrnl Bot
62ea1e2b23 Updating changelog [ci skip] 2020-04-18 12:35:46 -07:00
Jonathan Wren
a03445bb84 add pyflakes to dev deps, run pyflakes in CI 2020-04-18 12:35:46 -07:00
Jonathan Wren
e3a46e9846 fix various small issues in the codebase 2020-04-18 12:35:46 -07:00
Jrnl Bot
abad3a3a79 Updating changelog [ci skip] 2020-04-18 12:35:46 -07:00
Micah Jerome Ellison
8d49a9770d Update keyring version from "^19.0" to ">19.0, <22.0" (#914)
* #783 Allow keyring >19.0, <22.0 instead of ^19.0
2020-04-18 12:35:46 -07:00
Jrnl Bot
4eb5fe375a Updating changelog [ci skip] 2020-04-18 12:35:46 -07:00
Jonathan Wren
50d582ef73 Update the code of conduct (#913) 2020-04-18 12:35:46 -07:00
MinchinWeb
42bebd5632 Test Version match (#887)
* [Tests] makes sure `--version` works
Directly reads the version number from pyproject.toml

* Tag the tests
To run just this test, use `behave --tags=deployments_tests`
2020-04-18 12:35:46 -07:00
Jrnl Bot
bd6bee47b8 Updating changelog [ci skip] 2020-04-18 12:35:46 -07:00
MinchinWeb
4fed54576c [DayOne] support moderm plistlib (#909)
The API of the standard library's `plistlib` changed with version 3.4 of Python, and the old API is being removed in Python 3.9. In other words, the new API is supported by all version of Python we current support (3.6 to 3.8).

See https://docs.python.org/3.4/library/plistlib.html for more details.
2020-04-18 12:35:46 -07:00
Jrnl Bot
86f5e8e243 Updating changelog [ci skip] 2020-04-18 12:35:46 -07:00
MinchinWeb
65045cc332 [YAML Exporter] fix starred spelling (#907)
* fix starred spelling
c.f. #835
2020-04-18 12:35:46 -07:00
Jrnl Bot
7016c6925b Updating changelog [ci skip] 2020-04-10 16:18:34 -07:00
Jonathan Wren
333dbca783 Update twitter buttons, contribution in footer (#905) 2020-04-10 16:18:34 -07:00
Micah Jerome Ellison
79d2bd5ec7 Change install doc guideline from pip to pipx and mention minimum Python version 2020-04-10 16:18:34 -07:00
Micah Jerome Ellison
42e22950b1 Allow tzlocal version >1.5 <3.0 instead of >1.5 <2.0 (#900)
* Allow tzlocal version >1.5 instead of ^1.5 (#883)
* Change tzlocal version restriction to <3.0
2020-04-10 16:18:34 -07:00
notbalanced
aece970751 Properly display entries during a tag search. (#902) 2020-04-10 16:18:34 -07:00
Jrnl Bot
f57dcf5cab Updating changelog [ci skip] 2020-04-10 16:18:34 -07:00
Jonathan Wren
d3d3ef4c3e Update Poetry requirements for testing latest Python version (#898)
Poetry errors out if we try to run a different version of Python that
what is specified in the config file. We want to run tests against the
latest Python version so we can see problems before they happen. This
fix updates the config file so Poetry will allow us to test. Nothing is
committed after the update.
2020-04-10 16:18:34 -07:00
Jrnl Bot
c49e028dea Updating changelog [ci skip] 2020-04-10 16:18:34 -07:00
Jonathan Wren
0e1f415c97 Fix failing tests and linting issues 2020-04-10 16:18:34 -07:00
dbxnr
65a3b2ce7c Fix for upgrade with missing journal (#796)
* Fix for upgrade with missing journal
* add test, refactor solution
* add missing test config

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-04-10 16:18:34 -07:00
dbxnr
15429d4f61 Interactive delete (#850)
* fixup alichtman's implementation
* cleanup imports

Co-authored-by: Aaron Lichtman <aaronlichtman@gmail.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-04-10 16:18:34 -07:00
Aaron Lichtman
f4fca3e5a4 Add --delete for interactive removal of entries (#698)
* Add --delete for interactive removal of entries
* Add inquirer dependency for fancy prompting
* Fix some minor style issues
* Fix #434 
* Use PyInquirer instead of inquirer for Windows compatibility
* Add WIP (broken) test
* Change deletion interface to be more basic
* Update environment.py

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-04-10 16:18:34 -07:00
Jrnl Bot
d4a0895163 Updating changelog [ci skip] 2020-04-10 16:18:34 -07:00
Jonathan Wren
87d0c84757 Hotfix for keeping the version in sync in code (testing to come later) (#895)
hotfix for keeping the version in sync in code (testing to come later)
2020-04-10 11:51:56 -07:00
Jrnl Bot
edc49cf5a2 Incrementing version to v2.3.1-beta [ci skip] 2020-04-10 11:51:56 -07:00
Jrnl Bot
ff8a0c3f16 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
MinchinWeb
59624a4941 Syntax fix (#886)
SyntaxWarning: "is" with a literal. Did you mean "=="?

This works otherwise due to an implementation quirk of cPython.
2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
7a328d0fe3 Update and reorganize CONTRIBUTING (#885)
* Include information about branching strategy
* Re-organize documentation and include information on testing
* Use gerund form in Contributing headlines
* Fix markdown links and expand developing documentation
* Add pipx link and explain test code structure
* Include pull request process in CONTRIBUTING
* Update CONTRIBUTING with small changes from PR review
* Mention failing tests in CONTRIBUTING
* Add information for developers about issue labels
2020-04-10 11:51:56 -07:00
Jonathan Wren
aae55aa193 Update Travis caching to speed up builds (#871) 2020-04-10 11:51:56 -07:00
Jonathan Wren
0471402183 Create FUNDING.yml (#861)
Test out using Github sponsors
2020-04-10 11:51:56 -07:00
Jrnl Bot
bc35c356a9 Incrementing version to v2.3 [ci skip] 2020-04-10 11:51:56 -07:00
Jrnl Bot
3a72ea4af1 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Nathan Genetzky
327af80997 docs: Update url for "beautiful timeline" in export.md (#879)
The previous URL was invalid. Used way back time machine, and at least at some point a redirect was setup to this site.
2020-04-10 11:51:56 -07:00
Jonathan Wren
2a4f5ca5c9 fix up remnants of merge conflicts 2020-04-10 11:51:56 -07:00
Jrnl Bot
507914ff3c Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Jonathan Wren
cd437e8c8f Update stalebot emoji to 📌 instead of
The pushpin better reflects the functionality (stops the issue from
staling).
2020-04-10 11:51:56 -07:00
Jonathan Wren
302d353c4d Fix up tests and related issues
Upgrade poetry if already installed
Get rid of test function that was causing windows problems
2020-04-10 11:51:56 -07:00
Aaron Lichtman
9e5d160bbd Pretty print journal entries (#692)
* Pretty print journal entry titles and dates.

Changes appearance of all jrnl viewing commands, such as $ jrnl --short and
$ jrnl -n {NUM}.

Fix #508

* Removed extra newline at end of title

* Use ansiwrap to properly wrap strings with ANSI escapes

* Add ansiwrap to pyproject.toml

* Allow configuration of colors

- Replaced raw escapes with colorama
- Added colors key to config
- Add checks for validity of color values

* Add color configuration documentation

* Fix broken tests due to config change

* Add tests for colors in configs

- Identifying invalid color configs
- Upgrading config from no colors -> colors

* Add colorama dependency for all platforms

* Allow users to disable colorization of output

* Update poetry.lock

* Add tag and body color customization options

* Fix colorization of tags in title and body

* Updated tests to use no color by default

* Change pass to continue in verify_config()

* Better style in Entry.py

* Reduce code duplication for tag highlighting

- Breaks "unreadable date" regression test for unknown reason

* Properly colorize tags and print body

* Reformatting and clean up

* Replace list comprehension with generator

* Handle invalid colors by not using a color

* Process ANSI escapes properly with behave

* Fixed the 'spaces after tags directly next to punctuation' bug

Broke processing of tags next to any punctuation at all

* Closer to working tag colorization but not perfect

* Add tests printing for multiline journals

Fix #717

* Correctly indent first line of multiline entry

* Add test for multiline entries with tags

* Remove redundant UNICODE flag

* Progress towards proper tag colorization and body formatting

* Fix newline colorization bug

Debug code left intact since there are more bugs to fix :/

* And now the space just ends up before the tag instead of after it

* Fix assertion syntax warning

* Moved tag test to tagging.feature file

* Strip out debug code and clean up

* Bold datetimes in title

* Bold all titles

Fix #720

* Remove PY2 and PY3 constants

* Fix regression in features/steps/core.py

* Fix tag_regex

* Remove redundant re.UNICODE flag

* Remove extraneous code
2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
6985de2844 Add support to save journals to multiple files in a directory
Update FolderJournal reference to entry __unicode__ method to __str__
Remove DayOne test made obsolete by FolderJournal
Fix FolderJournal path tests for Windows paths
Apply Black linting
2020-04-10 11:51:56 -07:00
Craig Moyer
a3c81d46fe Add support for folder base journal.
Adds feature for issue #170 (and #398) where you configure your journal to
be a directory and entries are added as sub-directories and files:
yyyy/mm/dd.txt. Multiple entries in a day will go in the same file, but a
new entry for a specific day will create a new file (and directory
structure).

Fix failed test scenarios for folder journal.
2020-04-10 11:51:56 -07:00
Manuel Ebert
a3afa112ab Clean up shortcut for Limit
This piece of code has bothered me for more than 6 years! (See #131) - this moves parsing arguments to where it belongs.
2020-04-10 11:51:56 -07:00
Aurélien Ooms
1b3d2961a1 docs: Fix fish history instructions.
Use `--add` flag in fish `abbr` command.
2020-04-10 11:51:56 -07:00
Leroy van Logchem
55eff3b777 Update recipes.md
Fixed links to various documentation files
2020-04-10 11:51:56 -07:00
Jrnl Bot
cbea259648 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Jrnl Bot
7cf71c19a9 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Jrnl Bot
5e6517ef75 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
32bd4a2b71 Restore emoji test now that it works in Windows Travis builds 2020-04-10 11:51:56 -07:00
Jonathan Wren
480b881bda Put back build lines in poetry config (#838)
Taking out these lines earlier fixed the homebrew release, but broke
other things. So, I'm putting them back for now until we can find a
better solution.
2020-04-10 11:51:56 -07:00
Jonathan Wren
db6b0aa56c Don't re-run tests on deployment (#839)
By the time we get to the deployment step, we've already run these tests
dozens of times. We don't need to run them yet again at deploy time.
2020-04-10 11:51:56 -07:00
Jonathan Wren
4190494a4f Get rid of dumb sex joke (#840)
These kinds of jokes make us look bad, and have gotten this project bad
PR on social media. It's best to get rid of them. We can still be super
glib and funny without crass jokes.
2020-04-10 11:51:56 -07:00
Jonathan Wren
5135f6a4b3 Update site description (#841)
Don't know why this was what it was. Maybe an old joke I don't get?
Either way, new description makes more sense.
2020-04-10 11:51:56 -07:00
Jonathan Wren
9acdba1ec7 Update old links (#844)
Since we moved the core repo to jrnl-org, the old links no longer work.
2020-04-10 11:51:56 -07:00
Jonathan Wren
bafe7a19ae get rid of debug code 2020-04-10 11:51:56 -07:00
Jonathan Wren
bae53267bf Stop multipe changelog generators from crashing into each other 2020-04-10 11:51:56 -07:00
Jrnl Bot
864df9906a Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
3e1061df5f Fix crashing unicode Travis tests on Windows and fail build if Windows tests fail (#836) 2020-04-10 11:51:56 -07:00
Jrnl Bot
4757deee66 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
MinchinWeb
cec0beff9a Listing all entries in DayOne Classic journal throws IndexError (#786)
* Reproduce bug in #780
🎵 I have no body, no body to love me... 🎵
The bug is cause by a DayOne entry that has to entry body.

* Deal with empty bodies
Close #780.

* [Travis-CI] add "tree" command to debug missing files
* Fix file location
I have no idea why, but it ran locally fine without issue. Travis is more particular...
2020-04-10 11:51:56 -07:00
Jrnl Bot
06aa8b50d0 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Aurélien Ooms
839ce7d42d Fix typo in encryption docs (#812)
* Explain how fish can be configured to exclude jrnl commands from history by default
* Fix typo in encryption docs
2020-04-10 11:51:56 -07:00
MinchinWeb
66027e7746 Add UTC support for failing DayOne tests (#785)
* [Dayone] don't break if the system timezone is UTC
* [DayOne] re-enable tests that were failing on Travis
* [DayOne] change as per code review to avoid `except: pass`
2020-04-10 11:51:56 -07:00
Stav Shamir
8b7ebe2dcd Add test scenarios for the export feature (#824)
* Fix behave keyword "and" to correct case "And"
* Extract export_steps module
* Add scenario for XML export
* Add scenario for tags export
* Add scenario for fancy export
* Add scenario for yaml export
* Remove unused module export.py
* Run `make format`
* Fix `create_directory` step
2020-04-10 11:51:56 -07:00
Jonathan Wren
aacc245dc8 Small fixes to changelog 2020-04-10 11:51:56 -07:00
Jrnl Bot
a4da8f49e9 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Jrnl Bot
252ab7256b Incrementing version to v2.2.1-beta2 [ci skip]
Update changelog
2020-04-10 11:51:56 -07:00
Jonathan Wren
f83f486659 Take out build system from pyproject config #781
We don't use it, and it breaks the homebrew install.
2020-04-10 11:51:56 -07:00
Jrnl Bot
4d0a73dab2 Incrementing version to v2.2 [ci skip]
Update changelog
2020-04-10 11:51:56 -07:00
Jrnl Bot
c3d5878a31 Incrementing version to v2.2-beta2 [ci skip]
Update changelog
2020-04-10 11:51:56 -07:00
Jonathan Wren
416fe4d208 update poetry version 2020-04-10 11:51:56 -07:00
Jonathan Wren
5de0027f3b add maintainer field to config 2020-04-10 11:51:56 -07:00
Jonathan Wren
9a354a95d0 fix poetry warning 2020-04-10 11:51:56 -07:00
Jonathan Wren
64340727f1 add version file to repo 2020-04-10 11:51:56 -07:00
Jonathan Wren
e048d1bdf1 unpin poetry version in requirments 2020-04-10 11:51:56 -07:00
Aurélien Ooms
17ce55e031 Explain how fish can be configured to exclude jrnl commands from history by default 2020-04-10 11:51:56 -07:00
Jrnl Bot
36076de64f Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Jrnl Bot
4c6c58c929 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
heymajor
7a1ee99863 Updating/expanding template explanation
Smoothing out formatting issues
2020-04-10 11:51:56 -07:00
Jrnl Bot
9b80d478c2 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
a3a161376e Keep skip_win directive for empty entry test that still stalls on Travis 2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
923e0c25d5 Remove all skip_win directives now that Travis is not mangling newlines on Windows 2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
738e4459ba Prevent Travis from turning LF to CRLF in Windows 2020-04-10 11:51:56 -07:00
Jrnl Bot
6792397e9a Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
MinchinWeb
2b605f8177 [DayOne] YAML export improvements (#773)
* [YAML Export] code style improvements

* [Dayone] Brings back extended Dayone attributes to YAML export
c.f. 7d3afd811b
reverse b8dbf84753

* [YAML Exporter] switch to f-strings

* [Black] apply black formatter to YAML Exporter

* Code fixes as per review
2020-04-10 11:51:56 -07:00
Jrnl Bot
fdcbf8abc4 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
dbxnr
a5d993a9bb Fix for unhandled exception 2020-04-10 11:51:56 -07:00
Jrnl Bot
fc6d8156cd Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
373033a285 #790 - closing temp file before passing it to editor to prevent file locking issues in Windows 2020-04-10 11:51:56 -07:00
Jrnl Bot
1b64bb4a86 Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Jonathan Wren
4d4321738e small fixes for travis pipeline 2020-04-10 11:51:56 -07:00
Jrnl Bot
dc2d22b43e Updating changelog [ci skip] 2020-04-10 11:51:56 -07:00
Jonathan Wren
84882c1d98 update deploy stage condition 2020-04-10 11:51:56 -07:00
Jonathan Wren
3fc3233a44 update changelog script to handle different scenarios (#724) 2020-04-10 11:51:56 -07:00
Jonathan Wren
e6a9a0e3cd add script to generate changelog 2020-04-10 11:51:56 -07:00
Jonathan Wren
f92c789efe fix conditional for deploy step 2020-04-10 11:51:56 -07:00
Jonathan Wren
bfa0cae289 update changelog generator settings to be less verbose, fix links 2020-04-10 11:51:56 -07:00
Jonathan Wren
fcd8a11ae8 use api token instead of username and pw for pypi 2020-04-10 11:51:56 -07:00
Jonathan Wren
6d53ed1d94 add config file for changelog generator 2020-04-10 11:51:56 -07:00
Jonathan Wren
3762c008a6 Update changelog in prep for auto changelog generator (#724)
Getting ready to implement the auto-changelog generator is easier if we
are caught up with the old changes. This was generated by running the
generator locally.

Co-authored-by: Micah Jerome Ellison <git@micahjero.me>
2020-04-10 11:51:56 -07:00
Jonathan Wren
fde2cc83b0 skip more windows tests 2020-04-10 11:51:56 -07:00
Jonathan Wren
7f919fd071 run black 2020-04-10 11:51:56 -07:00
Jonathan Wren
6a675791a2 skip another windows test 2020-04-10 11:51:56 -07:00
Jonathan Wren
72e87c15c9 whitespace changes 2020-04-10 11:51:56 -07:00
Jonathan Wren
6428a461b8 skip another windows test 2020-04-10 11:51:56 -07:00
Jonathan Wren
5f31e1ab39 remove broken test (windows can't handle emoji) 2020-04-10 11:51:56 -07:00
Jonathan Wren
4086573f9d [#766] Skip another broken windows test 2020-04-10 11:51:56 -07:00
Jonathan Wren
da55914ec3 [#766] Skip the broken test on windows for now 2020-04-10 11:51:56 -07:00
Eshan
af6243c73d Fix usage notes
Notes were correctly indented.
2020-04-10 11:51:56 -07:00
Jonathan Wren
968ae6ca98 Change stage so travis doesn't get confused about allowed failures 2020-04-10 11:51:56 -07:00
Jonathan Wren
5c0a2a236a clarify build steps 2020-04-10 11:51:56 -07:00
Jonathan Wren
29af09f3c7 update lock file 2020-04-10 11:51:56 -07:00
Jonathan Wren
ca2a0e53c2 update black version 2020-04-10 11:51:56 -07:00
MinchinWeb
04f6154c93 Apply black formatter to code
[Travis] add a linting stage (via `black`)
[Travis] update as per code review
Remove "Lint" as separate stage; have `black` check the output rather
than run the re-formmater
2020-04-10 11:51:56 -07:00
Jonathan Wren
46c4c88231 (#770) run black formatter on codebase for standardization 2020-04-10 11:51:56 -07:00
Peter Schmidbauer
9664924096 Move all password handling to EncryptedJournal
This commit should greatly simplify all password handling logic. No passwords are stored in the config dict anymore. Only the Encrypted Journals have any password related logic. I also had to remove some password fields from the test files, which shows how dangerous the previous approach was. A slight code change could've leaked passwords to the config file. However, I had to change the install progress a little bit to make this work. It will now not ask you for a password right away but rather if you want to encrypt or not. Only if you reply 'y' will it ask you for the password later on.
2020-04-10 11:51:56 -07:00
Manuel Ebert
c8d59727eb Explicitly write Version to file
Delay import of asteval
Use __version__.py instead of VERSION.txt
2020-04-10 11:51:56 -07:00
Jims
b8d43db558 Added case-insensitive searching of entry title and body
added search test
Renamed searching to contains. Made changes as per pull-request:
https://github.com/jrnl-org/jrnl/pull/740
2020-04-10 11:51:56 -07:00
Jesper Kjeldgaard
657eb8fcda Fix merge conflict left-over 2020-04-10 11:51:56 -07:00
Jonathan Wren
abc6b53898 [#739] Update tests so that 3.8 is not an allowed failure 2020-04-10 11:51:56 -07:00
Jonathan Wren
f68de27b2b [#739][#747] update lock file 2020-04-10 11:51:56 -07:00
Jrnl Bot
35432f8c70 Incrementing version to v2.1.1 2020-04-10 11:51:56 -07:00
Jonathan Wren
eb16fe1130 [#757] update mac python version test to match others 2020-04-10 11:51:56 -07:00
Jonathan Wren
f86fb18d5d [#757] Add fast finish option to travis 2020-04-10 11:51:56 -07:00
Jonathan Wren
d8967ae9d3 [#757] update caching for ci 2020-04-10 11:51:56 -07:00
Jonathan Wren
3c6b8058ff [#757] Be explicit about python versio so travis doesn't get confused 2020-04-10 11:51:56 -07:00
Jonathan Wren
b349f5c477 [#757] Group tests by python version 2020-04-10 11:51:56 -07:00
Jonathan Wren
52934a78e4 [#757] Add more Mac tests for each Python version 2020-04-10 11:51:56 -07:00
Jonathan Wren
aa49dc3eb5 [#757] Add more testing for Windows across multiple Python versions 2020-04-10 11:51:56 -07:00
Jonathan Wren
1b9748e5ce [#757] Clean up travis yaml file for readability 2020-04-10 11:51:55 -07:00
Jonathan Wren
8004ef59af [#757] Take out unneeded quotes around strings in yaml 2020-04-10 11:51:55 -07:00
Jonathan Wren
63f2901bf4 [#757] update CI logic to new format 2020-04-10 11:51:55 -07:00
Jonathan Wren
a704863121 [#757] add explicit os at root per travis config linter 2020-04-10 11:51:55 -07:00
Jonathan Wren
b6bd14fb27 [#757] add stage name to test stage to be explicit 2020-04-10 11:51:55 -07:00
Jonathan Wren
eb4b3ead51 [#757] Add quotes around environment variables to be a little safer 2020-04-10 11:51:55 -07:00
Jonathan Wren
a1392d9c49 [#757] Take out old code (no longer needed) 2020-04-10 11:51:55 -07:00
Jonathan Wren
424e67e23a [#757] Move deploy to it's own stage on CI so it doesn't run multiple
times
2020-04-10 11:51:55 -07:00
Manuel Ebert
58ddee3b49 Display header in mobile docs 2020-04-10 11:51:55 -07:00
277 changed files with 21418 additions and 4787 deletions

View file

@ -0,0 +1,8 @@
import toml
pyproject = toml.load("pyproject.toml")
pyproject["tool"]["poetry"]["dependencies"]["python"] = "*"
with open("pyproject.toml", "w") as toml_file:
toml.dump(pyproject, toml_file)

4
.gitattributes vendored Normal file
View file

@ -0,0 +1,4 @@
*.journal text eol=lf
*.feature text eol=lf
poetry.lock text eol=lf
pyrpoject.toml text eol=lf

12
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: jrnl
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View file

@ -1,26 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ":new:, bug"
assignees: ''
---
## Bug report
Hello! Thank you for reporting an issue!
If you would fill out the below points, that would make our process a whole lot easier!
* **Please tell us about your environment:**
- Jrnl version: (run `jrnl -v`)
- How you installed Jrnl
- Operating system [MacOS, Linux, Windows?]
* **What is the current behavior?**
* **Please provide the steps to reproduce and if possible a minimal demo of the problem**
* **What is the expected behavior?**
* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

74
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View file

@ -0,0 +1,74 @@
name: Bug Report
description: Create a report to help us improve
title: "Bug Report"
labels: [ ":new:", "bug" ]
body:
- type: markdown
attributes:
value: |
# Bug Report
Hello, and thank you for reporting an issue!
Please fill out the points below, as it will make our process much easier.
- type: textarea
id: diagnostic
attributes:
label: Diagnostic output
description: Run `jrnl --diagnostic` and paste the output below
placeholder: Paste output here
validations:
required: true
- type: textarea
id: current-behavior
attributes:
label: Current Behavior
description: Please put a short description of what is currently happening.
placeholder: Tell us what is happening
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: Please write a short description of what you would expect to happen
placeholder: Tell us what should be happening
validations:
required: true
- type: textarea
id: repro-steps
attributes:
label: Repro Steps
description: |
Provide the steps to reproduce the problem.
Please be as precise as possible, since more info will let us help you faster.
placeholder: Repro steps
validations:
required: true
- type: textarea
id: debug-output
attributes:
label: Debug output
description: |
Please provide the output of your command with the `--debug` flag on.
placeholder: "example: `jrnl --debug lorem ipsum`"
validations:
required: true
- type: textarea
id: other-info
attributes:
label: Other Information
description: >
Is there anything else we should know?
(e.g. more detailed explanation, stacktraces, related
issues, suggestions how to fix, links for us to have context, eg.
stackoverflow, gitter, etc)
validations:
required: false

View file

@ -0,0 +1,41 @@
name: Documentation Change
description: Request or report any updates to our documentation (https://jrnl.sh)
title: Documentation Change
labels: [ ":new:", "documentation" ]
body:
- type: markdown
attributes:
value: |
# Documentation Change
Hello, and thank you for reporting an issue!
Please fill out the points below, as it will make our process much easier.
- type: textarea
id: affected-pages
attributes:
label: Affected Page(s)
description: >
Please tell us which page, or pages, from the documentation site
(https://jrnl.sh) are affected in this issue
placeholder: "example: https://jrnl.sh/en/stable/overview"
validations:
required: true
- type: textarea
id: what-could-be-better
attributes:
label: What Could Be Better?
description: >
Please write a short description of what you hope can be clarified or
further explained.
validations:
required: true
- type: textarea
id: other-info
attributes:
label: Other Information
description: Is there anything else we should know that might be helpful?
validations:
required: false

View file

@ -1,19 +0,0 @@
---
name: Feature request
about: Suggest an idea for jrnl
title: ''
labels: ":new:, enhancement"
assignees: ''
---
## Feature Request
Hello! Thank you for reporting an issue!
If you would fill out the below points, that would make our process a whole lot easier!
* **What is the motivation / use case for changing the behavior?**
* **Please provide examples of the usage**
* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

View file

@ -0,0 +1,43 @@
name: Feature Request
description: Suggest an idea for jrnl
title: "Feature Report"
labels: [ ":new:", "enhancement" ]
body:
- type: markdown
attributes:
value: |
# Feature Request
Hello, and thank you for reporting an issue!
Please fill out the points below, as it will make our process much easier.
- type: textarea
id: user-case
attributes:
label: Use Case/Motivation
description: What is the motivation / use case for changing the behavior?
placeholder: Tell us about your idea
validations:
required: true
- type: textarea
id: example-usage
attributes:
label: Example Usage
description: Please provide examples of the usage you would like to see.
placeholder: e.g `jrnl --new-flag="super cool new feature"`
validations:
required: true
- type: textarea
id: other-info
attributes:
label: Other Information
description: >
Is there anything else we should know?
(e.g. more detailed explanation, stacktraces, related
issues, suggestions how to fix, links for us to have context, eg.
stackoverflow, gitter, etc)
validations:
required: false

View file

@ -1,26 +0,0 @@
---
name: Support Request
about: Get help with jrnl
title: ''
labels: ":new:, support"
assignees: ''
---
## Support request
Hello! Thank you for reporting an issue!
If you would fill out the below points, that would make our process a whole lot easier!
* **Please tell us about your environment:**
- Jrnl version: (run `jrnl -v`)
- How you installed Jrnl
- Operating system [MacOS, Linux, Windows?]
* **What are you trying to do?**
* **What have you tried?**
* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

View file

@ -0,0 +1,54 @@
name: Support Request
description: Get help with jrnl
title: Support Request
labels: [ ":new:", "support" ]
body:
- type: markdown
attributes:
value: |
# Support Request
Hello, and thank you for reporting an issue!
Please fill out the points below, as it will make our process much easier.
- type: textarea
id: diagnostic
attributes:
label: Diagnostic output
description: Run `jrnl --diagnostic` and paste the output below
placeholder: Paste output here
validations:
required: true
- type: textarea
id: current-behavior
attributes:
label: What are you trying to do?
description: Please put a short description of what is happening.
placeholder: Tell us what is happening
validations:
required: true
- type: textarea
id: tried
attributes:
label: What have you tried?
description: >
Have you tried anything to fix the problem? This can help give us more
information to help you with.
placeholder: Tell us what should be happening
validations:
required: true
- type: textarea
id: other-info
attributes:
label: Other Information
description: >
Is there anything else we should know?
(e.g. more detailed explanation, stacktraces, related
issues, suggestions how to fix, links for us to have context, eg.
stackoverflow, gitter, etc)
validations:
required: false

View file

@ -1,19 +1,24 @@
<!--
Thank you for wanting to contribute!
# **TEMPLATE PLEASE EDIT** Please fill out this description, and the checklist below.
*Thank you for wanting to contribute! Please fill out this description as well as look at the checklist!*
Here are some key points to include in your description:
- What is this new code intended to do?
- Are there any related issues?
- What is the motivation for this change?
- What is an example of usage, or changes to config files? (if applicable)
-->
*Short block of text containing:
- Relevant changes in text form
- related issues
- Motivation (if applicable)
- Example of usage (if applicable)
- Example of changes to config files (if applicable)
*
### Checklist ### Checklist
- [ ] The code change is tested and works locally.
- [ ] Tests pass. Your PR cannot be merged unless tests pass - [ ] I have read the [contributing doc](https://github.com/jrnl-org/jrnl/blob/develop/docs/contributing.md).
- [ ] There is no commented out code in this PR. - [ ] I have included a link to the relevant issue number.
- [ ] Have you followed the guidelines in our Contributing document? - [ ] I have checked to ensure there aren't other open [pull requests](../pulls)
- [ ] Have you checked to ensure there aren't other open [Pull Requests](../pulls) for the same update/change? for the same issue.
- [ ] Have you added an explanation of what your changes do and why you'd like us to include them? - [ ] I have written new tests for these changes, as needed.
- [ ] Have you written new tests for your core changes, as applicable? <!--
NOTE: Your PR may not be reviewed if there are any failing tests. You can run
tests locally with `poe test` (see the contributing doc if you need help with
`poe`), or use our automated tests after you submit your PR.
-->

17
.github/actionlint-matcher.json vendored Normal file
View file

@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}

46
.github/actions/run_tests/action.yaml vendored Normal file
View file

@ -0,0 +1,46 @@
name: run jrnl tests
description: Runs all jrnl tests on multiple platforms
inputs:
cache-string:
description: 'Cache string secret. Change to bust the cache'
required: true
runs:
using: "composite"
steps:
- run: git config --global core.autocrlf false
shell: bash
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Capture full Python version in env
run: echo "PYTHON_FULL_VERSION=$(python --version)" >> $GITHUB_ENV
shell: bash
- name: poetry cache # Change CACHE_STRING secret to bust the cache
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_FULL_VERSION }}-${{ inputs.cache-string }}
- name: Install dependencies
run: |
echo '::group::poetry'
pip --disable-pip-version-check install poetry
poetry config --local virtualenvs.in-project true
echo '::endgroup::'
echo '::group::Other dependencies'
poetry sync
echo '::endgroup::'
echo 'DEPS_INSTALLED=true' >> $GITHUB_ENV
shell: bash
- name: Linting & Testing
if: ${{ env.DEPS_INSTALLED == 'true' }}
run: poetry run poe test
shell: bash

39
.github/lock.yml vendored Normal file
View file

@ -0,0 +1,39 @@
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 90
# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: false
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: []
# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: ':lock:'
# Comment to post before locking. Set to `false` to disable
lockComment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs. You can link back here from your new issue to continue
the conversation.
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: true
# Limit to only `issues` or `pulls`
# only: issues
# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
# exemptLabels:
# - help-wanted
# lockLabel: outdated
# pulls:
# daysUntilLock: 30
# Repository to extend settings from
# _extends: repo

14
.github/renovate.json vendored Normal file
View file

@ -0,0 +1,14 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"schedule": [ "at any time" ],
"prConcurrentLimit": 10,
"prHourlyLimit": 10,
"reviewers": [
"wren",
"micahellison"
],
"labels": [ "packaging" ]
}

4
.github/stale.yml vendored
View file

@ -4,8 +4,8 @@ daysUntilStale: 60
daysUntilClose: 7 daysUntilClose: 7
# Issues with these labels will never be considered stale # Issues with these labels will never be considered stale
exemptLabels: exemptLabels:
- ':star:' - ':pushpin:'
- security - critical
# Label to use when marking an issue as stale # Label to use when marking an issue as stale
staleLabel: stale staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable # Comment to post when marking an issue as stale. Set to `false` to disable

170
.github/workflows/changelog.yaml vendored Normal file
View file

@ -0,0 +1,170 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
name: Changelog
on:
push:
branches:
- develop
tags:
- 'v*'
jobs:
generate:
if: >
! contains(github.event.head_commit.message, '[ci skip]') &&
! (
startsWith(github.event.head_commit.message, 'Increment version to v') &&
startsWith(github.ref, 'refs/heads/')
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.JRNL_BOT_TOKEN }}
- name: Check branch for new commits, and env vars
run: |
echo "::group::git fetch origin --tags --force"
git fetch origin --tags --force
echo "::endgroup::"
TAG_REGEX='include-all'
echo "::debug::GITHUB_REF: $GITHUB_REF"
BRANCH="${GITHUB_REF##*/}"
if [[ $GITHUB_REF =~ ^refs/tags/ ]]; then
# This is a tag build (i.e. a release)
echo '::debug::Release build'
if [[ ! $BRANCH =~ ^v[0-9]+(\.[0-9]+){1,2}(-(alpha|beta)([0-9]+)?)?$ ]]; then
echo "::error::Invalid tag format: ${BRANCH}"
exit 1
fi
RELEASE=1
BRANCH=develop
git checkout $BRANCH
# if actual release (not pre), then changelog should exclude prereleases on update
prerelease_regex='(alpha|beta)'
if [[ ! ${GITHUB_REF##*/} =~ $prerelease_regex ]]; then
echo '::debug::Actual release (not a prerelease)'
TAG_REGEX="$prerelease_regex"
echo "FULL_RELEASE=true" >> "$GITHUB_ENV"
fi
fi
echo "::debug::TAG_REGEX: $TAG_REGEX"
if [[ "$(git rev-parse "origin/$BRANCH")" != "$GITHUB_SHA" ]]; then
# Normal build on a branch (no tag)
echo "::debug::BRANCH: $BRANCH $(git rev-parse "origin/$BRANCH")"
echo "::debug::GITHUB_SHA: $GITHUB_SHA"
echo "::error::$BRANCH has been updated since build started. Aborting changelog."
exit 1
fi
SINCE_TAG=$(git tag --sort=-creatordate | grep -Ev "$TAG_REGEX" | awk "NR==$(( 1 + ${RELEASE:-0} ))")
echo "::debug::BRANCH: $BRANCH"
echo "::debug::TAG_REGEX: $TAG_REGEX"
echo "::debug::FILENAME: CHANGELOG.md"
echo "::debug::SINCE_TAG: $SINCE_TAG"
{
echo "BRANCH=$BRANCH"
echo "TAG_REGEX=$TAG_REGEX"
echo "FILENAME=CHANGELOG.md"
echo "SINCE_TAG=$SINCE_TAG"
} >> "$GITHUB_ENV"
- name: Prep changelog file (clear out old lines)
run: |
# delete the top of the changelog up to the correct tag
tagline=$(grep -n "^## \[${SINCE_TAG}\]" "$FILENAME" | awk '{print $1}' FS=':' | head -1)
echo "tagline: ${tagline}"
if [[ -z $tagline ]]; then
echo "::error::Something is wrong. ${SINCE_TAG} isn't in the changelog."
exit 1
fi
if [[ $tagline == 1 ]]; then
echo "::error::Something is wrong."
echo "::error::The latest release ${SINCE_TAG} is the first line in the changelog,"
echo "::error::but the h1 '# Changelog' should always be the first line."
exit 1
fi
sed -i "1,$(( tagline - 1 ))d" "$FILENAME"
# delete generated line (or it will be added multiple times)
sed -i '/This Changelog was automatically generated by/d' "$FILENAME"
# delete trailing empty lines
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' "$FILENAME"
- name: Generate changelog
uses: heinrichreimer/action-github-changelog-generator@v2.1.1
with:
# see: https://github.com/heinrichreimer/action-github-changelog-generator
repo: jrnl-org/jrnl
token: ${{ secrets.JRNL_BOT_TOKEN }}
base: CHANGELOG.md
addSections: '{"build":{"prefix":"**Build:**","labels":["build"]},"docs":{"prefix":"**Documentation:**","labels":["documentation"]},"packaging":{"prefix":"**Packaging:**","labels":["packaging"]}}'
issues: true
pullRequests: true
issuesWoLabels: false
unreleased: true
compareLink: true
includeLabels: bug,enhancement,documentation,build,packaging,deprecated
excludeLabels: stale,wontfix
excludeTagsRegex: ${{ env.TAG_REGEX }}
sinceTag: ${{ env.SINCE_TAG }}
maxIssues: 150
releaseUrl: https://pypi.org/project/jrnl/%s/
releaseBranch: develop
verbose: false
author: true
- name: Small fixes
run: |
# Change unreleased link to correct url
sed -i 's!https://pypi.org/project/jrnl/HEAD/!https://github.com/jrnl-org/jrnl/!' "$FILENAME"
- name: Diff and consistency check
run: |
git diff
if [[ $(grep -c '^# Changelog$' "$FILENAME") != 1 ]]; then
echo '::error::Something is wrong with the changelog.'
exit 1
fi
SOMETHING_CHANGED=false
git diff --exit-code || SOMETHING_CHANGED=true
echo "::debug::SOMETHING_CHANGED: $SOMETHING_CHANGED"
echo "SOMETHING_CHANGED=$SOMETHING_CHANGED" >> "$GITHUB_ENV"
- name: Commit
if: env.SOMETHING_CHANGED == 'true'
run: |
git config --global user.name "${{ secrets.JRNL_BOT_NAME }}"
git config --global user.email "${{ secrets.JRNL_BOT_EMAIL }}"
git add "$FILENAME"
git commit -m "Update changelog [ci skip]"
git push origin "$BRANCH"
- name: Update tag to include changelog
if: startsWith(env.GITHUB_REF, 'refs/tags/')
run: |
# This is a tag build (releases and prereleases)
# update the tag to include the changelog
git tag -fam "$GITHUB_REF_NAME" "$GITHUB_REF_NAME"
git push --tags --force
- name: Merge to Release branch
if: env.FULL_RELEASE == 'true'
run: |
git fetch --unshallow origin
git checkout release
git merge --ff-only "$BRANCH"
git push origin release

76
.github/workflows/docs.yaml vendored Normal file
View file

@ -0,0 +1,76 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
name: Docs
on:
push:
branches: [ develop, release ]
paths:
- 'docs/**'
- 'docs_theme/**'
- 'mkdocs.yml'
- 'readthedocs.yml'
- '.github/workflows/docs.yaml'
- 'tasks.py'
- 'pyproject.toml'
pull_request:
branches: [ develop ]
paths:
- 'docs/**'
- 'docs_theme/**'
- 'mkdocs.yml'
- 'readthedocs.yml'
- '.github/workflows/docs.yaml'
- 'tasks.py'
- 'pyproject.toml'
jobs:
accessibility:
if: contains(toJson(github.event.commits), '[ci skip]') == false
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [ '3.11' ]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Node.js environment
uses: actions/setup-node@main
- name: Capture full Python version in env
run: echo "PYTHON_FULL_VERSION=$(python --version)" >> "$GITHUB_ENV"
- name: poetry cache
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_FULL_VERSION }}-${{ secrets.CACHE_STRING }}
- name: npm cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-pa11y-v3
- name: Install dependencies
run: |
pip install poetry
poetry config --local virtualenvs.in-project true
poetry sync --no-root
npm install
echo "node_modules/.bin" >> "$GITHUB_PATH"
- name: Start docs server
run: poetry run poe docs-run &
- name: Accessibility testing (Pa11y)
run: poetry run poe docs-check

109
.github/workflows/release.yaml vendored Normal file
View file

@ -0,0 +1,109 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version (e.g. v2.5, v2.5.1-beta, v2.6-beta2)'
type: string
required: true
include_repo_version:
description: 'Update version in repo?'
type: boolean
required: true
default: true
include_pypi:
description: 'Publish to PyPI?'
type: boolean
required: true
default: true
jobs:
validate:
name: "Validate version string"
runs-on: ubuntu-latest
steps:
- name: Validate version
run: |
JRNL_VERSION="${{ github.event.inputs.version }}"
echo "::debug::version: $JRNL_VERSION"
if [[ ! $JRNL_VERSION =~ ^v[0-9]+(\.[0-9]+){1,2}(-(alpha|beta)([0-9]+)?)?$ ]]; then
echo
echo "::error::Bad version"
echo
echo "Version string should match pattern above."
echo "Here are some examples of valid version numbers:"
echo
echo " v2.5"
echo " v2.5-alpha"
echo " v2.5-beta"
echo " v2.5.1"
echo " v2.5.1-alpha"
echo " v2.5.1-beta"
exit 1
fi
release_pypi:
needs: validate
name: "Release to PyPI"
runs-on: ubuntu-latest
outputs:
pypi_version: ${{ steps.pypi-version-getter.outputs.pypi_version }}
env:
HOME_REPO: ${{ secrets.HOME_REPO }}
steps:
- name: Get version
run: |
JRNL_VERSION="${{ github.event.inputs.version }}"
echo "::debug::version: $JRNL_VERSION"
echo "JRNL_VERSION=$JRNL_VERSION" >> "$GITHUB_ENV"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Checkout repo
uses: actions/checkout@v4
with:
token: ${{ secrets.JRNL_BOT_TOKEN }}
- name: Config git user
run: |
git config --global user.name "${{ secrets.JRNL_BOT_NAME }}"
git config --global user.email "${{ secrets.JRNL_BOT_EMAIL }}"
- name: Install dependencies
run: pip install poetry
- name: Update version in files
if: ${{ github.event.inputs.include_repo_version == 'true' }}
run: |
poetry version "$JRNL_VERSION"
echo "__version__ = \"$JRNL_VERSION\"" > jrnl/__version__.py
- name: Commit updated files
if: ${{ github.event.inputs.include_repo_version == 'true' && github.repository == env.HOME_REPO }}
run: |
git add pyproject.toml jrnl/__version__.py
git commit -m "Increment version to ${JRNL_VERSION}"
git tag -a -m "$JRNL_VERSION" "$JRNL_VERSION"
git push
git push --tags
- name: Build
run: poetry build
- name: Deploy to PyPI
if: ${{ github.event.inputs.include_pypi == 'true' && github.repository == env.HOME_REPO }}
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish
- name: Get PyPI version
id: pypi-version-getter
run: |
pypi_version="$(find dist/jrnl-*.tar.gz | sed -r 's!dist/jrnl-(.*)\.tar\.gz!\1!')"
echo "pypi_version=$pypi_version" >> "$GITHUB_OUTPUT"

View file

@ -0,0 +1,35 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
name: Testing Pipeline Files
on:
push:
branches: [ develop, release ]
paths:
- '.github/workflows/**'
- '.github/actions/**'
pull_request:
branches: [ develop ]
paths:
- '.github/workflows/**'
- '.github/actions/**'
schedule:
- cron: '0 0 * * SAT'
jobs:
test:
if: >
! contains(github.event.head_commit.message, '[ci skip]')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- name: Check workflow files
uses: docker://rhysd/actionlint:latest
with:
args: -color

48
.github/workflows/testing_prs.yaml vendored Normal file
View file

@ -0,0 +1,48 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
name: Testing
on:
push:
branches: [ develop, release ]
paths:
- 'jrnl/**'
- 'features/**'
- 'tests/**'
- 'poetry.lock'
- 'pyproject.toml'
- '.github/workflows/testing_prs.yaml'
- 'tasks.py'
pull_request:
branches: [ develop ]
paths:
- 'jrnl/**'
- 'features/**'
- 'tests/**'
- 'poetry.lock'
- 'pyproject.toml'
- '.github/workflows/testing_prs.yaml'
- 'tasks.py'
defaults:
run:
shell: bash # needed to prevent Windows from using PowerShell
jobs:
test:
if: >
! contains(github.event.head_commit.message, '[ci skip]')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- name: Run tests
uses: ./.github/actions/run_tests
with:
cache-string: ${{ secrets.CACHE_STRING }}

28
.github/workflows/testing_schedule.yaml vendored Normal file
View file

@ -0,0 +1,28 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
name: Testing
on:
schedule:
- cron: '0 0 * * SAT'
defaults:
run:
shell: bash # needed to prevent Windows from using PowerShell
jobs:
test_all:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- name: Run tests
uses: ./.github/actions/run_tests
with:
cache-string: ${{ secrets.CACHE_STRING }}

71
.gitignore vendored
View file

@ -1,54 +1,63 @@
# Byte-compiled DLL and Shared Library files
*.py[cod] *.py[cod]
# C extensions
*.so *.so
.python-version
# Packages # Packages
*.egg *.egg
*.egg-info *.egg-info/
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg .installed.cfg
lib bin/
lib64 build/
develop-eggs/
dist/
eggs/
lib64/
parts/
sdist/
.tox/
var/
node_modules/
__pycache__/
.pytest_cache/
.flakeheaven_cache/
# Versioning
.python-version .python-version
.tool-versions
# Installer logs # Installer logs
pip-log.txt
.DS_Store .DS_Store
.travis-solo .travis-solo
Icon Icon
pip-log.txt
# Documentation # Documentation
_build _build
_sources _sources
_static _static
coverage.xml
exp/
objects.inv objects.inv
searchindex.js searchindex.js
# MS Visual Studio (PyTools) # virtualenv
obj .venv*/
*.pyproj
*.sln
*.suo
# virtaulenv
env/ env/
env*/ env*/
venv*/
# PyCharm Project files # Editor and IDE specific files
.idea/ # Since contributors may want to user a variety of development tools it is
# recommended that editor specific file types be ignored globally by each
# export testing director # contributor via a global gitignore. Instructions for setting up a global
exp/ # ignore file can be found here:
# https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
_extras/ # (Configuring ignored files for all repositories on your computer)
*.sublime-* # Examples of such files are:
site/ # MS Visual Studio (PyTools)
# obj
# *.suo
# PyCharm
# .idea/
# VS Code
# .vscode/settings.json

28
.readthedocs.yaml Normal file
View file

@ -0,0 +1,28 @@
# readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the OS
build:
os: ubuntu-22.04
tools:
python: "3"
# Build documentation in the docs/ directory
mkdocs:
configuration: mkdocs.yml
fail_on_warning: false
# Optionally build your docs in additional formats such as PDF
formats:
- pdf
- epub
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: docs_theme/requirements.txt

View file

@ -1,67 +0,0 @@
dist: xenial # required for Python >= 3.7
language: python
jobs:
include:
- name: "Python 3.6 on Linux"
python: 3.6
- name: "Python 3.7 on Linux"
python: 3.7
- name: "Python 3.7 on Linux, not UTC"
python: 3.7
env:
- TZ=America/Edmonton
- name: "Python 3.8 on Linux"
python: 3.8
- name: "Python dev on Linux"
python: nightly
- name: "Python 3.7.4 on MacOS"
os: osx
osx_image: xcode11.2 # Python 3.7.4 running on macOS 10.14.4
language: shell # 'language: python' is an error on Travis CI macOS
before_install:
- pip3 install poetry~=0.12.17 # 'pip' points to Python 2 on MacOS
- name: "Python 3.7.5 on Windows"
os: windows
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version 3.7.5
- python -m pip install --upgrade pip
- pip --version
- pip install poetry~=0.12.17
env:
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
allow_failures:
- python: 3.8
- python: nightly
- os: windows
git:
depth: false
cache: pip
before_install:
- date
- pip install poetry~=0.12.17
install:
# we run `poetry version` here to appease poetry about '0.0.0-source'
- poetry version
- poetry install
- poetry run python --version
script:
- poetry run behave
before_deploy:
- poetry config http-basic.pypi $PYPI_USER $PYPI_PASS
- poetry version $TRAVIS_TAG
- poetry build
deploy:
- provider: script
script: poetry publish
skip_cleanup: true
on:
branch: master
tags: true
after_deploy:
- git config --global user.email "jrnl.bot@gmail.com"
- git config --global user.name "Jrnl Bot"
- git checkout master
- git add pyproject.toml
- git commit -m "Incrementing version to ${TRAVIS_TAG}"
- git push https://${GITHUB_TOKEN}@github.com/jrnl-org/jrnl.git master

File diff suppressed because it is too large Load diff

View file

@ -2,65 +2,126 @@
## Our Pledge ## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers We as members, contributors, and leaders pledge to make participation in our
pledge to making participation in our project and our community a harassment-free experience for community a harassment-free experience for everyone, regardless of age, body
everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity size, visible or invisible disability, ethnicity, sex characteristics, gender
and expression, level of experience, education, socio-economic status, nationality, personal identity and expression, level of experience, education, socio-economic status,
appearance, race, religion, or sexual identity and orientation. nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards ## Our Standards
Examples of behavior that contributes to creating a positive environment include: Examples of behavior that contributes to a positive environment for our
community include:
* Using welcoming and inclusive language Being respectful of differing viewpoints and experiences * Demonstrating empathy and kindness toward other people
* Gracefully accepting constructive criticism Focusing on what is best for the community Showing * Being respectful of differing opinions, viewpoints, and experiences
* empathy towards other community members * Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior by participants include: Examples of unacceptable behavior include:
* The use of sexualized language or imagery and unwelcome sexual attention or * The use of sexualized language or imagery, and sexual attention or
advances advances of any kind
* Trolling, insulting/derogatory comments, and personal or political attacks Public or private * Trolling, insulting or derogatory comments, and personal or political attacks
* harassment Publishing others' private information, such as a physical or electronic * Public or private harassment
address, without explicit permission * Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a * Other conduct which could reasonably be considered inappropriate in a
professional setting professional setting
## Our Responsibilities ## Enforcement Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are Community leaders are responsible for clarifying and enforcing our standards of
expected to take appropriate and fair corrective action in response to any instances of unacceptable acceptable behavior and will take appropriate and fair corrective action in
behavior. response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, Community leaders have the right and responsibility to remove, edit, or reject
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or comments, commits, code, wiki edits, issues, and other contributions that are
to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, not aligned to this Code of Conduct, and will communicate reasons for moderation
threatening, offensive, or harmful. decisions when appropriate.
## Scope ## Scope
This Code of Conduct applies within all project spaces, and it also applies when an individual is This Code of Conduct applies within all community spaces, and also applies when
representing the project or its community in public spaces. Examples of representing a project or an individual is officially representing the community in public spaces.
community include using an official project e-mail address, posting via an official social media Examples of representing our community include using an official e-mail address,
account, or acting as an appointed representative at an online or offline event. Representation of a posting via an official social media account, or acting as an appointed
project may be further defined and clarified by project maintainers. representative at an online or offline event.
## Enforcement ## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting Instances of abusive, harassing, or otherwise unacceptable behavior may be
the project team. All complaints will be reviewed and investigated and will result in a response reported by [emailing the maintainers](mailto:maintainers@jrnl.sh).
that is deemed necessary and appropriate to the circumstances. The project team is obligated to All complaints will be reviewed and investigated promptly and fairly.
maintain confidentiality with regard to the reporter of an incident. Further details of specific
enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face All community leaders are obligated to respect the privacy and security of the
temporary or permanent repercussions as determined by other members of the project's leadership. reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution ## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at This Code of Conduct is adapted from the [Contributor Covenant][homepage],
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org [homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View file

@ -1,45 +1,8 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Contributing # Contributing
If you use jrnl, you can totally make our day by just saying "thanks for the code." It's your chance to make a programmer happy today! If you have a moment, let us know what you use jrnl for and how; it'll help us to make it even better! See "[Contributing](docs/contributing.md)" in the `docs` directory.
# Table of Contents
* [Docs and Typos](#docs-and-typos)
* [Bugs](#bugs)
* [Feature requests and ideas](#feature-requests-and-ideas)
* [New programmers and programmers new to python](#new-programmers-and-programmers-new-to-python)
* [Developing jrnl](#developing-jrnl)
## Docs and Typos
If you find a typo or a mistake in the docs, please fix it right away and send a pull request. The Right Way™ to fix the docs is to edit the `docs/*.md` files on the **master** branch. You can see the result if you run `make html` inside the project's root directory, which will open a browser that hot-reloads as you change the docs. This requires [mkdocs](https://www.mkdocs.org) to be installed. The `gh-pages` branch is automatically maintained and updates from `master`; you should never have to edit that.
## Bugs
Unfortunately, bugs happen. If you found one, please [open a new issue](https://github.com/jrnl-org/jrnl/issues/new/choose) and describe it as well as possible. If you're a programmer with some time, go ahead and send us a pull request that references the issue! We'll review as quickly as we can.
## Feature requests and ideas
So, you have an idea for a great feature? Awesome! We'd love to hear from you! Please [open a new issue](https://github.com/jrnl-org/jrnl/issues/new/choose) and describe the goal of the feature, and any relevant use cases. We'll discuss the issue with you, and decide if it's a good fit for the project.
When discussing new features, please keep in mind our design goals. jrnl strives to do one thing well. To us, that means:
* be _slim_
* have a simple interface
* avoid duplicating functionality
## New programmers and programmers new to python
Although jrnl has grown quite a bit since its inception, the overall complexity (for an end-user program) is fairly low, and we hope you'll find the code easy enough to understand.
If you have a question, please don't hesitate to ask! Python is known for its welcoming community and openness to novice programmers, so feel free to fork the code and play around with it! If you create something you want to share with us, please create a pull request. We never expect pull requests to be perfect, idiomatic, instantly mergeable code. We can work through it together!
## Developing jrnl
The jrnl source uses [poetry](https://poetry.eustace.io/) for dependency management. You will need to install it to develop journal.
* To run tests: `make test` (or `poetry run behave` if on Windows)
* To run the source: `poetry install` then `poetry shell` then run `jrnl` with or without arguments as necessary
For testing, jrnl uses [behave](https://behave.readthedocs.io/).

21
LICENSE
View file

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2014-2019 Manuel Ebert
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

675
LICENSE.md Normal file
View file

@ -0,0 +1,675 @@
### GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
### Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom
to share and change all versions of a program--to make sure it remains
free software for all its users. We, the Free Software Foundation, use
the GNU General Public License for most of our software; it applies
also to any other work released this way by its authors. You can apply
it to your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you
have certain responsibilities if you distribute copies of the
software, or if you modify it: responsibilities to respect the freedom
of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the
manufacturer can do so. This is fundamentally incompatible with the
aim of protecting users' freedom to change the software. The
systematic pattern of such abuse occurs in the area of products for
individuals to use, which is precisely where it is most unacceptable.
Therefore, we have designed this version of the GPL to prohibit the
practice for those products. If such problems arise substantially in
other domains, we stand ready to extend this provision to those
domains in future versions of the GPL, as needed to protect the
freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish
to avoid the special danger that patents applied to a free program
could make it effectively proprietary. To prevent this, the GPL
assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
### TERMS AND CONDITIONS
#### 0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of
an exact copy. The resulting work is called a "modified version" of
the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user
through a computer network, with no transfer of a copy, is not
conveying.
An interactive user interface displays "Appropriate Legal Notices" to
the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
#### 1. Source Code.
The "source code" for a work means the preferred form of the work for
making modifications to it. "Object code" means any non-source form of
a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users can
regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same
work.
#### 2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey,
without conditions so long as your license otherwise remains in force.
You may convey covered works to others for the sole purpose of having
them make modifications exclusively for you, or provide you with
facilities for running those works, provided that you comply with the
terms of this License in conveying all material for which you do not
control copyright. Those thus making or running the covered works for
you must do so exclusively on your behalf, under your direction and
control, on terms that prohibit them from making any copies of your
copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the
conditions stated below. Sublicensing is not allowed; section 10 makes
it unnecessary.
#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such
circumvention is effected by exercising rights under this License with
respect to the covered work, and you disclaim any intention to limit
operation or modification of the work as a means of enforcing, against
the work's users, your or third parties' legal rights to forbid
circumvention of technological measures.
#### 4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
#### 5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these
conditions:
- a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
- b) The work must carry prominent notices stating that it is
released under this License and any conditions added under
section 7. This requirement modifies the requirement in section 4
to "keep intact all notices".
- c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
- d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
#### 6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of
sections 4 and 5, provided that you also convey the machine-readable
Corresponding Source under the terms of this License, in one of these
ways:
- a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
- b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the Corresponding
Source from a network server at no charge.
- c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
- d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
- e) Convey the object code using peer-to-peer transmission,
provided you inform other peers where the object code and
Corresponding Source of the work are being offered to the general
public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal,
family, or household purposes, or (2) anything designed or sold for
incorporation into a dwelling. In determining whether a product is a
consumer product, doubtful cases shall be resolved in favor of
coverage. For a particular product received by a particular user,
"normally used" refers to a typical or common use of that class of
product, regardless of the status of the particular user or of the way
in which the particular user actually uses, or expects or is expected
to use, the product. A product is a consumer product regardless of
whether the product has substantial commercial, industrial or
non-consumer uses, unless such uses represent the only significant
mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to
install and execute modified versions of a covered work in that User
Product from a modified version of its Corresponding Source. The
information must suffice to ensure that the continued functioning of
the modified object code is in no case prevented or interfered with
solely because modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or
updates for a work that has been modified or installed by the
recipient, or for the User Product in which it has been modified or
installed. Access to a network may be denied when the modification
itself materially and adversely affects the operation of the network
or violates the rules and protocols for communication across the
network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
#### 7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders
of that material) supplement the terms of this License with terms:
- a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
- b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
- c) Prohibiting misrepresentation of the origin of that material,
or requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
- d) Limiting the use for publicity purposes of names of licensors
or authors of the material; or
- e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
- f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions
of it) with contractual assumptions of liability to the recipient,
for any liability that these contractual assumptions directly
impose on those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions; the
above requirements apply either way.
#### 8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
#### 9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run
a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
#### 10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
#### 11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned
or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within the
scope of its coverage, prohibits the exercise of, or is conditioned on
the non-exercise of one or more of the rights that are specifically
granted under this License. You may not convey a covered work if you
are a party to an arrangement with a third party that is in the
business of distributing software, under which you make payment to the
third party based on the extent of your activity of conveying the
work, and under which the third party grants, to any of the parties
who would receive the covered work from you, a discriminatory patent
license (a) in connection with copies of the covered work conveyed by
you (or copies made from those copies), or (b) primarily for and in
connection with specific products or compilations that contain the
covered work, unless you entered into that arrangement, or that patent
license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
#### 12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under
this License and any other pertinent obligations, then as a
consequence you may not convey it at all. For example, if you agree to
terms that obligate you to collect a royalty for further conveying
from those to whom you convey the Program, the only way you could
satisfy both those terms and this License would be to refrain entirely
from conveying the Program.
#### 13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
#### 14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions
of the GNU General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in
detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies that a certain numbered version of the GNU General Public
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that numbered version or
of any later version published by the Free Software Foundation. If the
Program does not specify a version number of the GNU General Public
License, you may choose any version ever published by the Free
Software Foundation.
If the Program specifies that a proxy can decide which future versions
of the GNU General Public License can be used, that proxy's public
statement of acceptance of a version permanently authorizes you to
choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
#### 15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
#### 16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#### 17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
### How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively state
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper
mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands \`show w' and \`show c' should show the
appropriate parts of the General Public License. Of course, your
program's commands might be different; for a GUI interface, you would
use an "about box".
You should also get your employer (if you work as a programmer) or
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. For more information on this, and how to apply and follow
the GNU GPL, see <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your
program into proprietary programs. If your program is a subroutine
library, you may consider it more useful to permit linking proprietary
applications with the library. If this is what you want to do, use the
GNU Lesser General Public License instead of this License. But first,
please read <https://www.gnu.org/licenses/why-not-lgpl.html>.

View file

@ -1,29 +0,0 @@
# A Makefile for commands I run frequently:
clean:
rm -rf dist
rm -rf _static
rm -rf jrnl.egg-info
rm -rf _build
rm -rf _sources
rm -rf _static
rm -rf site/
rm -f *.html
html:
poetry run mkdocs serve
format: ## check style with flake8
poetry run black features jrnl
lint: ## check style with flake8
poetry run flake8 jrnl features --ignore E501
test: ## Run behave tests
poetry run behave
build:
poetry build
install: clean ## install the package to the active Python's site-packages
poetry install

View file

@ -1,41 +1,85 @@
jrnl [![Build Status](https://travis-ci.com/jrnl-org/jrnl.svg?branch=master)](https://travis-ci.com/jrnl-org/jrnl) [![Downloads](https://pepy.tech/badge/jrnl)](https://pepy.tech/project/jrnl) [![Version](http://img.shields.io/pypi/v/jrnl.svg?style=flat)](https://pypi.python.org/pypi/jrnl/) <!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
<p align="center">
<a href="https://jrnl.sh">
<img align="center" src="https://raw.githubusercontent.com/jrnl-org/jrnl/develop/docs_theme/assets/readme-header.png"/>
</a>
</p>
jrnl
[![Testing](https://github.com/jrnl-org/jrnl/workflows/Testing/badge.svg)](https://github.com/jrnl-org/jrnl/actions?query=workflow%3ATesting)
[![Downloads](https://pepy.tech/badge/jrnl)](https://pepy.tech/project/jrnl)
[![Version](http://img.shields.io/pypi/v/jrnl.svg?style=flat)](https://pypi.python.org/pypi/jrnl/)
[![Homebrew](https://img.shields.io/homebrew/v/jrnl?style=flat-square)](https://formulae.brew.sh/formula/jrnl)
[![Gitter](https://img.shields.io/gitter/room/jrnl-org/jrnl)](https://gitter.im/jrnl-org/jrnl)
[![Changelog](https://img.shields.io/badge/changelog-on%20github-green)](https://github.com/jrnl-org/jrnl/blob/develop/CHANGELOG.md)
==== ====
_To get help, [submit an issue](https://github.com/jrnl-org/jrnl/issues/new) on Github._ _To get help, [submit an issue](https://github.com/jrnl-org/jrnl/issues/new/choose) on
GitHub._
*jrnl* is a simple journal application for your command line. Journals are stored as human readable plain text files - you can put them into a Dropbox folder for instant syncing and you can be assured that your journal will still be readable in 2050, when all your fancy iPad journal applications will long be forgotten. `jrnl` is a simple journal application for the command line.
Optionally, your journal can be encrypted using the [256-bit AES](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard). You can use it to easily create, search, and view journal entries. Journals are
stored as human-readable plain text, and can also be encrypted using [AES
encryption](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard).
### Why keep a journal? ## In a Nutshell
Journals aren't just for 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. To make a new entry, just enter
In a Nutshell ``` sh
------------- jrnl yesterday: Called in sick. Used the time to clean the house and write my
book.
```
to make a new entry, just type `yesterday:` is interpreted by `jrnl` as a timestamp. Everything until the
first sentence ending (either `.`, `?`, or `!`) is interpreted as the title, and
the rest as the body. In your journal file, the result will look like this:
jrnl yesterday: Called in sick. Used the time to clean the house and spent 4h on writing my book. [2012-03-29 09:00] Called in sick.
Used the time to clean the house and write my book.
and hit return. `yesterday:` will be interpreted as a timestamp. Everything until the first sentence mark (`.?!`) will be interpreted as the title, the rest as the body. In your journal file, the result will look like this: If you just call `jrnl`, you will be prompted to compose your entry - but you
can also configure _jrnl_ to use your external editor.
2012-03-29 09:00 Called in sick. For more information, please read the
Used the time to clean the house and spent 4h on writing my book. [documentation](https://jrnl.sh).
If you just call `jrnl`, you will be prompted to compose your entry - but you can also configure _jrnl_ to use your external editor. ## Contributors
Known Issues ### Maintainers
------------
jrnl used to support integration with Day One, but no longer supports it since Day One 2 was released with a different backend. [See the GitHub issue for more information](https://github.com/jrnl-org/jrnl/issues/409).
Authors Our maintainers help keep the lights on for the project:
-------
Current maintainers:
* Jonathan Wren ([wren](https://github.com/wren)) * Jonathan Wren ([wren](https://github.com/wren))
* Micah Ellison ([micahellison](https://github.com/micahellison)) * Micah Ellison ([micahellison](https://github.com/micahellison))
Original maintainer: Please thank them if you like `jrnl`!
* Manuel Ebert ([maebert](https://github.com/maebert)) ### Code Contributors
This project is made with love by the many fabulous people who have contributed.
`jrnl` couldn't exist without each and every one of you!
<a href="https://github.com/jrnl-org/jrnl/graphs/contributors"><img
src="https://opencollective.com/jrnl/contributors.svg?width=890&button=false"
/></a>
If you'd also like to help make `jrnl` better, please see our [contributing
documentation](docs/contributing.md).
### Financial Backers
Another way show support is through direct financial contributions. These funds
go to covering our costs, and are a quick way to show your appreciation for
`jrnl`.
[Become a financial contributor](https://opencollective.com/jrnl/contribute)
and help us sustain our community.
<a href="https://opencollective.com/jrnl"><img
src="https://opencollective.com/jrnl/individuals.svg?width=890"></a>

7
SECURITY.md Normal file
View file

@ -0,0 +1,7 @@
# Security
If you've discovered a potential security issue in jrnl, please contact the maintainers at [maintainers@jrnl.sh](mailto:maintainers@jrnl.sh).
You can also feel free to [open an issue](https://github.com/jrnl-org/jrnl/issues/new/choose) (but please don't disclose the vulnerability) in case the email goes to spam.
You can find [known privacy and security issues in our documentation](https://jrnl.sh/en/stable/privacy-and-security/).

View file

@ -1,2 +0,0 @@
jrnl.sh

View file

@ -1,70 +1,27 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Advanced Usage # Advanced Usage
## Configuration File ## Configuration File
You can configure the way jrnl behaves in a configuration file. By `jrnl` has a wide variety of options that can be customized through the config file,
default, this is `~/.config/jrnl/jrnl.yaml`. If you have the `XDG_CONFIG_HOME` including templates, formats, multiple journals, and more. See
variable set, the configuration file will be saved as the [configuration file reference](./reference-config-file.md) for details
`$XDG_CONFIG_HOME/jrnl/jrnl.yaml`. or read on for some common use cases.
!!! note ### Multiple journal files
On Windows, the configuration file is typically found at `%USERPROFILE%\.config\jrnl\jrnl.yaml`.
The configuration file is a YAML file with the following options
and can be edited with a plain text editor.
!!! note
Backup your config file before editing. Changes to the config file
have destructive effects on your journal!
- `journals`
paths to your journal files
- `editor`
if set, executes this command to launch an external editor for
writing your entries, e.g. `vim`. Some editors require special
options to work properly, see `FAQ <recipes>` for details.
- `encrypt`
if `true`, encrypts your journal using AES.
- `tagsymbols`
Symbols to be interpreted as tags. (See note below)
- `default_hour` and `default_minute`
if you supply a date, such as `last thursday`, but no specific
time, the entry will be created at this time
- `timeformat`
how to format the timestamps in your journal, see the [python docs](http://docs.python.org/library/time.html#time.strftime) for reference
- `highlight`
if `true`, tags will be highlighted in cyan.
- `linewrap`
controls the width of the output. Set to `false` if you don't
want to wrap long lines.
!!! note
Although it seems intuitive to use the `#`
character for tags, there's a drawback: on most shells, this is
interpreted as a meta-character starting a comment. This means that if
you type
> `jrnl Implemented endless scrolling on the #frontend of our website.`
your bash will chop off everything after the `#` before passing it to
`jrnl`. To avoid this, wrap your input into quotation marks like
this:
> `jrnl "Implemented endless scrolling on the #frontend of our website."`
Or use the built-in prompt or an external editor to compose your
entries.
## Multiple journal files
You can configure `jrnl`to use with multiple journals (eg. You can configure `jrnl`to use with multiple journals (eg.
`private` and `work`) by defining more journals in your `jrnl.yaml`, `private` and `work`) by defining more journals in your [config file](./reference-config-file.md),
for example: for example:
``` yaml ``` yaml
journals: journals:
default: ~\journal.txt default: ~/journal.txt
work: ~\work.txt work: ~/work.txt
``` ```
The `default` journal gets created the first time you start `jrnl` The `default` journal gets created the first time you start `jrnl`
@ -85,31 +42,76 @@ If your `jrnl.yaml` looks like this:
``` yaml ``` yaml
encrypt: false encrypt: false
journals: journals:
default: ~/journal.txt default: ~/journal.txt
work: work:
journal: ~/work.txt journal: ~/work.txt
encrypt: true encrypt: true
food: ~/my_recipes.txt food: ~/my_recipes.txt
``` ```
Your `default` and your `food` journals won't be encrypted, however your Your `default` and your `food` journals won't be encrypted, however your
`work` journal will! You can override all options that are present at `work` journal will!
You can override all options that are present at
the top level of `jrnl.yaml`, just make sure that at the very least the top level of `jrnl.yaml`, just make sure that at the very least
you specify a `journal: ...` key that points to the journal file of you specify a `journal: ...` key that points to the journal file of
that journal. that journal.
Consider the following example configuration
``` yaml
editor: vi -c startinsert
journals:
default: ~/journal.txt
work:
journal: ~/work.txt
encrypt: true
display_format: json
editor: code -rw
food:
display_format: markdown
journal: ~/recipes.txt
```
The `work` journal is encrypted, prints to `json` by default, and is edited using an existing window of VSCode. Similarly, the `food` journal prints to markdown by default, but uses all the other defaults.
### Modifying Configurations from the Command line
You can override a configuration field for the current instance of `jrnl` using `--config-override CONFIG_KEY CONFIG_VALUE` where `CONFIG_KEY` is a valid configuration field, specified in dot notation and `CONFIG_VALUE` is the (valid) desired override value. The dot notation can be used to change config keys within other keys, such as `colors.title` for the `title` key within the `colors` key.
You can specify multiple overrides as multiple calls to `--config-override`.
!!! note !!! note
Changing `encrypt` to a different value will not encrypt or decrypt your These overrides allow you to modify ***any*** field of your jrnl configuration. We trust that you know what you are doing.
journal file, it merely says whether or not your journal
is encrypted. Hence manually changing
this option will most likely result in your journal file being
impossible to load.
## Known Issues #### Examples:
### Unicode on Windows ``` sh
# Create an entry using the `stdin` prompt, for rapid logging
jrnl --config-override editor ""
The Windows shell prior to Windows 7 has issues with unicode encoding. # Populate a project's log
To use non-ascii characters, first tweak Python to recognize the encoding by adding `'cp65001': 'utf_8'`, to `Lib/encoding/aliases.py`. Then, change the codepage with `chcp 1252` before using `jrnl`. jrnl --config-override journals.todo "$(git rev-parse --show-toplevel)/todo.txt" todo find my towel
(Related issue: [#486](https://github.com/jrnl-org/jrnl/issues/486)) # Pass multiple overrides
jrnl --config-override display_format fancy --config-override linewrap 20 \
--config-override colors.title green
```
### Using an alternate config
You can specify an alternate configuration file for the current instance of `jrnl` using `--config-file CONFIG_FILE_PATH` where
`CONFIG_FILE_PATH` is a path to an alternate `jrnl` configuration file.
#### Examples:
``` sh
# Use personalised configuration file for personal journal entries
jrnl --config-file ~/foo/jrnl/personal-config.yaml
# Use alternate configuration file for work-related entries
jrnl --config-file ~/foo/jrnl/work-config.yaml
# Use default configuration file (created on first run)
jrnl
```

View file

@ -1,79 +0,0 @@
/*
Atom One Dark With support for ReasonML by Gidi Morris, based off work by Daniel Gamage
Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
line-height: 1.3em;
color: #e2e8f2;
background: #383e49;
border-radius: 5px;
font-size: 0.9rem;
line-height: 1.3rem;
}
.hljs-keyword, .hljs-operator {
color: #F92672;
}
.hljs-pattern-match {
color: #F92672;
}
.hljs-pattern-match .hljs-constructor {
color: #61aeee;
}
.hljs-function {
color: #61aeee;
}
.hljs-function .hljs-params {
color: #A6E22E;
}
.hljs-function .hljs-params .hljs-typing {
color: #FD971F;
}
.hljs-module-access .hljs-module {
color: #7e57c2;
}
.hljs-constructor {
color: #e2b93d;
}
.hljs-constructor .hljs-string {
color: #9CCC65;
}
.hljs-comment, .hljs-quote {
color: #b18eb1;
font-style: italic;
}
.hljs-doctag, .hljs-formula {
color: #c678dd;
}
.hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst {
color: #e06c75;
}
.hljs-literal {
color: #56b6c2;
}
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string {
color: #98c379;
}
.hljs-built_in, .hljs-class .hljs-title {
color: #e6c07b;
}
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number {
color: #d19a66;
}
.hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title {
color: #61aeee;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
.hljs-link {
text-decoration: underline;
}

View file

@ -1,196 +0,0 @@
/* ------------------------------------------------------------ */
/* Overrides for jrnl theme */
/* ------------------------------------------------------------ */
:root {
--sidebar: #604385;
--sidebar-dark: #604385;
--off-white: rgba(255,255,255,.7);
}
body.wy-body-for-nav, section.wy-nav-content-wrap {
background-color: rgb(252,252,252);
}
pre {
background-color: transparent;
border: none;
margin: 1em -1em;
}
pre code {
padding: 1em 1.5em !important;
}
code {
background-color: transparent;
}
h1,h2 ,h3, h4, h5, h6 {
font-family: "Open Sans", "Helvetica Neue", Helvetica, sans-serif;
font-weight: 600;
margin-top: 2rem;
margin-bottom: 0.5rem;
}
p, td, tr, div, li {
font-family: "Open Sans", "Helvetica Neue", Helvetica, sans-serif;
font-weight: 00;
}
p {
margin: 1em 0em;
}
/* No-one likes lines that are 400 characters long. */
div.rst-content {max-width: 54em;}
.wy-side-nav-search, .wy-nav-top, .wy-menu-vertical li.current {
background-color: transparent;
}
.wy-side-nav-search a.icon-home {
width: 100%;
max-width: 250px;
background-size: 100%;
}
a.icon-home:before {
display: block;
width: 84px;
height: 70px;
content: "";
background: url(../img/logo_white.svg) center center no-repeat;
margin: 10px auto;
}
.wy-menu-vertical a, .wy-menu-vertical li ul li a {color: var(--off-white) !important; }
.wy-menu-vertical a:hover, .wy-menu-vertical li.current a:hover { background-color: transparent !important; color: white !important;}
.wy-menu-vertical li.on a, .wy-menu-vertical li.current>a {
background: transparent; !important;
color: white !important;
border: none;
position: relative;
font-weight: 700 !important;
border-right: none !important;
}
.wy-menu-vertical li.on a, .wy-menu-vertical li.current a {
border-right: none;
}
.wy-menu-vertical li.on a, .wy-menu-vertical li.current>a:after {
display: block;
position: absolute;
right: 0em;
top: 0;
z-index: 999 !important;
content: "";
width: 0;
height: 0;
border-top: 1em solid transparent;
border-bottom: 1em solid transparent;
border-right: 1em solid white;
}
.rst-versions, .rst-versions .rst-current-version { display: none; }
.wy-menu-vertical span {
color: white !important;
font-size: 1.2em;
font-weight: 300 !important;
}
.wy-menu-vertical li a {color: var(--off-white) !important; font-weight: 300 !important;}
.wy-nav-side {
background-image: linear-gradient(211deg, #95699C 0%, #604385 100%);
font-weight: 300 !important;
height: 100%;
}
footer {display: none;}
.wy-side-nav-search input[type=text], form .search-query {
background-color: rgba(0,0,0,.1) !important;
border: 1px solid rgba(255,255,255,.3);
box-shadow: none;
margin-bottom: 1em;
color: white !important;
font-weight: 500;
}
.wy-side-nav-search input[type=text]::placeholder, form .search-query::placeholder {
color: var(--off-white) !important;
}
.toctree-l2 a:first-child {display: none;}
/* ------------------------------------------------------------ */
/* Logo: ; */
/* ------------------------------------------------------------ */
.logo {
width: 128px;
height: 128px;
vertical-align: middle;
margin-right: 1em;
}
/* ------------------------------------------------------------ */
/* Code blocks in callouts */
/* ------------------------------------------------------------ */
div.admonition {
border-radius: 5px;
margin: 1em -1em;
}
div.admonition p.admonition-title {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
div.admonition > p {
padding: 0em .5em;
}
div.admonition div.highlight {
background: none !important;
}
div.admonition div.highlight pre {
background-color: rgba(255,255,255,.5) !important;
}
/* ------------------------------------------------------------ */
/* Fancy ordered lists. */
/* ------------------------------------------------------------ */
ol {
counter-reset:li;
margin-left: 0px;
padding: 0;
}
ol li {
list-style: none !important;
margin-bottom: 1.5em;
margin-left: 3em !important;
}
ol > li:before {
content:counter(li);
counter-increment:li;
background-color: var(--sidebar);
border-radius: 50%;
display: block;
float: left;
margin-left: -3em;
margin-top: -.3em;
width: 2em;
height: 2em;
color: var(--sidebar-dark);
text-align: center;
line-height: 2em;
font-weight: 600;
}

132
docs/contributing.md Normal file
View file

@ -0,0 +1,132 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Contributing to jrnl
We welcome contributions to jrnl, whether it's through reporting bugs, improving the documentation, testing releases, engaging in discussion on features and bugs, or writing code.
## Table of Contents
* [Code of Conduct](#code-of-conduct)
* [Reporting Bugs](#reporting-bugs)
* [Editing Documentation](#editing-documentation)
* [Testing](#testing)
* [Submitting feature requests and ideas](#submitting-feature-requests-and-ideas)
* [Developing jrnl](#developing)
## Code of Conduct
Before starting, please read the [Code of Conduct](https://github.com/jrnl-org/jrnl/blob/develop/CODE_OF_CONDUCT.md).
## Reporting Bugs
Please report bugs by [opening a new issue](https://github.com/jrnl-org/jrnl/issues/new/choose) and describing it as well as possible. Many bugs are specific to a particular operating system and Python version, so please include that information!
## Editing Documentation
If you find a typo or a mistake in the docs, please fix it right away and send a pull request. If you're unsure what to change but still see a problem, you can [open a new issue](https://github.com/jrnl-org/jrnl/issues/new/choose) with the "Documentation change" type.
To edit the documentation, edit the `docs/*.md` files on the **develop** branch. You can see the result by running `poe docs-run` inside the project's root directory, then navigating your browser to [localhost:8000](http://localhost:8000).
### External editors and tips and tricks
If you'd like to share a jrnl command line trick that you find useful, you may find it worthwhile to add it to the ["Tips and Tricks" section](tips-and-tricks.md). For advice on how to integrate a particular external editor, you can add to the ["External Editors" section](external-editors.md).
## Testing
Much of the work of maintaining jrnl involves testing rather than coding.
The nature of jrnl means we deal with extremely sensitive data, and can't risk data loss. While jrnl does have a comprehensive automated testing suite, user testing is crucial to mitigating this risk.
### Prereleases
[Prereleases are deployed through PyPi much like normal releases](https://pypi.org/project/jrnl/#history). You can use [pipx](https://pypi.org/project/pipx/) to fetch them and test them. See the [changelog](https://github.com/jrnl-org/jrnl/blob/develop/CHANGELOG.md) for information on what has changed with each release.
### Pull requests
If you are comfortable enough with git, feel free to fetch particular [pull requests](https://github.com/jrnl-org/jrnl/pulls), test them yourself, and report back your findings. Bonus points if you can add a screencast of how the new feature works.
### Confirm bug reports
There are always [open bugs among our GitHub issues](https://github.com/jrnl-org/jrnl/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and many are specific to a particular OS, Python version, or jrnl version. A simple comment like "Confirmed on jrnl v2.2, MacOS 10.15, Python 3.8.1" would be extremely helpful in tracking down bugs.
### Automate tests
See the develop section below for information on how to contribute new automated tests.
## Submitting feature requests and ideas
If you have a feature request or idea for jrnl, please [open a new issue](https://github.com/jrnl-org/jrnl/issues/new/choose) and describe the goal of the feature, and any relevant use cases. We'll discuss the issue with you, and decide if it's a good fit for the project.
When discussing new features, please keep in mind our design goals. jrnl strives to
[do one thing well](https://en.wikipedia.org/wiki/Unix_philosophy). To us, that means:
* being _nimble_
* having a simple interface
* avoiding duplicating functionality
## Developing
### Getting your environment set up
You will need to install [poetry](https://python-poetry.org/) to develop jrnl. It will take care of all of the project's other dependencies.
### Understanding the branches
jrnl uses two primary branches:
* `develop` - for ongoing development
* `release` - for releases
In general, pull requests should be made on the `develop` branch.
### Common development commands
You can find an inventory of commands in the `pyproject.toml`. Users can run the commands by typing `poe` followed by the name of the command ([Poe the Poet](https://github.com/nat-n/poethepoet) can be installed on its own, or as part of `poetry install`).
A typical development workflow includes:
* Installing dependencies:
* `poetry install`
* Activate virtual environment:
* `poetry shell`
* Running the source in a virtual environment:
* `jrnl` (with or without arguments as necessary)
* Running tests:
* `poe test`
* Formatting the code to standardize its style:
* `poe format`
### Updating automated tests
When resolving bugs or adding new functionality, please add tests to prevent that functionality from breaking in the future. If you notice any functionality that isn't covered in the tests, feel free to submit a test-only pull request as well.
For testing, jrnl uses [pytest](https://docs.pytest.org) for unit tests, and [pytest-bdd](https://pytest-bdd.readthedocs.io/) for integration testing. All tests are in the `tests` folder.
Many tests can be created by only editing `*.feature` files with the same format as other tests. For more complicated functionality, you may need to implement steps in `tests/lib/` which are then executed by your tests in the `feature` files.
### Submitting pull requests
When you're ready, feel free to submit a pull request (PR). The jrnl maintainers generally review the pull requests every two weeks, but the continuous integration pipeline will run on automated tests on it within a matter of minutes and will report back any issues it has found with your code across a variety of environments.
The pull request template contains a checklist full of housekeeping items. Please fill them out as necessary when you submit.
If a pull request contains failing tests, it probably will not be reviewed, and it definitely will not be approved. However, if you need help resolving a failing test, please mention that in your PR.
### Finding things to work on
You can search the [jrnl GitHub issues](https://github.com/jrnl-org/jrnl/issues) by [label](https://github.com/jrnl-org/jrnl/labels) for things to work on. Here are some labels worth searching:
* [critical](https://github.com/jrnl-org/jrnl/labels/critical)
* [help wanted](https://github.com/jrnl-org/jrnl/labels/help%20wanted)
* [bug](https://github.com/jrnl-org/jrnl/labels/bug)
* [enhancement](https://github.com/jrnl-org/jrnl/labels/enhancement)
You can also get a feel for the project's priorities by reviewing the [milestones](https://github.com/jrnl-org/jrnl/milestones).
### A note for new programmers and programmers new to python
Although jrnl has grown quite a bit since its inception, the overall complexity (for an end-user program) is fairly low, and we hope you'll find the code easy enough to understand.
If you have a question, please don't hesitate to ask! Python is known for its welcoming community and openness to novice programmers, so feel free to fork the code and play around with it! If you create something you want to share with us, please create a pull request. We never expect pull requests to be perfect, idiomatic, instantly mergeable code. We can work through it together!

View file

@ -1,94 +1,155 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Encryption # Encryption
## Encrypting and decrypting ## A Note on Security
If you dont choose to encrypt your file when you run While `jrnl` follows best practices, total security is never possible in the
`jrnl` for the first time, you can encrypt real world. There are a number of ways that people can at least partially
your existing journal file or change its password using this: compromise your `jrnl` data. See the [Privacy and Security](./privacy-and-security.md) page
for more information.
## Encrypting and Decrypting
Existing plain text journal files can be encrypted using the `--encrypt`
command:
``` sh ``` sh
jrnl --encrypt jrnl --encrypt [FILENAME]
``` ```
If it is already encrypted, you will first be asked for the current You can then enter a new password, and the unencrypted file will replaced with
password. You can then enter a new password and your plain journal will the new encrypted file.
replaced by the encrypted file. Conversely,
This command also works to change the password for a journal file that is
already encrypted. `jrnl` will prompt you for the current password and then new
password.
Conversely,
``` sh ``` sh
jrnl --decrypt jrnl --decrypt [FILENAME]
``` ```
will replace your encrypted journal file with a journal in plain text. You replaces the encrypted journal file with a plain text file. You can also specify
can also specify a filename, i.e. `jrnl --decrypt plain_text_copy.txt`, a filename, e.g., `jrnl --decrypt plain_text_copy.txt`, to leave the original
to leave your original file untouched. encrypted file untouched and create a new plain text file next to it.
## Storing passwords in your keychain !!! note
Changing `encrypt` in your [config file](./reference-config-file.md) to
a different value will not encrypt or decrypt your
journal file. It merely says whether or not your journal
is encrypted. Hence manually changing
this option will most likely result in your journal file being
impossible to load. This is why the above commands are necessary.
Whenever you encrypt your journal, you are asked whether you want to ## Storing Passwords in Your Keychain
store the encryption password in your keychain. If you do this, you
wont have to enter your password every time you want to write or read
your journal.
If you dont initially store the password in the keychain but decide to Nobody can recover or reset your `jrnl` password. If you lose it,
do so at a later point or maybe want to store it on one computer but your data will be inaccessible forever.
not on another you can simply run `jrnl --encrypt` on an encrypted
journal and use the same password again.
## A note on security For this reason, when encrypting a journal, `jrnl` asks whether you would like
to store the password in your system's keychain. An added benefit is that you
will not need to enter the password when interacting with the journal file.
While jrnl follows best practises, true security is an illusion. If you don't initially store the password in your keychain but decide to do so
Specifically, jrnl will leave traces in your memory and your shell later---or if you want to store it in one computer's keychain but not in another
history its meant to keep journals secure in transit, for example computer's---you can run `jrnl --encrypt` on an encrypted journal and use the
when storing it on an same password again. This will trigger the keychain storage prompt.
[untrusted](http://techcrunch.com/2014/04/09/condoleezza-rice-joins-dropboxs-board/)
services such as Dropbox. If youre concerned about security, disable
history logging for journal in your `.bashrc`:
``` sh ## Manual Decryption
HISTIGNORE="$HISTIGNORE:jrnl *"
```
If you are using zsh instead of bash, you can get the same behaviour by The easiest way to decrypt your journal is with `jrnl --decrypt`, but you could
adding this to your `zshrc`: also decrypt your journal manually if needed. To do this, you can use any
program that supports the AES algorithm (specifically AES-CBC), and you'll need
the following relevant information for decryption:
``` sh - **Key:** The key used for encryption is the
setopt HIST_IGNORE_SPACE [SHA-256](https://en.wikipedia.org/wiki/SHA-2) hash of your password.
alias jrnl=" jrnl" - **Initialization vector (IV):** The IV is stored in the first 16 bytes of
``` your encrypted journal file.
- **The actual text of the journal** (everything after the first 16 bytes in
the encrypted journal file) is encoded in
[UTF-8](https://en.wikipedia.org/wiki/UTF-8) and padded according to
[PKCS\#7](https://en.wikipedia.org/wiki/PKCS_7) before being encrypted.
The fish shell does not support automatically preventing logging like If you'd like an example of what this might look like in script form, please
this. To prevent `jrnl` commands being logged by fish, you must make see below for some examples of Python scripts that you could use to manually
sure to type a space before every `jrnl` command you enter. To delete decrypt your journal.
existing `jrnl` commands from fishs history, run
`history delete --prefix 'jrnl '`.
## Manual decryption
Should you ever want to decrypt your journal manually, you can do so
with any program that supports the AES algorithm in CBC. The key used
for encryption is the SHA-256-hash of your password, the IV
(initialisation vector) is stored in the first 16 bytes of the encrypted
file. The plain text is encoded in UTF-8 and padded according to PKCS\#7
before being encrypted. Heres a Python script that you can use to
decrypt your journal:
!!! note
These are only examples, and are only here to illustrate that your journal files
will still be recoverable even if `jrnl` isn't around anymore. Please use
`jrnl --decrypt` if available.
**Example for jrnl v2 files**:
``` python ``` python
#!/usr/bin/env python3 #!/usr/bin/env python3
"""
Decrypt a jrnl v2 encrypted journal.
Note: the `cryptography` module must be installed (you can do this with
something like `pip3 install crytography`)
"""
import base64
import getpass
from pathlib import Path
from cryptography.fernet import Fernet
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
filepath = input("journal file path: ")
password = getpass.getpass("Password: ")
with open(Path(filepath), "rb") as f:
ciphertext = f.read()
password = password.encode("utf-8")
kdf = PBKDF2HMAC(
algorithm=hashes.SHA256(),
length=32,
salt=b"\xf2\xd5q\x0e\xc1\x8d.\xde\xdc\x8e6t\x89\x04\xce\xf8",
iterations=100_000,
backend=default_backend(),
)
key = base64.urlsafe_b64encode(kdf.derive(password))
print(Fernet(key).decrypt(ciphertext).decode("utf-8"))
```
**Example for jrnl v1 files**:
``` python
#!/usr/bin/env python3
"""
Decrypt a jrnl v1 encrypted journal.
Note: the `pycrypto` module must be installed (you can do this with something
like `pip3 install pycrypto`)
"""
import argparse import argparse
from Crypto.Cipher import AES
import getpass import getpass
import hashlib import hashlib
import sys
from Crypto.Cipher import AES
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("filepath", help="journal file to decrypt") parser.add_argument("filepath", help="journal file to decrypt")
args = parser.parse_args() args = parser.parse_args()
pwd = getpass.getpass() pwd = getpass.getpass()
key = hashlib.sha256(pwd.encode('utf-8')).digest() key = hashlib.sha256(pwd.encode("utf-8")).digest()
with open(args.filepath, 'rb') as f: with open(args.filepath, "rb") as f:
ciphertext = f.read() ciphertext = f.read()
crypto = AES.new(key, AES.MODE_CBC, ciphertext[:16]) crypto = AES.new(key, AES.MODE_CBC, ciphertext[:16])

View file

@ -1,76 +0,0 @@
# Import and Export
## Tag export
With
``` sh
jrnl --tags
```
you'll get a list of all tags you used in your journal, sorted by most
frequent. Tags occurring several times in the same entry are only
counted as one.
## List of all entries
``` sh
jrnl --short
```
Will only display the date and title of each entry.
## JSON export
Can do
``` sh
jrnl --export json
```
Why not create a [beautiful timeline](http://timeline.verite.co/) of
your journal?
## Markdown export
Use
``` sh
jrnl --export markdown
```
Markdown is a simple markup language that is human readable and can be
used to be rendered to other formats (html, pdf). This README for
example is formatted in markdown and github makes it look nice.
## Text export
``` sh
jrnl --export text
```
Pretty-prints your entire journal.
## Export to files
You can specify the output file of your exported journal using the
`-o` argument
``` sh
jrnl --export md -o journal.md
```
The above command will generate a file named `journal.md`. If the`-o` argument is a directory, jrnl will export each entry into an individual file
``` sh
jrnl --export json -o my_entries/
```
The contents of `my\_entries/` will then look like this:
``` output
my_entries/
|- 2013_06_03_a-beautiful-day.json
|- 2013_06_07_dinner-with-gabriel.json
|- ...
```

137
docs/external-editors.md Normal file
View file

@ -0,0 +1,137 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# External editors
Configure your preferred external editor by updating the `editor` option
in your [configuration file](./reference-config-file.md#editor). If your editor is not
in your operating system's `PATH` environment variable, then you will have to
enter the full path of your editor.
Once it's configured, you can create an entry as a new document in your editor using the `jrnl`
command by itself:
``` text
jrnl
```
You can specify the time and title of the entry as usual on the first line of the document.
If you want, you can skip the editor by including a quick entry with the `jrnl` command:
``` text
jrnl yesterday: All my troubles seemed so far away.
```
If you want to start the entry on the command line and continue writing in your chosen editor,
use the `--edit` flag. For example:
``` text
jrnl yesterday: All my troubles seemed so far away. --edit
```
!!! note
To save and log any entry edits, save and close the file.
All editors must be [blocking processes](https://en.wikipedia.org/wiki/Blocking_(computing)) to work with jrnl. Some editors, such as [micro](https://micro-editor.github.io/), are blocking by default, though others can be made to block with additional arguments, such as many of those documented below. If jrnl opens your editor but finishes running immediately, then your editor is not a blocking process, and you may be able to correct that with one of the suggestions below.
Please see [this section](./privacy-and-security.md#editor-history) about how
your editor might leak sensitive information and how to mitigate that risk.
## Sublime Text
To use [Sublime Text](https://www.sublimetext.com/), install the command line
tools for Sublime Text and configure your `jrnl.yaml` like this:
```yaml
editor: "subl -w"
```
Note the `-w` flag to make sure `jrnl` waits for Sublime Text to close the
file before writing into the journal.
## Visual Studio Code
[Visual Studio Code](https://code.visualstudio.com) also requires a flag
that tells the process to wait until the file is closed before exiting:
```yaml
editor: "code --wait"
```
On Windows, `code` is not added to the path by default, so you'll need to
enter the full path to your `code.exe` file, or add it to the `PATH` variable.
## MacVim
Also similar to Sublime Text, MacVim must be started with a flag that tells
the the process to wait until the file is closed before passing control
back to journal. In the case of MacVim, this is `-f`:
```yaml
editor: "mvim -f"
```
## Vim/Neovim
To use any of the Vim derivatives as editor in Linux, simply set the `editor`
to the executable:
```yaml
editor: "vim"
# or
editor: "nvim"
```
## iA Writer
On OS X, you can use the fabulous [iA
Writer](http://www.iawriter.com/mac) to write entries. Configure your
`jrnl.yaml` like this:
```yaml
editor: "open -b pro.writer.mac -Wn"
```
What does this do? `open -b ...` opens a file using the application
identified by the bundle identifier (a unique string for every app out
there). `-Wn` tells the application to wait until it's closed before
passing back control, and to use a new instance of the application.
If the `pro.writer.mac` bundle identifier is not found on your system,
you can find the right string to use by inspecting iA Writer's
`Info.plist` file in your shell:
```sh
grep -A 1 CFBundleIdentifier /Applications/iA\ Writer.app/Contents/Info.plist
```
## Notepad++ on Windows
To set [Notepad++](http://notepad-plus-plus.org/) as your editor, edit
the `jrnl` config file (`jrnl.yaml`) like this:
```yaml
editor: "C:\\Program Files (x86)\\Notepad++\\notepad++.exe -multiInst -nosession"
```
The double backslashes are needed so `jrnl` can read the file path
correctly. The `-multiInst -nosession` options will cause `jrnl` to open
its own Notepad++ window.
## emacs
To use `emacs` as your editor, edit the `jrnl` config file (`jrnl.yaml`) like this:
```yaml
editor: emacsclient -a "" -c
```
When you're done editing the message, save and `C-x #` to close the buffer and stop the emacsclient process.
## Other editors
If you're using another editor and would like to share, feel free to [contribute documentation](./contributing.md#editing-documentation) on it.

354
docs/formats.md Normal file
View file

@ -0,0 +1,354 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Formats
`jrnl` supports a variety of alternate formats. These can be used to display your
journal in a different manner than the `jrnl` default, and can even be used to pipe data
from your journal for use in another program to create reports, or do whatever you want
with your `jrnl` data.
Any of these formats can be used with a search (e.g. `jrnl -contains "lorem ipsum"
--format json`) to display the results of that search in the given format, or can be
used alone (e.g. `jrnl --format json`) to display all entries from the selected journal.
This page shows examples of all the built-in formats, but since `jrnl` supports adding
more formats through plugins, you may have more available on your system. Please see
`jrnl --help` for a list of which formats are available on your system.
Any of these formats can be used interchangeably, and are only grouped into "display",
"data", and "report" formats below for convenience.
## Display Formats
These formats are mainly intended for displaying your journal in the terminal. Even so,
they can still be used in the same way as any other format (like written to a file, if
you choose).
### Pretty
``` sh
jrnl --format pretty
# or
jrnl -1 # any search
```
This is the default format in `jrnl`. If no `--format` is given, `pretty` will be used.
It displays the timestamp of each entry formatted to by the user config followed by the
title on the same line. Then the body of the entry is shown below.
This format is configurable through these values from your config file (see
[Advanced Usage](./advanced.md) for more details):
- `colors`
- `body`
- `date`
- `tags`
- `title`
- `indent_character`
- `linewrap`
- `timeformat`
**Example output**:
``` sh
2020-06-28 18:22 This is the first sample entry
| This is the sample body text of the first sample entry.
2020-07-01 20:00 This is the second sample entry
| This is the sample body text of the second sample entry, but
| this one has a @tag.
2020-07-02 09:00 This is the third sample entry
| This is the sample body text of the third sample entry.
```
### Short
``` sh
jrnl --format short
# or
jrnl --short
```
This will shorten entries to display only the date and title. It is essentially the
`pretty` format but without the body of each entry. This can be useful if you have long
journal entries and only want to see a list of entries that match your search.
**Example output**:
``` sh
2020-06-28 18:22 This is the first sample entry
2020-07-01 20:00 This is the second sample entry
2020-07-02 09:00 This is the third sample entry
```
### Fancy (or Boxed)
``` sh
jrnl --format fancy
# or
jrnl --format boxed
```
This format outlines each entry with a border. This makes it much easier to tell where
each entry starts and ends. It's an example of how free-form the formats can be, and also
just looks kinda ~*~fancy~*~, if you're into that kind of thing.
**Example output**:
``` sh
┎──────────────────────────────────────────────────────────────────────╮2020-06-28 18:22
┃ This is the first sample entry ╘═══════════════╕
┠╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
┃ This is the sample body text of the first sample entry. │
┖──────────────────────────────────────────────────────────────────────────────────────┘
┎──────────────────────────────────────────────────────────────────────╮2020-07-01 20:00
┃ This is the second sample entry ╘═══════════════╕
┠╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
┃ This is the sample body text of the second sample entry, but this one has a @tag. │
┖──────────────────────────────────────────────────────────────────────────────────────┘
┎──────────────────────────────────────────────────────────────────────╮2020-07-02 09:00
┃ This is the third sample entry ╘═══════════════╕
┠╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
┃ This is the sample body text of the third sample entry. │
┖──────────────────────────────────────────────────────────────────────────────────────┘
```
## Data Formats
These formats are mainly intended for piping or exporting your journal to other
programs. Even so, they can still be used in the same way as any other format (like
written to a file, or displayed in your terminal, if you want).
!!! note
You may see boxed messages like "2 entries found" when using these formats, but
those messages are written to `stderr` instead of `stdout`, and won't be piped when
using the `|` operator.
### JSON
``` sh
jrnl --format json
```
JSON is a very handy format used by many programs and has support in nearly every
programming language. There are many things you could do with JSON data. Maybe you could
use `jq` ([project page](https://github.com/stedolan/jq)) to filter through the fields in your journal.
Like this:
``` sh
$ j -3 --format json | jq '.entries[].date' jrnl-GFqVlfgP-py3.8 
"2020-06-28"
"2020-07-01"
"2020-07-02"
```
Or why not create a [beautiful timeline](http://timeline.knightlab.com/) of your journal?
**Example output**:
``` json
{
"tags": {
"@tag": 1
},
"entries": [
{
"title": "This is the first sample entry",
"body": "This is the sample body text of the first sample entry.",
"date": "2020-06-28",
"time": "18:22",
"tags": [],
"starred": false
},
{
"title": "This is the second sample entry",
"body": "This is the sample body text of the second sample entry, but this one has a @tag.",
"date": "2020-07-01",
"time": "20:00",
"tags": [
"@tag"
],
"starred": false
},
{
"title": "This is the third sample entry",
"body": "This is the sample body text of the third sample entry.",
"date": "2020-07-02",
"time": "09:00",
"tags": [],
"starred": false
}
]
}
```
### Markdown
``` sh
jrnl --format markdown
# or
jrnl --format md
```
Markdown is a simple markup language that is human readable and can be used to be
rendered to other formats (html, pdf). `jrnl`'s
[README](https://github.com/jrnl-org/jrnl/blob/develop/README.md) for example is
formatted in markdown, then Github adds some formatting to make it look nice.
The markdown format groups entries by date (first by year, then by month), and adds
header markings as needed (e.g. `#`, `##`, etc). If you already have markdown header
markings in your journal, they will be incremented as necessary to make them fit under
these new headers (i.e. `#` will become `##`).
This format can be very useful, for example, to export a journal to a program that
converts markdown to html to make a website or a blog from your journal.
**Example output**:
``` markdown
# 2020
## June
### 2020-06-28 18:22 This is the first sample entry
This is the sample body text of the first sample entry.
## July
### 2020-07-01 20:00 This is the second sample entry
This is the sample body text of the second sample entry, but this one has a @tag.
### 2020-07-02 09:00 This is the third sample entry
This is the sample body text of the third sample entry.
```
### Plain Text
``` sh
jrnl --format text
# or
jrnl --format txt
```
This outputs your journal in the same plain-text format that `jrnl` uses to store your
journal on disk. This format is particularly useful for importing and exporting journals
within `jrnl`.
You can use it, for example, to move entries from one journal to another, or to create a
new journal with search results from another journal.
**Example output**:
``` sh
[2020-06-28 18:22] This is the first sample entry
This is the sample body text of the first sample entry.
[2020-07-01 20:00] This is the second sample entry
This is the sample body text of the second sample entry, but this one has a @tag.
[2020-07-02 09:00] This is the third sample entry
This is the sample body text of the third sample entry.
```
### XML
``` sh
jrnl --format xml
```
This outputs your journal into XML format. XML is a commonly used data format and is
supported by many programs and programming languages.
**Example output**:
``` xml
<?xml version="1.0" ?>
<journal>
<entries>
<entry date="2020-06-28T18:22:00" starred="">This is the first sample entry This is the sample body text of the first sample entry.</entry>
<entry date="2020-07-01T20:00:00" starred="">
<tag name="@tag"/>
This is the second sample entry This is the sample body text of the second sample entry, but this one has a @tag.
</entry>
<entry date="2020-07-02T09:00:00" starred="">*This is the third sample entry, and is starred This is the sample body text of the third sample entry.</entry>
</entries>
<tags>
<tag name="@tag">1</tag>
</tags>
</journal>
```
### YAML
``` sh
jrnl --format yaml --file 'my_directory/'
```
This outputs your journal into YAML format. YAML is a commonly used data format and is
supported by many programs and programming languages. [Exporting to directories](#exporting-to-directories) is the
only supported YAML export option and each entry will be written to a separate file.
**Example file**:
``` yaml
title: This is the second sample entry
date: 2020-07-01 20:00
starred: False
tags: tag
This is the sample body text of the second sample entry, but this one has a @tag.
```
## Report formats
Since formats use your journal data and display it in different ways, they can also be
used to create reports.
### Tags
``` sh
jrnl --format tags
# or
jrnl --tags
```
This format is a simple example of how formats can be used to create reports. It
displays each tag, and a count of how many entries in which tag appears in your journal
(or in the search results), sorted by most frequent.
Example output:
``` sh
@one : 32
@two : 17
@three : 4
```
## Options
### Exporting with `--file`
Example: `jrnl --format json --file /some/path/to/a/file.txt`
By default, `jrnl` will output entries to your terminal. But if you provide `--file`
along with a filename, the same output that would have been to your terminal will be
written to the file instead. This is the same as piping the output to a file.
So, in bash for example, the following two statements are equivalent:
``` sh
jrnl --format json --file myjournal.json
```
``` sh
jrnl --format json > myjournal.json
```
#### Exporting to directories
If the `--file` argument is a directory, jrnl will export each entry into an individual file:
``` sh
jrnl --format yaml --file my_entries/
```
The contents of `my_entries/` will then look like this:
``` output
my_entries/
|- 2013_06_03_a-beautiful-day.yaml
|- 2013_06_07_dinner-with-gabriel.yaml
|- ...
```

View file

@ -1,19 +1,22 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Getting started # Getting started
## Installation ## Installation
On OS X, the easiest way to install *jrnl* is using The easiest way to install `jrnl` is using
[Homebrew](http://brew.sh/) [pipx](https://pipx.pypa.io/stable/installation/)
with [Python](https://www.python.org/) 3.10+:
``` sh ``` sh
brew install jrnl pipx install jrnl
``` ```
On other platforms, install *jrnl* using pip !!! tip
Do not use `sudo` while installing `jrnl`. This may lead to path issues.
``` sh
pip install jrnl
```
The first time you run `jrnl` you will be asked where your journal file The first time you run `jrnl` you will be asked where your journal file
should be created and whether you wish to encrypt it. should be created and whether you wish to encrypt it.
@ -22,8 +25,8 @@ should be created and whether you wish to encrypt it.
To make a new entry, just type To make a new entry, just type
``` sh ``` text
jrnl yesterday: Called in sick. Used the time to clean the house and spent 4h on writing my book. jrnl yesterday: Called in sick. Used the time to clean, and spent 4h on writing my book.
``` ```
and hit return. `yesterday:` will be interpreted as a time stamp. and hit return. `yesterday:` will be interpreted as a time stamp.
@ -37,4 +40,4 @@ Used the time to clean the house and spent 4h on writing my book.
``` ```
If you just call `jrnl`, you will be prompted to compose your entry - If you just call `jrnl`, you will be prompted to compose your entry -
but you can also configure *jrnl* to use your external editor. but you can also [configure](advanced.md) *jrnl* to use your external editor.

65
docs/journal-types.md Normal file
View file

@ -0,0 +1,65 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Journal Types
`jrnl` can store your journal in a few different ways:
- a single text file (encrypted or otherwise)
- a folder structure organized by date containing unencrypted text files
- the DayOne Classic format
There is no need to specify what type of journal you'd like to use. Instead,
`jrnl` will automatically detect the journal type based on whether you're
referencing a file or a folder in your [config file](advanced.md),
and if it's a folder, whether or not DayOne Classic content exists in it.
## Single File
The single file format is the most flexible, as it can be [encrypted](encryption.md).
To use it, enter any path that is a file or does not already exist. You can
use any extension. `jrnl` will automatically create the file when you save
your first entry.
## Folder
The folder journal format organizes your entries into subfolders for the year
and month and `.txt` files for each day. If there are multiple entries in a day,
they all appear in the same `.txt` file.
The directory tree structure is in this format: `YYYY/MM/DD.txt`. For instance, if
you have an entry on May 5th, 2021 in a folder journal at `~/folderjournal`, it will
be located in: `~/folderjournal/2021/05/05.txt`
!!! note
Creating a new folder journal can be done in two ways:
* Create a folder with the name of the journal before running `jrnl`. Otherwise, when you run `jrnl` for the first time, it will assume that you are creating a single file journal instead, and it will create a file at that path.
* Create a new journal in your [config_file](advanced.md) and end the path with a ``/`` (on a POSIX system like Linux or MacOSX) or a ``\`` (on a Windows system). The folder will be created automatically if it doesn't exist.
!!! note
Folder journals can't be encrypted.
## Day One Classic
`jrnl` supports the original data format used by DayOne. It's similar to the folder
journal format, except it's identified by either of these characteristics:
* the folder has a `.dayone` extension
* the folder has a subfolder named `entries`
This is not to be confused with the DayOne 2.0 format, [which is very different](https://help.dayoneapp.com/en/articles/1187337-day-one-classic-is-retired).
!!! note
DayOne Classic journals can't be encrypted.
## Changing your journal type
You can't simply modify a journal's configuration to change its type. Instead,
define a new journal as the type you'd like, and use
[piping](https://en.wikipedia.org/wiki/Redirection_(computing)#Piping)
to export your old journal as `txt` to an import command on your new journal.
For instance, if you have a `projects` journal you would like to import into
a `new` journal, you would run the following after setting up the configuration
for your `new` journal:
```
jrnl projects --format txt | jrnl new --import
```

View file

@ -1,27 +1,64 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Overview # Overview
## What is jrnl? `jrnl` is a simple journal application for the command line.
`jrnl` is a simple journal application for You can use it to easily create, search, and view journal entries. Journals are
your command line. Journals are stored as human readable plain text stored as human-readable plain text, and can also be encrypted using [AES
files - you can put them into a Dropbox folder for instant syncing and encryption](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard).
you can be assured that your journal will still be readable in 2050,
when all your fancy iPad journal applications will long be forgotten.
Optionally, your journal can be encrypted using the [256-bit `jrnl` has most of the features you need, and few of the ones you don't.
AES](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard).
## Why keep a journal? ## Plain Text
Journals aren't just for people who have too much `jrnl` stores each journal in plain text. You can store `jrnl` files anywhere,
time on their summer vacation. A journal helps you to keep track of the including in shared folders to keep them synchronized between devices. Journal
things you get done and how you did them. Your imagination may be files are compact (thousands of entries take up less than 1 MiB) and can be read
limitless, but your memory isn't. by almost any electronic device, now and for the foreseeable future.
For personal use, make it a good habit to write at least 20 words a day. ## Tags
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 To make it easier to find entries later, `jrnl` includes support for inline tags
complement to your GTD todo list - a documentation of what and how (the default tag symbol is `@`). You can find and filter entries by using tags
you've done it. Or use it as a quick way to keep a change log. Or use it along with other search criteria.
to keep a lab book.
## Support for Multiple Journals
`jrnl` includes support for the creation of multiple journals, each of which
can be stored as a single file or as a set of files. Entries are automatically
timestamped in a human-readable format that makes it easy to view multiple
entries at a time. `jrnl` can easily find the entries you want so that you can
read them or edit them.
## Support for External Editors
`jrnl` plays nicely with your favorite text editor. You may prefer to write
journal entries in an editor. Or you may want to make changes that require a
more comprehensive application. `jrnl` can filter specific entries and pass them
to the [external editor](./external-editors.md) of your choice.
## Encryption
`jrnl` includes support for [AES
encryption](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard). See the
[encryption page](./encryption.md) for more information.
## Import and Export
`jrnl` makes it easy to import entries from other sources. Existing entries can
be exported in a variety of [formats](./formats.md).
## Multi-Platform Support
`jrnl` is compatible with most operating systems. You can [download](./installation.md) it using one
of a variety of package managers, or you can build from source.
## Open-Source
`jrnl` is written in [Python](https://www.python.org) and maintained by a
[friendly community](https://github.com/jrnl-org/jrnl) of open-source software
enthusiasts.

View file

@ -0,0 +1,232 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Privacy and Security
`jrnl` is designed with privacy and security in mind, but like any other
program there are some limitations to be aware of.
## Password strength
`jrnl` doesn't enforce password strength requirements. Short or commonly-used
passwords can be easily circumvented by someone with basic security skills
to access to your encrypted `jrnl` file.
## Plausible deniability
You may be able to hide the contents of your journal behind a layer of encryption,
but if someone has access to your configuration file, then they can figure out that
you have a journal, where that journal file is, and when you last edited it.
With a sufficient power imbalance, someone may be able to force you to unencrypt
it through non-technical means.
## Spying
While `jrnl` can protect against unauthorized access to your journal entries while
it isn't open, it cannot protect you against an unsafe computer/location.
For example:
- Someone installs a keylogger, tracking what you type into your journal.
- Someone watches your screen while you write your entry.
- Someone installs a backdoor into `jrnl` or poisons your journal into revealing your entries.
## Saved Passwords
When creating an encrypted journal, you'll be prompted as to whether or not you
want to "store the password in your keychain." This keychain is accessed using
the [Python keyring library](https://pypi.org/project/keyring/), which has different
behavior depending on your operating system.
In Windows, the keychain is the Windows Credential Manager (WCM), which can't be locked
and can be accessed by any other application running under your username. If this is
a concern for you, you may not want to store your password.
## Shell history
Since you can enter entries from the command line, any tool that logs command
line actions is a potential security risk. See below for how to deal with this
problem in various shells.
### bash
You can disable history logging for jrnl by adding this line into your
`~/.bashrc` file:
``` sh
HISTIGNORE="$HISTIGNORE:jrnl *"
```
To delete existing `jrnl` commands from `bash` history, simply delete them from
your bash history file. The default location of this file is `~/.bash_history`,
but you can run `echo "$HISTFILE"` to find it if needed. Also, you can run
`history -c` to delete all commands from your history.
### zsh
You can disable history logging for jrnl by adding this to your `~/.zshrc`
file:
``` sh
setopt HIST_IGNORE_SPACE
alias jrnl=" jrnl"
```
To delete existing `jrnl` commands from `zsh` history, simply remove them from
your zsh history file. The default location of this file is `~/.zsh_history`,
but you can run `echo "$HISTFILE"` to find it if needed. Also, you can run
`history -c` to delete all commands from your history.
### fish
By default `fish` will not log any command that starts with a space. If you
want to always run jrnl with a space before it, then you can add this to your
`~/.config/fish/config.fish` file:
``` sh
abbr --add jrnl " jrnl"
```
To delete existing jrnl commands from `fish` history, run `history delete --prefix 'jrnl '`.
### Windows Command Prompt
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
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
Some editors keep usage history stored on disk for future use. This can be a
security risk in the sense that sensitive information can leak via recent
search patterns or editor commands.
### Visual Studio Code
Visual Studio Code stores the contents of saved files to allow you to restore or
review the contents later. You can disable this feature for all files by unchecking
the `workbench.localHistory.enabled` setting in the
[Settings editor](https://code.visualstudio.com/docs/getstarted/settings#_settings-editor).
Alternatively, you can disable this feature for specific files by configuring a
[pattern](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options)
in the `workbench.localHistory.exclude` setting. To exclude unencrypted temporary files generated
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).
!!! note
On Windows, the history location is typically found at
`%APPDATA%\Code\User\History`.
Visual Studio Code also creates a copy of all unsaved files that are open.
It stores these copies in a backup location that's automatically cleaned when
you save the file. However, if your computer shuts off before you save the file,
or the Visual Studio Code process stops unexpectedly, then an unencrypted
temporary file may remain on your disk. You can manually delete these files
from the backup location.
!!! note
On Windows, the backup location is typically found at
`%APPDATA%\Code\Backups`.
### Vim
Vim stores progress data in a so called Viminfo file located at `~/.viminfo`
which contains all sorts of user data including command line history, search
string history, search/substitute patterns, contents of register etc. Also to
be able to recover opened files after an unexpected application close Vim uses
swap files.
These options as well as other leaky features can be disabled by setting the
`editor` key in the Jrnl settings like this:
``` yaml
editor: "vim -c 'set viminfo= noswapfile noundofile nobackup nowritebackup noshelltemp history=0 nomodeline secure'"
```
To disable all plugins and custom configurations and start Vim with the default
configuration `-u NONE` can be passed on the command line as well. This will
ensure that any rogue plugins or other difficult to catch information leaks are
eliminated. The downside to this is that the editor experience will decrease
quite a bit.
To instead let Vim automatically detect when a Jrnl file is being edited an
autocommand can be used. Place this in your `~/.vimrc`:
``` vim
autocmd BufNewFile,BufReadPre *.jrnl setlocal viminfo= noswapfile noundofile nobackup nowritebackup noshelltemp history=0 nomodeline secure
```
!!! 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 strives to be mostly compatible with Vim and has therefore similar
functionality as Vim. One difference in Neovim is that the Viminfo file is
instead called the ShaDa ("shared data") file which resides in
`~/.local/state/nvim` (`~/.local/share/nvim` pre Neovim v0.8.0). The ShaDa file
can be disabled in the same way as for Vim.
``` yaml
editor: "nvim -c 'set shada= noswapfile noundofile nobackup nowritebackup noshelltemp history=0 nomodeline secure'"
```
`-u NONE` can be passed here as well to start a session with the default configs.
As for Vim above we can create an autocommand in Vimscript:
``` vim
autocmd BufNewFile,BufReadPre *.jrnl setlocal shada= noswapfile noundofile nobackup nowritebackup noshelltemp history=0 nomodeline secure
```
or the same but in Lua:
``` lua
vim.api.nvim_create_autocmd( {"BufNewFile","BufReadPre" }, {
group = vim.api.nvim_create_augroup("PrivateJrnl", {}),
pattern = "*.jrnl",
callback = function()
vim.o.shada = ""
vim.o.swapfile = false
vim.o.undofile = false
vim.o.backup = false
vim.o.writebackup = false
vim.o.shelltemp = false
vim.o.history = 0
vim.o.modeline = false
vim.o.secure = true
end,
})
```
!!! 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.
## Notice any other risks?
Please let the maintainers know by [filing an issue on GitHub](https://github.com/jrnl-org/jrnl/issues).

View file

@ -1,199 +0,0 @@
# FAQ
## Recipes
### Co-occurrence of tags
If I want to find out how often I mentioned my flatmates Alberto and
Melo in the same entry, I run
```sh
jrnl @alberto --tags | grep @melo
```
And will get something like `@melo: 9`, meaning there are 9 entries
where both `@alberto` and `@melo` are tagged. How does this work? First,
`jrnl @alberto` will filter the journal to only entries containing the
tag `@alberto`, and then the `--tags` option will print out how often
each tag occurred in this filtered journal. Finally, we pipe this to
`grep` which will only display the line containing `@melo`.
### Combining filters
You can do things like
```sh
jrnl @fixed -starred -n 10 -until "jan 2013" --short
```
To get a short summary of the 10 most recent, favourited entries before
January 1, 2013 that are tagged with `@fixed`.
### Statistics
How much did I write last year?
```sh
jrnl -from "jan 1 2013" -until "dec 31 2013" | wc -w
```
Will give you the number of words you wrote in 2013. How long is my
average entry?
```sh
expr $(jrnl --export text | wc -w) / $(jrnl --short | wc -l)
```
This will first get the total number of words in the journal and divide
it by the number of entries (this works because `jrnl --short` will
print exactly one line per entry).
### Importing older files
If you want to import a file as an entry to jrnl, you can just do `jrnl < entry.ext`. But what if you want the modification date of the file to
be the date of the entry in jrnl? Try this
```sh
echo `stat -f %Sm -t '%d %b %Y at %H:%M: ' entry.txt` `cat entry.txt` | jrnl
```
The first part will format the modification date of `entry.txt`, and
then combine it with the contents of the file before piping it to jrnl.
If you do that often, consider creating a function in your `.bashrc` or
`.bash_profile`
```sh
jrnlimport () {
echo `stat -f %Sm -t '%d %b %Y at %H:%M: ' $1` `cat $1` | jrnl
}
```
### Using templates
Say you always want to use the same template for creating new entries.
If you have an [external editor](../advanced) set up, you can use this:
```sh
jrnl < my_template.txt
jrnl -1 --edit
```
Another nice solution that allows you to define individual prompts comes
from [Jacobo de
Vera](https://github.com/maebert/jrnl/issues/194#issuecomment-47402869):
```sh
function log_question()
{
echo $1
read
jrnl today: ${1}. $REPLY
}
log_question 'What did I achieve today?'
log_question 'What did I make progress with?'
```
### Display random entry
You can use this to select one title at random and then display the whole
entry. The invocation of `cut` needs to match the format of the timestamp.
For timestamps that have a space between data and time components, select
fields 1 and 2 as shown. For timestamps that have no whitespace, select
only field 1.
```sh
jrnl -on "$(jrnl --short | shuf -n 1 | cut -d' ' -f1,2)"
```
## External editors
To use external editors for writing and editing journal entries, set
them up in your `jrnl.yaml` (see `advanced usage <advanced>` for
details). Generally, after writing an entry, you will have to save and
close the file to save the changes to jrnl.
### Sublime Text
To use Sublime Text, install the command line tools for Sublime Text and
configure your `jrnl.yaml` like this:
```yaml
editor: "subl -w"
```
Note the `-w` flag to make sure jrnl waits for Sublime Text to close the
file before writing into the journal.
### MacVim
Similar to Sublime Text, MacVim must be started with a flag that tells
the the process to wait until the file is closed before passing control
back to journal. In the case of MacVim, this is `-f`:
<<<<<<< HEAD
```yaml
editor: "mvim -f"
```
### iA Writer
On OS X, you can use the fabulous [iA
Writer](http://www.iawriter.com/mac) to write entries. Configure your
`jrnl.yaml` like this:
```yaml
editor: "open -b pro.writer.mac -Wn"
```
What does this do? `open -b ...` opens a file using the application
identified by the bundle identifier (a unique string for every app out
there). `-Wn` tells the application to wait until it's closed before
passing back control, and to use a new instance of the application.
If the `pro.writer.mac` bundle identifier is not found on your system,
you can find the right string to use by inspecting iA Writer's
`Info.plist` file in your shell:
```sh
grep -A 1 CFBundleIdentifier /Applications/iA\ Writer.app/Contents/Info.plist
```
### Notepad++ on Windows
To set [Notepad++](http://notepad-plus-plus.org/) as your editor, edit
the jrnl config file (`jrnl.yaml`) like this:
```yaml
editor: "C:\\Program Files (x86)\\Notepad++\\notepad++.exe -multiInst -nosession"
```
The double backslashes are needed so jrnl can read the file path
correctly. The `-multiInst -nosession` options will cause jrnl to open
its own Notepad++ window.
### Visual Studio Code
To set [Visual Studo Code](https://code.visualstudio.com) as your editor on Linux, edit `jrnl.yaml` like this:
```yaml
editor: "/usr/bin/code --wait"
```
The `--wait` argument tells VS Code to wait for files to be written out before handing back control to jrnl.
On MacOS you will need to add VS Code to your PATH. You can do that by adding:
```sh
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
```
to your `.bash_profile`, or by running the **Install 'code' command in PATH** command from the command pallet in VS Code.
Then you can add:
```yaml
editor: "code --wait"
```
to `jrnl.yaml`. See also the [Visual Studio Code documentation](https://code.visualstudio.com/docs/setup/mac)

View file

@ -0,0 +1,141 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Command Line Reference
## Synopsis
```
usage: jrnl [--debug] [--help] [--version] [--list] [--encrypt] [--decrypt]
[--import] [-on DATE] [-today-in-history] [-month DATE]
[-day DATE] [-year DATE] [-from DATE] [-to DATE] [-contains TEXT]
[-and] [-starred] [-n [NUMBER]] [-not [TAG]] [--edit] [--delete]
[--format TYPE] [--tags] [--short]
[--config-override CONFIG_KEY CONFIG_VALUE]
[--config-file CONFIG_FILE_PATH]
[[...]]
```
## Standalone Commands
These commands will exit after they complete. You may only run one at a time.
### --help
Show a help message.
### --version
Print version and license information.
### --list
List the config file location, all configured journals, and their locations.
### ---encrypt
Encrypt a journal. See [encryption](encryption.md) for more information.
### --decrypt
Decrypt a journal. See [encryption](encryption.md) for more information.
### --import
Import entries from another journal. If any entries have the exact same content
and timestamp, they will be deduplicated.
Optional parameters:
```sh
--file FILENAME
```
Specify a file to import. If not provided, `jrnl` will use STDIN as the data source.
```sh
--format TYPE
```
Specify the format of the file that is being imported. Defaults to the same data
storage method that jrnl uses. See [formats](formats.md) for more information.
## Writing new entries
See [Basic Usage](usage.md).
## Searching
To find entries from your journal, use any combination of the below filters.
Only entries that match all the filters will be displayed.
When specifying dates, you can use the same kinds of dates you use for new
entries, such as `yesterday`, `today`, `Tuesday`, or `2021-08-01`.
| Search Argument | Description |
| --- | --- |
| -on DATE | Show entries on this date |
| -today-in-history | Show entries of today over the years |
| -month DATE | Show entries on this month of any year |
| -day DATE | Show entries on this day of any month |
| -year DATE | Show entries of a specific year |
| -from DATE | Show entries after, or on, this date |
| -to DATE | Show entries before, or on, this date (alias: -until) |
| -contains TEXT | Show entries containing specific text (put quotes around text with spaces) |
| -and | Show only entries that match all conditions, like saying "x AND y" (default: OR) |
| -starred | Show only starred entries (marked with *) |
| -tagged | Show only tagged entries (marked with the [configured tagsymbols](reference-config-file.md#tagsymbols)) |
| -n [NUMBER] | Show a maximum of NUMBER entries (note: '-n 3' and '-3' have the same effect) |
| -not [TAG] | Exclude entries with this tag |
| -not -starred | Exclude entries that are starred |
| -not -tagged | Exclude entries that are tagged |
## Searching Options
These help you do various tasks with the selected entries from your search.
If used on their own (with no search), they will act on your entire journal.
### --edit
Opens the selected entries in your configured editor. It will fail if the
`editor` key is not set in your config file.
Once you begin editing, you can add multiple entries and delete entries
by modifying the text in your editor. When your editor closes, jrnl reads
the temporary file you were editing and makes the changes to your journal.
### --delete
Interactively deletes selected entries. You'll be asked to confirm deletion of
each entry.
### --change-time DATE
Interactively changes the time of the selected entries to the date specified,
or to right now if no date is specified. You'll be asked to confirm each entry,
unless you are using this with `--edit` on a single entry.
### --format TYPE
Display selected entries in an alternate format. See [formats](formats.md).
#### Optional parameters
```sh
--file FILENAME
```
Write output to file instead of STDOUT. In most shells, the
same effect can be achieved using `>`.
### --tags
Alias for '--format tags'. Returns a list of all tags and the number of times
they occur within the searched entries. If there are no tags found, `jrnl` will output a message saying so.
### --short
Only shows the date and titles of the searched entries.
## Configuration arguments
### --config-override CONFIG_KEY CONFIG_VALUE
Override configured key-value pair with CONFIG_KV_PAIR for this command invocation only. To access config keys that aren't at the top level, separate the keys with a dot, such as `colors.title` to access the `title` key within the `colors` key. Read [advanced usage](./advanced.md) for examples.
### --config-file CONFIG_FILE_PATH
Use the config file at CONFIG_FILE_PATH for this command invocation only.
Read [advanced usage](./advanced.md) for examples.
## Other Arguments
### --debug
Prints information useful for troubleshooting while `jrnl` executes.
### --diagnostic
Prints diagnostic information useful for [reporting issues](https://github.com/jrnl-org/jrnl/issues).

View file

@ -0,0 +1,123 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Configuration File Reference
`jrnl` stores its information in a YAML configuration file.
!!! note
Backup your journal and config file before editing. Changes to the config file
can have destructive effects on your journal!
## Config location
You can find your configuration file location by running:
`jrnl --list`
By default, the configuration file is `~/.config/jrnl/jrnl.yaml`.
If you have the `XDG_CONFIG_HOME` variable set, the configuration
file will be saved as `$XDG_CONFIG_HOME/jrnl/jrnl.yaml`.
!!! note
On Windows, the configuration file is typically found at
`%USERPROFILE%\.config\jrnl\jrnl.yaml`.
## Config format
The configuration file is a [YAML](https://yaml.org/) file and can be edited with
a text editor.
## Config keys
### journals
Describes each journal used by `jrnl`. Each indented key after this key is
the name of a journal.
If a journal key has a value, that value will be interpreted as the path
to the journal. Otherwise, the journal needs the additional indented key
`journal` to specify its path.
All keys below can be specified for each journal at the same level as the
`journal` key. If a key conflicts with a top-level key, the journal-specific
key will be used instead.
### editor
If set, executes this command to launch an external editor for
writing and editing your entries. The path to a temporary file
is passed after it, and `jrnl` processes the file once
the editor returns control to `jrnl`.
Some editors require special options to work properly, since they must be
blocking processes to work with `jrnl`. See [External Editors](external-editors.md)
for details.
### encrypt
If `true`, encrypts your journal using AES. Do not change this
value for journals that already have data in them.
### template
The path to a text file to use as a template for new entries. Only works when you
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
Symbols to be interpreted as tags.
!!! note
Although it seems intuitive to use the `#`
character for tags, there's a drawback: on most shells, this is
interpreted as a meta-character starting a comment. This means that if
you type
> `jrnl Implemented endless scrolling on the #frontend of our website.`
your bash will chop off everything after the `#` before passing it to
`jrnl`. To avoid this, wrap your input into quotation marks like
this:
> `jrnl "Implemented endless scrolling on the #frontend of our website."`
Or use the built-in prompt or an external editor to compose your
entries.
### default_hour and default_minute
Entries will be created at this time if you supply a date but no specific time (for example, `last thursday`).
### timeformat
Defines how to format the timestamps as they are stored in your journal.
See the [python docs](http://docs.python.org/library/time.html#time.strftime) for reference.
Do not change this for an existing journal, since that might lead
to data loss.
!!! note
`jrnl` doesn't support the `%z` or `%Z` time zone identifiers.
### highlight
If `true`, tags will be highlighted in cyan.
### linewrap
Controls the width of the output. Set to `false` if you don't want to
wrap long lines. Set to `auto` to let `jrnl` automatically determine
the terminal width.
### colors
A dictionary that controls the colors used to display journal entries.
It has four subkeys, which are: `body`, `date`, `tags`, and `title`.
Current valid values are: `BLACK`, `RED`, `GREEN`, `YELLOW`, `BLUE`,
`MAGENTA`, `CYAN`, `WHITE`, and `NONE`.
`colorama.Fore` is used for colorization, and you can find the [docs here](https://github.com/tartley/colorama#colored-output).
To disable colored output, set the value to `NONE`.
### display_format
Specifies formatter to use by default. See [formats](formats.md).
### version
`jrnl` automatically updates this field to the version that it is running.
There is no need to change this field manually.

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="160px" viewBox="0 0 400 160" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 55 (78076) - https://sketchapp.com -->
<title>sprites</title>
<desc>Created with Sketch.</desc>
<g id="sprites" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M200.001666,7.10542736e-15 C186.746448,7.10542736e-15 176.000667,10.745781 176.000667,24.0009999 C176.000667,28.0531687 177.014042,31.8666609 178.791449,35.2174671 L162.102754,51.9021622 L162.117422,51.9141627 C160.812034,53.1968828 160,54.9729568 160,56.9463723 C160,60.8452014 163.160132,64.0039997 167.057627,64.0039997 C169.028376,64.0039997 170.805783,63.1919658 172.08717,61.8865781 L172.08317,61.882578 L188.765198,45.2018831 C192.117338,46.984624 195.937497,48.0019997 199.999,48.0019997 C213.254219,48.0019997 224,37.2562187 224,24.0009999 C224.002666,10.7471144 213.256885,7.10542736e-15 200.001666,7.10542736e-15 Z M169.589733,59.386474 C168.945706,60.0545018 168.053669,60.4731859 167.057627,60.4731859 C165.108213,60.4731859 163.528147,58.8957869 163.528147,56.9450389 C163.528147,55.9489974 163.948164,55.0596271 164.614859,54.4129335 L164.597525,54.3969328 L180.730197,38.2642607 C182.139589,40.1656733 183.819659,41.8457432 185.718405,43.2604689 L169.589733,59.386474 Z M200.001666,44.0044998 C188.957206,44.0044998 180.000833,35.04546 180.000833,24.0036666 C180.000833,12.9592065 188.957206,4.00283342 200.001666,4.00283342 C211.04346,4.00283342 220.0025,12.9592065 220.0025,24.0036666 C220.0025,35.0467933 211.044793,44.0044998 200.001666,44.0044998 Z M200.001666,10.00175 C200.551023,10.00175 201.001708,10.4497687 201.001708,11.0017917 C201.001708,11.5524813 200.551023,12.0018333 200.001666,12.0018333 C193.37339,12.0018333 188.001166,17.3753905 188.001166,24.0023332 C188.001166,24.5543562 187.553148,25.0023749 187.001125,25.0023749 C186.449102,25.0023749 186.001083,24.5543562 186.001083,24.0023332 C186.001083,16.2686777 192.268011,10.00175 200.001666,10.00175 Z" id="path10" fill="#684688" fill-rule="nonzero"></path>
<path d="M42,26 L42,18 C42,8.05733333 33.9426667,0 24,0 C14.0573333,0 6,8.05733333 6,18 L6,26 C2.68533333,26 0,28.6853333 0,32 L0,38 L0,40 L0,44 L0,46 C0,55.9426667 8.05733333,64 18,64 L30,64 C39.9426667,64 48,55.9426667 48,46 L48,44 L48,40 L48,38 L48,32 C48,28.684 45.312,26 42,26 Z M10,18 C10,10.268 16.268,4 24,4 C31.732,4 38,10.268 38,18 L38,26 L34,26 L34,18.004 C34,12.48 29.524,8.004 24,8.004 C18.476,8.004 14,12.48 14,18.004 L14,26 L10,26 L10,18 Z M32,18 L32,18.0066667 L32,26 L16,26 L16,18.004 L16,18 C16,13.5813333 19.5813333,10 24,10 C28.4173333,10 32,13.5826667 32,18 Z M44,38 L44,40 L44,44 L44,46 C44,53.7173333 37.7173333,60 30,60 L18,60 C10.2826667,60 4,53.7173333 4,46 L4,44 L4,40 L4,38 L4,32 C4,30.896 4.896,30 6,30 C7.33466667,30 8.66533333,30 10,30 L38,30 C39.332,30 40.664,30 42,30 C43.1026667,30 44,30.896 44,32 L44,38 Z M24,38 C26.208,38 28,39.7906667 28,42 C28,43.2173333 27.344,45.536 26.668,47.364 C26.1213333,48.84 25.564,49.996 24,49.996 C22.5626667,49.996 21.8786667,48.828 21.3333333,47.344 C20.6666667,45.52 20,43.2133333 20,42 C20,39.7906667 21.792,38 24,38 Z" id="path12" fill="#684688" fill-rule="nonzero"></path>
<path d="M56,110.174879 L37.4495142,102.225364 L44.8646072,96.9285223 C41.0009854,92.8572051 35.5547484,90.2992712 29.5,90.2992712 C19.2306123,90.2992712 10.6738014,97.6001925 8.72073517,107.291434 L3.77369603,105.243629 C6.58790907,93.6333303 17.023696,85 29.5,85 C37.336557,85 44.3508342,88.4239389 49.2055642,93.8300944 L56,88.9753644 L56,110.174879 Z M14.1353928,126.072692 C17.9965854,130.142795 23.4452516,132.700729 29.5,132.700729 C39.8082547,132.700729 48.3893574,125.343936 50.2974837,115.594395 L55.2396645,117.709002 C52.4412412,129.342378 41.9945229,138 29.5,138 C21.663443,138 14.6467366,134.576061 9.79443579,129.169906 L3,134.024636 L3,112.823907 L21.5504858,120.773421 L14.1353928,126.072692 Z" id="path6" fill="#684688" fill-rule="nonzero"></path>
<path d="M110.666667,136 L110.666667,88 L114.666667,88 L114.666667,136 L124,136 C129.154658,136 133.333333,131.821324 133.333333,126.666667 L133.333333,97.3333333 C133.333333,94.1616732 131.751312,91.3595139 129.333333,89.672919 L129.333333,109.333333 L124,105.333333 L118.666667,109.333333 L118.666667,88 L121.333333,88 L100,88 C94.8453423,88 90.6666667,92.1786757 90.6666667,97.3333333 L90.6666667,126.666667 C90.6666667,131.821324 94.8453423,136 100,136 L110.666667,136 Z M134.130346,88.6638236 C136.127154,90.9949079 137.333333,94.0232615 137.333333,97.3333333 L137.333333,126.666667 C137.333333,129.976739 136.127154,133.005092 134.130346,135.336176 C137.570042,133.9607 140,130.597457 140,126.666667 L140,97.3333333 C140,93.4025432 137.570042,90.0393001 134.130346,88.6638236 Z M89.8696538,135.336176 C87.872846,133.005092 86.6666667,129.976739 86.6666667,126.666667 L86.6666667,97.3333333 C86.6666667,94.0232615 87.872846,90.9949079 89.8696538,88.6638236 C86.4299578,90.0393001 84,93.4025432 84,97.3333333 L84,126.666667 C84,130.597457 86.4299578,133.9607 89.8696538,135.336176 Z M93.3333333,84 L130.666667,84 C138.030463,84 144,89.9695367 144,97.3333333 L144,126.666667 C144,134.030463 138.030463,140 130.666667,140 L93.3333333,140 C85.9695367,140 80,134.030463 80,126.666667 L80,97.3333333 C80,89.9695367 85.9695367,84 93.3333333,84 Z" id="Combined-Shape" fill="#684688" fill-rule="nonzero"></path>
<path d="M363.625,2 L363.625,13.625 C363.625,13.625 332.463,13.711 331.708333,47.375 C332.168333,42.2843333 335.715667,22.375 363.625,22.375 L363.625,31.0833333 L384,16.5416667 L363.625,2 Z M328,8.54166667 C323.568,8.54166667 320,12.1096667 320,16.5416667 L320,52.5416667 C320,56.9736667 323.568,60.5416667 328,60.5416667 L369.333333,60.5416667 C373.765333,60.5416667 377.333333,56.9736667 377.333333,52.5416667 L377.333333,29.875 L373.333333,32.5416667 L373.333333,52.5416667 C373.333333,54.7576667 371.549333,56.5416667 369.333333,56.5416667 L328,56.5416667 C325.784,56.5416667 324,54.7576667 324,52.5416667 L324,16.5416667 C324,14.3256667 325.784,12.5416667 328,12.5416667 L344,12.5416667 L353.333333,8.54166667 L328,8.54166667 Z" id="path8" fill="#684688" fill-rule="nonzero"></path>
<path d="M272,13 C272.552,13 273,13.448 273,14 C273,14.552 272.549333,15 272,15 C261.345333,15 252,20.608 252,27 C252,27.552 251.552,28 251,28 C250.448,28 250,27.552 250,27 C250,19.412 260.074667,13 272,13 Z M272,3 C254.326667,3 240,13.7453333 240,27 C240,35.2546667 245.557333,42.532 254.016,46.852 C254.016,46.9053333 254,46.9413333 254,47 C254,50.5853333 251.322667,54.4466667 250.144,56.472 C250.146667,56.472 250.148,56.472 250.148,56.472 C250.053333,56.692 250,56.9333333 250,57.188 C250,58.188 250.809333,59 251.812,59 C252,59 252.330667,58.9506667 252.321333,58.972 C258.572,57.948 264.46,52.2053333 265.828,50.5426667 C267.826667,50.836 269.886667,51 272,51 C289.670667,51 304,40.2546667 304,27 C304,13.7453333 289.672,3 272,3 Z M272,47 C270.165333,47 268.284,46.86 266.408,46.5866667 C266.213333,46.5546667 266.02,46.544 265.828,46.544 C264.64,46.544 263.502667,47.072 262.736,48.004 C261.88,49.0466667 259.444,51.372 256.566667,53.0826667 C257.346667,51.292 257.956,49.2866667 257.998667,47.2186667 C258.010667,47.0906667 258.016,46.96 258.016,46.8506667 C258.016,45.3466667 257.174667,43.972 255.836,43.2893333 C248.424,39.504 244,33.4146667 244,27 C244,15.972 256.56,7 272,7 C287.436,7 300,15.972 300,27 C300,38.028 287.438667,47 272,47 Z" id="path16" fill="#684688" fill-rule="nonzero"></path>
<path d="M192,80 C174.326667,80 160,94.3266667 160,112 C160,129.673333 174.326667,144 192,144 C209.673333,144 224,129.673333 224,112 C224,94.3266667 209.673333,80 192,80 Z M192,84 C207.463973,84 220,96.536024 220,112 C220,124.684311 211.56628,135.391332 200,138.833333 L200,137.666667 L200,135.375 L200,132.875 C200,130.353667 199.104333,128.479667 197.375,127.291667 C198.459,127.187667 199.469667,127.061667 200.375,126.875 C201.280333,126.688333 202.239333,126.436667 203.25,126.083333 C204.260667,125.73 205.155667,125.281 205.958333,124.791667 C206.761,124.302333 207.553,123.656333 208.291667,122.875 C209.030333,122.093667 209.625,121.239333 210.125,120.25 C210.625,119.260667 211.041333,118.052 211.333333,116.666667 C211.625333,115.281333 211.75,113.75 211.75,112.083333 C211.75,108.854 210.729,106.105333 208.625,103.833333 C209.583667,101.333333 209.458333,98.604 208.291667,95.6666667 L207.5,95.5833333 C206.958667,95.5206667 205.988667,95.7703333 204.583333,96.2916667 C203.178,96.813 201.625667,97.6453333 199.875,98.8333333 C197.396333,98.1453333 194.791667,97.8333333 192.125,97.8333333 C189.437,97.8333333 186.895667,98.1466667 184.458333,98.8333333 C183.354333,98.0826667 182.322667,97.4906667 181.333333,97 C180.344,96.5106667 179.551667,96.1773333 178.958333,96 C178.365,95.8226667 177.802333,95.708 177.291667,95.6666667 C176.781,95.6253333 176.437,95.6036667 176.291667,95.625 C176.146333,95.6463333 176.061333,95.687 176,95.7083333 C174.833333,98.667 174.708,101.354667 175.666667,103.833333 C173.562667,106.104 172.5,108.854 172.5,112.083333 C172.5,113.75 172.666333,115.281333 172.958333,116.666667 C173.250333,118.052 173.625,119.260667 174.125,120.25 C174.625,121.239333 175.26,122.093667 176,122.875 C176.74,123.656333 177.532,124.301 178.333333,124.791667 C179.134667,125.282333 180.031,125.73 181.041667,126.083333 C182.052333,126.436667 182.678,126.688333 183.583333,126.875 C184.488667,127.061667 185.500667,127.229333 186.583333,127.333333 C184.875333,128.5 184,130.333667 184,132.875 L184,135.125 L184,137.75 L184,138.833333 C172.433733,135.391332 164,124.684311 164,112 C164,96.536024 176.53604,84 192,84 Z" id="path22" fill="#684688" fill-rule="nonzero"></path>
<path d="M100,1.0658141e-14 C99.0049467,1.0658141e-14 98.0752267,0.350804013 97.3333333,0.958333333 C96.59144,1.56586265 96,2.50111463 96,3.625 L96,5.33333333 L94.6666667,5.33333333 L94.6666667,6.66666667 L87.3333333,6.66666667 C87.264,6.66305333 87.1943867,6.66305333 87.125,6.66666667 C86.1491067,6.76895307 85.32808,7.6854408 85.3333333,8.66666667 L85.3333333,9.33333333 L83.3333333,9.33333333 C82.28616,9.333438 81.33344,10.2861644 81.3333333,11.3333333 L81.3333333,12.125 C80.5629867,12.3974076 80.0044,13.1829169 80,14 L80,18 C80.0001067,19.0471693 80.9528267,19.9998947 82,20 L85.3333333,20 L85.3333333,53.3333333 L83.6666667,54.9166667 C83.05688,55.268736 82.6604,55.962572 82.6666667,56.6666667 L82.6666667,60.6666667 C82.6667733,61.713836 83.6194933,62.6665613 84.6666667,62.6666667 L95.2083333,62.6666667 L104.666667,62.6666667 L104.875,62.6666667 L115.333333,62.6666667 C116.380507,62.6665613 117.333227,61.713836 117.333333,60.6666667 L117.333333,56.6666667 C117.34,55.962572 116.94312,55.268736 116.333333,54.9166667 L114.666667,53.3333333 L114.666667,20 L118,20 C119.047173,19.9998947 119.999893,19.0471693 120,18 L120,14 C119.996,13.1829169 119.437013,12.3974076 118.666667,12.125 L118.666667,11.3333333 C118.66656,10.2861644 117.71384,9.333438 116.666667,9.33333333 L114.666667,9.33333333 L114.666667,8.66666667 C114.66656,7.61949773 113.71384,6.66677133 112.666667,6.66666667 L105.333333,6.66666667 L105.333333,5.33333333 L104,5.33333333 L104,3.625 C104,2.50111463 103.40856,1.56586269 102.666667,0.958333333 C101.924773,0.350803973 100.995053,1.0658141e-14 100,1.0658141e-14 Z M100,2.66666667 C100.274467,2.66666667 100.684267,2.8172396 100.958333,3.04166667 C101.2324,3.26609373 101.333333,3.4793628 101.333333,3.625 L101.333333,5.33333333 L98.6666667,5.33333333 L98.6666667,3.625 C98.6666667,3.4793628 98.7676,3.2660936 99.0416667,3.04166667 C99.3157333,2.81723973 99.7255333,2.66666667 100,2.66666667 Z M88,10.6666667 L112,10.6666667 L112,12 L114.666667,12 C114.596267,12.9827864 114.819853,13.6843969 116,13.4166667 L116,17.3333333 L110.666667,17.3333333 L89.3333333,17.3333333 L84,17.3333333 L84,13.5416667 C85.09188,13.6062785 85.25424,12.8356391 85.3333333,12 L88,12 L88,10.6666667 Z M89.3333333,20 L110.666667,20 L110.666667,56 L113.333333,57.8333333 L113.333333,58.6666667 L86.6666667,58.6666667 L86.6666667,57.8333333 L89.3333333,56 L89.3333333,20 Z M92,22.6666667 L92,28 L94.6666667,28 L94.6666667,22.6666667 L92,22.6666667 Z M96,22.6666667 L96,28 L98.6666667,28 L98.6666667,22.6666667 L96,22.6666667 Z M101.333333,22.6666667 L101.333333,28 L104,28 L104,22.6666667 L101.333333,22.6666667 Z M105.333333,22.6666667 L105.333333,28 L108,28 L108,22.6666667 L105.333333,22.6666667 Z M92,29.3333333 L92,34.6666667 L94.6666667,34.6666667 L94.6666667,29.3333333 L92,29.3333333 Z M96,29.3333333 L96,34.6666667 L98.6666667,34.6666667 L98.6666667,29.3333333 L96,29.3333333 Z M101.333333,29.3333333 L101.333333,34.6666667 L104,34.6666667 L104,29.3333333 L101.333333,29.3333333 Z M105.333333,29.3333333 L105.333333,34.6666667 L108,34.6666667 L108,29.3333333 L105.333333,29.3333333 Z M103.166667,40.8333333 C102.15268,40.8333333 101.333333,41.6526813 101.333333,42.6666667 C101.333333,43.680652 102.15268,44.5 103.166667,44.5 C104.180653,44.5 105,43.680652 105,42.6666667 C105,41.6526813 104.180653,40.8333333 103.166667,40.8333333 Z" id="path3858" fill="#684688" fill-rule="nonzero"></path>
<path d="M247.471598,80 L243.471598,115.791667 L247.429931,116.208333 L251.013264,84 L291.929931,84 L295.513264,116.208333 L299.471598,115.791667 L295.471598,80 L247.471598,80 Z M255.471598,88 L255.471598,92 L287.471598,92 L287.471598,88 L255.471598,88 Z M255.471598,96 L255.471598,100 L287.471598,100 L287.471598,96 L255.471598,96 Z M255.471598,104 L255.471598,108 L287.471598,108 L287.471598,104 L255.471598,104 Z M255.471598,112 L255.471598,116 L287.471598,116 L287.471598,112 L255.471598,112 Z M241.471598,120 C240.371598,120 239.748598,120.872667 240.096598,121.916667 L246.846598,142.083333 C247.194598,143.127333 248.371598,144 249.471598,144 L293.471598,144 C294.571598,144 295.748598,143.127333 296.096598,142.083333 L302.846598,121.916667 C303.195931,120.872667 302.571598,120 301.471598,120 L241.471598,120 Z M263.471598,124 L279.471598,124 L279.471598,128 L263.471598,128 L263.471598,124 Z" id="path20" fill="#684688" fill-rule="nonzero"></path>
<path d="M384,92.1508074 C381.644441,93.1945738 379.116959,93.9024443 376.461373,94.2184709 C379.172907,92.5947297 381.248518,90.0192484 382.232259,86.9597924 C379.688777,88.4634811 376.881243,89.5553522 373.889761,90.1472486 C371.494254,87.5917412 368.086876,86 364.307523,86 C357.056897,86 351.177986,91.8789116 351.177986,99.1255639 C351.177986,100.15333 351.29396,101.157149 351.51796,102.117046 C340.608034,101.569071 330.933874,96.3420823 324.459092,88.399481 C323.327273,90.3351705 322.683403,92.5906513 322.683403,94.9982892 C322.683403,99.5534862 325.002989,103.572735 328.522367,105.924216 C326.370729,105.852268 324.347092,105.260371 322.575481,104.276527 L322.575481,104.440501 C322.575481,110.799308 327.102652,116.106298 333.105485,117.314143 C332.005667,117.610091 330.845926,117.774065 329.646133,117.774065 C328.798341,117.774065 327.978471,117.690091 327.1746,117.530091 C328.846237,122.749132 333.693408,126.54438 339.436372,126.648432 C334.945175,130.167811 329.282211,132.259422 323.131404,132.259422 C322.071637,132.259422 321.027766,132.195422 320,132.079448 C325.810938,135.8108 332.709668,137.986386 340.124268,137.986386 C364.275732,137.986386 377.477323,117.982065 377.477323,100.633331 L377.433296,98.9336682 C380.012752,97.0938743 382.244285,94.7823411 384,92.1508074 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 15 KiB

307
docs/theme/index.css vendored
View file

@ -1,307 +0,0 @@
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}
body
{
background-color: #FAFDFE;
background-color: #f7f8f9;
font-family: "Open Sans", "Helvetica Neue", sans-serif;
font-weight: 300;
}
.icon {
background-image: url("img/sprites.svg");
width: 32px;
height: 32px;
display: inline-block;
font-size: 40px;
background-size: 200px 80px;
}
h3 { font-weight: 400; }
.icon.secure {
background-position: 0em 0em;
}
.icon.future {
background-position: -1em 0em;
}
.icon.search {
background-position: -2em 0em;
}
.icon.nli {
background-position: -3em 0em;
}
.icon.share {
background-position: 0em -1em;
}
.icon.sync {
background-position: 0em -1em;
}
.icon.dayone {
background-position: -1em -1em;
}
.icon.github {
background-position: -2em -1em;
}
.icon.folders {
background-position: -3em -1em;
}
.icon.twitter {
background-position: -4em -1em;
}
header {
background-image: linear-gradient(211deg, #95699C 0%, #604385 100%);
color: white;
border: 0px solid transparent;
display: relative;
padding-top: 150px;
overflow: hidden;
}
#terminal {
background: #1B1C2E;
max-width: 520px;
box-shadow: 0 -2px 16px 0 rgba(0,0,0,0.35);
border-radius: 6px 6px 0 0;
min-height: 100px;
margin: 0px auto;
position: relative;
/*transform: translateY(40px);*/
color: #f7f8f9;
font-family: "Monaco", "Courier New";
font-size: 12pt;
padding: 45px 20px 0px 20px;
line-height: 165%;
}
#terminal b {
font-weight: normal;
color: #C2CDD9;
}
#terminal i {
font-style: normal;
color: #BB97BA;
}
#terminal:before {
content: '';
position: absolute;
top: 15px;
left: 15px;
display: inline-block;
width: 15px;
height: 15px;
border-radius: 50%;
background: #3B3B4A;
box-shadow: 25px 0 0 #3B3B4A, 50px 0 0 #3B3B4A;
}
#typed:before {
content: "$ ";
color: #A879A7;
}
#twitter {
display: block;
position: absolute;
text-decoration: none;
top: 20px;
right: 20px;
border: 1px solid white;
padding: 5px 10px;
color: white;
border-radius: 3px;
opacity: .7;
}
#twitter .icon {
transform: scale(.5);
vertical-align: -18%;
margin: 0;
padding: 0;
}
#twitter:hover,
#twitter:active {
opacity: 1;
text-decoration: none;
}
#title {
max-width: 630px;
margin: 0 auto;
padding: 0px 20px;
}
#prompt {
max-width: 700px;
margin: 100px auto 0px auto;
padding: 0px 20px;
}
header img {
float: left;
margin-right: 30px;
}
h1 {
color: white;
font-weight: 300;
}
nav {
text-align: center;
}
nav a#twitter-nav {
display: none;
}
a {
color: #684688;
text-decoration: underline;
}
nav a {
font-size: 14pt;
line-height: 40pt;
margin: 0 40px;
}
a:hover {
color: #A3629F;
}
nav a.cta {
display: inline-block;
color: white;
background-image: linear-gradient(259deg, #A3629F 0%, #604385 100%);
box-shadow: 0 2px 8px 0 rgba(0,0,0,0.25);
border-radius: 50px;
padding: 0px 30pt;
white-space: nowrap;
transition: all .1s ease;
font-weight: 600;
text-decoration: none;
}
nav a.cta:hover {
text-decoration: none;
background-image: linear-gradient(259deg, #AE57A8 0%, #68419C 100%);
box-shadow: 0 4px 16px 0 rgba(0,0,0,0.25);
color: #f7f8f9;
}
main {
padding: 50px 0 0 0;
}
.flex {
display: flex;
margin: 0 auto;
max-width: 920px;
flex-wrap: wrap;
padding: 20px 20px;
justify-content: space-between;
}
.flex section {
/*margin: 20px;*/
margin-top: 40px;
width: 32%;
}
.flex section:first-child {
margin-left: 0px;
}
.flex section:last-child {
margin-right: 0px;
}
.flex section i {
float: left;
left: 0;
display: block;
margin: 0px auto 10px auto;
}
.flex section h3 {
margin-top: 0;
font-size: 14pt;
color: #684688;
margin-bottom: .5em;
font-weight: 300;
margin-left: 40px;
}
.flex section p {
padding-left: 40px;
color: #888;
font-size: 12pt;
margin: 0;
}
footer {
max-width: 700px;
margin: 20px auto;
padding: 0 20px 20px 20px;
font-size: 10pt;
opacity: .5;
text-align: center;
}
@media screen and (max-width: 680px) {
.flex {
display: block;
padding: 0;
}
.flex section {
width: 100%;
}
main {
padding: 20px;
margin: 0;
width: calc(100% - 40px);
}
nav a,
nav a#twitter-nav {
display: inline-block;
margin: 0px 10px;
}
nav a.cta {
display: block;
margin: 20px;
}
header #twitter {
display: none;
}
header #logo {
display: block;
float: none;
margin: 0px auto;
}
header #title br {
display: none;
}
}

224
docs/tips-and-tricks.md Normal file
View file

@ -0,0 +1,224 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
# Tips and Tricks
This page contains tips and tricks for using `jrnl`, often in conjunction
with other tools, including external editors.
## Co-occurrence of tags
If I want to find out how often I mentioned my flatmates Alberto and
Melo in the same entry, I run
```sh
jrnl @alberto --tags | grep @melo
```
And will get something like `@melo: 9`, meaning there are 9 entries
where both `@alberto` and `@melo` are tagged. How does this work? First,
`jrnl @alberto` will filter the journal to only entries containing the
tag `@alberto`, and then the `--tags` option will print out how often
each tag occurred in this filtered journal. Finally, we pipe this to
`grep` which will only display the line containing `@melo`.
## Combining filters
You can do things like
```sh
jrnl @fixed -starred -n 10 -to "jan 2013" --short
```
To get a short summary of the 10 most recent, favourite entries before
January 1, 2013 that are tagged with `@fixed`.
## Statistics
How much did I write last year?
```sh
jrnl -from "jan 1 2013" -to "dec 31 2013" | wc -w
```
Will give you the number of words you wrote in 2013. How long is my
average entry?
```sh
expr $(jrnl --export text | wc -w) / $(jrnl --short | wc -l)
```
This will first get the total number of words in the journal and divide
it by the number of entries (this works because `jrnl --short` will
print exactly one line per entry).
## Importing older files
If you want to import a file as an entry to `jrnl`, you can just do `jrnl < entry.ext`. But what if you want the modification date of the file to
be the date of the entry in `jrnl`? Try this
```sh
echo `stat -f %Sm -t '%d %b %Y at %H:%M: ' entry.txt` `cat entry.txt` | jrnl
```
The first part will format the modification date of `entry.txt`, and
then combine it with the contents of the file before piping it to jrnl.
If you do that often, consider creating a function in your `.bashrc` or
`.bash_profile`
```sh
jrnlimport () {
echo `stat -f %Sm -t '%d %b %Y at %H:%M: ' $1` `cat $1` | jrnl
}
```
## Using Templates
!!! note
Templates require an [external editor](./advanced.md) be configured.
Templates are text files that are used for creating structured journals.
There are three ways you can use templates:
### 1. Use the `--template` command line argument and the default $XDG_DATA_HOME/jrnl/templates directory
`$XDG_DATA_HOME/jrnl/templates` is created by default to store your templates! Create a template (like `default.md`) in this directory and pass `--template FILE_IN_DIR`.
```sh
jrnl --template default.md
```
### 2. Use the `--template` command line argument with a local / absolute path
You can create a template file with any text. Here is an example:
```sh
# /tmp/template.txt
My Personal Journal
Title:
Body:
```
Then, pass the absolute or relative path to the template file as an argument, and your external
editor will open and have your template pre-populated.
```sh
jrnl --template /tmp/template.md
```
### 3. Set a default template file in `jrnl.yaml`
If you want a template by default, change the value of `template` in the [config file](./reference-config-file.md)
from `false` to the template file's path, wrapped in double quotes:
```sh
...
template: "/path/to/template.txt"
...
```
!!! tip
To read your journal entry or to verify the entry saved, you can use this
command: `jrnl -n 1` (Check out [Formats](./formats.md) for more options).
```sh
jrnl -n 1
```
## Prompts on shell reload
If you'd like to be prompted each time you refresh your shell, you can include
this in your `.bash_profile`:
```sh
function log_question()
{
echo $1
read
jrnl today: ${1}. $REPLY
}
log_question 'What did I achieve today?'
log_question 'What did I make progress with?'
```
Whenever your shell is reloaded, you will be prompted to answer each of the
questions in the example above. Each answer will be logged as a separate
journal entry at the `default_hour` and `default_minute` listed in your
`jrnl.yaml` [config file](../advanced/#configuration-file).
## Display random entry
You can use this to select one title at random and then display the whole
entry. The invocation of `cut` needs to match the format of the timestamp.
For timestamps that have a space between data and time components, select
fields 1 and 2 as shown. For timestamps that have no whitespace, select
only field 1.
```sh
jrnl -on "$(jrnl --short | shuf -n 1 | cut -d' ' -f1,2)"
```
## Launch a terminal for rapid logging
You can use this to launch a terminal that is the `jrnl` stdin prompt so you can start typing away immediately.
```bash
jrnl --config-override editor ""
```
Bind this to a keyboard shortcut.
Map `Super+Alt+J` to launch the terminal with `jrnl` prompt
- **xbindkeys**
In your `.xbindkeysrc`
```ini
Mod4+Mod1+j
alacritty -t floating-jrnl -e jrnl --config-override editor "",
```
- **I3 WM** Launch a floating terminal with the `jrnl` prompt
```ini
bindsym Mod4+Mod1+j exec --no-startup-id alacritty -t floating-jrnl -e jrnl --config-override editor ""
for_window[title="floating *"] floating enable
```
## Visualize Formatted Markdown in the CLI
Out of the box, `jrnl` can output journal entries in Markdown. To visualize it, you can pipe to [mdless](https://github.com/ttscoff/mdless), which is a [less](https://en.wikipedia.org/wiki/Less_(Unix))-like tool that allows you to visualize your Markdown text with formatting and syntax highlighting from the CLI. You can use this in any shell that supports piping.
The simplest way to visualize your Markdown output with `mdless` is as follows:
```sh
jrnl --export md | mdless
```
This will render your Markdown output in the whole screen.
Fortunately, `mdless` has an option that allows you to adjust the screen width by using the `-w` option as follows:
```sh
jrnl --export md | mdless -w 70
```
If you want Markdown to be your default display format, you can define this in your config file as follows:
```yaml
display_format: md
# or
display_format: markdown
```
For more information on how `jrnl` outputs your entries in Markdown, please visit the [Formats](./formats.md) section.
## Jump to end of buffer (with vi)
To cause vi to jump to the end of the last line of the entry you edit, in your config file set:
```yaml
editor: vi + -c "call cursor('.',strwidth(getline('.')))"
```

View file

@ -1,56 +1,51 @@
# Basic Usage <!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
`jrnl` has two modes: **composing** and **viewing**. Basically, whenever # Basic Usage #
you _don't_ supply any arguments that start
with a dash or double-dash, you're in composing mode, meaning you can
write your entry on the command line or an editor of your choice.
We intentionally break a convention on command line arguments: all `jrnl` has two modes: **composing** and **viewing**. Whenever you don't enter
arguments starting with a _single dash_ any arguments that start with a dash (`-`) or double-dash (`--`), you're in
will _filter_ your journal before viewing composing mode, meaning that you can write your entry on the command line.
it, and can be combined arbitrarily. Arguments with a
_double dash_ will control how your journal
is displayed or exported and are mutually exclusive (ie. you can only
specify one way to display or export your journal at a time).
## Listing Journals We intentionally break a convention on command line arguments: all arguments
starting with a _single dash_ (`-`) will _filter_ your journal before viewing
it. Filter arguments can be combined arbitrarily. Arguments with a _double dash_
(`--`) will _control_ how your journal is displayed or exported. Control
arguments are mutually exclusive (i.e., you can only specify one way to display
or export your journal at a time).
You can list the journals accessible by jrnl For a list of commands, enter `jrnl --help`.
```sh ## Composing Entries ##
jrnl -ls
```
The journals displayed correspond to those specified in the jrnl Composing mode is entered by either starting `jrnl` without any arguments --
configuration file. which will launch an external editor -- or by just writing an entry on the
command line:
## Composing Entries ```text
jrnl today at 3am: I just met Steve Buscemi in a bar! What a nice guy.
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
```sh
jrnl today at 3am: I just met Steve Buscemi in a bar! He looked funny.
``` ```
!!! note !!! note
Most shell contains a certain number of reserved characters, such as `#` Most shells contain a certain number of reserved characters, such as `#` and
and `*`. Unbalanced quotes, parenthesis, and so on will also get into `*`. These characters, as well as unbalanced single or double quotation
the way of your editing. marks, parentheses, and others, likely will cause problems. Although
For writing longer entries, just enter `jrnl` reserved characters can be escaped using `\`, this is not ideal for
and hit `return`. Only then enter the text of your journal entry. long-form writing. The solution: first enter `jrnl` and hit `return`. You
Alternatively, `use an external editor <advanced>`). can then enter the text of your journal entry. Alternatively, you can [use
an external editor](./advanced.md).
You can also import an entry directly from a file You can also import an entry directly from a file:
```sh ```sh
jrnl < my_entry.txt jrnl < my_entry.txt
``` ```
### Smart timestamps ### Specifying Date and Time ###
Timestamps that work: If you don't specify a date and time (e.g., `jrnl finished writing letter to brother`), `jrnl` will create an entry using the current date and time. For retrospective entries, you can use a timestamp to tell `jrnl` where to put the entry. Timestamps can be entered using a variety of formats. Here are some that work:
- at 6am - at 6am
- yesterday - yesterday
@ -59,102 +54,203 @@ Timestamps that work:
- 2 march 2012 - 2 march 2012
- 7 apr - 7 apr
- 5/20/1998 at 23:42 - 5/20/1998 at 23:42
- 2020-05-22T15:55-04:00
### Starring entries If you don't use a timestamp, `jrnl` will create an entry using the current
time. If you use a date only (no time), `jrnl` will use the default time
specified in your [configuration file](./reference-config-file.md#default_hour-and-default_minute).
Behind the scenes, `jrnl` reorganizes entries in chronological order.
To mark an entry as a favourite, simply "star" it ### Using Tags ###
`jrnl` supports tags. The default tag symbol is `@` (largely because `#` is a
reserved character). You can specify your own tag symbol in the
[configuration file](./reference-config-file.md#tagsymbols). To use tags, preface the
desired tag with the symbol:
```sh
jrnl Had a wonderful day at the @beach with @Tom and @Anna.
```
Although you can use capitals while tagging an entry, searches by tag are
case-insensitive.
There is no limit to how many tags you can use in an entry.
### Starring Entries ###
To mark an entry as a favorite, simply "star" it using an asterisk (`*`):
```sh ```sh
jrnl last sunday *: Best day of my life. jrnl last sunday *: Best day of my life.
``` ```
If you don't want to add a date (ie. your entry will be dated as now), If you don't want to add a date (i.e., you want the date to be entered as
The following options are equivalent: _now_), the following options are equivalent:
- `jrnl *: Best day of my life.` - `jrnl *: Best day of my life.`
- `jrnl *Best day of my life.` - `jrnl *Best day of my life.`
- `jrnl Best day of my life.*` - `jrnl Best day of my life.*`
!!! note !!! note
Just make sure that the asterisk sign is **not** surrounded by Make sure that the asterisk (`*`) is **not** surrounded by whitespaces.
whitespaces, e.g. `jrnl Best day of my life! *` will **not** work (the `jrnl Best day of my life! *` will not work because the `*` character has a
reason being that the `*` sign has a special meaning on most shells). special meaning in most shells.
## Viewing ## Viewing and Searching Entries ##
`jrnl` can display entries in a variety of ways.
To view all entries, enter:
```sh
jrnl -to today
```
`jrnl` provides several filtering commands, prefaced by a single dash (`-`), that
allow you to find a more specific range of entries. For example,
```sh ```sh
jrnl -n 10 jrnl -n 10
``` ```
will list you the ten latest entries (if you're lazy, `jrnl -10` will do lists the ten most recent entries. `jrnl -10` is even more concise and works the
the same), same way. If you want to see all of the entries you wrote from the beginning of
last year until the end of this past March, you would enter
```sh ```sh
jrnl -from "last year" -until march jrnl -from "last year" -to march
``` ```
everything that happened from the start of last year to the start of Filter criteria that use more than one word require surrounding quotes (`""`).
last march. To only see your favourite entries, use
To see entries on a particular date, use `-on`:
```sh
jrnl -on yesterday
```
### Text Search ###
The `-contains` command displays all entries containing the text you enter after it.
This may be helpful when you're searching for entries and you can't remember if you
tagged any words when you wrote them.
You may realize that you use a word a lot and want to turn it into a tag in all
of your previous entries.
```sh ```sh
jrnl -starred jrnl -contains "dogs" --edit
``` ```
## Using Tags opens your external editor so that you can add a tag symbol (`@` by default) to
all instances of the word "dogs."
Keep track of people, projects or locations, by tagging them with an `@` ### Filtering by Tag ###
in your entries
```sh You can filter your journal entries by tag. For example,
jrnl Had a wonderful day on the @beach with @Tom and @Anna.
```
You can filter your journal entries just like this:
```sh ```sh
jrnl @pinkie @WorldDomination jrnl @pinkie @WorldDomination
``` ```
Will print all entries in which either `@pinkie` or `@WorldDomination` displays all entries in which either `@pinkie` or `@WorldDomination`
occurred. occurred. Tag filters can be combined with other filters:
```sh ```sh
jrnl -n 5 -and @pineapple @lubricant jrnl -n 5 @pinkie -and @WorldDomination
``` ```
the last five entries containing both `@pineapple` **and** `@lubricant`. displays the last five entries containing _both_ `@pinkie` _and_
You can change which symbols you'd like to use for tagging in the `@worldDomination`. You can change which symbols you'd like to use for tagging
configuration. in the [configuration file](./reference-config-file.md#tagsymbols).
!!! note !!! note
`jrnl @pinkie @WorldDomination` will switch to viewing mode because Entering `jrnl @pinkie @WorldDomination` will display entries in which both
although **no** command line arguments are given, all the input strings tags are present because, although no command line arguments are given, all
look like tags - _jrnl_ will assume you want to filter by tag. of the input strings look like tags. `jrnl` will assume you want to filter
by tag, rather than create a new entry that consists only of tags.
## Editing older entries To view a list of all tags in the journal, enter:
You can edit selected entries after you wrote them. This is particularly
useful when your journal file is encrypted. To use this feature, you need
to have an editor configured in your journal configuration file (see
`advanced usage <advanced>`)
```sh ```sh
jrnl -until 1950 @texas -and @history --edit jrnl --tags
``` ```
Will open your editor with all entries tagged with `@texas` and ### Viewing Starred Entries ###
`@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. To display only your favorite (starred) entries, enter
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
```sh ```sh
jrnl @girlfriend -until 'june 2012' --edit jrnl -starred
``` ```
Just select all text, press delete, and everything is gone... ## Editing Entries ##
You can edit entries after writing them. This is particularly useful when your
journal file is encrypted. To use this feature, you need to have an external
editor configured in your [configuration file](./reference-config-file.md#editor). You
can also edit only the entries that match specific search criteria. For example,
```sh
jrnl -to 1950 @texas -and @history --edit
```
opens your external editor displaying all entries tagged with `@texas` and
`@history` that were written before 1950. After making changes, save and close
the file, and only those entries will be modified (and encrypted, if
applicable).
If you are using multiple journals, it's easy to edit specific entries from
specific journals. Simply prefix the filter string with the name of the journal.
For example,
```sh
jrnl work -n 1 --edit
```
opens the most recent entry in the 'work' journal in your external editor.
## Deleting Entries ##
The `--delete` command opens an interactive interface for deleting entries. The
date and title of each entry in the journal are presented one at a time, and you
can choose whether to keep or delete each entry.
If no filters are specified, `jrnl` will ask you to keep or delete each entry in
the entire journal, one by one. If there are a lot of entries in the journal, it
may be more efficient to filter entries before passing the `--delete` command.
Here's an example. Say you have a journal into which you've imported the last 12
years of blog posts. You use the `@book` tag a lot, and for some reason you want
to delete some, but not all, of the entries in which you used that tag, but only
the ones you wrote at some point in 2004 or earlier. You're not sure which
entries you want to keep, and you want to look through them before deciding.
This is what you might enter:
```sh
jrnl -to 2004 @book --delete
```
`jrnl` will show you only the relevant entries, and you can choose the ones you
want to delete.
You may want to delete _all_ of the entries containing `@book` that you wrote in
2004 or earlier. If there are dozens or hundreds, the easiest way would be to
use an external editor. Open an editor with the entries you want to delete...
```sh
jrnl -to 2004 @book --edit
```
...select everything, delete it, save and close, and all of those entries are
removed from the journal.
## Listing Journals ##
To list all of your journals:
```sh
jrnl --list
```
The journals displayed correspond to those specified in the `jrnl`
[configuration file](./reference-config-file.md#journals).

View file

@ -0,0 +1,34 @@
/*
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
*/
:root {
/* For dark bg */
--white: #fcfcfc;
--off-white: #f4f0ff;
--purple: #7e57c2;
--light-purple: #cf93e6;
--blue: #61aeee;
--green: #a6e22e;
--orange: #fd971f;
--red: #eb5567;
--pink: #d57699;
--yellow: #e2b93d;
/* For light bg */
--black: #404040;
--teal: #2a8068;
--dark-blue: #356eb7;
--mid-purple: #846392;
--bright-purple: #af27ad;
--dark-purple: #604385;
--darkest-purple: #251A32;
--grey: #3b3b4a;
--black-shadow: #0000001A;
--blacker-shadow: #00000059;
/* Special cases */
--terminal: #1b1c2e;
}

View file

@ -0,0 +1,147 @@
/*
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
Atom One Dark With support for ReasonML by Gidi Morris, based off work by
Daniel Gamage
Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
line-height: 1.3em;
color: var(--off-white);
background: #383e49;
border-radius: 5px;
font-size: 0.9rem;
line-height: 1.3rem;
}
.hljs-keyword,
.hljs-operator {
color: var(--pink);
}
.hljs-pattern-match {
color: var(--pink);
}
.hljs-pattern-match .hljs-constructor {
color: var(--blue);
}
.hljs-function {
color: var(--blue);
}
.hljs-function .hljs-params {
color: var(--green);
}
.hljs-function .hljs-params .hljs-typing {
color: var(--orange);
}
.hljs-module-access .hljs-module {
color: var(--purple);
}
.hljs-constructor {
color: var(--yellow);
}
.hljs-constructor .hljs-string {
color: var(--green);
}
.hljs-comment,
.hljs-quote {
color: var(--light-purple);
font-style: italic;
}
.hljs-doctag,
.hljs-formula {
color: var(--purple);
}
.hljs-section,
.hljs-name,
.hljs-selector-tag,
.hljs-deletion,
.hljs-subst {
color: var(--yellow);
}
.hljs-literal {
color: var(--blue);
}
.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta-string {
color: var(--green);
}
.hljs-built_in,
.hljs-class .hljs-title {
color: var(--orange);
}
.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-number {
color: var(--orange);
}
.rst-content a tt,
.rst-content a tt,
.rst-content a code {
color: var(--blue);
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: var(--blue);
}
.hljs-tag {
color: var(--pink)
}
.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-title {
color: var(--blue);
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
.hljs-link {
text-decoration: underline;
}
.rst-content .note .admonition-title {
background: var(--dark-blue);
}
.rst-content .note.admonition {
background: var(--light-blue);
}
.rst-content .tip .admonition-title {
background: var(--teal);
}
.rst-content .tip .admonition {
background: var(--light-blue);
}
/* hack to bypass a11y issue with conflicting highlight.css files */
code.language-xml span.hljs-meta span.hljs-string {
color: var(--green) !important;
}

325
docs_theme/assets/index.css Normal file
View file

@ -0,0 +1,325 @@
/*
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
*/
/* reset */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}
body {
background-color: var(--white);
font-family: "Open Sans", "Helvetica Neue", sans-serif;
font-weight: 300;
}
.icon {
background-image: url("../img/sprites.svg");
width: 32px;
height: 32px;
display: inline-block;
font-size: 40px;
background-size: 200px 80px;
}
h3 {
font-weight: 400;
}
.icon.secure {
background-position: 0em 0em;
}
.icon.future {
background-position: -1em 0em;
}
.icon.search {
background-position: -2em 0em;
}
.icon.nli {
background-position: -3em 0em;
}
.icon.share {
background-position: 0em -1em;
}
.icon.sync {
background-position: 0 -1em;
}
.icon.dayone {
background-position: -1em -1em;
}
.icon.github {
background-position: -2em -1em;
}
.icon.search {
background-position: -2em 0;
}
.icon.folders {
background-position: -3em -1em;
}
.icon.twitter {
background-position: -4em -1em;
}
header {
background-color: var(--mid-purple);
background-image: linear-gradient(211deg, var(--mid-purple) 0%, var(--dark-purple) 100%);
color: var(--white);
border: 0px solid transparent;
display: relative;
padding-top: 150px;
overflow: visible;
}
#terminal {
background: var(--terminal);
max-width: 520px;
box-shadow: 0 -2px 16px 0 var(--black-shadow);
border-radius: 6px;
min-height: 120px;
margin: 0px auto;
position: relative;
transform: translateY(75px);
color: var(--off-white);
font-family: "Monaco", "Courier New";
font-size: 18px;
padding: 45px 20px 0px 20px;
line-height: 165%;
}
#terminal b {
font-weight: normal;
color: var(--off-white);
}
#terminal i {
font-style: normal;
color: var(--light-purple);
}
#terminal:before {
content: "";
position: absolute;
top: 15px;
left: 15px;
display: inline-block;
width: 15px;
height: 15px;
border-radius: 50%;
background: var(--grey);
box-shadow: 25px 0 0 var(--grey), 50px 0 0 var(--grey);
}
#typed:before {
content: "$ ";
color: var(--mid-purple);
}
#twitter {
display: block;
position: absolute;
text-decoration: none;
top: 20px;
right: 20px;
border: 1px solid var(--white);
padding: 5px 10px;
color: var(--white);
border-radius: 3px;
}
#twitter .icon {
transform: scale(0.5);
vertical-align: -18%;
margin: 0;
padding: 0;
}
#twitter:hover,
#twitter:active {
text-decoration: none;
box-shadow: 0 2px 25px 0 var(--blacker-shadow);
transition: all .5s ease;
}
#title {
max-width: 630px;
margin: 0 auto;
padding: 0px 20px;
}
#prompt {
max-width: 700px;
margin: 25px auto 100px auto;
padding: 0px 20px;
}
header img {
float: left;
margin-right: 30px;
}
h1 {
color: var(--white);
font-weight: 300;
}
a,
a:visited {
color: var(--dark-purple);
}
a:hover {
color: var(--bright-purple);
}
nav {
text-align: center;
}
nav a#twitter-nav {
display: none;
}
nav a, nav a:visited {
color: var(--dark-purple);
font-size: 20px;
line-height: 2.5em;
margin: 0 40px;
font-weight: 400;
text-decoration: none;
}
nav a:hover,
nav a:visited:hover {
color: var(--bright-purple);
text-decoration: underline;
}
nav a.cta {
display: inline-block;
color: var(--white);
background-color: var(--mid-purple);
background-image: linear-gradient(259deg, var(--mid-purple) 0%, var(--dark-purple) 100%);
box-shadow: 0 2px 8px 0 var(--blacker-shadow);
border-radius: 50px;
padding: 0 2em;
white-space: nowrap;
transition: all 0.1s ease;
text-decoration: none;
}
nav a.cta:hover {
text-decoration: none;
background-color: var(--mid-purple);
background-image: linear-gradient(259deg, var(--bright-purple) 0%, var(--dark-purple) 100%);
box-shadow: 0 4px 16px 0 var(--black-shadow);
color: var(--off-white);
}
main {
padding: 60px 0 0 0;
}
.flex {
display: flex;
margin: 0 auto;
max-width: 920px;
flex-wrap: wrap;
padding: 20px 20px;
padding-top: 30px;
justify-content: space-between;
}
.flex section {
/*margin: 20px;*/
margin-top: 40px;
width: 32%;
}
.flex section:first-child {
margin-left: 0px;
}
.flex section:last-child {
margin-right: 0px;
}
.flex section i {
float: left;
left: 0;
display: block;
margin: 0px auto 10px auto;
}
.flex section h3 {
margin-top: 0;
font-size: 18px;
color: var(--dark-purple);
margin-bottom: 0.5em;
font-weight: 300;
margin-left: 40px;
}
.flex section p {
padding-left: 40px;
color: var(--grey);
font-size: 16px;
margin: 0;
}
footer {
color: var(--grey);
max-width: 700px;
margin: 70px auto 20px;
padding: 0 20px 20px 20px;
font-size: 16px;
text-align: center;
}
@media screen and (max-width: 680px) {
.flex {
display: block;
padding: 0;
}
.flex section {
width: 100%;
}
main {
padding: 20px;
margin: 0;
width: calc(100% - 40px);
}
nav a,
nav a#twitter-nav {
display: inline-block;
margin: 0px 10px;
}
nav a.cta {
display: block;
margin: 20px;
}
header #twitter {
display: none;
}
header #logo {
display: block;
float: none;
margin: 0px auto;
}
header #title br {
display: none;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

378
docs_theme/assets/theme.css Normal file
View file

@ -0,0 +1,378 @@
/*
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
*/
/* ------------------------------------------------------------ */
/* Overrides for jrnl theme */
/* ------------------------------------------------------------ */
body.wy-body-for-nav,
section.wy-nav-content-wrap {
background-color: var(--white);
color: var(--black);
}
.rst-content pre {
background-color: transparent;
border: none;
margin: 1em -1em;
}
.rst-content code {
color: var(--darkest-purple);
background-color: var(--off-white);
font-size: 15px;
}
.rst-content pre code {
color: var(--off-white);
background: var(--darkest-purple);
padding: 1em 1.5em;
border-radius: 15px;
border: none;
font-size: 16px;
line-height: 1.5em;
font-weight: 200 !important;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "Open Sans", "Helvetica Neue", Helvetica, sans-serif;
font-weight: 600;
margin-top: 2rem;
margin-bottom: 0.2rem;
}
h2 {
font-size: 1.2em;
margin-top: 40px;
}
h3 {
font-size: 1.1em;
}
h4 {
font-size: 1em;
}
p,
td,
tr,
div,
li {
font-family: "Open Sans", "Helvetica Neue", Helvetica, sans-serif;
font-weight: 00;
font-size: 18px;
line-height: 1.5em;
}
p {
margin: 1em 0em;
}
/* No-one likes lines that are 400 characters long. */
div.rst-content {
max-width: 54em;
}
.wy-side-nav-search,
.wy-menu-vertical li.current,
.wy-menu-vertical li.toctree-l1.current > a,
.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l3.current > a {
background-color: transparent;
border: none;
}
.wy-menu-vertical li.toctree-l2.current li.toctree-l3,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a {
background: transparent;
}
.wy-menu-vertical li.toctree-l4,
.wy-menu-vertical li.toctree-l5,
.wy-menu-vertical li.toctree-l6,
.wy-menu-vertical li.toctree-l7 {
display: none;
}
.wy-nav-top {
background-color: var(--mid-purple);
background-image: linear-gradient(-211deg, var(--mid-purple) 0%, var(--dark-purple) 100%);
}
.wy-nav-top .fa-bars {
line-height: 50px;
}
.wy-side-nav-search a.icon-home {
width: 100%;
max-width: 250px;
background-size: 100%;
}
.wy-side-nav-search a.icon-home:before {
display: block;
width: 84px;
height: 70px;
content: "";
background: url(../img/logo_white.svg) center center no-repeat;
margin: 10px auto;
}
.wy-menu-vertical a,
.wy-menu-vertical li ul li a {
font-size: 16px;
color: var(--white);
line-height: 2em;
}
.wy-menu-vertical a:hover,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a:hover,
.wy-menu-vertical li.current a:hover {
background-color: var(--black-shadow);
color: var(--white);
}
.wy-menu-vertical li.on a {
transition: all .25s ease;
background: var(--dark-purple);
color: var(--white);
position: relative;
}
.wy-menu-vertical li.toctree-l1.current > a {
background: var(--darkest-purple);
border: none !important;
pointer-events: none;
}
.wy-menu-vertical li.on a,
.wy-menu-vertical li.current a {
border-right: none;
}
.wy-menu-vertical li.on a,
.wy-menu-vertical li > a.current:after {
position: absolute;
right: 0em;
z-index: 999;
content: "";
width: 0;
height: 0;
border-top: 1em solid transparent;
border-bottom: 1em solid transparent;
border-right: 1em solid var(--white);
}
.toctree-expand:before {
display: none !important;
}
.rst-versions,
.rst-versions .rst-current-version {
display: none;
}
.wy-menu-vertical p.caption {
margin-top: 2em;
}
.wy-menu-vertical span {
color: var(--white);
font-size: 1.2em;
font-weight: 600;
}
.wy-menu-vertical li a {
color: var(--white) !important;
font-weight: 300;
}
.wy-nav-side {
background-color: var(--mid-purple);
font-weight: 300;
height: 100%;
}
footer {
display: none;
}
.wy-side-nav-search input[type=text],
.mkdocs-search input[type=text],
form .search-query {
background-color: var(--off-white);
border: none;
margin-bottom: 1em;
color: var(--black);
font-weight: 500;
box-shadow: none;
}
.wy-side-nav-search input[type=text]::placeholder,
.mkdocs-search input[type=text]::placeholder,
form .search-query::placeholder {
color: var(--dark-purple);
}
.wy-side-nav-search > a:hover {
background: transparent;
}
.wy-menu-vertical li.current ul {
background-color: var(--mid-purple);
}
/* ------------------------------------------------------------ */
/* Logo: ; */
/* ------------------------------------------------------------ */
.logo {
width: 128px;
height: 128px;
vertical-align: middle;
margin-right: 1em;
}
/* ------------------------------------------------------------ */
/* Code blocks in callouts */
/* ------------------------------------------------------------ */
div.admonition {
border-radius: 5px;
margin: 1em -1em;
}
div.admonition p.admonition-title {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
div.admonition>p {
padding: 0em .5em;
}
div.admonition div.highlight {
background: none !important;
}
/* ------------------------------------------------------------ */
/* Fancy ordered lists. */
/* ------------------------------------------------------------ */
ol {
counter-reset: li;
margin-left: 0px;
padding: 0;
}
ol li {
list-style: none !important;
margin-bottom: 1.5em;
margin-left: 3em !important;
}
ol>li:before {
content: counter(li);
counter-increment: li;
background-color: var(--sidebar);
border-radius: 50%;
display: block;
float: left;
margin-left: -3em;
margin-top: -.3em;
width: 2em;
height: 2em;
color: var(--dark-purple);
text-align: center;
line-height: 2em;
font-weight: 600;
}
/* ------------------------------------------------------------ */
/* Accessibility-related changes */
/* ------------------------------------------------------------ */
.rst-content div[role="main"] a,
.rst-content div[role="main"] a:visited {
color: var(--mid-purple);
text-decoration: underline;
}
.rst-content div[role="main"] a:hover {
color: var(--bright-purple);
}
.rst-content div[role="navigation"] a,
.rst-content div[role="navigation"] a:visited {
color: var(--mid-purple);
}
.mkdocs-search {
display: flex;
margin-top: 20px;
}
.wy-side-nav-search input[type="text"],
.mkdocs-search input[type=text] {
border-radius: 50px 0 0 50px;
height: 32px;
border-right: none;
margin: 0;
}
.mkdocs-search button {
background-color: var(--off-white);
border: none;
box-shadow: none;
color: var(--mid-purple);
border-radius: 0 50px 50px 0;
height: 32px;
width: 2.5em;
overflow: hidden;
}
.mkdocs-search {
border-radius: 50px;
}
.mkdocs-search:focus-within {
box-shadow: 0 2px 25px 0 var(--blacker-shadow);
transition: all .5s ease;
}
.rst-content div[role="main"] .mkdocs-search input[type="text"] {
border-right: none;
font-size: 100%;
height: 48px;
margin: 0;
}
.rst-content div[role="main"] .mkdocs-search button {
border-left: none;
font-size: 100%;
height: 48px;
}
.rst-content div[role="main"] .mkdocs-search button:before {
font-size: 140%;
position: relative;
left: -7px;
top: -1px;
}
.search-results {
margin-top: 0;
}

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

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 224 KiB

View file

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 175 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1,14 @@
<svg width="400" height="160" viewBox="0 0 400 160" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="sprites">
<path id="path10" fill-rule="evenodd" clip-rule="evenodd" d="M176.001 24.001C176.001 10.7458 186.746 0 200.002 0C213.257 0 224.003 10.7471 224 24.001C224 37.2562 213.254 48.002 199.999 48.002C195.938 48.002 192.117 46.9846 188.765 45.2019L172.083 61.8826L172.087 61.8866C170.806 63.192 169.028 64.004 167.058 64.004C163.16 64.004 160 60.8452 160 56.9464C160 54.973 160.812 53.1969 162.117 51.9142L162.103 51.9022L178.791 35.2175C177.014 31.8667 176.001 28.0532 176.001 24.001ZM167.058 60.4732C168.054 60.4732 168.946 60.0545 169.59 59.3865L185.718 43.2605C183.82 41.8457 182.14 40.1657 180.73 38.2643L164.598 54.3969L164.615 54.4129C163.948 55.0596 163.528 55.949 163.528 56.945C163.528 58.8958 165.108 60.4732 167.058 60.4732ZM200.002 44.0045C188.957 44.0045 180.001 35.0455 180.001 24.0037C180.001 12.9592 188.957 4.00283 200.002 4.00283C211.043 4.00283 220.003 12.9592 220.003 24.0037C220.003 35.0468 211.045 44.0045 200.002 44.0045ZM201.002 11.0018C201.002 10.4498 200.551 10.0017 200.002 10.0017C192.268 10.0017 186.001 16.2687 186.001 24.0023C186.001 24.5544 186.449 25.0024 187.001 25.0024C187.553 25.0024 188.001 24.5544 188.001 24.0023C188.001 17.3754 193.373 12.0018 200.002 12.0018C200.551 12.0018 201.002 11.5525 201.002 11.0018Z" fill="#684688"/>
<path id="path12" fill-rule="evenodd" clip-rule="evenodd" d="M42 26V18C42 8.05733 33.9427 0 24 0C14.0573 0 6 8.05733 6 18V26C2.68533 26 0 28.6853 0 32V38V40V44V46C0 55.9427 8.05733 64 18 64H30C39.9427 64 48 55.9427 48 46V44V40V38V32C48 28.684 45.312 26 42 26ZM10 18C10 10.268 16.268 4 24 4C31.732 4 38 10.268 38 18V26H34V18.004C34 12.48 29.524 8.004 24 8.004C18.476 8.004 14 12.48 14 18.004V26H10V18ZM32 18.0067V18C32 13.5827 28.4173 10 24 10C19.5813 10 16 13.5813 16 18V18.004V26H32V18.0067ZM44 38V40V44V46C44 53.7173 37.7173 60 30 60H18C10.2827 60 4 53.7173 4 46V44V40V38V32C4 30.896 4.896 30 6 30H10H38H42C43.1027 30 44 30.896 44 32V38ZM28 42C28 39.7907 26.208 38 24 38C21.792 38 20 39.7907 20 42C20 43.2133 20.6667 45.52 21.3333 47.344C21.8787 48.828 22.5627 49.996 24 49.996C25.564 49.996 26.1213 48.84 26.668 47.364C27.344 45.536 28 43.2173 28 42Z" fill="#684688"/>
<path id="path6" fill-rule="evenodd" clip-rule="evenodd" d="M37.4495 102.225L56 110.175V88.9754L49.2056 93.8301C44.3508 88.4239 37.3366 85 29.5 85C17.0237 85 6.58791 93.6333 3.7737 105.244L8.72074 107.291C10.6738 97.6002 19.2306 90.2993 29.5 90.2993C35.5547 90.2993 41.001 92.8572 44.8646 96.9285L37.4495 102.225ZM29.5 132.701C23.4453 132.701 17.9966 130.143 14.1354 126.073L21.5505 120.773L3 112.824V134.025L9.79444 129.17C14.6467 134.576 21.6634 138 29.5 138C41.9945 138 52.4412 129.342 55.2397 117.709L50.2975 115.594C48.3894 125.344 39.8083 132.701 29.5 132.701Z" fill="#684688"/>
<path id="Combined Shape" fill-rule="evenodd" clip-rule="evenodd" d="M124 84H130.667C138.03 84 144 89.9695 144 97.3333V126.667C144 134.03 138.03 140 130.667 140H124H100H93.3333C85.9695 140 80 134.03 80 126.667V97.3333C80 89.9695 85.9695 84 93.3333 84H100H124ZM110.667 88H100C94.8453 88 90.6667 92.1787 90.6667 97.3333V126.667C90.6667 131.821 94.8453 136 100 136H110.667V88ZM114.667 88V136H124C129.155 136 133.333 131.821 133.333 126.667V97.3333C133.333 94.1617 131.751 91.3595 129.333 89.6729V109.333L124 105.333L118.667 109.333V88H114.667ZM134.13 135.336C136.127 133.005 137.333 129.977 137.333 126.667V97.3333C137.333 94.0233 136.127 90.9949 134.13 88.6638C137.57 90.0393 140 93.4025 140 97.3333V126.667C140 130.597 137.57 133.961 134.13 135.336ZM89.8697 135.336C87.8729 133.005 86.6667 129.977 86.6667 126.667V97.3333C86.6667 94.0233 87.8728 90.9949 89.8697 88.6638C86.43 90.0393 84 93.4025 84 97.3333V126.667C84 130.597 86.43 133.961 89.8697 135.336Z" fill="#684688"/>
<path id="path8" fill-rule="evenodd" clip-rule="evenodd" d="M363.625 13.625V2L384 16.5417L363.625 31.0833V22.375C335.716 22.375 332.168 42.2843 331.708 47.375C332.463 13.711 363.625 13.625 363.625 13.625ZM320 16.5417C320 12.1097 323.568 8.54167 328 8.54167H353.333L344 12.5417H328C325.784 12.5417 324 14.3257 324 16.5417V52.5417C324 54.7577 325.784 56.5417 328 56.5417H369.333C371.549 56.5417 373.333 54.7577 373.333 52.5417V32.5417L377.333 29.875V52.5417C377.333 56.9737 373.765 60.5417 369.333 60.5417H328C323.568 60.5417 320 56.9737 320 52.5417V16.5417Z" fill="#684688"/>
<path id="path16" fill-rule="evenodd" clip-rule="evenodd" d="M272 3C254.327 3 240 13.7453 240 27C240 35.2547 245.557 42.532 254.016 46.852C254.016 46.878 254.012 46.8999 254.008 46.9224C254.004 46.9459 254 46.97 254 47C254 50.1096 251.986 53.4268 250.683 55.5737L250.683 55.5739C250.483 55.9023 250.3 56.2033 250.144 56.472H250.148C250.053 56.692 250 56.9333 250 57.188C250 58.188 250.809 59 251.812 59C251.902 59 252.025 58.9887 252.127 58.9792C252.239 58.9689 252.326 58.9609 252.321 58.972C258.572 57.948 264.46 52.2053 265.828 50.5427C267.827 50.836 269.887 51 272 51C289.671 51 304 40.2547 304 27C304 13.7453 289.672 3 272 3ZM272 13C272.552 13 273 13.448 273 14C273 14.552 272.549 15 272 15C261.345 15 252 20.608 252 27C252 27.552 251.552 28 251 28C250.448 28 250 27.552 250 27C250 19.412 260.075 13 272 13ZM266.408 46.5867C268.284 46.86 270.165 47 272 47C287.439 47 300 38.028 300 27C300 15.972 287.436 7 272 7C256.56 7 244 15.972 244 27C244 33.4147 248.424 39.504 255.836 43.2893C257.175 43.972 258.016 45.3467 258.016 46.8507C258.016 46.96 258.011 47.0907 257.999 47.2187C257.956 49.2867 257.347 51.292 256.567 53.0827C259.444 51.372 261.88 49.0467 262.736 48.004C263.503 47.072 264.64 46.544 265.828 46.544C266.02 46.544 266.213 46.5547 266.408 46.5867Z" fill="#684688"/>
<path id="path22" fill-rule="evenodd" clip-rule="evenodd" d="M160 112C160 94.3267 174.327 80 192 80C209.673 80 224 94.3267 224 112C224 129.673 209.673 144 192 144C174.327 144 160 129.673 160 112ZM220 112C220 96.536 207.464 84 192 84C176.536 84 164 96.536 164 112C164 124.684 172.434 135.391 184 138.833V137.75V135.125V132.875C184 130.334 184.875 128.5 186.583 127.333C185.501 127.229 184.489 127.062 183.583 126.875C182.838 126.721 182.282 126.524 181.545 126.261C181.387 126.205 181.22 126.146 181.042 126.083C180.031 125.73 179.135 125.282 178.333 124.792C177.532 124.301 176.74 123.656 176 122.875C175.26 122.094 174.625 121.239 174.125 120.25C173.625 119.261 173.25 118.052 172.958 116.667C172.666 115.281 172.5 113.75 172.5 112.083C172.5 108.854 173.563 106.104 175.667 103.833C174.708 101.355 174.833 98.667 176 95.7083C176.012 95.7042 176.025 95.6992 176.039 95.6938C176.097 95.6718 176.175 95.6422 176.292 95.625C176.437 95.6037 176.781 95.6253 177.292 95.6667C177.802 95.708 178.365 95.8227 178.958 96C179.552 96.1773 180.344 96.5107 181.333 97C182.323 97.4907 183.354 98.0827 184.458 98.8333C186.896 98.1467 189.437 97.8333 192.125 97.8333C194.792 97.8333 197.396 98.1453 199.875 98.8333C201.626 97.6453 203.178 96.813 204.583 96.2917C205.989 95.7703 206.959 95.5207 207.5 95.5833L208.292 95.6667C209.458 98.604 209.584 101.333 208.625 103.833C210.729 106.105 211.75 108.854 211.75 112.083C211.75 113.75 211.625 115.281 211.333 116.667C211.041 118.052 210.625 119.261 210.125 120.25C209.625 121.239 209.03 122.094 208.292 122.875C207.553 123.656 206.761 124.302 205.958 124.792C205.156 125.281 204.261 125.73 203.25 126.083C202.239 126.437 201.28 126.688 200.375 126.875C199.47 127.062 198.459 127.188 197.375 127.292C199.104 128.48 200 130.354 200 132.875V135.375V137.667V138.833C211.566 135.391 220 124.684 220 112Z" fill="#684688"/>
<path id="path3858" fill-rule="evenodd" clip-rule="evenodd" d="M100 0C99.0049 0 98.0752 0.350804 97.3333 0.958333C96.5914 1.56586 96 2.50111 96 3.625V5.33333H94.6667V6.66667H87.3333C87.264 6.66305 87.1944 6.66305 87.125 6.66667C86.1491 6.76895 85.3281 7.68544 85.3333 8.66667V9.33333H83.3333C82.2862 9.33344 81.3334 10.2862 81.3333 11.3333V12.125C80.563 12.3974 80.0044 13.1829 80 14V18C80.0001 19.0472 80.9528 19.9999 82 20H85.3333V53.3333L83.6667 54.9167C83.0569 55.2687 82.6604 55.9626 82.6667 56.6667V60.6667C82.6668 61.7138 83.6195 62.6666 84.6667 62.6667H95.2083H104.667H104.875H115.333C116.381 62.6666 117.333 61.7138 117.333 60.6667V56.6667C117.34 55.9626 116.943 55.2687 116.333 54.9167L114.667 53.3333V20H118C119.047 19.9999 120 19.0472 120 18V14C119.996 13.1829 119.437 12.3974 118.667 12.125V11.3333C118.667 10.2862 117.714 9.33344 116.667 9.33333H114.667V8.66667C114.667 7.6195 113.714 6.66677 112.667 6.66667H105.333V5.33333H104V3.625C104 2.50111 103.409 1.56586 102.667 0.958333C101.925 0.350804 100.995 0 100 0ZM100 2.66667C100.274 2.66667 100.684 2.81724 100.958 3.04167C101.232 3.26609 101.333 3.47936 101.333 3.625V5.33333H98.6667V3.625C98.6667 3.47936 98.7676 3.26609 99.0417 3.04167C99.3157 2.81724 99.7255 2.66667 100 2.66667ZM112 12V10.6667H88V12H85.3333C85.2542 12.8356 85.0919 13.6063 84 13.5417V17.3333H89.3333H110.667H116V13.4167C114.82 13.6844 114.596 12.9828 114.667 12H112ZM110.667 20V56L113.333 57.8333V58.6667H86.6667V57.8333L89.3333 56V20H110.667ZM92 28V22.6667H94.6667V28H92ZM96 22.6667V28H98.6667V22.6667H96ZM101.333 28V22.6667H104V28H101.333ZM105.333 22.6667V28H108V22.6667H105.333ZM92 34.6667V29.3333H94.6667V34.6667H92ZM96 29.3333V34.6667H98.6667V29.3333H96ZM101.333 34.6667V29.3333H104V34.6667H101.333ZM105.333 29.3333V34.6667H108V29.3333H105.333ZM101.333 42.6667C101.333 41.6527 102.153 40.8333 103.167 40.8333C104.181 40.8333 105 41.6527 105 42.6667C105 43.6806 104.181 44.5 103.167 44.5C102.153 44.5 101.333 43.6806 101.333 42.6667Z" fill="#684688"/>
<path id="path20" fill-rule="evenodd" clip-rule="evenodd" d="M247.472 80L243.472 115.792L247.43 116.208L251.013 84H291.93L295.513 116.208L299.472 115.792L295.472 80H247.472ZM255.472 88V92H287.472V88H255.472ZM255.472 100V96H287.472V100H255.472ZM255.472 104V108H287.472V104H255.472ZM255.472 116V112H287.472V116H255.472ZM241.472 120C240.372 120 239.749 120.873 240.097 121.917L246.847 142.083C247.195 143.127 248.372 144 249.472 144H293.472C294.572 144 295.749 143.127 296.097 142.083L302.847 121.917C303.196 120.873 302.572 120 301.472 120H241.472ZM279.472 124H263.472V128H279.472V124Z" fill="#684688"/>
<path id="Vector" d="M370.378 82H380.145L358.811 107.042L384 141H364.209L348.787 120.416L331.052 141H321.285L344.161 114.253L320 82H340.305L354.313 100.88L370.378 82ZM366.908 134.969H372.305L337.349 87.6378H331.438L366.908 134.969Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

64
docs/theme/index.html → docs_theme/index.html Executable file → Normal file
View file

@ -1,28 +1,34 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>jrnl - The Command Line Journal</title> <title>jrnl - The Command Line Journal</title>
<meta name="description" content="Collect your thoughts and notes without leaving the command line."> <meta name="description" content="Collect your thoughts and notes without leaving the command line.">
<meta name="image" content="https://jrnl.sh/img/banner.png"> <meta name="image" content="https://jrnl.sh/en/stable/img/banner_og.png">
<meta itemprop="name" content="jrnl - The Command Line Journal"> <meta itemprop="name" content="jrnl - The Command Line Journal">
<meta itemprop="description" content="Collect your thoughts and notes without leaving the command line."> <meta itemprop="description" content="Collect your thoughts and notes without leaving the command line.">
<meta itemprop="image" content="https://jrnl.sh/img/banner_og.png"> <meta itemprop="image" content="https://jrnl.sh/en/stable/img/banner_og.png">
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
<meta name="twitter:title" content="jrnl - The Command Line Journal"> <meta name="twitter:title" content="jrnl - The Command Line Journal">
<meta name="twitter:description" content="Collect your thoughts and notes without leaving the command line."> <meta name="twitter:description" content="Collect your thoughts and notes without leaving the command line.">
<meta name="twitter:creator" content="jrnl"> <meta name="twitter:creator" content="jrnl">
<meta name="twitter:image:src" content="https://jrnl.sh/img/banner_twitter.png"> <meta name="twitter:image:src" content="https://jrnl.sh/en/stable/img/banner_twitter.png">
<meta name="og:title" content="jrnl - The Command Line Journal"> <meta name="og:title" content="jrnl - The Command Line Journal">
<meta name="og:description" content="Collect your thoughts and notes without leaving the command line."> <meta name="og:description" content="Collect your thoughts and notes without leaving the command line.">
<meta name="og:image" content="https://jrnl.sh/img/banner_og.png"> <meta name="og:image" content="https://jrnl.sh/en/stable/img/banner_og.png">
<meta name="og:url" content="https://jrnl.sh"> <meta name="og:url" content="https://jrnl.sh">
<meta name="og:site_name" content="jrnl - The Command Line Journal"> <meta name="og:site_name" content="jrnl - The Command Line Journal">
<meta name="og:type" content="website"> <meta name="og:type" content="website">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="index.css"> <link rel="stylesheet" href="assets/colors.css">
<link rel="stylesheet" href="assets/index.css">
<link rel="shortcut icon" href="img/favicon.ico"> <link rel="shortcut icon" href="img/favicon.ico">
<script type="application/ld+json"> <script type="application/ld+json">
{ {
@ -32,9 +38,9 @@
"name": "jrnl", "name": "jrnl",
"description": "Collect your thoughts and notes without leaving the command line.", "description": "Collect your thoughts and notes without leaving the command line.",
"operatingSystem": ["macOS", "Windows", "Linux"], "operatingSystem": ["macOS", "Windows", "Linux"],
"thumbnailUrl": "https://jrnl.sh/img/banner_og.png", "thumbnailUrl": "https://jrnl.sh/en/stable/img/banner_og.png",
"installUrl": "https://jrnl.sh/installation", "installUrl": "https://jrnl.sh/en/stable/installation",
"softwareVersion": "2.0.0rc2" "softwareVersion": "2.5"
} }
</script> </script>
</head> </head>
@ -42,10 +48,10 @@
<body> <body>
<header> <header>
<aside> <aside>
<a id="twitter" href="https://twitter.com/intent/tweet?text=Write+your+memoirs+on+the+command+line.+Like+a+boss.+%23jrnl&url=http%3A%2F%2Fjrnl.sh&via=maebert"><i class="icon twitter"></i>Tell your friends</a> <a id="twitter" href="https://twitter.com/intent/tweet?text=Collect+your+thoughts+and+notes+without+leaving+the+command+line.+https%3A%2F%2Fjrnl.sh+via+@JrnlSh"><i class="icon twitter"></i>Tell your friends</a>
</aside> </aside>
<div id="title"> <div id="title">
<img id="logo" src="img/jrnl_white.svg" width="90px" height="98px" title="jrnl" /> <img id="logo" src="img/jrnl_white.svg" width="90px" height="98px" title="jrnl" alt="jrnl logo" />
<h1>Collect your thoughts and notes <br />without leaving the command line.</h1> <h1>Collect your thoughts and notes <br />without leaving the command line.</h1>
</div> </div>
<div id="prompt"> <div id="prompt">
@ -57,9 +63,9 @@
<main> <main>
<nav> <nav>
<a href="overview">Documentation</a> <a href="overview">Documentation</a>
<a href="http://github.com/jrnl-org/jrnl" title="View on Github">Fork me on GitHub</a> <a href="installation" class="cta">Get Started</a>
<a id="twitter-nav" href="https://twitter.com/intent/tweet?text=Write+your+memoirs+on+the+command+line.+Like+a+boss.+%23jrnl&url=http%3A%2F%2Fjrnl.sh&via=maebert">Tell your friends on twitter</a> <a href="http://github.com/jrnl-org/jrnl" title="View on Github">Fork on GitHub</a>
<a href="installation" class="cta">Download</a> <a id="twitter-nav" href="https://twitter.com/intent/tweet?text=Collect+your+thoughts+and+notes+without+leaving+the+command+line.+https%3A%2F%2Fjrnl.sh+via+@JrnlSh">Tell your friends on X</a>
</nav> </nav>
<div class="flex"> <div class="flex">
<section> <section>
@ -70,22 +76,22 @@
<section> <section>
<i class="icon future"></i> <i class="icon future"></i>
<h3>Future-proof.</h3> <h3>Future-proof.</h3>
<p>Your journals are stored in plain-text files that will still be readable in 50 years when all your fancy iPad apps will have gone the way of the Dodo.</p> <p>Your journals are stored in plain-text files that will still be readable in 50 years when your fancy proprietary apps will have gone the way of the dodo.</p>
</section> </section>
<section> <section>
<i class="icon secure"></i> <i class="icon secure"></i>
<h3>Secure.</h3> <h3>Secure.</h3>
<p>Encrypt your journals with the industry-strength AES encryption. The NSA won't be able to read your dirty secrets.</p> <p>Encrypt your journals with industry-strength AES encryption. Nobody will be able to read your dirty secrets&mdash;not even you, if you lose your password!</p>
</section> </section>
<section> <section>
<i class="icon sync"></i> <i class="icon sync"></i>
<h3>Accessible anywhere.</h3> <h3>Accessible anywhere.</h3>
<p>Sync your journals with Dropbox and capture your thoughts where ever you are</p> <p>Sync your journal files with other tools like Dropbox to capture your thoughts wherever you are.</p>
</section> </section>
<section> <section>
<i class="icon github"></i> <i class="icon github"></i>
<h3>Free &amp; Open Source.</h3> <h3>Free &amp; Open Source.</h3>
<p>jrnl is made by a bunch of really friendly and remarkably attractive people. Maybe even <a href="https://www.github.com/jrnl-org/jrnl" title="Fork jrnl on GitHub">you</a>?</p> <p>jrnl is made by a bunch of really friendly and remarkably amazing people. Maybe even <a href="https://www.github.com/jrnl-org/jrnl" title="Fork jrnl on GitHub">you</a>?</p>
</section> </section>
<section> <section>
<i class="icon folders"></i> <i class="icon folders"></i>
@ -95,23 +101,23 @@
</div> </div>
</main> </main>
<footer> <footer>
jrnl is made with love by <a rel="author" href="http://www.1450.me">Manuel Ebert</a> and <a href="https://github.com/jrnl-org/jrnl/graphs/contributors" title="Contributors">many other fabulous people</a>. If you need help, <a href="https://github.com/jrnl-org/jrnl/issues/new" title="Open a new issue on Github">submit an issue</a> on Github. jrnl is made with love by <a href="https://github.com/jrnl-org/jrnl/graphs/contributors" title="Contributors">many fabulous people</a>. If you need help, <a href="https://github.com/jrnl-org/jrnl/issues/new/choose" title="Open a new issue on Github">submit an issue</a> on Github.
</footer> </footer>
<script src="//cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.10/typed.min.js"></script> <script src="https://unpkg.com/typed.js@2.1.0/dist/typed.umd.js"></script>
<script> <script>
new Typed("#typed", { new Typed("#typed", {
strings: [ strings: [
"jrnl today: Started writing my memoirs. On the command line. Like a boss.", "jrnl Started writing my memoirs on the command line. 🎉🔥💻🔥🎉",
"jrnl yesterday 2pm: used jrnl to keep track of accomplished tasks. The done.txt for my todo.txt", "jrnl yesterday 2pm: used jrnl to keep track of accomplished tasks. The done.txt for my todo.txt",
"jrnl <b>-from</b> 2009 <b>-until</b> may<br /><i>`(Displays all entries from January 2009 to last may)`</i>", "jrnl <b>-from</b> 2019 <b>-until</b> may<br /><i>`(displays all entries from January 2019 to last May)`</i>",
"jrnl A day on the beach with @beth and @frank. Taggidy-tag-tag.", "jrnl A day on the beach with @beth and @frank. Tagging them so I can easily look this up later.",
"jrnl <b>--tags</b><br /><i>`@idea 7<br />@beth 5</i>`", "jrnl <b>--tags</b><br /><i>`@frank 7<br />@beth 5</i>`",
"jrnl <b>--export</b> json<br /><i>`(Exports your entire journal to json)</i>`", "jrnl <b>--format</b> json<br /><i>`(Outputs your entire journal as json)</i>`",
"jrnl <b>--encrypt</b><br /><i>`(256 bit AES encryption. Crack this, NSA)</i>`" "jrnl <b>--encrypt</b><br /><i>`(AES encryption. Don't lose your password!)</i>`"
], ],
typeSpeed: 35, typeSpeed: 20, // less is faster
backSpeed: 15, backSpeed: 10,
backDelay: 2000, backDelay: 2500,
loop: true, loop: true,
showCursor: false showCursor: false
}); });

17
docs_theme/main.html Normal file
View file

@ -0,0 +1,17 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
{% extends "base.html" %}
{%- block search_button %}
{% if 'search' in config['plugins'] %}
<div role="search">
<form id ="rtd-search-form" class="wy-form mkdocs-search" action="{{ base_url }}/search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
<button class="icon icon-search" aria-label="submit"></button>
</form>
</div>
{% endif %}
{%- endblock %}

View file

@ -0,0 +1,2 @@
mkdocs>=1.4
jinja2==3.1.6

34
docs_theme/search.html Normal file
View file

@ -0,0 +1,34 @@
<!--
Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html
-->
{% extends "main.html" %}
{% block content %}
<div role="search">
<form id ="content_search" class="wy-form mkdocs-search" action="{{ base_url }}/search.html" method="get">
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
<input
name="q"
id="mkdocs-search-query"
type="text"
class="search_input search-query ui-autocomplete-input"
placeholder="Search the Docs"
autocomplete="off"
autofocus
title="Type search term here"
>
<button class="icon icon-search" aria-label="submit"></button>
</form>
</div>
<h1 id="search">Results</h1>
<div id="mkdocs-search-results" class="search-results">
Searching...
</div>
{% endblock %}

View file

@ -1,73 +0,0 @@
Feature: Basic reading and writing to a journal
Scenario: Loading a sample journal
Given we use the config "basic.yaml"
When we run "jrnl -n 2"
Then we should get no error
and the output should be
"""
2013-06-09 15:39 My first entry.
| Everything is alright
2013-06-10 15:40 Life is good.
| But I'm better.
"""
Scenario: Writing an entry from command line
Given we use the config "basic.yaml"
When we run "jrnl 23 july 2013: A cold and stormy day. I ate crisps on the sofa."
Then we should see the message "Entry added"
When we run "jrnl -n 1"
Then the output should contain "2013-07-23 09:00 A cold and stormy day."
Scenario: Writing an empty entry from the editor
Given we use the config "editor.yaml"
When we open the editor and enter ""
Then we should see the message "[Nothing saved to file]"
Scenario: Writing an empty entry from the command line
Given we use the config "basic.yaml"
When we run "jrnl" and enter ""
Then the output should be
"""
"""
Scenario: Filtering for dates
Given we use the config "basic.yaml"
When we run "jrnl -on 2013-06-10 --short"
Then the output should be "2013-06-10 15:40 Life is good."
When we run "jrnl -on 'june 6 2013' --short"
Then the output should be "2013-06-10 15:40 Life is good."
Scenario: Emoji support
Given we use the config "basic.yaml"
When we run "jrnl 23 july 2013: 🌞 sunny day. Saw an 🐘"
Then we should see the message "Entry added"
When we run "jrnl -n 1"
Then the output should contain "🌞"
and the output should contain "🐘"
Scenario: Writing an entry at the prompt
Given we use the config "basic.yaml"
When we run "jrnl" and enter "25 jul 2013: I saw Elvis. He's alive."
Then we should get no error
and the journal should contain "[2013-07-25 09:00] I saw Elvis."
and the journal should contain "He's alive."
Scenario: Displaying the version number
Given we use the config "basic.yaml"
When we run "jrnl -v"
Then we should get no error
Then the output should contain "version"
Scenario: --short displays the short version of entries (only the title)
Given we use the config "basic.yaml"
When we run "jrnl -on 2013-06-10 --short"
Then the output should be "2013-06-10 15:40 Life is good."
Scenario: -s displays the short version of entries (only the title)
Given we use the config "basic.yaml"
When we run "jrnl -on 2013-06-10 -s"
Then the output should be "2013-06-10 15:40 Life is good."

View file

@ -1,35 +0,0 @@
Feature: Reading and writing to journal with custom date formats
Scenario: Loading a sample journal
Given we use the config "little_endian_dates.yaml"
When we run "jrnl -n 2"
Then we should get no error
And the output should be
"""
09.06.2013 15:39 My first entry.
| Everything is alright
10.06.2013 15:40 Life is good.
| But I'm better.
"""
Scenario: Writing an entry from command line
Given we use the config "little_endian_dates.yaml"
When we run "jrnl 2013-07-12: A cold and stormy day. I ate crisps on the sofa."
Then we should see the message "Entry added"
When we run "jrnl -n 1"
Then the output should contain "12.07.2013 09:00 A cold and stormy day."
Scenario: Filtering for dates
Given we use the config "little_endian_dates.yaml"
When we run "jrnl -on 2013-06-10 --short"
Then the output should be "10.06.2013 15:40 Life is good."
When we run "jrnl -on 'june 6 2013' --short"
Then the output should be "10.06.2013 15:40 Life is good."
Scenario: Writing an entry at the prompt
Given we use the config "little_endian_dates.yaml"
When we run "jrnl" and enter "2013-05-10: I saw Elvis. He's alive."
Then we should get no error
And the journal should contain "[10.05.2013 09:00] I saw Elvis."
And the journal should contain "He's alive."

View file

@ -1,76 +0,0 @@
Feature: Dayone specific implementation details.
# fails when system time is UTC (as on Travis-CI)
@skip
Scenario: Loading a DayOne Journal
Given we use the config "dayone.yaml"
When we run "jrnl -from 'feb 2013'"
Then we should get no error
and the output should be
"""
2013-05-17 11:39 This entry has tags!
2013-06-17 20:38 This entry has a location.
2013-07-17 11:38 This entry is starred!
"""
# fails when system time is UTC (as on Travis-CI)
@skip
Scenario: Entries without timezone information will be interpreted as in the current timezone
Given we use the config "dayone.yaml"
When we run "jrnl -until 'feb 2013'"
Then we should get no error
and the output should contain "2013-01-17T18:37Z" in the local time
@skip
Scenario: Writing into Dayone
Given we use the config "dayone.yaml"
When we run "jrnl 01 may 1979: Being born hurts."
and we run "jrnl -until 1980"
Then the output should be
"""
1979-05-01 09:00 Being born hurts.
"""
# fails when system time is UTC (as on Travis-CI)
@skip
Scenario: Loading tags from a DayOne Journal
Given we use the config "dayone.yaml"
When we run "jrnl --tags"
Then the output should be
"""
@work : 1
@play : 1
"""
# fails when system time is UTC (as on Travis-CI)
@skip
Scenario: Saving tags from a DayOne Journal
Given we use the config "dayone.yaml"
When we run "jrnl A hard day at @work"
and we run "jrnl --tags"
Then the output should be
"""
@work : 2
@play : 1
"""
# fails when system time is UTC (as on Travis-CI)
@skip
Scenario: Filtering by tags from a DayOne Journal
Given we use the config "dayone.yaml"
When we run "jrnl @work"
Then the output should be
"""
2013-05-17 11:39 This entry has tags!
"""
# fails when system time is UTC (as on Travis-CI)
@skip
Scenario: Exporting dayone to json
Given we use the config "dayone.yaml"
When we run "jrnl --export json"
Then we should get no error
and the output should be parsable as json
and the json output should contain entries.0.uuid = "4BB1F46946AD439996C9B59DE7C4DDC1"

View file

@ -1,31 +0,0 @@
Feature: Zapped Dayone bugs stay dead!
# fails when system time is UTC (as on Travis-CI)
@skip
Scenario: DayOne tag searching should work with tags containing a mixture of upper and lower case.
# https://github.com/jrnl-org/jrnl/issues/354
Given we use the config "dayone.yaml"
When we run "jrnl @plAy"
Then the output should contain
"""
2013-05-17 11:39 This entry has tags!
"""
# fails when system time is UTC (as on Travis-CI)
@skip
Scenario: Title with an embedded period on DayOne journal
Given we use the config "dayone.yaml"
When we run "jrnl 04-24-2014: "Ran 6.2 miles today in 1:02:03. I'm feeling sore because I forgot to stretch.""
Then we should see the message "Entry added"
When we run "jrnl -1"
Then the output should be
"""
2014-04-24 09:00 Ran 6.2 miles today in 1:02:03.
| I'm feeling sore because I forgot to stretch.
"""
Scenario: Opening an folder that's not a DayOne folder gives a nice error message
Given we use the config "empty_folder.yaml"
When we run "jrnl Herro"
Then we should get an error
Then we should see the message "is a directory, but doesn't seem to be a DayOne journal either"

View file

@ -1,57 +0,0 @@
Feature: Encrypted journals
Scenario: Loading an encrypted journal
Given we use the config "encrypted.yaml"
When we run "jrnl -n 1" and enter "bad doggie no biscuit"
Then the output should contain "Password"
And the output should contain "2013-06-10 15:40 Life is good"
Scenario: Decrypting a journal
Given we use the config "encrypted.yaml"
When we run "jrnl --decrypt" and enter "bad doggie no biscuit"
Then the config for journal "default" should have "encrypt" set to "bool:False"
Then we should see the message "Journal decrypted"
And the journal should have 2 entries
Scenario: Encrypting a journal
Given we use the config "basic.yaml"
When we run "jrnl --encrypt" and enter
"""
swordfish
swordfish
n
"""
Then we should see the message "Journal encrypted"
And the config for journal "default" should have "encrypt" set to "bool:True"
When we run "jrnl -n 1" and enter "swordfish"
Then the output should contain "Password"
And the output should contain "2013-06-10 15:40 Life is good"
Scenario: Mistyping your password
Given we use the config "basic.yaml"
When we run "jrnl --encrypt" and enter
"""
swordfish
sordfish
swordfish
swordfish
n
"""
Then we should see the message "Passwords did not match"
And we should see the message "Journal encrypted"
And the config for journal "default" should have "encrypt" set to "bool:True"
When we run "jrnl -n 1" and enter "swordfish"
Then the output should contain "Password"
And the output should contain "2013-06-10 15:40 Life is good"
Scenario: Storing a password in Keychain
Given we use the config "multiple.yaml"
When we run "jrnl simple --encrypt" and enter
"""
sabertooth
sabertooth
y
"""
When we set the keychain password of "simple" to "sabertooth"
Then the config for journal "simple" should have "encrypt" set to "bool:True"
When we run "jrnl simple -n 1"
Then the output should contain "2013-06-10 15:40 Life is good"

View file

@ -1,45 +0,0 @@
import shutil
import os
def before_feature(context, feature):
# add "skip" tag
# https://stackoverflow.com/a/42721605/4276230
if "skip" in feature.tags:
feature.skip("Marked with @skip")
return
def before_scenario(context, scenario):
"""Before each scenario, backup all config and journal test data."""
# Clean up in case something went wrong
for folder in ("configs", "journals"):
working_dir = os.path.join("features", folder)
if os.path.exists(working_dir):
shutil.rmtree(working_dir)
for folder in ("configs", "journals"):
original = os.path.join("features", "data", folder)
working_dir = os.path.join("features", folder)
if not os.path.exists(working_dir):
os.mkdir(working_dir)
for filename in os.listdir(original):
source = os.path.join(original, filename)
if os.path.isdir(source):
shutil.copytree(source, os.path.join(working_dir, filename))
else:
shutil.copy2(source, working_dir)
# add "skip" tag
# https://stackoverflow.com/a/42721605/4276230
if "skip" in scenario.effective_tags:
scenario.skip("Marked with @skip")
return
def after_scenario(context, scenario):
"""After each scenario, restore all test data and remove working_dirs."""
for folder in ("configs", "journals"):
working_dir = os.path.join("features", folder)
if os.path.exists(working_dir):
shutil.rmtree(working_dir)

View file

@ -1,85 +0,0 @@
Feature: Exporting a Journal
Scenario: Exporting to json
Given we use the config "tags.yaml"
When we run "jrnl --export json"
Then we should get no error
and the output should be parsable as json
and "entries" in the json output should have 2 elements
and "tags" in the json output should contain "@idea"
and "tags" in the json output should contain "@journal"
and "tags" in the json output should contain "@dan"
Scenario: Exporting using filters should only export parts of the journal
Given we use the config "tags.yaml"
When we run "jrnl -until 'may 2013' --export json"
# Then we should get no error
Then the output should be parsable as json
and "entries" in the json output should have 1 element
and "tags" in the json output should contain "@idea"
and "tags" in the json output should contain "@journal"
and "tags" in the json output should not contain "@dan"
Scenario: Exporting using custom templates
Given we use the config "basic.yaml"
Given we load template "sample.template"
When we run "jrnl --export sample"
Then the output should be
"""
My first entry.
---------------
Everything is alright
Life is good.
-------------
But I'm better.
"""
Scenario: Increasing Headings on Markdown export
Given we use the config "markdown-headings-335.yaml"
When we run "jrnl --export markdown"
Then the output should be
"""
# 2015
## April
### 2015-04-14 13:23 Heading Test
#### H1-1
#### H1-2
#### H1-3
##### H2-1
##### H2-2
##### H2-3
Horizontal Rules (ignore)
---
===
#### ATX H1
##### ATX H2
###### ATX H3
####### ATX H4
######## ATX H5
######### ATX H6
Stuff
More stuff
more stuff again
"""

View file

@ -1,51 +0,0 @@
Feature: Multiple journals
Scenario: Loading a config with two journals
Given we use the config "multiple.yaml"
Then journal "default" should have 2 entries
and journal "work" should have 0 entries
Scenario: Write to default config by default
Given we use the config "multiple.yaml"
When we run "jrnl this goes to default"
Then journal "default" should have 3 entries
and journal "work" should have 0 entries
Scenario: Write to specified journal
Given we use the config "multiple.yaml"
When we run "jrnl work a long day in the office"
Then journal "default" should have 2 entries
and journal "work" should have 1 entry
Scenario: Tell user which journal was used
Given we use the config "multiple.yaml"
When we run "jrnl work a long day in the office"
Then we should see the message "Entry added to work journal"
Scenario: Write to specified journal with a timestamp
Given we use the config "multiple.yaml"
When we run "jrnl work 23 july 2012: a long day in the office"
Then journal "default" should have 2 entries
and journal "work" should have 1 entry
and journal "work" should contain "2012-07-23"
Scenario: Create new journals as required
Given we use the config "multiple.yaml"
Then journal "ideas" should not exist
When we run "jrnl ideas 23 july 2012: sell my junk on ebay and make lots of money"
Then journal "ideas" should have 1 entry
Scenario: Don't crash if no default journal is specified
Given we use the config "bug343.yaml"
When we run "jrnl a long day in the office"
Then we should see the message "No default journal configured"
Scenario: Don't crash if no file exists for a configured encrypted journal
Given we use the config "multiple.yaml"
When we run "jrnl new_encrypted Adding first entry" and enter
"""
these three eyes
these three eyes
n
"""
Then we should see the message "Journal 'new_encrypted' created"

View file

@ -1,118 +0,0 @@
Feature: Zapped bugs should stay dead.
Scenario: Writing an entry does not print the entire journal
# https://github.com/maebert/jrnl/issues/87
Given we use the config "basic.yaml"
When we run "jrnl 23 july 2013: A cold and stormy day. I ate crisps on the sofa."
Then we should see the message "Entry added"
When we run "jrnl -n 1"
Then the output should not contain "Life is good"
Scenario: Date with time should be parsed correctly
# https://github.com/maebert/jrnl/issues/117
Given we use the config "basic.yaml"
When we run "jrnl 2013-11-30 15:42: Project Started."
Then we should see the message "Entry added"
and the journal should contain "[2013-11-30 15:42] Project Started."
Scenario: Date in the future should be parsed correctly
# https://github.com/maebert/jrnl/issues/185
Given we use the config "basic.yaml"
When we run "jrnl 26/06/2019: Planet? Earth. Year? 2019."
Then we should see the message "Entry added"
and the journal should contain "[2019-06-26 09:00] Planet?"
Scenario: Loading entry with ambiguous time stamp
#https://github.com/maebert/jrnl/issues/153
Given we use the config "bug153.yaml"
When we run "jrnl -1"
Then we should get no error
and the output should be
"""
2013-10-27 03:27 Some text.
"""
Scenario: Title with an embedded period.
Given we use the config "basic.yaml"
When we run "jrnl 04-24-2014: Created a new website - empty.com. Hope to get a lot of traffic."
Then we should see the message "Entry added"
When we run "jrnl -1"
Then the output should be
"""
2014-04-24 09:00 Created a new website - empty.com.
| Hope to get a lot of traffic.
"""
Scenario: Integers in square brackets should not be read as dates
Given we use the config "brackets.yaml"
When we run "jrnl -1"
Then the output should contain "[1] line starting with 1"
Scenario: Journals with unreadable dates should still be viewable
Given we use the config "unreadabledates.yaml"
When we run "jrnl -2"
Then the output should contain "I've lost track of time."
Then the output should contain "Time has no meaning."
Scenario: Journals with readable dates AND unreadable dates should still contain all data.
Given we use the config "mostlyreadabledates.yaml"
When we run "jrnl -3"
Then the output should contain "Time machines are possible."
When we run "jrnl -1"
Then the output should contain "I'm going to activate the machine."
Then the output should contain "I've crossed so many timelines. Is there any going back?"
Scenario: Viewing today's entries does not print the entire journal
# https://github.com/jrnl-org/jrnl/issues/741
Given we use the config "basic.yaml"
When we run "jrnl -on today"
Then the output should not contain "Life is good"
Then the output should not contain "But I'm better."
Scenario: Create entry using day of the week as entry date.
Given we use the config "basic.yaml"
When we run "jrnl monday: This is an entry on a Monday."
Then we should see the message "Entry added"
When we run "jrnl -1"
Then the output should contain "monday at 9am" in the local time
Then the output should contain "This is an entry on a Monday."
Scenario: Create entry using day of the week abbreviations as entry date.
Given we use the config "basic.yaml"
When we run "jrnl fri: This is an entry on a Friday."
Then we should see the message "Entry added"
When we run "jrnl -1"
Then the output should contain "friday at 9am" in the local time
Scenario: Displaying entries using -on today should display entries created today.
Given we use the config "basic.yaml"
When we run "jrnl today: Adding an entry right now."
Then we should see the message "Entry added"
When we run "jrnl -on today"
Then the output should contain "Adding an entry right now."
Scenario: Displaying entries using -from day should display correct entries
Given we use the config "basic.yaml"
When we run "jrnl yesterday: This thing happened yesterday"
Then we should see the message "Entry added"
When we run "jrnl today at 11:59pm: Adding an entry right now."
Then we should see the message "Entry added"
When we run "jrnl tomorrow: A future entry."
Then we should see the message "Entry added"
When we run "jrnl -from today"
Then the output should contain "Adding an entry right now."
Then the output should contain "A future entry."
Then the output should not contain "This thing happened yesterday"
Scenario: Displaying entries using -from and -to day should display correct entries
Given we use the config "basic.yaml"
When we run "jrnl yesterday: This thing happened yesterday"
Then we should see the message "Entry added"
When we run "jrnl today at 11:59pm: Adding an entry right now."
Then we should see the message "Entry added"
When we run "jrnl tomorrow: A future entry."
Then we should see the message "Entry added"
When we run "jrnl -from yesterday -to today"
Then the output should contain "This thing happened yesterday"
Then the output should contain "Adding an entry right now."
Then the output should not contain "A future entry."

View file

@ -1,20 +0,0 @@
Feature: Starring entries
Scenario: Starring an entry will mark it in the journal file
Given we use the config "basic.yaml"
When we run "jrnl 20 july 2013 *: Best day of my life!"
Then we should see the message "Entry added"
and the journal should contain "[2013-07-20 09:00] Best day of my life! *"
Scenario: Filtering by starred entries
Given we use the config "basic.yaml"
When we run "jrnl -starred"
Then the output should be
"""
"""
When we run "jrnl 20 july 2013 *: Best day of my life!"
When we run "jrnl -starred"
Then the output should be
"""
2013-07-20 09:00 Best day of my life!
"""

View file

@ -1,308 +0,0 @@
from unittest.mock import patch
from behave import given, when, then
from jrnl import cli, install, Journal, util, plugins
from jrnl import __version__
from dateutil import parser as date_parser
from collections import defaultdict
try: import parsedatetime.parsedatetime_consts as pdt
except ImportError: import parsedatetime as pdt
import time
import os
import json
import yaml
import keyring
import tzlocal
import shlex
import sys
consts = pdt.Constants(usePyICU=False)
consts.DOWParseStyle = -1 # Prefers past weekdays
CALENDAR = pdt.Calendar(consts)
class TestKeyring(keyring.backend.KeyringBackend):
"""A test keyring that just stores its values in a hash"""
priority = 1
keys = defaultdict(dict)
def set_password(self, servicename, username, password):
self.keys[servicename][username] = password
def get_password(self, servicename, username):
return self.keys[servicename].get(username)
def delete_password(self, servicename, username):
self.keys[servicename][username] = None
# set the keyring for keyring lib
keyring.set_keyring(TestKeyring())
def ushlex(command):
if sys.version_info[0] == 3:
return shlex.split(command)
return map(lambda s: s.decode('UTF8'), shlex.split(command.encode('utf8')))
def read_journal(journal_name="default"):
config = util.load_config(install.CONFIG_FILE_PATH)
with open(config['journals'][journal_name]) as journal_file:
journal = journal_file.read()
return journal
def open_journal(journal_name="default"):
config = util.load_config(install.CONFIG_FILE_PATH)
journal_conf = config['journals'][journal_name]
if type(journal_conf) is dict: # We can override the default config on a by-journal basis
config.update(journal_conf)
else: # But also just give them a string to point to the journal file
config['journal'] = journal_conf
return Journal.open_journal(journal_name, config)
@given('we use the config "{config_file}"')
def set_config(context, config_file):
full_path = os.path.join("features/configs", config_file)
install.CONFIG_FILE_PATH = os.path.abspath(full_path)
if config_file.endswith("yaml"):
# Add jrnl version to file for 2.x journals
with open(install.CONFIG_FILE_PATH, 'a') as cf:
cf.write("version: {}".format(__version__))
@when('we open the editor and enter ""')
@when('we open the editor and enter "{text}"')
def open_editor_and_enter(context, text=""):
text = (text or context.text)
def _mock_editor_function(command):
tmpfile = command[-1]
with open(tmpfile, "w+") as f:
if text is not None:
f.write(text)
else:
f.write("")
return tmpfile
with patch('subprocess.call', side_effect=_mock_editor_function):
run(context, "jrnl")
def _mock_getpass(inputs):
def prompt_return(prompt="Password: "):
print(prompt)
return next(inputs)
return prompt_return
def _mock_input(inputs):
def prompt_return(prompt=""):
val = next(inputs)
print(prompt, val)
return val
return prompt_return
@when('we run "{command}" and enter')
@when('we run "{command}" and enter ""')
@when('we run "{command}" and enter "{inputs}"')
def run_with_input(context, command, inputs=""):
# create an iterator through all inputs. These inputs will be fed one by one
# to the mocked calls for 'input()', 'util.getpass()' and 'sys.stdin.read()'
if context.text:
text = iter(context.text.split("\n"))
else:
text = iter([inputs])
args = ushlex(command)[1:]
with patch("builtins.input", side_effect=_mock_input(text)) as mock_input,\
patch("getpass.getpass", side_effect=_mock_getpass(text)) as mock_getpass,\
patch("sys.stdin.read", side_effect=text) as mock_read:
try:
cli.run(args or [])
context.exit_status = 0
except SystemExit as e:
context.exit_status = e.code
# at least one of the mocked input methods got called
assert mock_input.called or mock_getpass.called or mock_read.called
# all inputs were used
try:
next(text)
assert False, "Not all inputs were consumed"
except StopIteration:
pass
@when('we run "{command}"')
def run(context, command):
args = ushlex(command)[1:]
try:
cli.run(args or None)
context.exit_status = 0
except SystemExit as e:
context.exit_status = e.code
@given('we load template "{filename}"')
def load_template(context, filename):
full_path = os.path.join("features/data/templates", filename)
exporter = plugins.template_exporter.__exporter_from_file(full_path)
plugins.__exporter_types[exporter.names[0]] = exporter
@when('we set the keychain password of "{journal}" to "{password}"')
def set_keychain(context, journal, password):
keyring.set_password('jrnl', journal, password)
@then('we should get an error')
def has_error(context):
assert context.exit_status != 0, context.exit_status
@then('we should get no error')
def no_error(context):
assert context.exit_status == 0, context.exit_status
@then('the output should be parsable as json')
def check_output_json(context):
out = context.stdout_capture.getvalue()
assert json.loads(out), out
@then('"{field}" in the json output should have {number:d} elements')
@then('"{field}" in the json output should have 1 element')
def check_output_field(context, field, number=1):
out = context.stdout_capture.getvalue()
out_json = json.loads(out)
assert field in out_json, [field, out_json]
assert len(out_json[field]) == number, len(out_json[field])
@then('"{field}" in the json output should not contain "{key}"')
def check_output_field_not_key(context, field, key):
out = context.stdout_capture.getvalue()
out_json = json.loads(out)
assert field in out_json
assert key not in out_json[field]
@then('"{field}" in the json output should contain "{key}"')
def check_output_field_key(context, field, key):
out = context.stdout_capture.getvalue()
out_json = json.loads(out)
assert field in out_json
assert key in out_json[field]
@then('the json output should contain {path} = "{value}"')
def check_json_output_path(context, path, value):
""" E.g.
the json output should contain entries.0.title = "hello"
"""
out = context.stdout_capture.getvalue()
struct = json.loads(out)
for node in path.split('.'):
try:
struct = struct[int(node)]
except ValueError:
struct = struct[node]
assert struct == value, struct
@then('the output should be')
@then('the output should be "{text}"')
def check_output(context, text=None):
text = (text or context.text).strip().splitlines()
out = context.stdout_capture.getvalue().strip().splitlines()
assert len(text) == len(out), "Output has {} lines (expected: {})".format(len(out), len(text))
for line_text, line_out in zip(text, out):
assert line_text.strip() == line_out.strip(), [line_text.strip(), line_out.strip()]
@then('the output should contain "{text}" in the local time')
def check_output_time_inline(context, text):
out = context.stdout_capture.getvalue()
local_tz = tzlocal.get_localzone()
date, flag = CALENDAR.parse(text)
output_date = time.strftime("%Y-%m-%d %H:%M",date)
assert output_date in out, output_date
@then('the output should contain')
@then('the output should contain "{text}"')
def check_output_inline(context, text=None):
text = text or context.text
out = context.stdout_capture.getvalue()
assert text in out, text
@then('the output should not contain "{text}"')
def check_output_not_inline(context, text):
out = context.stdout_capture.getvalue()
assert text not in out
@then('we should see the message "{text}"')
def check_message(context, text):
out = context.stderr_capture.getvalue()
assert text in out, [text, out]
@then('we should not see the message "{text}"')
def check_not_message(context, text):
out = context.stderr_capture.getvalue()
assert text not in out, [text, out]
@then('the journal should contain "{text}"')
@then('journal "{journal_name}" should contain "{text}"')
def check_journal_content(context, text, journal_name="default"):
journal = read_journal(journal_name)
assert text in journal, journal
@then('journal "{journal_name}" should not exist')
def journal_doesnt_exist(context, journal_name="default"):
with open(install.CONFIG_FILE_PATH) as config_file:
config = yaml.load(config_file, Loader=yaml.FullLoader)
journal_path = config['journals'][journal_name]
assert not os.path.exists(journal_path)
@then('the config should have "{key}" set to "{value}"')
@then('the config for journal "{journal}" should have "{key}" set to "{value}"')
def config_var(context, key, value, journal=None):
t, value = value.split(":")
value = {
"bool": lambda v: v.lower() == "true",
"int": int,
"str": str
}[t](value)
config = util.load_config(install.CONFIG_FILE_PATH)
if journal:
config = config["journals"][journal]
assert key in config
assert config[key] == value
@then('the journal should have {number:d} entries')
@then('the journal should have {number:d} entry')
@then('journal "{journal_name}" should have {number:d} entries')
@then('journal "{journal_name}" should have {number:d} entry')
def check_journal_entries(context, number, journal_name="default"):
journal = open_journal(journal_name)
assert len(journal.entries) == number
@then('fail')
def debug_fail(context):
assert False

View file

@ -1,84 +0,0 @@
Feature: Tagging
Scenario: Displaying tags
Given we use the config "tags.yaml"
When we run "jrnl --tags"
Then we should get no error
and the output should be
"""
@idea : 2
@journal : 1
@dan : 1
"""
Scenario: Filtering journals should also filter tags
Given we use the config "tags.yaml"
When we run "jrnl -from 'may 2013' --tags"
Then we should get no error
and the output should be
"""
@idea : 1
@dan : 1
"""
Scenario: Tags should allow certain special characters
Given we use the config "tags-216.yaml"
When we run "jrnl --tags"
Then we should get no error
and the output should be
"""
@os/2 : 1
@c++ : 1
@c# : 1
"""
Scenario: An email should not be a tag
Given we use the config "tags-237.yaml"
When we run "jrnl --tags"
Then we should get no error
and the output should be
"""
@newline : 1
@email : 1
"""
Scenario: Entry cans start and end with tags
Given we use the config "basic.yaml"
When we run "jrnl today: @foo came over, we went to a @bar"
When we run "jrnl --tags"
Then the output should be
"""
@foo : 1
@bar : 1
"""
Scenario: Excluding a tag should filter it
Given we use the config "basic.yaml"
When we run "jrnl today: @foo came over, we went to a bar"
When we run "jrnl I have decided I did not enjoy that @bar"
When we run "jrnl --tags -not @bar"
Then the output should be
"""
@foo : 1
"""
Scenario: Excluding a tag should filter an entry, even if an unfiltered tag is in that entry
Given we use the config "basic.yaml"
When we run "jrnl today: I do @not think this will show up @thought"
When we run "jrnl today: I think this will show up @thought"
When we run "jrnl --tags -not @not"
Then the output should be
"""
@thought : 1
"""
Scenario: Excluding multiple tags should filter them
Given we use the config "basic.yaml"
When we run "jrnl today: I do @not think this will show up @thought"
When we run "jrnl today: I think this will show up @thought"
When we run "jrnl today: This should @never show up @thought"
When we run "jrnl today: What a nice day for filtering @thought"
When we run "jrnl --tags -not @not @never"
Then the output should be
"""
@thought : 2
"""

View file

@ -1,34 +0,0 @@
Feature: Upgrading Journals from 1.x.x to 2.x.x
Scenario: Upgrade and parse journals with square brackets
Given we use the config "upgrade_from_195.json"
When we run "jrnl -9" and enter "Y"
Then the output should contain
"""
2010-06-10 15:00 A life without chocolate is like a bad analogy.
2013-06-10 15:40 He said "[this] is the best time to be alive".
"""
Then the journal should have 2 entries
Scenario: Upgrading a journal encrypted with jrnl 1.x
Given we use the config "encrypted_old.json"
When we run "jrnl -n 1" and enter
"""
Y
bad doggie no biscuit
bad doggie no biscuit
"""
Then the output should contain "Password"
and the output should contain "2013-06-10 15:40 Life is good"
Scenario: Upgrade and parse journals with little endian date format
Given we use the config "upgrade_from_195_little_endian_dates.json"
When we run "jrnl -9" and enter "Y"
Then the output should contain
"""
10.06.2010 15:00 A life without chocolate is like a bad analogy.
10.06.2013 15:40 He said "[this] is the best time to be alive".
"""
Then the journal should have 2 entries

8
issue_template.md Normal file
View file

@ -0,0 +1,8 @@
# Stop
Please don't file a blank issue.
Fill out one of the templates from the link below and we'll be better able to
help you.
https://github.com/jrnl-org/jrnl/issues/new/choose

View file

@ -1,144 +0,0 @@
#!/usr/bin/env python
from . import Entry
from . import Journal
from . import time as jrnl_time
import os
import re
from datetime import datetime
import time
import fnmatch
import plistlib
import pytz
import uuid
import tzlocal
from xml.parsers.expat import ExpatError
class DayOne(Journal.Journal):
"""A special Journal handling DayOne files"""
# InvalidFileException was added to plistlib in Python3.4
PLIST_EXCEPTIONS = (ExpatError, plistlib.InvalidFileException) if hasattr(plistlib, "InvalidFileException") else ExpatError
def __init__(self, **kwargs):
self.entries = []
self._deleted_entries = []
super().__init__(**kwargs)
def open(self):
filenames = [os.path.join(self.config['journal'], "entries", f) for f in os.listdir(os.path.join(self.config['journal'], "entries"))]
filenames = []
for root, dirnames, f in os.walk(self.config['journal']):
for filename in fnmatch.filter(f, '*.doentry'):
filenames.append(os.path.join(root, filename))
self.entries = []
for filename in filenames:
with open(filename, 'rb') as plist_entry:
try:
dict_entry = plistlib.readPlist(plist_entry)
except self.PLIST_EXCEPTIONS:
pass
else:
try:
timezone = pytz.timezone(dict_entry['Time Zone'])
except (KeyError, pytz.exceptions.UnknownTimeZoneError):
timezone = tzlocal.get_localzone()
date = dict_entry['Creation Date']
date = date + timezone.utcoffset(date, is_dst=False)
entry = Entry.Entry(self, date, text=dict_entry['Entry Text'], starred=dict_entry["Starred"])
entry.uuid = dict_entry["UUID"]
entry._tags = [self.config['tagsymbols'][0] + tag.lower() for tag in dict_entry.get("Tags", [])]
self.entries.append(entry)
self.sort()
return self
def write(self):
"""Writes only the entries that have been modified into plist files."""
for entry in self.entries:
if entry.modified:
utc_time = datetime.utcfromtimestamp(time.mktime(entry.date.timetuple()))
if not hasattr(entry, "uuid"):
entry.uuid = uuid.uuid1().hex
filename = os.path.join(self.config['journal'], "entries", entry.uuid.upper() + ".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': str(tzlocal.get_localzone()),
'UUID': entry.uuid.upper(),
'Tags': [tag.strip(self.config['tagsymbols']).replace("_", " ") for tag in entry.tags]
}
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 "\n".join([f"# {e.uuid}\n{str(e)}" for e in self.entries])
def parse_editable_str(self, edited):
"""Parses the output of self.editable_str and updates its 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.
# Initialise our current entry
entries = []
current_entry = None
for line in edited.splitlines():
# try to parse line as UUID => new entry begins
line = line.rstrip()
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:
date_blob_re = re.compile("^\\[[^\\]]+\\] ")
date_blob = date_blob_re.findall(line)
if date_blob:
date_blob = date_blob[0]
new_date = jrnl_time.parse(date_blob.strip(" []"))
if line.endswith("*"):
current_entry.starred = True
line = line[:-1]
current_entry.title = line[len(date_blob) - 1:]
current_entry.date = new_date
elif 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_text()
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

View file

@ -1,125 +0,0 @@
from . import Journal, util
from cryptography.fernet import Fernet, InvalidToken
from cryptography.hazmat.primitives import hashes, padding
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
import hashlib
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.backends import default_backend
import sys
import os
import base64
import logging
log = logging.getLogger()
def make_key(password):
password = password.encode("utf-8")
kdf = PBKDF2HMAC(
algorithm=hashes.SHA256(),
length=32,
# Salt is hard-coded
salt=b'\xf2\xd5q\x0e\xc1\x8d.\xde\xdc\x8e6t\x89\x04\xce\xf8',
iterations=100000,
backend=default_backend()
)
key = kdf.derive(password)
return base64.urlsafe_b64encode(key)
class EncryptedJournal(Journal.Journal):
def __init__(self, name='default', **kwargs):
super().__init__(name, **kwargs)
self.config['encrypt'] = True
def open(self, filename=None):
"""Opens the journal file defined in the config and parses it into a list of Entries.
Entries have the form (date, title, body)."""
filename = filename or self.config['journal']
if not os.path.exists(filename):
password = util.create_password()
if password:
if util.yesno("Do you want to store the password in your keychain?", default=True):
util.set_keychain(self.name, password)
else:
util.set_keychain(self.name, None)
self.config['password'] = password
text = ""
self._store(filename, text)
print(f"[Journal '{self.name}' created at {filename}]", file=sys.stderr)
else:
print("No password supplied for encrypted journal", file=sys.stderr)
sys.exit(1)
else:
text = self._load(filename)
self.entries = self._parse(text)
self.sort()
log.debug("opened %s with %d entries", self.__class__.__name__, len(self))
return self
def _load(self, filename, password=None):
"""Loads an encrypted journal from a file and tries to decrypt it.
If password is not provided, will look for password in the keychain
and otherwise ask the user to enter a password up to three times.
If the password is provided but wrong (or corrupt), this will simply
return None."""
with open(filename, 'rb') as f:
journal_encrypted = f.read()
def validate_password(password):
key = make_key(password)
try:
plain = Fernet(key).decrypt(journal_encrypted).decode('utf-8')
self.config['password'] = password
return plain
except (InvalidToken, IndexError):
return None
if password:
return validate_password(password)
return util.get_password(keychain=self.name, validator=validate_password)
def _store(self, filename, text):
key = make_key(self.config['password'])
journal = Fernet(key).encrypt(text.encode('utf-8'))
with open(filename, 'wb') as f:
f.write(journal)
@classmethod
def _create(cls, filename, password):
key = make_key(password)
dummy = Fernet(key).encrypt(b"")
with open(filename, 'wb') as f:
f.write(dummy)
class LegacyEncryptedJournal(Journal.LegacyJournal):
"""Legacy class to support opening journals encrypted with the jrnl 1.x
standard. You'll not be able to save these journals anymore."""
def __init__(self, name='default', **kwargs):
super().__init__(name, **kwargs)
self.config['encrypt'] = True
def _load(self, filename, password=None):
with open(filename, 'rb') as f:
journal_encrypted = f.read()
iv, cipher = journal_encrypted[:16], journal_encrypted[16:]
def validate_password(password):
decryption_key = hashlib.sha256(password.encode('utf-8')).digest()
decryptor = Cipher(algorithms.AES(decryption_key), modes.CBC(iv), default_backend()).decryptor()
try:
plain_padded = decryptor.update(cipher) + decryptor.finalize()
self.config['password'] = password
if plain_padded[-1] in (" ", 32):
# Ancient versions of jrnl. Do not judge me.
return plain_padded.decode('utf-8').rstrip(" ")
else:
unpadder = padding.PKCS7(algorithms.AES.block_size).unpadder()
plain = unpadder.update(plain_padded) + unpadder.finalize()
return plain.decode('utf-8')
except ValueError:
return None
if password:
return validate_password(password)
return util.get_password(keychain=self.name, validator=validate_password)

View file

@ -1,122 +0,0 @@
#!/usr/bin/env python
import re
import textwrap
from datetime import datetime
from .util import split_title
class Entry:
def __init__(self, journal, date=None, text="", starred=False):
self.journal = journal # Reference to journal mainly to access its config
self.date = date or datetime.now()
self.text = text
self._title = self._body = self._tags = None
self.starred = starred
self.modified = False
@property
def fulltext(self):
return self.title + " " + self.body
def _parse_text(self):
raw_text = self.text
lines = raw_text.splitlines()
if lines[0].strip().endswith("*"):
self.starred = True
raw_text = lines[0].strip("\n *") + "\n" + "\n".join(lines[1:])
self._title, self._body = split_title(raw_text)
if self._tags is None:
self._tags = list(self._parse_tags())
@property
def title(self):
if self._title is None:
self._parse_text()
return self._title
@property
def body(self):
if self._body is None:
self._parse_text()
return self._body
@property
def tags(self):
if self._tags is None:
self._parse_text()
return self._tags
@staticmethod
def tag_regex(tagsymbols):
pattern = fr'(?u)(?:^|\s)([{tagsymbols}][-+*#/\w]+)'
return re.compile(pattern)
def _parse_tags(self):
tagsymbols = self.journal.config['tagsymbols']
return {tag.lower() for tag in re.findall(Entry.tag_regex(tagsymbols), self.text)}
def __str__(self):
"""Returns a string representation of the entry to be written into a journal file."""
date_str = self.date.strftime(self.journal.config['timeformat'])
title = "[{}] {}".format(date_str, self.title.rstrip("\n "))
if self.starred:
title += " *"
return "{title}{sep}{body}\n".format(
title=title,
sep="\n" if self.body.rstrip("\n ") else "",
body=self.body.rstrip("\n ")
)
def pprint(self, short=False):
"""Returns a pretty-printed version of the entry.
If short is true, only print the title."""
date_str = self.date.strftime(self.journal.config['timeformat'])
if self.journal.config['indent_character']:
indent = self.journal.config['indent_character'].rstrip() + " "
else:
indent = ""
if not short and self.journal.config['linewrap']:
title = textwrap.fill(date_str + " " + self.title, self.journal.config['linewrap'])
body = "\n".join([
textwrap.fill(
line,
self.journal.config['linewrap'],
initial_indent=indent,
subsequent_indent=indent,
drop_whitespace=True) or indent
for line in self.body.rstrip(" \n").splitlines()
])
else:
title = date_str + " " + self.title.rstrip("\n ")
body = self.body.rstrip("\n ")
# Suppress bodies that are just blanks and new lines.
has_body = len(self.body) > 20 or not all(char in (" ", "\n") for char in self.body)
if short:
return title
else:
return "{title}{sep}{body}\n".format(
title=title,
sep="\n" if has_body else "",
body=body if has_body else "",
)
def __repr__(self):
return "<Entry '{}' on {}>".format(self.title.strip(), self.date.strftime("%Y-%m-%d %H:%M"))
def __hash__(self):
return hash(self.__repr__())
def __eq__(self, other):
if not isinstance(other, Entry) \
or self.title.strip() != other.title.strip() \
or self.body.rstrip() != other.body.rstrip() \
or self.date != other.date \
or self.starred != other.starred:
return False
return True
def __ne__(self, other):
return not self.__eq__(other)

View file

@ -1,367 +0,0 @@
#!/usr/bin/env python
from . import Entry
from . import util
from . import time
import os
import sys
import re
from datetime import datetime
import logging
log = logging.getLogger(__name__)
class Tag:
def __init__(self, name, count=0):
self.name = name
self.count = count
def __str__(self):
return self.name
def __repr__(self):
return f"<Tag '{self.name}'>"
class Journal:
def __init__(self, name='default', **kwargs):
self.config = {
'journal': "journal.txt",
'encrypt': False,
'default_hour': 9,
'default_minute': 0,
'timeformat': "%Y-%m-%d %H:%M",
'tagsymbols': '@',
'highlight': True,
'linewrap': 80,
'indent_character': '|',
}
self.config.update(kwargs)
# Set up date parser
self.search_tags = None # Store tags we're highlighting
self.name = name
def __len__(self):
"""Returns the number of entries"""
return len(self.entries)
def __iter__(self):
"""Iterates over the journal's entries."""
return (entry for entry in self.entries)
@classmethod
def from_journal(cls, other):
"""Creates a new journal by copying configuration and entries from
another journal object"""
new_journal = cls(other.name, **other.config)
new_journal.entries = other.entries
log.debug("Imported %d entries from %s to %s", len(new_journal), other.__class__.__name__, cls.__name__)
return new_journal
def import_(self, other_journal_txt):
self.entries = list(frozenset(self.entries) | frozenset(self._parse(other_journal_txt)))
self.sort()
def open(self, filename=None):
"""Opens the journal file defined in the config and parses it into a list of Entries.
Entries have the form (date, title, body)."""
filename = filename or self.config['journal']
if not os.path.exists(filename):
print(f"[Journal '{self.name}' created at {filename}]", file=sys.stderr)
self._create(filename)
text = self._load(filename)
self.entries = self._parse(text)
self.sort()
log.debug("opened %s with %d entries", self.__class__.__name__, len(self))
return self
def write(self, filename=None):
"""Dumps the journal into the config file, overwriting it"""
filename = filename or self.config['journal']
text = self._to_text()
self._store(filename, text)
def validate_parsing(self):
"""Confirms that the jrnl is still parsed correctly after being dumped to text."""
new_entries = self._parse(self._to_text())
for i, entry in enumerate(self.entries):
if entry != new_entries[i]:
return False
return True
def _to_text(self):
return "\n".join([str(e) for e in self.entries])
def _load(self, filename):
raise NotImplementedError
def _store(self, filename, text):
raise NotImplementedError
@classmethod
def _create(cls, filename):
raise NotImplementedError
def _parse(self, journal_txt):
"""Parses a journal that's stored in a string and returns a list of entries"""
# Return empty array if the journal is blank
if not journal_txt:
return []
# Initialise our current entry
entries = []
date_blob_re = re.compile("(?:^|\n)\\[([^\\]]+)\\] ")
last_entry_pos = 0
for match in date_blob_re.finditer(journal_txt):
date_blob = match.groups()[0]
try:
new_date = datetime.strptime(date_blob, self.config["timeformat"])
except ValueError:
# Passing in a date that had brackets around it
new_date = time.parse(date_blob, bracketed=True)
if new_date:
if entries:
entries[-1].text = journal_txt[last_entry_pos:match.start()]
last_entry_pos = match.end()
entries.append(Entry.Entry(self, date=new_date))
# If no entries were found, treat all the existing text as an entry made now
if not entries:
entries.append(Entry.Entry(self, date=time.parse("now")))
# Fill in the text of the last entry
entries[-1].text = journal_txt[last_entry_pos:]
for entry in entries:
entry._parse_text()
return entries
def pprint(self, short=False):
"""Prettyprints the journal's entries"""
sep = "\n"
pp = sep.join([e.pprint(short=short) for e in self.entries])
if self.config['highlight']: # highlight tags
if self.search_tags:
for tag in self.search_tags:
tagre = re.compile(re.escape(tag), re.IGNORECASE)
pp = re.sub(tagre,
lambda match: util.colorize(match.group(0)),
pp)
else:
pp = re.sub(
Entry.Entry.tag_regex(self.config['tagsymbols']),
lambda match: util.colorize(match.group(0)),
pp
)
return pp
def __str__(self):
return self.pprint()
def __repr__(self):
return f"<Journal with {len(self.entries)} entries>"
def sort(self):
"""Sorts the Journal's entries by date"""
self.entries = sorted(self.entries, key=lambda entry: entry.date)
def limit(self, n=None):
"""Removes all but the last n entries"""
if n:
self.entries = self.entries[-n:]
@property
def tags(self):
"""Returns a set of tuples (count, tag) for all tags present in the journal."""
# Astute reader: should the following line leave you as puzzled as me the first time
# I came across this construction, worry not and embrace the ensuing moment of enlightment.
tags = [tag
for entry in self.entries
for tag in set(entry.tags)]
# To be read: [for entry in journal.entries: for tag in set(entry.tags): tag]
tag_counts = {(tags.count(tag), tag) for tag in tags}
return [Tag(tag, count=count) for count, tag in sorted(tag_counts)]
def filter(self, tags=[], start_date=None, end_date=None, starred=False, strict=False, short=False, exclude=[]):
"""Removes all entries from the journal that don't match the filter.
tags is a list of tags, each being a string that starts with one of the
tag symbols defined in the config, e.g. ["@John", "#WorldDomination"].
start_date and end_date define a timespan by which to filter.
starred limits journal to starred entries
If strict is True, all tags must be present in an entry. If false, the
exclude is a list of the tags which should not appear in the results.
entry is kept if any tag is present, unless they appear in exclude."""
self.search_tags = {tag.lower() for tag in tags}
excluded_tags = {tag.lower() for tag in exclude}
end_date = time.parse(end_date, inclusive=True)
start_date = time.parse(start_date)
# If strict mode is on, all tags have to be present in entry
tagged = self.search_tags.issubset if strict else self.search_tags.intersection
excluded = lambda tags: len([tag for tag in tags if tag in excluded_tags]) > 0
result = [
entry for entry in self.entries
if (not tags or tagged(entry.tags))
and (not starred or entry.starred)
and (not start_date or entry.date >= start_date)
and (not end_date or entry.date <= end_date)
and (not exclude or not excluded(entry.tags))
]
self.entries = result
def new_entry(self, raw, date=None, sort=True):
"""Constructs a new entry from some raw text input.
If a date is given, it will parse and use this, otherwise scan for a date in the input first."""
raw = raw.replace('\\n ', '\n').replace('\\n', '\n')
starred = False
# Split raw text into title and body
sep = re.search(r"\n|[?!.]+ +\n?", raw)
first_line = raw[:sep.end()].strip() if sep else raw
starred = False
if not date:
colon_pos = first_line.find(": ")
if colon_pos > 0:
date = time.parse(
raw[:colon_pos],
default_hour=self.config['default_hour'],
default_minute=self.config['default_minute']
)
if date: # Parsed successfully, strip that from the raw text
starred = raw[:colon_pos].strip().endswith("*")
raw = raw[colon_pos + 1:].strip()
starred = starred or first_line.startswith("*") or first_line.endswith("*")
if not date: # Still nothing? Meh, just live in the moment.
date = time.parse("now")
entry = Entry.Entry(self, date, raw, 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 "\n".join([str(e) 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 PlainJournal(Journal):
@classmethod
def _create(cls, filename):
with open(filename, "a", encoding="utf-8"):
pass
def _load(self, filename):
with open(filename, "r", encoding="utf-8") as f:
return f.read()
def _store(self, filename, text):
with open(filename, 'w', encoding="utf-8") as f:
f.write(text)
class LegacyJournal(Journal):
"""Legacy class to support opening journals formatted with the jrnl 1.x
standard. Main difference here is that in 1.x, timestamps were not cuddled
by square brackets. You'll not be able to save these journals anymore."""
def _load(self, filename):
with open(filename, "r", encoding="utf-8") as f:
return f.read()
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
# long the date will be by constructing one
date_length = len(datetime.today().strftime(self.config['timeformat']))
# Initialise our current entry
entries = []
current_entry = None
new_date_format_regex = re.compile(r'(^\[[^\]]+\].*?$)')
for line in journal_txt.splitlines():
line = line.rstrip()
try:
# try to parse line as date => new entry begins
new_date = datetime.strptime(line[:date_length], self.config['timeformat'])
# parsing successful => save old entry and create new one
if new_date and current_entry:
entries.append(current_entry)
if line.endswith("*"):
starred = True
line = line[:-1]
else:
starred = False
current_entry = Entry.Entry(self, date=new_date, text=line[date_length + 1:], starred=starred)
except ValueError:
# Happens when we can't parse the start of the line as an date.
# In this case, just append line to our body (after some
# escaping for the new format).
line = new_date_format_regex.sub(r' \1', line)
if current_entry:
current_entry.text += line + "\n"
# Append last entry
if current_entry:
entries.append(current_entry)
for entry in entries:
entry._parse_text()
return entries
def open_journal(name, config, legacy=False):
"""
Creates a normal, encrypted or DayOne journal based on the passed config.
If legacy is True, it will open Journals with legacy classes build for
backwards compatibility with jrnl 1.x
"""
config = config.copy()
config['journal'] = os.path.expanduser(os.path.expandvars(config['journal']))
if os.path.isdir(config['journal']):
if config['journal'].strip("/").endswith(".dayone") or "entries" in os.listdir(config['journal']):
from . import DayOneJournal
return DayOneJournal.DayOne(**config).open()
else:
print(
f"[Error: {config['journal']} is a directory, but doesn't seem to be a DayOne journal either.",
file=sys.stderr
)
sys.exit(1)
if not config['encrypt']:
if legacy:
return LegacyJournal(name, **config).open()
return PlainJournal(name, **config).open()
else:
from . import EncryptedJournal
if legacy:
return EncryptedJournal.LegacyEncryptedJournal(name, **config).open()
return EncryptedJournal.EncryptedJournal(name, **config).open()

View file

@ -1,8 +1,8 @@
#!/usr/bin/env python # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
import pkg_resources
dist = pkg_resources.get_distribution('jrnl')
__title__ = dist.project_name
__version__ = dist.version
try:
from jrnl.__version__ import __version__
except ImportError:
__version__ = "source"
__title__ = "jrnl"

View file

@ -1,6 +1,9 @@
#!/usr/bin/env python # Copyright © 2012-2023 jrnl contributors
from . import cli # License: https://www.gnu.org/licenses/gpl-3.0.html
import sys
from jrnl.main import run
if __name__ == "__main__": if __name__ == "__main__":
cli.run() sys.exit(run())

1
jrnl/__version__.py Normal file
View file

@ -0,0 +1 @@
__version__ = "v4.2.1"

456
jrnl/args.py Normal file
View file

@ -0,0 +1,456 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
import argparse
import re
import textwrap
from jrnl.commands import postconfig_decrypt
from jrnl.commands import postconfig_encrypt
from jrnl.commands import postconfig_import
from jrnl.commands import postconfig_list
from jrnl.commands import preconfig_diagnostic
from jrnl.commands import preconfig_version
from jrnl.output import deprecated_cmd
from jrnl.plugins import EXPORT_FORMATS
from jrnl.plugins import IMPORT_FORMATS
from jrnl.plugins import util
class WrappingFormatter(argparse.RawTextHelpFormatter):
"""Used in help screen"""
def _split_lines(self, text: str, width: int) -> list[str]:
text = text.split("\n\n")
text = map(lambda t: self._whitespace_matcher.sub(" ", t).strip(), text)
text = map(lambda t: textwrap.wrap(t, width=56), text)
text = [item for sublist in text for item in sublist]
return text
class IgnoreNoneAppendAction(argparse._AppendAction):
"""
Pass -not without a following string and avoid appending
a None value to the excluded list
"""
def __call__(self, parser, namespace, values, option_string=None):
if values is not None:
super().__call__(parser, namespace, values, option_string)
def parse_not_arg(
args: list[str], parsed_args: argparse.Namespace, parser: argparse.ArgumentParser
) -> argparse.Namespace:
"""
It's possible to use -not as a precursor to -starred and -tagged
to reverse their behaviour, however this requires some extra logic
to parse, and to ensure we still do not allow passing an empty -not
"""
parsed_args.exclude_starred = False
parsed_args.exclude_tagged = False
if "-not-starred" in "".join(args):
parsed_args.starred = False
parsed_args.exclude_starred = True
if "-not-tagged" in "".join(args):
parsed_args.tagged = False
parsed_args.exclude_tagged = True
if "-not" in args and not any(
[parsed_args.exclude_starred, parsed_args.exclude_tagged, parsed_args.excluded]
):
parser.error("argument -not: expected 1 argument")
return parsed_args
def parse_args(args: list[str] = []) -> argparse.Namespace:
"""
Argument parsing that is doable before the config is available.
Everything else goes into "text" for later parsing.
"""
parser = argparse.ArgumentParser(
formatter_class=WrappingFormatter,
add_help=False,
description="Collect your thoughts and notes without leaving the command line",
epilog=textwrap.dedent(
"""
We gratefully thank all contributors!
Come see the whole list of code and financial contributors at https://github.com/jrnl-org/jrnl
And special thanks to Bad Lip Reading for the Yoda joke in the Writing section above :)""" # noqa: E501
),
)
optional = parser.add_argument_group("Optional Arguments")
optional.add_argument(
"--debug",
dest="debug",
action="store_true",
help="Print information useful for troubleshooting",
)
standalone = parser.add_argument_group(
"Standalone Commands",
"These commands will exit after they complete. You may only run one at a time.",
)
standalone.add_argument("--help", action="help", help="Show this help message")
standalone.add_argument("-h", action="help", help=argparse.SUPPRESS)
standalone.add_argument(
"--version",
action="store_const",
const=preconfig_version,
dest="preconfig_cmd",
help="Print version information",
)
standalone.add_argument(
"-v",
action="store_const",
const=preconfig_version,
dest="preconfig_cmd",
help=argparse.SUPPRESS,
)
standalone.add_argument(
"--diagnostic",
action="store_const",
const=preconfig_diagnostic,
dest="preconfig_cmd",
help=argparse.SUPPRESS,
)
standalone.add_argument(
"--list",
action="store_const",
const=postconfig_list,
dest="postconfig_cmd",
help="""
List all configured journals.
Optional parameters:
--format [json or yaml]
""",
)
standalone.add_argument(
"--ls",
action="store_const",
const=postconfig_list,
dest="postconfig_cmd",
help=argparse.SUPPRESS,
)
standalone.add_argument(
"-ls",
action="store_const",
const=lambda **kwargs: deprecated_cmd(
"-ls", "--list or --ls", callback=postconfig_list, **kwargs
),
dest="postconfig_cmd",
help=argparse.SUPPRESS,
)
standalone.add_argument(
"--encrypt",
help="Encrypt selected journal with a password",
action="store_const",
metavar="TYPE",
const=postconfig_encrypt,
dest="postconfig_cmd",
)
standalone.add_argument(
"--decrypt",
help="Decrypt selected journal and store it in plain text",
action="store_const",
metavar="TYPE",
const=postconfig_decrypt,
dest="postconfig_cmd",
)
standalone.add_argument(
"--import",
action="store_const",
metavar="TYPE",
const=postconfig_import,
dest="postconfig_cmd",
help=f"""
Import entries from another journal.
Optional parameters:
--file FILENAME (default: uses stdin)
--format [{util.oxford_list(IMPORT_FORMATS)}] (default: jrnl)
""",
)
standalone.add_argument(
"--file",
metavar="FILENAME",
dest="filename",
help=argparse.SUPPRESS,
default=None,
)
standalone.add_argument("-i", dest="filename", help=argparse.SUPPRESS)
compose_msg = """
To add a new entry into your journal, simply write it on the command line:
jrnl yesterday: I was walking and I found this big log.
The date and the following colon ("yesterday:") are optional. If you leave
them out, "now" will be used:
jrnl Then I rolled the log over.
Also, you can mark extra special entries ("star" them) with an asterisk:
jrnl *And underneath was a tiny little stick.
Please note that asterisks might be a special character in your shell, so you
might have to escape them. When in doubt about escaping, put quotes around
your entire entry:
jrnl "saturday at 2am: *Then I was like 'That log had a child!'" """
composing = parser.add_argument_group(
"Writing", textwrap.dedent(compose_msg).strip()
)
composing.add_argument("text", metavar="", nargs="*")
composing.add_argument(
"--template",
dest="template",
help="Path to template file. Can be a local path, absolute path, or a path "
"relative to $XDG_DATA_HOME/jrnl/templates/",
)
read_msg = (
"To find entries from your journal, use any combination of the below filters."
)
reading = parser.add_argument_group("Searching", textwrap.dedent(read_msg))
reading.add_argument(
"-on", dest="on_date", metavar="DATE", help="Show entries on this date"
)
reading.add_argument(
"-today-in-history",
dest="today_in_history",
action="store_true",
help="Show entries of today over the years",
)
reading.add_argument(
"-month",
dest="month",
metavar="DATE",
help="Show entries on this month of any year",
)
reading.add_argument(
"-day",
dest="day",
metavar="DATE",
help="Show entries on this day of any month",
)
reading.add_argument(
"-year",
dest="year",
metavar="DATE",
help="Show entries of a specific year",
)
reading.add_argument(
"-from",
dest="start_date",
metavar="DATE",
help="Show entries after, or on, this date",
)
reading.add_argument(
"-to",
dest="end_date",
metavar="DATE",
help="Show entries before, or on, this date (alias: -until)",
)
reading.add_argument("-until", dest="end_date", help=argparse.SUPPRESS)
reading.add_argument(
"-contains",
dest="contains",
action="append",
metavar="TEXT",
help="Show entries containing specific text (put quotes around text with "
"spaces)",
)
reading.add_argument(
"-and",
dest="strict",
action="store_true",
help='Show only entries that match all conditions, like saying "x AND y" '
"(default: OR)",
)
reading.add_argument(
"-starred",
dest="starred",
action="store_true",
help="Show only starred entries (marked with *)",
)
reading.add_argument(
"-tagged",
dest="tagged",
action="store_true",
help="Show only entries that have at least one tag",
)
reading.add_argument(
"-n",
dest="limit",
default=None,
metavar="NUMBER",
help="Show a maximum of NUMBER entries (note: '-n 3' and '-3' have the same "
"effect)",
nargs="?",
type=int,
)
reading.add_argument(
"-not",
dest="excluded",
nargs="?",
default=[],
metavar="TAG/FLAG",
action=IgnoreNoneAppendAction,
help=(
"If passed a string, will exclude entries with that tag. "
"Can be also used before -starred or -tagged flags, to exclude "
"starred or tagged entries respectively."
),
)
search_options_msg = (
" " # Preserves indentation
"""
These help you do various tasks with the selected entries from your search.
If used on their own (with no search), they will act on your entire journal"""
)
exporting = parser.add_argument_group(
"Searching Options", textwrap.dedent(search_options_msg)
)
exporting.add_argument(
"--edit",
dest="edit",
help="Opens the selected entries in your configured editor",
action="store_true",
)
exporting.add_argument(
"--delete",
dest="delete",
action="store_true",
help="Interactively deletes selected entries",
)
exporting.add_argument(
"--change-time",
dest="change_time",
nargs="?",
metavar="DATE",
const="now",
help="Change timestamp for selected entries (default: now)",
)
exporting.add_argument(
"--format",
metavar="TYPE",
dest="export",
choices=EXPORT_FORMATS,
help=f"""
Display selected entries in an alternate format.
TYPE can be: {util.oxford_list(EXPORT_FORMATS)}.
Optional parameters:
--file FILENAME Write output to file instead of stdout
""",
default=False,
)
exporting.add_argument(
"--export",
metavar="TYPE",
dest="export",
choices=EXPORT_FORMATS,
help=argparse.SUPPRESS,
)
exporting.add_argument(
"--tags",
dest="tags",
action="store_true",
help="Alias for '--format tags'. Returns a list of all tags and number of "
"occurrences",
)
exporting.add_argument(
"--short",
dest="short",
action="store_true",
help="Show only titles or line containing the search tags",
)
exporting.add_argument(
"-s",
dest="short",
action="store_true",
help=argparse.SUPPRESS,
)
exporting.add_argument(
"-o",
dest="filename",
help=argparse.SUPPRESS,
)
config_overrides = parser.add_argument_group(
"Config file override",
textwrap.dedent("Apply a one-off override of the config file option"),
)
config_overrides.add_argument(
"--config-override",
dest="config_override",
action="append",
type=str,
nargs=2,
default=[],
metavar="CONFIG_KV_PAIR",
help="""
Override configured key-value pair with CONFIG_KV_PAIR for this command invocation only.
Examples: \n
\t - Use a different editor for this jrnl entry, call: \n
\t jrnl --config-override editor "nano" \n
\t - Override color selections\n
\t jrnl --config-override colors.body blue --config-override colors.title green
""", # noqa: E501
)
config_overrides.add_argument(
"--co",
dest="config_override",
action="append",
type=str,
nargs=2,
default=[],
help=argparse.SUPPRESS,
)
alternate_config = parser.add_argument_group(
"Specifies alternate config to be used",
textwrap.dedent("Applies alternate config for current session"),
)
alternate_config.add_argument(
"--config-file",
dest="config_file_path",
type=str,
default="",
help="""
Overrides default (created when first installed) config file for this command only.
Examples: \n
\t - Use a work config file for this jrnl entry, call: \n
\t jrnl --config-file /home/user1/work_config.yaml
\t - Use a personal config file stored on a thumb drive: \n
\t jrnl --config-file /media/user1/my-thumb-drive/personal_config.yaml
""", # noqa: E501
)
alternate_config.add_argument(
"--cf", dest="config_file_path", type=str, default="", help=argparse.SUPPRESS
)
# Handle '-123' as a shortcut for '-n 123'
num = re.compile(r"^-(\d+)$")
args = [num.sub(r"-n \1", arg) for arg in args]
parsed_args = parser.parse_intermixed_args(args)
parsed_args = parse_not_arg(args, parsed_args, parser)
return parsed_args

View file

@ -1,292 +0,0 @@
#!/usr/bin/env python
"""
jrnl
license: MIT, see LICENSE for more details.
"""
from . import Journal
from . import util
from . import install
from . import plugins
from .util import ERROR_COLOR, RESET_COLOR, UserAbort
import jrnl
import argparse
import sys
import logging
log = logging.getLogger(__name__)
logging.getLogger("keyring.backend").setLevel(logging.ERROR)
def parse_args(args=None):
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--version', dest='version', action="store_true", help="prints version information and exits")
parser.add_argument('-ls', dest='ls', action="store_true", help="displays accessible journals")
parser.add_argument('-d', '--debug', dest='debug', action='store_true', help='execute in debug mode')
composing = parser.add_argument_group('Composing', 'To write an entry simply write it on the command line, e.g. "jrnl yesterday at 1pm: Went to the gym."')
composing.add_argument('text', metavar='', nargs="*")
reading = parser.add_argument_group('Reading', 'Specifying either of these parameters will display posts of your journal')
reading.add_argument('-from', dest='start_date', metavar="DATE", help='View entries after this date')
reading.add_argument('-until', '-to', dest='end_date', metavar="DATE", help='View entries before this date')
reading.add_argument('-on', dest='on_date', metavar="DATE", help='View entries on this date')
reading.add_argument('-and', dest='strict', action="store_true", help='Filter by tags using AND (default: OR)')
reading.add_argument('-starred', dest='starred', action="store_true", help='Show only starred entries')
reading.add_argument('-n', dest='limit', default=None, metavar="N", help="Shows the last n entries matching the filter. '-n 3' and '-3' have the same effect.", nargs="?", type=int)
reading.add_argument('-not', dest='excluded', nargs='+', default=[], metavar="E", help="Exclude entries with these tags")
exporting = parser.add_argument_group('Export / Import', 'Options for transmogrifying your journal')
exporting.add_argument('-s', '--short', dest='short', action="store_true", help='Show only titles or line containing the search tags')
exporting.add_argument('--tags', dest='tags', action="store_true", help='Returns a list of all tags and number of occurences')
exporting.add_argument('--export', metavar='TYPE', dest='export', choices=plugins.EXPORT_FORMATS, help='Export your journal. TYPE can be {}.'.format(plugins.util.oxford_list(plugins.EXPORT_FORMATS)), default=False, const=None)
exporting.add_argument('-o', metavar='OUTPUT', dest='output', help='Optionally specifies output file when using --export. If OUTPUT is a directory, exports each entry into an individual file instead.', default=False, const=None)
exporting.add_argument('--import', metavar='TYPE', dest='import_', choices=plugins.IMPORT_FORMATS, help='Import entries into your journal. TYPE can be {}, and it defaults to jrnl if nothing else is specified.'.format(plugins.util.oxford_list(plugins.IMPORT_FORMATS)), default=False, const='jrnl', nargs='?')
exporting.add_argument('-i', metavar='INPUT', dest='input', help='Optionally specifies input file when using --import.', 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('--edit', dest='edit', help='Opens your editor to edit the selected entries.', action="store_true")
return parser.parse_args(args)
def guess_mode(args, config):
"""Guesses the mode (compose, read or export) from the given arguments"""
compose = True
export = False
import_ = False
if args.import_ is not False:
compose = False
export = False
import_ = True
elif 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.on_date, args.limit, args.strict, args.starred)):
# Any sign of displaying stuff?
compose = False
elif args.text and all(word[0] in config['tagsymbols'] for word in " ".join(args.text).split()):
# No date and only tags?
compose = False
return compose, export, import_
def encrypt(journal, filename=None):
""" Encrypt into new file. If filename is not set, we encrypt the journal file itself. """
from . import EncryptedJournal
journal.config['password'] = util.create_password()
journal.config['encrypt'] = True
new_journal = EncryptedJournal.EncryptedJournal(None, **journal.config)
new_journal.entries = journal.entries
new_journal.write(filename)
if util.yesno("Do you want to store the password in your keychain?", default=True):
util.set_keychain(journal.name, journal.config['password'])
print("Journal encrypted to {}.".format(filename or new_journal.config['journal']), file=sys.stderr)
def decrypt(journal, filename=None):
""" Decrypts into new file. If filename is not set, we encrypt the journal file itself. """
journal.config['encrypt'] = False
journal.config['password'] = ""
new_journal = Journal.PlainJournal(filename, **journal.config)
new_journal.entries = journal.entries
new_journal.write(filename)
print("Journal decrypted to {}.".format(filename or new_journal.config['journal']), file=sys.stderr)
def list_journals(config):
"""List the journals specified in the configuration file"""
result = f"Journals defined in {install.CONFIG_FILE_PATH}\n"
ml = min(max(len(k) for k in config['journals']), 20)
for journal, cfg in config['journals'].items():
result += " * {:{}} -> {}\n".format(journal, ml, cfg['journal'] if isinstance(cfg, dict) else cfg)
return result
def update_config(config, new_config, scope, force_local=False):
"""Updates a config dict with new values - either global if scope is None
or config['journals'][scope] is just a string pointing to a journal file,
or within the scope"""
if scope and type(config['journals'][scope]) is dict: # Update to journal specific
config['journals'][scope].update(new_config)
elif scope and force_local: # Convert to dict
config['journals'][scope] = {"journal": config['journals'][scope]}
config['journals'][scope].update(new_config)
else:
config.update(new_config)
def configure_logger(debug=False):
logging.basicConfig(
level=logging.DEBUG if debug else logging.INFO,
format='%(levelname)-8s %(name)-12s %(message)s'
)
logging.getLogger('parsedatetime').setLevel(logging.INFO) # disable parsedatetime debug logging
def run(manual_args=None):
args = parse_args(manual_args)
configure_logger(args.debug)
if args.version:
version_str = f"{jrnl.__title__} version {jrnl.__version__}"
print(version_str)
sys.exit(0)
try:
config = install.load_or_install_jrnl()
except UserAbort as err:
print(f"\n{err}", file=sys.stderr)
sys.exit(1)
if args.ls:
print(list_journals(config))
sys.exit(0)
log.debug('Using configuration "%s"', config)
original_config = config.copy()
# If the first textual argument points to a journal file,
# use this!
journal_name = args.text[0] if (args.text and args.text[0] in config['journals']) else 'default'
if journal_name != 'default':
args.text = args.text[1:]
elif "default" not in config['journals']:
print("No default journal configured.", file=sys.stderr)
print(list_journals(config), file=sys.stderr)
sys.exit(1)
config = util.scope_config(config, journal_name)
# If the first remaining argument looks like e.g. '-3', interpret that as a limiter
if not args.limit and args.text and args.text[0].startswith("-"):
try:
args.limit = int(args.text[0].lstrip("-"))
args.text = args.text[1:]
except ValueError:
pass
log.debug('Using journal "%s"', journal_name)
mode_compose, mode_export, mode_import = guess_mode(args, config)
# How to quit writing?
if "win32" in sys.platform:
_exit_multiline_code = "on a blank line, press Ctrl+Z and then Enter"
else:
_exit_multiline_code = "press Ctrl+D"
if mode_compose and not args.text:
if not sys.stdin.isatty():
# Piping data into jrnl
raw = sys.stdin.read()
elif config['editor']:
template = ""
if config['template']:
try:
template = open(config['template']).read()
except OSError:
print(f"[Could not read template at '{config['template']}']", file=sys.stderr)
sys.exit(1)
raw = util.get_text_from_editor(config, template)
else:
try:
print("[Compose Entry; " + _exit_multiline_code + " to finish writing]\n", file=sys.stderr)
raw = sys.stdin.read()
except KeyboardInterrupt:
print("[Entry NOT saved to journal.]", file=sys.stderr)
sys.exit(0)
if raw:
args.text = [raw]
else:
sys.exit()
# This is where we finally open the journal!
try:
journal = Journal.open_journal(journal_name, config)
except KeyboardInterrupt:
print(f"[Interrupted while opening journal]", file=sys.stderr)
sys.exit(1)
# Import mode
if mode_import:
plugins.get_importer(args.import_).import_(journal, args.input)
# Writing mode
elif mode_compose:
raw = " ".join(args.text).strip()
log.debug('Appending raw line "%s" to journal "%s"', raw, journal_name)
journal.new_entry(raw)
print(f"[Entry added to {journal_name} journal]", file=sys.stderr)
journal.write()
if not mode_compose:
old_entries = journal.entries
if args.on_date:
args.start_date = args.end_date = args.on_date
journal.filter(tags=args.text,
start_date=args.start_date, end_date=args.end_date,
strict=args.strict,
short=args.short,
starred=args.starred,
exclude=args.excluded)
journal.limit(args.limit)
# Reading mode
if not mode_compose and not mode_export and not mode_import:
print(journal.pprint())
# Various export modes
elif args.short:
print(journal.pprint(short=True))
elif args.tags:
print(plugins.get_exporter("tags").export(journal))
elif args.export is not False:
exporter = plugins.get_exporter(args.export)
print(exporter.export(journal, args.output))
elif args.encrypt is not False:
encrypt(journal, filename=args.encrypt)
# Not encrypting to a separate file: update config!
if not args.encrypt:
update_config(original_config, {"encrypt": True}, journal_name, force_local=True)
install.save_config(original_config)
elif args.decrypt is not False:
decrypt(journal, filename=args.decrypt)
# Not decrypting to a separate file: update config!
if not args.decrypt:
update_config(original_config, {"encrypt": False}, journal_name, force_local=True)
install.save_config(original_config)
elif args.edit:
if not config['editor']:
print("[{1}ERROR{2}: You need to specify an editor in {0} to use the --edit function.]"
.format(install.CONFIG_FILE_PATH, ERROR_COLOR, RESET_COLOR), file=sys.stderr)
sys.exit(1)
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("{} {} deleted".format(num_deleted, "entry" if num_deleted == 1 else "entries"))
if num_edited:
prompts.append("{} {} modified".format(num_edited, "entry" if num_deleted == 1 else "entries"))
if prompts:
print("[{}]".format(", ".join(prompts).capitalize()), file=sys.stderr)
journal.entries += other_entries
journal.sort()
journal.write()

83
jrnl/color.py Normal file
View file

@ -0,0 +1,83 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
import re
from string import punctuation
from string import whitespace
from typing import TYPE_CHECKING
import colorama
from jrnl.os_compat import on_windows
if TYPE_CHECKING:
from jrnl.journals import Entry
if on_windows():
colorama.init()
def colorize(string: str, color: str, bold: bool = False) -> str:
"""Returns the string colored with colorama.Fore.color. If the color set by
the user is "NONE" or the color doesn't exist in the colorama.Fore attributes,
it returns the string without any modification."""
color_escape = getattr(colorama.Fore, color.upper(), None)
if not color_escape:
return string
elif not bold:
return color_escape + string + colorama.Fore.RESET
else:
return colorama.Style.BRIGHT + color_escape + string + colorama.Style.RESET_ALL
def highlight_tags_with_background_color(
entry: "Entry", text: str, color: str, is_title: bool = False
) -> str:
"""
Takes a string and colorizes the tags in it based upon the config value for
color.tags, while colorizing the rest of the text based on `color`.
:param entry: Entry object, for access to journal config
:param text: Text to be colorized
:param color: Color for non-tag text, passed to colorize()
:param is_title: Boolean flag indicating if the text is a title or not
:return: Colorized str
"""
def colorized_text_generator(fragments):
"""Efficiently generate colorized tags / text from text fragments.
Taken from @shobrook. Thanks, buddy :)
:param fragments: List of strings representing parts of entry (tag or word).
:rtype: List of tuples
:returns [(colorized_str, original_str)]"""
for part in fragments:
if part and part[0] not in config["tagsymbols"]:
yield colorize(part, color, bold=is_title), part
elif part:
yield colorize(part, config["colors"]["tags"], bold=True), part
config = entry.journal.config
if config["highlight"]: # highlight tags
text_fragments = re.split(entry.tag_regex(config["tagsymbols"]), text)
# Colorizing tags inside of other blocks of text
final_text = ""
previous_piece = ""
for colorized_piece, piece in colorized_text_generator(text_fragments):
# If this piece is entirely punctuation or whitespace or the start
# of a line or the previous piece was a tag or this piece is a tag,
# then add it to the final text without a leading space.
if (
all(char in punctuation + whitespace for char in piece)
or previous_piece.endswith("\n")
or (previous_piece and previous_piece[0] in config["tagsymbols"])
or piece[0] in config["tagsymbols"]
):
final_text += colorized_piece
else:
# Otherwise add a leading space and then append the piece.
final_text += " " + colorized_piece
previous_piece = piece
return final_text.lstrip()
else:
return text

182
jrnl/commands.py Normal file
View file

@ -0,0 +1,182 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
"""
Functions in this file are standalone commands. All standalone commands are split into
two categories depending on whether they require the config to be loaded to be able to
run.
1. "preconfig" commands don't require the config at all, and can be run before the
config has been loaded.
2. "postconfig" commands require to config to have already been loaded, parsed, and
scoped before they can be run.
Also, please note that all (non-builtin) imports should be scoped to each function to
avoid any possible overhead for these standalone commands.
"""
import argparse
import logging
import platform
import sys
from jrnl.config import cmd_requires_valid_journal_name
from jrnl.exception import JrnlException
from jrnl.messages import Message
from jrnl.messages import MsgStyle
from jrnl.messages import MsgText
from jrnl.output import print_msg
def preconfig_diagnostic(_) -> None:
from jrnl import __title__
from jrnl import __version__
print(
f"{__title__}: {__version__}\n"
f"Python: {sys.version}\n"
f"OS: {platform.system()} {platform.release()}"
)
def preconfig_version(_) -> None:
import textwrap
from jrnl import __title__
from jrnl import __version__
output = f"""
{__title__} {__version__}
Copyright © 2012-2023 jrnl contributors
This is free software, and you are welcome to redistribute it under certain
conditions; for details, see: https://www.gnu.org/licenses/gpl-3.0.html
"""
output = textwrap.dedent(output).strip()
print(output)
def postconfig_list(args: argparse.Namespace, config: dict, **_) -> int:
from jrnl.output import list_journals
print(list_journals(config, args.export))
return 0
@cmd_requires_valid_journal_name
def postconfig_import(args: argparse.Namespace, config: dict, **_) -> int:
from jrnl.journals import open_journal
from jrnl.plugins import get_importer
# Requires opening the journal
journal = open_journal(args.journal_name, config)
format = args.export if args.export else "jrnl"
if (importer := get_importer(format)) is None:
raise JrnlException(
Message(
MsgText.ImporterNotFound,
MsgStyle.ERROR,
{"format": format},
)
)
importer.import_(journal, args.filename)
return 0
@cmd_requires_valid_journal_name
def postconfig_encrypt(
args: argparse.Namespace, config: dict, original_config: dict
) -> int:
"""
Encrypt a journal in place, or optionally to a new file
"""
from jrnl.config import update_config
from jrnl.install import save_config
from jrnl.journals import open_journal
# Open the journal
journal = open_journal(args.journal_name, config)
if hasattr(journal, "can_be_encrypted") and not journal.can_be_encrypted:
raise JrnlException(
Message(
MsgText.CannotEncryptJournalType,
MsgStyle.ERROR,
{
"journal_name": args.journal_name,
"journal_type": journal.__class__.__name__,
},
)
)
# If journal is encrypted, create new password
logging.debug("Clearing encryption method...")
if journal.config["encrypt"] is True:
logging.debug("Journal already encrypted. Re-encrypting...")
print(f"Journal {journal.name} is already encrypted. Create a new password.")
journal.encryption_method.clear()
else:
journal.config["encrypt"] = True
journal.encryption_method = None
journal.write(args.filename)
print_msg(
Message(
MsgText.JournalEncryptedTo,
MsgStyle.NORMAL,
{"path": args.filename or journal.config["journal"]},
)
)
# Update the config, if we encrypted in place
if not args.filename:
update_config(
original_config, {"encrypt": True}, args.journal_name, force_local=True
)
save_config(original_config)
return 0
@cmd_requires_valid_journal_name
def postconfig_decrypt(
args: argparse.Namespace, config: dict, original_config: dict
) -> int:
"""Decrypts to file. If filename is not set, we encrypt the journal file itself."""
from jrnl.config import update_config
from jrnl.install import save_config
from jrnl.journals import open_journal
journal = open_journal(args.journal_name, config)
logging.debug("Clearing encryption method...")
journal.config["encrypt"] = False
journal.encryption_method = None
journal.write(args.filename)
print_msg(
Message(
MsgText.JournalDecryptedTo,
MsgStyle.NORMAL,
{"path": args.filename or journal.config["journal"]},
)
)
# Update the config, if we decrypted in place
if not args.filename:
update_config(
original_config, {"encrypt": False}, args.journal_name, force_local=True
)
save_config(original_config)
return 0

229
jrnl/config.py Normal file
View file

@ -0,0 +1,229 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
import argparse
import logging
import os
from typing import Any
from typing import Callable
import colorama
from rich.pretty import pretty_repr
from ruamel.yaml import YAML
from ruamel.yaml import constructor
from jrnl import __version__
from jrnl.exception import JrnlException
from jrnl.messages import Message
from jrnl.messages import MsgStyle
from jrnl.messages import MsgText
from jrnl.output import list_journals
from jrnl.output import print_msg
from jrnl.path import get_config_path
from jrnl.path import get_default_journal_path
# Constants
DEFAULT_JOURNAL_KEY = "default"
YAML_SEPARATOR = ": "
YAML_FILE_ENCODING = "utf-8"
def make_yaml_valid_dict(input: list) -> dict:
"""
Convert a two-element list of configuration key-value pair into a flat dict.
The dict is created through the yaml loader, with the assumption that
"input[0]: input[1]" is valid yaml.
:param input: list of configuration keys in dot-notation and their respective values
:type input: list
:return: A single level dict of the configuration keys in dot-notation and their
respective desired values
:rtype: dict
"""
assert len(input) == 2
# yaml compatible strings are of the form Key:Value
yamlstr = YAML_SEPARATOR.join(input)
runtime_modifications = YAML(typ="safe").load(yamlstr)
return runtime_modifications
def save_config(config: dict, alt_config_path: str | None = None) -> None:
"""Supply alt_config_path if using an alternate config through --config-file."""
config["version"] = __version__
yaml = YAML(typ="safe")
yaml.default_flow_style = False # prevents collapsing of tree structure
with open(
alt_config_path if alt_config_path else get_config_path(),
"w",
encoding=YAML_FILE_ENCODING,
) as f:
yaml.dump(config, f)
def get_default_config() -> dict[str, Any]:
return {
"version": __version__,
"journals": {"default": {"journal": get_default_journal_path()}},
"editor": os.getenv("VISUAL") or os.getenv("EDITOR") or "",
"encrypt": False,
"template": False,
"default_hour": 9,
"default_minute": 0,
"timeformat": "%F %r",
"tagsymbols": "#@",
"highlight": True,
"linewrap": 79,
"indent_character": "|",
"colors": {
"body": "none",
"date": "none",
"tags": "none",
"title": "none",
},
}
def get_default_colors() -> dict[str, Any]:
return {
"body": "none",
"date": "black",
"tags": "yellow",
"title": "cyan",
}
def scope_config(config: dict, journal_name: str) -> dict:
if journal_name not in config["journals"]:
return config
config = config.copy()
journal_conf = config["journals"].get(journal_name)
if isinstance(journal_conf, dict):
# We can override the default config on a by-journal basis
logging.debug(
"Updating configuration with specific journal overrides:\n%s",
pretty_repr(journal_conf),
)
config.update(journal_conf)
else:
# But also just give them a string to point to the journal file
config["journal"] = journal_conf
logging.debug("Scoped config:\n%s", pretty_repr(config))
return config
def verify_config_colors(config: dict) -> bool:
"""
Ensures the keys set for colors are valid colorama.Fore attributes, or "None"
:return: True if all keys are set correctly, False otherwise
"""
all_valid_colors = True
for key, color in config["colors"].items():
upper_color = color.upper()
if upper_color == "NONE":
continue
if not getattr(colorama.Fore, upper_color, None):
print_msg(
Message(
MsgText.InvalidColor,
MsgStyle.NORMAL,
{
"key": key,
"color": color,
},
)
)
all_valid_colors = False
return all_valid_colors
def load_config(config_path: str) -> dict:
"""Tries to load a config file from YAML."""
try:
with open(config_path, encoding=YAML_FILE_ENCODING) as f:
yaml = YAML(typ="safe")
yaml.allow_duplicate_keys = False
return yaml.load(f)
except constructor.DuplicateKeyError as e:
print_msg(
Message(
MsgText.ConfigDoubleKeys,
MsgStyle.WARNING,
{
"error_message": e,
},
)
)
with open(config_path, encoding=YAML_FILE_ENCODING) as f:
yaml = YAML(typ="safe")
yaml.allow_duplicate_keys = True
return yaml.load(f)
def is_config_json(config_path: str) -> bool:
with open(config_path, "r", encoding="utf-8") as f:
config_file = f.read()
return config_file.strip().startswith("{")
def update_config(
config: dict, new_config: dict, scope: str | None, force_local: bool = False
) -> None:
"""Updates a config dict with new values - either global if scope is None
or config['journals'][scope] is just a string pointing to a journal file,
or within the scope"""
if scope and isinstance(config["journals"][scope], dict):
config["journals"][scope].update(new_config)
elif scope and force_local: # Convert to dict
config["journals"][scope] = {"journal": config["journals"][scope]}
config["journals"][scope].update(new_config)
else:
config.update(new_config)
def get_journal_name(args: argparse.Namespace, config: dict) -> argparse.Namespace:
args.journal_name = DEFAULT_JOURNAL_KEY
# The first arg might be a journal name
if args.text:
potential_journal_name = args.text[0]
if potential_journal_name[-1] == ":":
potential_journal_name = potential_journal_name[0:-1]
if potential_journal_name in config["journals"]:
args.journal_name = potential_journal_name
args.text = args.text[1:]
logging.debug("Using journal name: %s", args.journal_name)
return args
def cmd_requires_valid_journal_name(func: Callable) -> Callable:
def wrapper(args: argparse.Namespace, config: dict, original_config: dict):
validate_journal_name(args.journal_name, config)
func(args=args, config=config, original_config=original_config)
return wrapper
def validate_journal_name(journal_name: str, config: dict) -> None:
if journal_name not in config["journals"]:
raise JrnlException(
Message(
MsgText.NoNamedJournal,
MsgStyle.ERROR,
{
"journal_name": journal_name,
"journals": list_journals(config),
},
),
)

455
jrnl/controller.py Normal file
View file

@ -0,0 +1,455 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
import logging
import sys
from typing import TYPE_CHECKING
from jrnl import install
from jrnl import plugins
from jrnl import time
from jrnl.config import DEFAULT_JOURNAL_KEY
from jrnl.config import get_config_path
from jrnl.config import get_journal_name
from jrnl.config import scope_config
from jrnl.editor import get_text_from_editor
from jrnl.editor import get_text_from_stdin
from jrnl.editor import read_template_file
from jrnl.exception import JrnlException
from jrnl.journals import open_journal
from jrnl.messages import Message
from jrnl.messages import MsgStyle
from jrnl.messages import MsgText
from jrnl.output import print_msg
from jrnl.output import print_msgs
from jrnl.override import apply_overrides
if TYPE_CHECKING:
from argparse import Namespace
from jrnl.journals import Entry
from jrnl.journals import Journal
def run(args: "Namespace"):
"""
Flow:
1. Run standalone command if it doesn't need config (help, version, etc), then exit
2. Load config
3. Run standalone command if it does need config (encrypt, decrypt, etc), then exit
4. Load specified journal
5. Start append mode, or search mode
6. Perform actions with results from search mode (if needed)
7. Profit
"""
# Run command if possible before config is available
if callable(args.preconfig_cmd):
return args.preconfig_cmd(args)
# Load the config, and extract journal name
config = install.load_or_install_jrnl(args.config_file_path)
original_config = config.copy()
# Apply config overrides
config = apply_overrides(args, config)
args = get_journal_name(args, config)
config = scope_config(config, args.journal_name)
# Run post-config command now that config is ready
if callable(args.postconfig_cmd):
return args.postconfig_cmd(
args=args, config=config, original_config=original_config
)
# --- All the standalone commands are now done --- #
# Get the journal we're going to be working with
journal = open_journal(args.journal_name, config)
kwargs = {
"args": args,
"config": config,
"journal": journal,
"old_entries": journal.entries,
}
if _is_append_mode(**kwargs):
append_mode(**kwargs)
return
# If not append mode, then we're in search mode (only 2 modes exist)
search_mode(**kwargs)
entries_found_count = len(journal)
_print_entries_found_count(entries_found_count, args)
# Actions
_perform_actions_on_search_results(**kwargs)
if entries_found_count != 0 and _has_action_args(args):
_print_changed_counts(journal)
else:
# display only occurs if no other action occurs
_display_search_results(**kwargs)
def _perform_actions_on_search_results(**kwargs):
args = kwargs["args"]
# Perform actions (if needed)
if args.change_time:
_change_time_search_results(**kwargs)
if args.delete:
_delete_search_results(**kwargs)
# open results in editor (if `--edit` was used)
if args.edit:
_edit_search_results(**kwargs)
def _is_append_mode(args: "Namespace", config: dict, **kwargs) -> bool:
"""Determines if we are in append mode (as opposed to search mode)"""
# Are any search filters present? If so, then search mode.
append_mode = (
not _has_search_args(args)
and not _has_action_args(args)
and not _has_display_args(args)
)
# Might be writing and want to move to editor part of the way through
if args.edit and args.text:
append_mode = True
# If the text is entirely tags, then we are also searching (not writing)
if append_mode and args.text and _has_only_tags(config["tagsymbols"], args.text):
append_mode = False
return append_mode
def append_mode(args: "Namespace", config: dict, journal: "Journal", **kwargs) -> None:
"""
Gets input from the user to write to the journal
0. Check for a template passed as an argument, or in the global config
1. Check for input from cli
2. Check input being piped in
3. Open editor if configured (prepopulated with template if available)
4. Use stdin.read as last resort
6. Write any found text to journal, or exit
"""
logging.debug("Append mode: starting")
template_text = _get_template(args, config)
if args.text:
logging.debug(f"Append mode: cli text detected: {args.text}")
raw = " ".join(args.text).strip()
if args.edit:
raw = _write_in_editor(config, raw)
elif not sys.stdin.isatty():
logging.debug("Append mode: receiving piped text")
raw = sys.stdin.read()
else:
raw = _write_in_editor(config, template_text)
if template_text is not None and raw == template_text:
logging.error("Append mode: raw text was the same as the template")
raise JrnlException(Message(MsgText.NoChangesToTemplate, MsgStyle.NORMAL))
if not raw or raw.isspace():
logging.error("Append mode: couldn't get raw text or entry was empty")
raise JrnlException(Message(MsgText.NoTextReceived, MsgStyle.NORMAL))
logging.debug(
f"Append mode: appending raw text to journal '{args.journal_name}': {raw}"
)
journal.new_entry(raw)
if args.journal_name != DEFAULT_JOURNAL_KEY:
print_msg(
Message(
MsgText.JournalEntryAdded,
MsgStyle.NORMAL,
{"journal_name": args.journal_name},
)
)
journal.write()
logging.debug("Append mode: completed journal.write()")
def _get_template(args, config) -> str:
# Read template file and pass as raw text into the composer
logging.debug(
"Get template:\n"
f"--template: {args.template}\n"
f"from config: {config.get('template')}"
)
template_path = args.template or config.get("template")
template_text = None
if template_path:
template_text = read_template_file(template_path)
return template_text
def search_mode(args: "Namespace", journal: "Journal", **kwargs) -> None:
"""
Search for entries in a journal, and return the
results. If no search args, then return all results
"""
logging.debug("Search mode: starting")
# If no search args, then return all results (don't filter anything)
if not _has_search_args(args) and not _has_display_args(args) and not args.text:
logging.debug("Search mode: has no search args")
return
logging.debug("Search mode: has search args")
_filter_journal_entries(args, journal)
def _write_in_editor(config: dict, prepopulated_text: str | None = None) -> str:
if config["editor"]:
logging.debug("Append mode: opening editor")
raw = get_text_from_editor(config, prepopulated_text)
else:
raw = get_text_from_stdin()
return raw
def _filter_journal_entries(args: "Namespace", journal: "Journal", **kwargs) -> None:
"""Filter journal entries in-place based upon search args"""
if args.on_date:
args.start_date = args.end_date = args.on_date
if args.today_in_history:
now = time.parse("now")
args.day = now.day
args.month = now.month
journal.filter(
tags=args.text,
month=args.month,
day=args.day,
year=args.year,
start_date=args.start_date,
end_date=args.end_date,
strict=args.strict,
starred=args.starred,
tagged=args.tagged,
exclude=args.excluded,
exclude_starred=args.exclude_starred,
exclude_tagged=args.exclude_tagged,
contains=args.contains,
)
journal.limit(args.limit)
def _print_entries_found_count(count: int, args: "Namespace") -> None:
logging.debug(f"count: {count}")
if count == 0:
if args.edit or args.change_time:
print_msg(Message(MsgText.NothingToModify, MsgStyle.WARNING))
elif args.delete:
print_msg(Message(MsgText.NothingToDelete, MsgStyle.WARNING))
else:
print_msg(Message(MsgText.NoEntriesFound, MsgStyle.NORMAL))
return
elif args.limit and args.limit == count:
# Don't show count if the user expects a limited number of results
logging.debug("args.limit is true-ish")
return
logging.debug("Printing general summary")
my_msg = (
MsgText.EntryFoundCountSingular if count == 1 else MsgText.EntryFoundCountPlural
)
print_msg(Message(my_msg, MsgStyle.NORMAL, {"num": count}))
def _other_entries(journal: "Journal", entries: list["Entry"]) -> list["Entry"]:
"""Find entries that are not in journal"""
return [e for e in entries if e not in journal.entries]
def _edit_search_results(
config: dict, journal: "Journal", old_entries: list["Entry"], **kwargs
) -> None:
"""
1. Send the given journal entries to the user-configured editor
2. Print out stats on any modifications to journal
3. Write modifications to journal
"""
if not config["editor"]:
raise JrnlException(
Message(
MsgText.EditorNotConfigured,
MsgStyle.ERROR,
{"config_file": get_config_path()},
)
)
# separate entries we are not editing
other_entries = _other_entries(journal, old_entries)
# Send user to the editor
try:
edited = get_text_from_editor(config, journal.editable_str())
except JrnlException as e:
if e.has_message_text(MsgText.NoTextReceived):
raise JrnlException(
Message(MsgText.NoEditsReceivedJournalNotDeleted, MsgStyle.WARNING)
)
else:
raise e
journal.parse_editable_str(edited)
# Put back entries we separated earlier, sort, and write the journal
journal.entries += other_entries
journal.sort()
journal.write()
def _print_changed_counts(journal: "Journal", **kwargs) -> None:
stats = journal.get_change_counts()
msgs = []
if stats["added"] > 0:
my_msg = (
MsgText.JournalCountAddedSingular
if stats["added"] == 1
else MsgText.JournalCountAddedPlural
)
msgs.append(Message(my_msg, MsgStyle.NORMAL, {"num": stats["added"]}))
if stats["deleted"] > 0:
my_msg = (
MsgText.JournalCountDeletedSingular
if stats["deleted"] == 1
else MsgText.JournalCountDeletedPlural
)
msgs.append(Message(my_msg, MsgStyle.NORMAL, {"num": stats["deleted"]}))
if stats["modified"] > 0:
my_msg = (
MsgText.JournalCountModifiedSingular
if stats["modified"] == 1
else MsgText.JournalCountModifiedPlural
)
msgs.append(Message(my_msg, MsgStyle.NORMAL, {"num": stats["modified"]}))
if not msgs:
msgs.append(Message(MsgText.NoEditsReceived, MsgStyle.NORMAL))
print_msgs(msgs)
def _get_predit_stats(journal: "Journal") -> dict[str, int]:
return {"count": len(journal)}
def _delete_search_results(
journal: "Journal", old_entries: list["Entry"], **kwargs
) -> None:
entries_to_delete = journal.prompt_action_entries(MsgText.DeleteEntryQuestion)
journal.entries = old_entries
if entries_to_delete:
journal.delete_entries(entries_to_delete)
journal.write()
def _change_time_search_results(
args: "Namespace",
journal: "Journal",
old_entries: list["Entry"],
no_prompt: bool = False,
**kwargs,
) -> None:
# separate entries we are not editing
# @todo if there's only 1, don't prompt
entries_to_change = journal.prompt_action_entries(MsgText.ChangeTimeEntryQuestion)
if entries_to_change:
date = time.parse(args.change_time)
journal.entries = old_entries
journal.change_date_entries(date, entries_to_change)
journal.write()
def _display_search_results(args: "Namespace", journal: "Journal", **kwargs) -> None:
if len(journal) == 0:
return
# Get export format from config file if not provided at the command line
args.export = args.export or kwargs["config"].get("display_format")
if args.tags:
print(plugins.get_exporter("tags").export(journal))
elif args.short or args.export == "short":
print(journal.pprint(short=True))
elif args.export == "pretty":
print(journal.pprint())
elif args.export:
exporter = plugins.get_exporter(args.export)
print(exporter.export(journal, args.filename))
else:
print(journal.pprint())
def _has_search_args(args: "Namespace") -> bool:
"""Looking for arguments that filter a journal"""
return any(
(
args.contains,
args.tagged,
args.excluded,
args.exclude_starred,
args.exclude_tagged,
args.end_date,
args.today_in_history,
args.month,
args.day,
args.year,
args.limit,
args.on_date,
args.starred,
args.start_date,
args.strict, # -and
)
)
def _has_action_args(args: "Namespace") -> bool:
return any(
(
args.change_time,
args.delete,
args.edit,
)
)
def _has_display_args(args: "Namespace") -> bool:
return any(
(
args.tags,
args.short,
args.export, # --format
)
)
def _has_only_tags(tag_symbols: str, args_text: str) -> bool:
return all(word[0] in tag_symbols for word in " ".join(args_text).split())

121
jrnl/editor.py Normal file
View file

@ -0,0 +1,121 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
import logging
import os
import subprocess
import sys
import tempfile
from pathlib import Path
from jrnl.exception import JrnlException
from jrnl.messages import Message
from jrnl.messages import MsgStyle
from jrnl.messages import MsgText
from jrnl.os_compat import on_windows
from jrnl.os_compat import split_args
from jrnl.output import print_msg
from jrnl.path import absolute_path
from jrnl.path import get_templates_path
def get_text_from_editor(config: dict, template: str = "") -> str:
suffix = ".jrnl"
if config["template"]:
template_filename = Path(config["template"]).name
suffix = "-" + template_filename
filehandle, tmpfile = tempfile.mkstemp(prefix="jrnl", text=True, suffix=suffix)
os.close(filehandle)
with open(tmpfile, "w", encoding="utf-8") as f:
if template:
f.write(template)
try:
subprocess.call(split_args(config["editor"]) + [tmpfile])
except FileNotFoundError:
raise JrnlException(
Message(
MsgText.EditorMisconfigured,
MsgStyle.ERROR,
{"editor_key": config["editor"]},
)
)
with open(tmpfile, "r", encoding="utf-8") as f:
raw = f.read()
os.remove(tmpfile)
if not raw:
raise JrnlException(Message(MsgText.NoTextReceived, MsgStyle.NORMAL))
return raw
def get_text_from_stdin() -> str:
print_msg(
Message(
MsgText.WritingEntryStart,
MsgStyle.TITLE,
{
"how_to_quit": (
MsgText.HowToQuitWindows if on_windows() else MsgText.HowToQuitLinux
)
},
)
)
try:
raw = sys.stdin.read()
except KeyboardInterrupt:
logging.error("Append mode: keyboard interrupt")
raise JrnlException(
Message(MsgText.KeyboardInterruptMsg, MsgStyle.ERROR_ON_NEW_LINE),
Message(MsgText.JournalNotSaved, MsgStyle.WARNING),
)
return raw
def get_template_path(template_path: str, jrnl_template_dir: str) -> str:
actual_template_path = os.path.join(jrnl_template_dir, template_path)
if not os.path.exists(actual_template_path):
logging.debug(
f"Couldn't open {actual_template_path}. "
"Treating template path like a local / abs path."
)
actual_template_path = absolute_path(template_path)
return actual_template_path
def read_template_file(template_path: str) -> str:
"""
Reads the template file given a template path in this order:
* Check $XDG_DATA_HOME/jrnl/templates/template_path.
* Check template_arg as an absolute / relative path.
If a file is found, its contents are returned as a string.
If not, a JrnlException is raised.
"""
jrnl_template_dir = get_templates_path()
actual_template_path = get_template_path(template_path, jrnl_template_dir)
try:
with open(actual_template_path, encoding="utf-8") as f:
template_data = f.read()
return template_data
except FileNotFoundError:
raise JrnlException(
Message(
MsgText.CantReadTemplate,
MsgStyle.ERROR,
{
"template_path": template_path,
"actual_template_path": actual_template_path,
"jrnl_template_dir": str(jrnl_template_dir) + os.sep,
},
)
)

Some files were not shown because too many files have changed in this diff Show more