docs-v2/.github/copilot-instructions.md

5.5 KiB

GitHub Copilot Instructions for InfluxData Documentation

Purpose and Scope

GitHub Copilot should help document InfluxData products by creating clear, accurate technical content with proper code examples, frontmatter, and formatting.

Documentation Structure

Style Guidelines

  • Follow Google Developer Documentation style guidelines
  • For API references, follow YouTube Data API style
  • Use semantic line feeds (one sentence per line)
  • Use only h2-h6 headings in content (h1 comes from frontmatter title properties)
  • Use sentence case for headings
  • Use GitHub callout syntax
  • Image naming: project/version-context-description.png
  • Use appropriate product names and versions consistently
  • Follow InfluxData vocabulary guidelines

Markdown and Shortcodes

  • Include proper frontmatter for each page:

    title: # Page title (h1)
    seotitle: # SEO title
    list_title: # Title for article lists
    description: # SEO description
    menu:
      product_version:
    weight: # Page order (1-99, 101-199, etc.)
    
  • Use provided shortcodes correctly:

    • Notes/warnings: {{% note %}}, {{% warn %}}
    • Product-specific: {{% enterprise %}}, {{% cloud %}}
    • Tabbed content: {{< tabs-wrapper >}}, {{% tabs %}}, {{% tab-content %}}
    • Version links: {{< latest >}}, {{< latest-patch >}}
    • API endpoints: {{< api-endpoint >}}
    • Required elements: {{< req >}}
    • Navigation: {{< page-nav >}}
    • Diagrams: {{< diagram >}}, {{< filesystem-diagram >}}

Code Examples and Testing

  • Provide complete, working examples with proper testing annotations:
print("Hello, world!")
Hello, world!
  • CLI command example:
influx query 'from(bucket:"example") |> range(start:-1h)'
Table: keys: [_start, _stop, _field, _measurement]
           _start:time                      _stop:time           _field:string     _measurement:string                      _time:time                  _value:float
------------------------------  ------------------------------  ----------------------  ----------------------  ------------------------------  ----------------------------
  • Include necessary environment variables
  • Show proper credential handling for authenticated commands

API Documentation

  • Follow OpenAPI specification patterns
  • Match REST API examples to current implementation
  • Include complete request/response examples
  • Document required headers and authentication

Versioning and Product Differentiation

  • Clearly distinguish between different InfluxDB versions (1.x, 2.x, 3.x)
  • Use correct terminology for each product variant
  • Apply appropriate UI descriptions and screenshots
  • Reference appropriate query language per version

Development Tools

  • Vale.sh linter for style checking
  • Docker for local development and testing
  • pytest and pytest-codeblocks for validating code examples
  • Pre-commit hooks for quality assurance