gsantner / markor

Text editor - Notes & ToDo (for Android) - Markdown, todo.txt, plaintext, math, ..
https://github.com/gsantner/markor/discussions/2269
Other
3.85k stars 369 forks source link

Cannot change the template/snippet folder #2369

Closed joebetsill closed 3 months ago

joebetsill commented 3 months ago

⚠️ This issue respects the following points: ⚠️

Description

When I go to Settings> Other> Snippet/Template Directory:

  1. The directory shown is always /whatever/path/the/default/notebook/is/set/to/.app/snippets, even though there is no .app/snippets folder at that location. Not even on a fresh install, when it points to the Documents/markor/.app/snippets folder.
  2. The snippets/templates folder cannot be changed. No matter what I select with the folder selection prompt, the folder is still set to the original one, as described in step 1.

As a side note: I'm not sure that I grasp how snippets and templates are expected to work, and maybe that's part of my problem. I am trying to select my Obsidian template folder as the Markor template folder, with the idea that my Obsidian templates would show up in the new file prompt under templates in Markor.

Edit: I made a backup of my settings and checked the resulting file, and it shows the correct (what I previously selected) folder location for pref_key__snippet_directory_path.

Steps to reproduce

  1. See the description field.

Information

Android version: 14 Device: Pixel 8 Pro App Version: 2.12.4 (153)

Source

GitHub Releases

Format / File type

Not specific

Additional info / Log

-
gsantner commented 3 months ago

Not sure what Obsidian templates are, but it's something on it's own. Don't expect Markor to be Obsidian specific client.

For the rest, can you try creating the folders with .app/snippets yourself and check if it works then?

joebetsill commented 3 months ago

Obsidian templates are just markdown files. I just want to use the same folder for both.

Does the template/snippet folder have to point to something that terminates in .app/snippets?

On Fri, Jul 26, 2024, 12:39 Gregor Santner @.***> wrote:

Not sure what Obsidian templates are, but it's something on it's own. Don't expect Markor to be Obsidian specific client.

For the rest, can you try creating the folders with .app/snippets yourself and check if it works then?

— Reply to this email directly, view it on GitHub https://github.com/gsantner/markor/issues/2369#issuecomment-2253114692, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYBUJ5ZUSYNJSYTBL2OC2DZOJ3TPAVCNFSM6AAAAABLQZAWP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJTGEYTINRZGI . You are receiving this because you authored the thread.Message ID: @.***>

gsantner commented 3 months ago

Normal text files also here, no special things. The snippets should then show up listed by their filenames

joebetsill commented 3 months ago

For the rest, can you try creating the folders with .app/snippets yourself and check if it works then?

This does work. Markdown files placed in the manually created .app/snippets folder show up in the templates drop-down in the new file prompt.

Do you think allowing to choose any folder for template and snippets could be added, instead of making a hard requirement for it to terminate in .app/snippets?

joebetsill commented 3 months ago

It seems like line 130 of /model/AppSettings.java incorrectly references pref_key__quicknote_filepath and since that's a file, it always fails the subsequent check to ensure the snippets directory is a directory, which then sets it back to default.