Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix configuration slashes and indentation in advanced usage documentation #852

Merged
merged 1 commit into from
Feb 22, 2020

Conversation

aallbrig
Copy link

@aallbrig aallbrig commented Feb 16, 2020

Update Advanced Usage documentation

Changes

  1. Update \ to / from the first code snippet from Multiple journal files section.

    I had copy and pasted this into my ~/.config/jrnl/jrnl.yaml and found that journal files were created in my current working directory as ~\work.txt and ~\journal.txt.

    Screenshot 2020-02-16 10 41 37

    Manual test

    # Confirm the issue from current version of docs
    cd /tmp
    cat << HERE > ~/.config/jrnl/jrnl.yaml
    journals:
      default: ~\test-journal.txt
      work: ~\test-work.txt
    HERE
    ls *.txt
    
    jrnl at 3:30pm: Test default journal
    jrnl work at 4:30pm: Test work journal
    ls *.txt
    echo '*.txt files should exist in your current directory (which confirms the issue!)'
    rm -f *.txt
    
    # Confirm the doc changes work as intended
    rm -f ~/test-journal.txt ~/test-work.txt
    
    cat << HERE > ~/.config/jrnl/jrnl.yaml
    journals:
      default: ~/test-journal.txt
      work: ~/test-work.txt
    HERE
    
    jrnl at 3:30pm: Test default journal
    jrnl work at 4:30pm: Test work journal
    
    ls *.txt
    echo 'No *.txt should exist in your current directory'
  2. Indent code snippet from override defaults per journal example from Multiple journal files section.

    Taking the snippet as-is, I got TypeError: argument of type 'NoneType' is not iterable errors. However; updating the YAML to have an indents resolved the issue.

    Screenshot 2020-02-16 10 44 24

    Manual test

    # Confirm the issue from current version of docs
    cd /tmp
    cat << HERE > ~/.config/jrnl/jrnl.yaml
    journals:
    default: ~/test-journal.txt
    work:
      journal: ~/test-work.txt
      encrypt: true
    food: ~/test-food.txt
    HERE
    
    # Errors will to occur when trying to write journal entries
    jrnl at 3:30pm: Test default journal
    jrnl work at 4:30pm: Test work journal
    jrnl food at 5:30pm: Test food journal
    
    jrnl -n 1
    jrnl work -n 1
    jrnl food -n 1
    
    
    # Confirm the doc changes work as intended
    cat << HERE > ~/.config/jrnl/jrnl.yaml
    journals:
      default: ~/test-journal.txt
      work:
        journal: ~/test-work.txt
        encrypt: true
      food: ~/test-food.txt
    HERE
    
    jrnl at 3:30pm: Test default journal
    jrnl work at 4:30pm: Test work journal
    jrnl food at 5:30pm: Test food journal
    
    jrnl -n 1
    jrnl work -n 1
    jrnl food -n 1

Documentation Before Changes

Screenshot 2020-02-16 10 32 12

Documentation After Changes

Screenshot 2020-02-16 10 33 14

My motivation for these changes are to improve the advanced usage documentation.

Checklist

  • The code change is tested and works locally.
  • Tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?

Copy link
Member

@micahellison micahellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change. I was worried about Windows users, but I tested out the ~/ format on Windows and it works just fine.

@micahellison micahellison added the documentation Improvements or additions to documentation label Feb 22, 2020
@micahellison micahellison changed the title Formatting for Advanced Usage documentation Fix configuration slashes and indentation in advanced usage documentation Feb 22, 2020
@micahellison micahellison merged commit a66c51b into jrnl-org:master Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants