hougesen / mdsf

Format markdown code blocks using your favorite code formatters.
MIT License
12 stars 0 forks source link

Please consider creating an "awesome list" with the formatters you found #490

Open ccoVeille opened 2 weeks ago

ccoVeille commented 2 weeks ago

I'm impressed by the amount of formatter you support, but also that exists.

You are supporting almost 200 formatters.

I'm looking for one for http for ages and you found it.

Creating an awesome list providing a list of format would be definitely helpful.

Maybe one already exists, and if so please share it here.

hougesen commented 3 days ago

This is a reply to a mix of this issue and https://github.com/hougesen/mdsf/pull/480#discussion_r1797401647.

I completely agree that the documentation is rather lacking.

The original list of tool <-> language support was removed when the config was refactored to support custom languages, since it was automatically generated from the config's json schema. After that I simply forgot to create a new way to manage the linkings.

Lately I have been thinking about reworking how the supported tools are defined in a way that would make it easier for non-Rust developers to contribute new tools.

My current plan is to move all tooling to json files (I am open to other formats), and then generating the Rust code based on the file.

This would also allow us to add more metadata to the files.

// biome.json
{
  "name": "biome",
  "binary": "biome",
  "npm": "@biomejs/biome",
  "description": "A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.",
  "website": "https://github.com/biomejs/biome",
  "categories": ["formatter", "linter"],
  "languages": ["javascript", "typescript", "json", "html", "css"],
  "commands": {
    "format": ["format", "--write", "$PATH"],
    "lint": ["lint", "--write", "$PATH"],
    "check": ["check", "--write", "$PATH"]
  }
}

The file above would then be generated into something like this:

// biome.rs

fn command_format(path: &std::path::Path) {
    // Do something
}

fn command_check(path: &std::path::Path) {
    // Do something
}

fn command_check(path: &std::path::Path) {
    // Do something
}

I am not aware of any existing awesome-lists that are still maintained. I find new tools to support by periodically checking which tools other projects like Mason and lspconfig support.

ccoVeille commented 3 days ago

I am not aware of any existing awesome-lists that are still maintained. I find new tools to support by periodically checking which tools other projects like Mason and lspconfig support.

That's why I suggested you could create your own awesome list

ccoVeille commented 3 days ago

My current plan is to move all tooling to json files (I am open to other formats), and then generating the Rust code based on the file.

I would like to suggest using YAML then.

YAML also natively supports comments, while json requires json5 extension

This format is way easier to maintain when there are git conflicts

hougesen commented 11 hours ago

I would like to suggest using YAML then.

So I was playing around with using yaml, but ended up staying with json since I ran into issues with my serializer serializing multiline strings in a way that broke my tests lol