Skip to content

Extend aliases and add .mdoc as a supported Roff extension#4232

Merged
pchaigno merged 3 commits intomasterfrom
mdoc-extension
Aug 17, 2018
Merged

Extend aliases and add .mdoc as a supported Roff extension#4232
pchaigno merged 3 commits intomasterfrom
mdoc-extension

Conversation

@Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented Aug 16, 2018

This PR adds .mdoc to GitHub's list of Roff extensions, and adds several aliases to make tagging fenced code-blocks easier.

Description

The .mdoc extension was brought to my attention by github/markup#1196, and I was surprised it was missing. In-the-world usage is in the neighbourhood of 9,374 results. The sample being added here is taken from libzip, released under MIT.

In addition, I've added several commonly-used synonyms for Roff to facilitate the tagging of fenced code-blocks on GitHub. There's a good chance users might use ~~~man or ~~~groff without knowing the correct name/spelling.

I've also replaced .man with .roff as the language's primary extension. Roff doesn't have a canonical file extension, but if it did, .roff would make more sense than .man. =)

Checklist:

/cc @jordemort

Copy link
Contributor

@pchaigno pchaigno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pchaigno pchaigno merged commit 55bf480 into master Aug 17, 2018
@pchaigno pchaigno deleted the mdoc-extension branch August 17, 2018 09:23
@Alhadis Alhadis self-assigned this Aug 17, 2018
@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 17, 2018

I wonder why GitHub allows self-assignment to merged/closed pull-requests...

Moreover, I wonder why the hell I'm noticing this, let alone writing about it.

@RalphCorderoy
Copy link

If roff has a canonical file extension then I'd say it's .tr originating historically to indicate troff-compatible input versus troff's predecessors.

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 28, 2018

@RalphCorderoy Yes, but unfortunately, the .tr extension has very little usage in-the-wild; and that's a binding factor when determining which extensions we can and can't register on GitHub. =)

My point was that there isn't a canonical extension, but .man probably isn't the best compromise... 😕

@RalphCorderoy
Copy link

So it's a land-grab of file extension, first takes all? Or more than one thing can say .foo might be theirs and they all get to have a closer look? For finding man pages, a search for ".SH NAME" and/or ".SH SYNOPSIS" would seem suitable, but I had no luck getting GitHub to want both words on the same line, in that order, with only mandatory white-space separating them.

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 28, 2018

See CONTRIBUTING.md. =) It pretty much explains the prerequisites; and yes, to some extent, I'm afraid it is largely down to a popularity contest, so to speak...

Think of it this way: GitHub certainly don't want to be indexing literally every single file-extension that has less than a hundred uses, and that's where they'd find themselves eventually. If every user felt their hobbyist side-project-programming-languages were eligible for registration on GitHub, think of the mess we'd find ourselves in. 😉 It'd be an endless deluge of conflicting extensions and misclassifications as the Bayesian classifier struggles to cope with 430 .gs extensions that were used about 10-30 times on GitHub.

I'm not site staff, so I don't claim to know the exact reasoning behind their prerequisites... but if I were in their shoes, I'd be doing the same thing. A line has to be drawn somewhere.

@pchaigno
Copy link
Contributor

So it's a land-grab of file extension, first takes all?

To complete @Alhadis's answer, several languages can be associated to the same extension of course. Even if we associated extension .stuff only to language X in the past, language Y can be associated to .stuff at a later time. Both languages will have to meet the prerequisite @Alhadis mentioned of course.

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 28, 2018

I feel legitimately guilty right now.

Poor @RalphCorderoy is left thinking .tr isn't important or popular enough to become a first-class citizen, and here I am preparing a PR to get FIglet fonts added to GitHub. 😅

And, uh, 3-4 other font-specific text formats I smashed out grammars for.

I should be designing fonts instead of ruining @lildude's week...

@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants