doc icon indicating copy to clipboard operation
doc copied to clipboard

Remove the vim mode line.

Open antoniogamiz opened this issue 6 years ago • 15 comments

Problem

This issue comes from https://github.com/perl6/Documentable/issues/51, it's the same here.

Solution

~Add the line where missing~ Remove the line from every file.

antoniogamiz avatar Oct 15 '19 18:10 antoniogamiz

Hum, I'm not sure it's that useful... I'm using Comma now...

JJ avatar Oct 15 '19 18:10 JJ

I'd actually go with globally removing the vim modelines, there are other ways of determining the filetype and not everyone uses vim.

jonathanstowe avatar Oct 15 '19 18:10 jonathanstowe

@jonathanstowe I'm not really against removing these lines, but if memory serves me right, some editors recognizes the format to determine filetype. So, it could be useful sometimes.

Removal would make more sense when we move to .rakudoc.

vrurg avatar Oct 15 '19 22:10 vrurg

I'd actually go with globally removing the vim modelines, there are other ways of determining the filetype and not everyone uses vim.

Please.

Vim users should just configure their vim so that it applies the correct style for the file type, which would be a polite and simple solution that works for every file for them, instead of adding config lines in every single file which are redundant for a great chunk of other users.

Altai-man avatar Oct 17 '19 09:10 Altai-man

The problem is that GitHub only recognises Pod6 files if you add the vim mode line.

antoniogamiz avatar Oct 18 '19 16:10 antoniogamiz

Are sure it's that?

JJ avatar Oct 18 '19 19:10 JJ

Check this: (it's the same file, I only have added that line)

You can also check perl6/doc/doc, all files not rendering correctly do not have that line at the bottom.

antoniogamiz avatar Oct 19 '19 07:10 antoniogamiz

Eugh

I wonder if it actually needs to be a vim modeline or just something that has some of the features of one. It's worth knowing this additionally because it will need to be addressed as part of the rename.

jonathanstowe avatar Oct 19 '19 08:10 jonathanstowe

But I think the right way to address this is at the @github level. I'll try and find the repo for the renderer, and raise an issue.

JJ avatar Oct 19 '19 08:10 JJ

Support for Pod 6 was added here https://github.com/github/linguist/pull/4083/files.

@Tyil maybe you have an idea why it would work this way? It's really weird, my understanding is that .pod6 files should just work.

Currently: https://github.com/github/linguist/blob/b4a068abf3b9ee66d9413bab5d4dc16ef7c9a71a/lib/linguist/languages.yml#L3908-L3918

AlexDaniel avatar Oct 19 '19 08:10 AlexDaniel

Ah, I see. I uploaded these files as gists and peeked at them through github api:

So there are two problems with it:

  1. RakuDoc renderer seems to be broken, at least for that particular file
  2. Vim mode line overrides correct language detection. Does it mean that the right vim mode line should mention rakudoc, or does it mean that it shouldn't override the correct detection?

Anyway, this should be fixed in linguist.

AlexDaniel avatar Oct 19 '19 09:10 AlexDaniel

The problem is that GitHub only recognises Pod6 files if you add the vim mode line

~This is a github bug then. I believe we should investigate why https://github.com/github/linguist does that (https://github.com/github/linguist/blob/master/lib/linguist/languages.yml#L3915 ?) and send a patch.~

Ignore me, did not see latest comments after a power outage. But I do agree it should be addressed at github level.

Altai-man avatar Oct 19 '19 10:10 Altai-man

@AlexDaniel linguist is used to find out the language, but a different thing is used for rendering pages. I've added a comment to the issue. The examples and heuristcs added to linguist do not have anything to do with the modeline, so the error must be somewhere else. However, the issue has been sitting there for a few months and it's not being addressed...

JJ avatar Oct 19 '19 15:10 JJ

Looking at the API results, if the vim mode is present, it's consider a Raku file. If not, it's considering a pod6 file. This is correct:

The files are all named pod6, so the type should default to pod6. With the vim mode present, it's showing as Raku (and the ft line includes ft=perl6).

The rendering for both files appears correct (pod syntax is highlighted in the gists I tried this in) as of now.

So, we should be clear to remove the mode line in the repository.

coke avatar May 08 '22 19:05 coke

Also, add an author test to avoid them being inadvertently added back in.

coke avatar May 08 '22 19:05 coke