Skip to content

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

Open
@ezimuel

Description

@ezimuel

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 #1717) but I don't have the HTML page name.
I'm using the 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
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:

{
    "source_location": {
        "file": "getting-started.asciidoc",
        "block": "getting-started-index",
        "line": 253,
    },
    "digest":"3f3b3e207f79303ce6f86e03e928e062",
}

Thoughts?

CC @elastic/es-clients-core

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferenhancementSomething we'd like to improveexamplesExamples, Snippets, Code Blocks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions