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

Support configuration aliases #618

Closed
ccoVeille opened this issue Jan 20, 2025 · 5 comments · Fixed by #627
Closed

Support configuration aliases #618

ccoVeille opened this issue Jan 20, 2025 · 5 comments · Fixed by #627

Comments

@ccoVeille
Copy link
Contributor

I would like to be able to comfugue something like this

Language:
bash: shfmt
shell: shfmt
console: shfmt
sh: shfmt

This is pseudo code, but my problem is that I have to write the same line again and again.

I would appreciate to have aliases and if possible have them preconfigured

@hougesen
Copy link
Owner

Something like adding the following to the config?

{
  "language_aliases": {
    "shell": ["bash", "shell", "console", "sh"]
  }
}

@ccoVeille
Copy link
Contributor Author

Yes, also you have something equivalent here

"languages": ["bash", "shell"]

I mean, you don't support the one that are available via linguist

https://github.com/github-linguist/linguist/blob/be39d09a3789d068afb33533f285df02d8e9c367/lib/linguist/languages.yml#L6813-L6818

I mean some are classic code block identifier, and I'm not talking only about shell/bash

https://github.com/search?q=language:markdown%20%22```javascript%22&type=code
https://github.com/search?q=language:markdown%20%22```js%22&type=code

So yes aliases might help, but your code (in the plugin.json files) could/should consider some of them by default.

Maybe I'm simply wrong, and I don't get what the languages node states for in the plugin.json files

@hougesen
Copy link
Owner

Aaah, I think we are talking about two different things 😅

I thought you were asking for a way to create aliases for code block languages when defining your mdsf.json config file.

The languages field in plugin.json is only used for the readme documentation. It is not taken into account when running the formatter.

@ccoVeille
Copy link
Contributor Author

Aaah, I think we are talking about two different things 😅

Thanks for confirming

The languages field in plugin.json is only used for the readme documentation. It is not taken into account when running the formatter.

I'm sorry if I brought confusion by talking about languages node in plugin.json files

I thought you were asking for a way to create aliases for code block languages when defining your mdsf.json config file.

It's exacly what I was talking about. I would like to get this implemented

#618 (comment)

@hougesen
Copy link
Owner

Alright, I like the idea 🚀

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

Successfully merging a pull request may close this issue.

2 participants