elastic / elastic/docs

Add block id asciidoc reference for code example in alternative_report.json

Open
#1,721 2 comments 0 reactions 0 assignees View on GitHub
defer enhancement examples
Dominant language
Ruby
Stars
265
Forks
347
Avg merge
3d 15h
Merged PRs (30d)
2

Description

I'm building a report to track the code examples for each client repositories (see https://github.com/elastic/clients-team/pull/114). I would like to have the link to the Elastic documentation where the code example is available. Now, we have the anchor link with the digest (thanks to https://github.com/elastic/docs/pull/1717) but I don't have the HTML page name.
I'm using the [alternatives_report.json](https://raw.githubusercontent.com/elastic/built-docs/master/raw/en/elasticsearch/reference/master/alternatives_report.json) as source and we have only the asciidoc file for each code example. We need also the asciidoc **block id** to find out the HTML page name.

For instance, this code example [getting-started-index.html#3f3b3e207f79303ce6f86e03e928e062](https://www.elastic.co/guide/en/elasticsearch/reference/master/getting-started-index.html#3f3b3e207f79303ce6f86e03e928e062)
is located in `getting-started.asciidoc` but the URL of the HTML page is `getting-started-index.html`. In order to get this URL I need the **`[[getting-started-index]]`** block id in the `alternative_report.json` for the code example. Can we add this block name in the `source_location`?

For instance, something like this:
```json
{
"source_location": {
"file": "getting-started.asciidoc",
"block": "getting-started-index",
"line": 253,
},
"digest":"3f3b3e207f79303ce6f86e03e928e062",
}
```

Thoughts?

CC @elastic/es-clients-core

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.