Format the system prompt with module name and optional custom instructions. Args: module_name: Name of the module to document custom_instructions: Optional custom instructions to append Returns: Formatted system prompt string
(module_name: str, custom_instructions: str = None)
| 375 | ".phtml": "php", |
| 376 | ".inc": "php", |
| 377 | ".rb": "ruby", |
| 378 | } |
| 379 | |
| 380 | |
| 381 | def is_flat_layout(layout: str | None) -> bool: |
| 382 | return layout == LAYOUT_FLAT |
| 383 | |
| 384 | |
| 385 | def _layout_fields(module_name: str, module_path: list[str] | None, layout: str | None) -> dict: |
| 386 | doc_file = module_doc_file(module_name, module_path, layout) |
| 387 | if is_flat_layout(layout): |
| 388 | return { |
| 389 | "doc_file": doc_file, |
| 390 | "sub_module_location": "in the working directory under the name of `sub-module_name.md`", |
| 391 | "uniqueness_reason": "all docs share one flat directory", |
| 392 | } |
| 393 | folder = doc_file[: -len(".md")] + "/" if module_path else "" |
| 394 | location = ( |
| 395 | f"by `generate_sub_module_documentation` under `{folder}` as `sub-module_name.md`" |
no test coverage detected