elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.48k stars 8.05k forks source link

Create kibana-devtools syntax file for linguist (and github) #127573

Open matschaffer opened 2 years ago

matschaffer commented 2 years ago

Describe the feature:

https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting has details on highlighting language support for github.

It uses https://github.com/github/linguist/blob/master/lib/linguist/languages.yml under the hood which we could contribute too.

If we added a Kibana Dev Tools entry, we could enjoy kibana-appropriate highlighting for dev tools snippets.

(see markdown source for language marker)

POST .monitoring-*/_search
{
  "size": 0,
  "query": {
    "range": {
      "timestamp": {
        "gte": "now-1h",
        "lte": "now"
      }
    }
  },
  "aggs": {
    "clusters": {
      "terms": {
        "field": "cluster_uuid",
        "size": 1000
      }
    }
  }
}

That rendered like this:

Screen Shot 2022-03-14 at 14 06 31

Describe a specific use case for the feature:

I was writing documentation today and came across places I wanted to include dev tools snippets into markdown.

But I couldn't find a format that highlighed nicely. I tried HTTP and json but both have errors.

POST .monitoring-*/_search
{
  "size": 0,
  "query": {
    "range": {
      "timestamp": {
        "gte": "now-1h",
        "lte": "now"
      }
    }
  },
  "aggs": {
    "clusters": {
      "terms": {
        "field": "cluster_uuid",
        "size": 1000
      }
    }
  }
}
POST .monitoring-*/_search
{
  "size": 0,
  "query": {
    "range": {
      "timestamp": {
        "gte": "now-1h",
        "lte": "now"
      }
    }
  },
  "aggs": {
    "clusters": {
      "terms": {
        "field": "cluster_uuid",
        "size": 1000
      }
    }
  }
}
elasticmachine commented 2 years ago

Pinging @elastic/platform-deployment-management (Team:Deployment Management)