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

Is it possible to change filetype to .md in config file? #1801

Closed
vinoff opened this issue Sep 28, 2023 · 8 comments
Closed

Is it possible to change filetype to .md in config file? #1801

vinoff opened this issue Sep 28, 2023 · 8 comments
Labels
support End user support

Comments

@vinoff
Copy link

vinoff commented Sep 28, 2023

Diagnostic output

❯ jrnl --diagnostic
jrnl: v4.0.1
Python: 3.11.5 (main, Sep  2 2023, 14:16:33) [GCC 13.2.1 20230801]
OS: Linux 6.5.5-arch1-1

What are you trying to do?

By default, it seems like new diary/journal entries are saved in .txt. I am using an external editor. Is there any config parameter for the jrnl.yaml that changes the filetype from .txt to .md (markdown)?

What have you tried?

I tried searching the issues but couldnt find anything.

Other Information

No response

@vinoff vinoff added 🆕 New! support End user support labels Sep 28, 2023
@VirbickasGytautas

This comment was marked as spam.

@vinoff
Copy link
Author

vinoff commented Sep 28, 2023

Oh, thank you! I didn´t see file_extension in the user-guide. I searched for that but got no results:

https://jrnl.sh/en/stable/search.html?q=file_extension

@vinoff
Copy link
Author

vinoff commented Sep 28, 2023

file_extension: .md this does not work. Was I just chatGPTd?

@VirbickasGytautas

This comment was marked as off-topic.

@micahellison
Copy link
Member

By default, it seems like new diary/journal entries are saved in .txt. I am using an external editor. Is there any config parameter for the jrnl.yaml that changes the filetype from .txt to .md (markdown)?

Hi @vinoff, it is possible to do what you want through the template config key. You create a template file with the extension that you prefer, then add the template key to your YAML file with the path. Even if it's just a blank file, jrnl will use the template's extension as the extension of the temporary file you're editing.

I'm closing this as resolved, though if you run into any trouble with this approach, feel free to respond here.

@VirbickasGytautas, I am hiding the incorrect answers you posted. Please don't use chatbots to answer questions here.

@micahellison micahellison removed the 🆕 New! label Sep 28, 2023
@vinoff
Copy link
Author

vinoff commented Sep 28, 2023

@micahellison, thank you for the reply.

I do that and it is not working, it seems. Here is my config:

colors:
  body: none
  date: none
  tags: none
  title: none
default_hour: 9
default_minute: 0
editor: neovide --nofork --multigrid
encrypt: false
highlight: true
indent_character: "|"
journals:
  default: /home/vinoff/docs/journal/
linewrap: 80
tagsymbols: "#@"
template: /home/vinoff/docs/journal/template.md
timeformat: "%Y-%m-%d %H:%M"
version: v4.0.1

As you see, the template has the .md extension. When I do jrnl, it does open an .md file with the appropriate syntax. However, when saved, it saves as .txt.

Can you reproduce?

The issue is that I wanted it saved as .md, not as .txt.

@micahellison
Copy link
Member

Hi @vinoff, apologies, I misunderstood the question (now I feel like a chatbot!!!).

When it comes to actual data storage, the file extension can be set to anything for a single-file journal but not a folder journal, which is the type of journal you're using.

We do have an open issue to allow you to do change the extension for a folder journal (#1289), though I'm not sure if the current contributor is actively working on it still. However, you can follow that issue if you'd like to know when you can use this in the future.

@vinoff
Copy link
Author

vinoff commented Sep 28, 2023

Ah, I see. Thank you @micahellison!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support End user support
Projects
None yet
Development

No branches or pull requests

3 participants