elastic / elastic-otel-java

Apache License 2.0
8 stars 7 forks source link

Convert docs to mdx #271

Closed bmorelli25 closed 3 weeks ago

bmorelli25 commented 1 month ago

Summary

This PR converts the existing asciidoc documentation to MDX. .mdx is the file format our new documentation system uses. This PR also deletes configuration.asciidoc.ftl and replaces it with configuration.mdx.ftl.

My team will help structure and improve content at a later date. This is part one of https://github.com/elastic/obs-docs-team/issues/231.

Update the config docs

To update the configure.mdx file, ensure Docker is running and run:

./gradlew clean :custom:test --tests "*ConfigurationExporterTest" -Pelastic.otel.overwrite.config.docs=true --debug

Preview this PR

We do not currently have a way to generate PR previews for this content (yet). Here's what the auto-generated config page looks like when I build this PR locally:

Screenshot 2024-05-30 at 5 06 39 PM

Build this PR locally

You can build this PR locally by checking out elastic/docs.elastic.co and this branch of elastic/observability-docs: https://github.com/elastic/observability-docs/pull/3915.

In elastic/docs.elastic.co, update your content-dev.js file to the following:

content-dev.js

const content = {
  sources: [
    {
      type: 'file',
      location: '../../observability-docs/docs/en/apm-agents',
    },
    {
      type: 'file',
      location: '../../elastic-otel-java/docs',
    },
  ],
  nav: {
    default: 'obs',
    structure: [
      {
        collection: 'Observability',
        navs: [
          'obs',
          {
            group: 'Java',
            pageId: 'apmAgentOverview',
            navs: [
              'elastic-otel-java',
              'elastic-apm-java'
            ],
          },
        ],
      },
    ],
  },
}

module.exports = { content }

Run nvm use && yarn && yarn init-docs && yarn dev.

Related