#186
gdtest_ref_mixed
OK
CONFIG
Mix of explicit reference sections and auto-discovered items.
Mix of explicit reference items and auto-discovered ones. Config defines some sections explicitly, others are auto-generated.
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
P3
P3Mixed auto+explicitreference
Source Files
gdtest_ref_mixed/
__init__.py
"""Test package for mixed reference config.""" from .core import connect, disconnect, ping, trace __all__ = ["connect", "disconnect", "ping", "trace"]
core.py
"""Core networking functions."""
def connect(host: str, port: int = 8080) -> dict:
"""Connect to a remote host.
Parameters
----------
host : str
The hostname or IP address to connect to.
port : int, optional
The port number, by default 8080.
Returns
-------
dict
A dictionary with connection details.
Examples
--------
>>> connect("localhost")
{'host': 'localhost', 'port': 8080, 'status': 'connected'}
"""
return {"host": host, "port": port, "status": "connected"}
def disconnect(connection: dict) -> bool:
"""Disconnect from a remote host.
Parameters
----------
connection : dict
The connection dictionary to disconnect.
Returns
-------
bool
True if disconnected successfully.
Examples
--------
>>> disconnect({"host": "localhost", "status": "connected"})
True
"""
return True
def ping(host: str) -> float:
"""Ping a remote host and return the latency.
Parameters
----------
host : str
The hostname or IP address to ping.
Returns
-------
float
The latency in milliseconds.
Examples
--------
>>> ping("localhost")
0.1
"""
return 0.1
def trace(host: str) -> list:
"""Trace the route to a remote host.
Parameters
----------
host : str
The hostname or IP address to trace to.
Returns
-------
list
A list of hops along the route.
Examples
--------
>>> trace("localhost")
['127.0.0.1']
"""
return ["127.0.0.1"]README.md
# gdtest-ref-mixed Test mixed explicit and auto-discovered reference.
great-docs.yml
reference:
- title: Primary API
desc: Main functions
contents:
- name: connect
- name: disconnect