[File] Adding text/gemtext to file

file at ploum.eu file at ploum.eu
Fri Feb 28 16:46:43 UTC 2025


Le 25 fév 28 11:21, Christos Zoulas a écrit :
>
>
>> On Feb 28, 2025, at 11:11 AM, file at ploum.eu wrote:
>>
>> Le 25 fév 28 09:55, Christos Zoulas a écrit :
>>>
>>>
>>>>>
>>>>> There is no magic number for gemtext, or any required structure that
>>>>> file(1) can rely upon to identify the format.
>>>>>
>>>>
>>>> Is there a way to solve that and create one?
>>>>
>>>> (my question might be dumb, I’ve no knowledge about how all of that is working)
>>>>
>>>
>>> The creators of the format could have required an Identifying string for all gemtext files,
>>> for example every gemtext file should start with:
>>>
>>> -GemText-
>>>
>>> or something, but they did not do that because they wanted the format to resemble regular
>>> text and to not have anything special about it.
>>>
>>> christos
>>
>> Is there a list about all those Identifying strings somewhere? That
>> would help me understand when a gemtext file is identified as something
>> else.
>
>They are all in: https://github.com/file/file/tree/master/magic/Magdir

Thanks a lot. I’ve been able to identify the problem: "file" consider 
that any text file starting with the string "Article" is message/news 
type. This might be, IMHO, a bit too restrictive as I could see many 
cases where a text file would start with "Article" (which is a common 
word, unlike Xref: or Path: ). 

In my case, a wikipedia->gemini platform was returning searches results 
with the first line being "Articles containing your query". 

So this might be considered as a "bug" in the sense that file should 
probably return text/plain, not message/news. I don’t know if there’s 
something that could be done.

I’m also realizing that, unless I missed it, file doesn’t handle text 
formats like text/markdown so it makes little sense to support 
text/gemtext.


-- 
Ploum - Lionel Dricot

Blog: https://www.ploum.net
Bikepunk: https://bikepunk.fr/




More information about the File mailing list