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

show title instead of filename #2309

Closed
4 tasks done
Hate9 opened this issue May 29, 2024 · 8 comments
Closed
4 tasks done

show title instead of filename #2309

Hate9 opened this issue May 29, 2024 · 8 comments

Comments

@Hate9
Copy link

Hate9 commented May 29, 2024

⚠️ This issue respects the following points: ⚠️

  • This is a enhancement/feature request. Not a bug or question.
  • The topic is not already reported at Issues. (I've searched it).
  • Markor is up to date. See Releases for the latest version. Updates are available from F-Droid and GitHub.
  • The wanted feature/enhancement is not present in the latest development version (git master). (Please download and try the test version of Markor, named Marder. Don't worry; Markor and Marder appear as completely separate applications. You can install both side-by-side, and Markor's settings are not touched. If your desired feature is present, you don't need to open this issue. The change will be part of the next Markor update.)

Description

I would love the ability to show the title from a markdown file (that is, the content of the first h1) instead of the filename, by default (falling-back to filename if no title is found, of course).

Information

Android version: 11
Device: Unihertz Jelly 2
App Version: 2.12.1

Source

F-Droid

Format / File type

Markdown

Additional info / Log

No response

@harshad1
Copy link
Collaborator

harshad1 commented Jun 1, 2024

An idea if someone wants to implement this in the future:

Don't change names in the file manager. Instead add a template key for the file subtext which pulls the title from the file.

@gsantner
Copy link
Owner

gsantner commented Jun 1, 2024 via email

@Hate9
Copy link
Author

Hate9 commented Jun 1, 2024

@gsantner I mean, you can always cache it to save on performance - and I wouldn't suggest it as a default-on feature, but it would mean much better compatibility with apps like Obsidian and Zettlr.

@harshad1
Copy link
Collaborator

harshad1 commented Jun 1, 2024

Orchestrating this kind of cache is a huge pain. Android timestamps are notoriously untrustworthy. We had to jump through quite a few hoops to get file IO working reliably.

@gsantner
Copy link
Owner

Closing. You need to know that a specific file having a specific title stored in it's content is possible, but not all formats have such.

What is also a title, works in every file management application and not is optional: The file name. Suggestion is to use a somewhat meaningful proper file name. This helps you not only with Markor to find things, but any application, be it some Markdown specific software or not.

@ehula
Copy link

ehula commented Oct 11, 2024

I don't know if I should be commenting on a closed issue, but I would like to register my desire for this option.

I recently started using nb on my laptop, and am syncthinging the files to my Android device. In nb the files are named 'datetime.mb', but are listed with the H1 heading, if present.

Currently in Markor, I just see a bunch of files like this: 20241011094325.md. Not very usable.

If this was an option, I would gladly take any performance hit to extract the headings, or they could be cached as suggested.

Regarding the possibility of duplicated "names", yes this is a potential "problem", but the files still retain their underlying datetime filenames, so there is no problem at the filesystem level. If I have two files with the same heading, I can either change the headings, or maybe there is a reason for it, and having the files sorted by filename (datetime in my case) would display the latest version with the duplicated heading first. Maybe this would be desired by the user. Either way, it would always be something the user could change to suit his needs.

What about an option to use "Heading 1" in the "file description format"? With a new line character like this:

20241011094325.mb

This is the text that is stored as Heading 1
2024-10-11, 9:43 a.m.

or better yet:

This is the text that is stored as Heading 1

20241011094325.mb
2024-10-11, 9:43 a.m.

@gsantner
Copy link
Owner

gsantner commented Oct 11, 2024

Choosing a meaningful filename helps. / instructing your other software to create meaningful filenames.

Not only with Markor, but any software - especially filrmanagers.

Believing that some words somewhere in a file that might be a textfile of specific format form the title VS giving the file a meaningful filename.

Markor is also not just Markdown. And not every format has such a way with title in frontmatter.

Reading files is performance critical, guessing title from hundreds of files is not a good idea.

@ehula
Copy link

ehula commented Oct 11, 2024

Thanks for taking the time to respond. I understand your response as a developer wanting to create a tool that can work like a Swiss Army Knife on many different filetypes. There is always tension when introducing new features.

I am glad you heard my request. Maybe one day you will find a good solution. I won't try to convince you to implement this change, only to inform you of my use case, and maybe the use case of others.

Regarding meaningful filenames, that of course is subjective. For me, "datetime.md" is a great choice and is meaningful.

I will push back slightly though. It's not "some words somewhere in a file". I am proposing that there be an option to display the file as noted above (Heading1; Filename; Date and Time) only for .md files with a Heading1 in the first line. Otherwise, display the name as it is currently. The Heading isn't some words somewhere, but very deliberately chosen words for a specific purpose.

I understand the performance consideration. I would accept a performance hit, but I can understand that as a developer that may not sit well with you.

I am relatively new to your app and am very much enjoying it so far. Thank you for a great app and keep up the good work.

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

No branches or pull requests

4 participants