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

Auto add `Content-Type:` header when creating new zim/wikitext file #2456

Closed tenzap closed 4 weeks ago

tenzap commented 1 month ago

⚠️ This issue respects the following points: ⚠️

Description

When creating a new file of format zim/wikitext, the default model is empty file.

It should at least contain this first line: Content-Type: text/x-zim-wiki Otherwise, when opening the notepad containing that file in zim-desktop software, the file will not be displayed in the desktop app.

See: https://zim-wiki.org/manual/Help/Importing_external_files.html

 Finally zim pages that have a ".txt" extension must start with a header line that identifies the content as zim wiki formatted text, optionally followed by more header lines and separated from the main content by an empty line. Like this:

Content-Type: text/x-zim-wiki

=== First heading ===
some text

Without the heading line, ".txt" files are regarded as text file attachments. 

2 possibles ways to achieve this:

Information

Android version: 12 Device: Xiaomi Redmi note 9s App Version: 2.12.5

Source

F-Droid

Format / File type

Wikitext, Zim

Additional info / Log

-
gsantner commented 1 month ago

The template can be adapted by simple text changes in the git repository.

A merge request is welcome, a easy thing for somebody who wants to contribute (first time also).

harshad1 commented 4 weeks ago

We already gave a built in template for this:

Screenshot_20241024-191735

tenzap commented 4 weeks ago

I think you didn't understand what I mean.

What is requested here is that any creation of a file with type wikitext/zim must have a first line with correct content-type header. This is the way the format is (see URL in original post) and it should not be left to the user to figure that out.

You can implement this in whichever way you prefer, but for the end user it is not straightforward that empty file template will not contain the mandatory header. And it shouldn't be required to select the zim template either. That is somehow too much of app technical internals. By the way the zim template is not completely empty since it contains page name and creation date also when displayed.

gsantner commented 4 weeks ago

Markor is not just Zim but many formats. You have the free choice to apply whatever text you wish.

If you chose empy text, you get exactly that - empty text.

Maybe Markor is not the right software for you if you expect a pure Zim client, or checking the right box that fits your needs is too much for you.

tenzap commented 4 weeks ago

I was hoping to make life easier for the future users like me who synchronize part of their notebook with zim on desktop. I know what I have to be careful of for new files but new users without any technical background may not, and may face the same issue. The chance that they find this conversation is low.

I like your app because it supports many formats and is on fdroid and without trackers. I haven't found another Android app that supports wikitext format anyway. Do you by chance have one in mind?

gsantner commented 4 weeks ago

I don't use Zim, so don't know much about others on Android.

Because Markor supports many formats, that is the difference to something for just one - you have to make the choice for a speicifc one at those few places.

Also be said, Zim has low contribution interest at Markor. Most only are using (and want to contribute to) Markdown & todo.txt.