← GDG /

#271 gdtest_page_status

#271 gdtest_page_status OK CONFIG
Page status badges in sidebar navigation and on pages
Seven user-guide pages exercising page status badges. Six pages carry a status frontmatter value (new, updated, beta, deprecated, experimental, and a custom draft status) while one page has no status. Tests that _page_status.json is generated with the correct page-to-status mapping, that page-status-badges.js is included for client-side rendering, that sidebar links display compact status badges, and that page titles show a styled status indicator with icon and description. The custom draft status (defined in great-docs.yml) verifies user-defined status extensions.
View Site → Build Log ๐Ÿงช Test Coverage

Build Mode

● Has great-docs.yml

This package ships a pre-supplied config. The great-docs init step is skipped and great-docs build uses the spec-defined configuration directly. Tests specific config options and their rendered output.

Dimensions

T2
T2Page status badges in sidebar + pagesstatus

Source Files

๐Ÿ“ gdtest_page_status/
๐Ÿ“„ __init__.py
"""A test package for the page status badges feature."""

__version__ = "0.1.0"
__all__ = ["Processor", "run_pipeline", "PipelineError"]


class PipelineError(Exception):
    """Raised when a pipeline step fails."""


class Processor:
    """
    A data processor that runs a pipeline of steps.

    Parameters
    ----------
    name
        Processor name.
    steps
        Number of steps in the pipeline.
    """

    def __init__(self, name: str, steps: int = 3):
        self.name = name
        self.steps = steps

    def execute(self) -> str:
        """
        Execute the processing pipeline.

        Returns
        -------
        str
            A summary of the execution.
        """
        return f"Processed {self.steps} steps"

    def validate(self) -> bool:
        """
        Validate pipeline configuration.

        Returns
        -------
        bool
            True if valid.

        Raises
        ------
        PipelineError
            If validation fails.
        """
        if self.steps <= 0:
            raise PipelineError("Steps must be positive")
        return True


def run_pipeline(name: str, steps: int = 3) -> str:
    """
    Run a named pipeline.

    Parameters
    ----------
    name
        Pipeline name.
    steps
        Number of steps (default 3).

    Returns
    -------
    str
        Execution summary.
    """
    p = Processor(name, steps)
    p.validate()
    return p.execute()
๐Ÿ“ user_guide/
๐Ÿ“„ 01-getting-started.qmd
---
title: Getting Started
status: new
---

Welcome to the Page Status Demo!

This page has `status: new` and should show a green
"New" badge in the sidebar and below the title.
๐Ÿ“„ 02-configuration.qmd
---
title: Configuration Guide
status: updated
---

Learn the configuration options.

This page has `status: updated` and should show a blue
"Updated" badge.
๐Ÿ“„ 03-advanced.qmd
---
title: Advanced Usage
status: beta
---

Advanced features that are still in beta.

This page has `status: beta` and should show an amber
"Beta" badge with a flask icon.
๐Ÿ“„ 04-migration.qmd
---
title: Migration from v1
status: deprecated
---

This migration guide is deprecated.

The v1 API has been removed. This page has `status: deprecated`
and should show a red "Deprecated" badge with a warning icon.
๐Ÿ“„ 05-experimental.qmd
---
title: Experimental Features
status: experimental
---

These features are experimental and may change.

This page has `status: experimental` and should show a
purple "Experimental" badge.
๐Ÿ“„ 06-draft-notes.qmd
---
title: Draft Notes
status: draft
---

This page uses a custom status `draft` defined in
the great-docs.yml configuration.
๐Ÿ“„ 07-stable.qmd
---
title: Stable Features
---

This page has no status and should NOT display any
status badge.
๐Ÿ“„ 08-subtitle-only.qmd
---
title: Subtitle Only
subtitle: A page with a subtitle but no description
status: new
---

This page tests the badge layout when a subtitle is present
but there is no description.
๐Ÿ“„ 09-description-only.qmd
---
title: Description Only
description: A page with a description but no subtitle
status: beta
---

This page tests the badge layout when a description is present
but there is no subtitle.
๐Ÿ“„ 10-subtitle-and-description.qmd
---
title: Subtitle and Description
subtitle: Both subtitle and description present
description: This page has both a subtitle and a description alongside a status badge.
status: updated
---

This page tests the badge layout when both a subtitle and a
description are present.
๐Ÿ“„ 11-neither.qmd
---
title: Title Only
status: deprecated
---

This page has only a title (no subtitle, no description)
with a status badge. The simplest layout case.
๐Ÿ“„ README.md
# gdtest-page-status

A test package demonstrating page status badges.

## Features

- Visual status indicators in sidebar navigation
- Page-level status banners below titles
- Built-in statuses: new, updated, beta, deprecated, experimental
- Custom status definitions via configuration
๐Ÿ“„ great-docs.yml
display_name: Page Status Demo
page_status:
  enabled: true
  show_in_sidebar: true
  show_on_pages: true
  statuses:
    draft:
      label: Draft
      icon: pencil
      color: "#999999"
      description: Work in progress