Skip to content

docs(config): fix configuration file formatting and accuracy - #2605

Open
Olawoyin365 wants to merge 15 commits into
containers:mainfrom
Olawoyin365:fix-config-doc-formatting
Open

docs(config): fix configuration file formatting and accuracy#2605
Olawoyin365 wants to merge 15 commits into
containers:mainfrom
Olawoyin365:fix-config-doc-formatting

Conversation

@Olawoyin365

@Olawoyin365 Olawoyin365 commented Apr 7, 2026

Copy link
Copy Markdown

This PR addresses formatting issues, content errors, and structural issues impacting readability in the Configuration File documentation (ramalama.conf.5.md).

Issue Summary

The current configuration documentation page is quite hard to follow and has few breaks, broken links, content errors, manpage-style formatting not adapted for Docusaurus, no clear section organizations, poor scanability etc as identified in issue #111 on Fedora Forge

Changes Made

Restructured Content

Fixed All Tables

Added Code Blocks with Syntax Highlighting

Fixed Grammar and Spelling

Structured Configuration Options

Added Complete Configuration Example

Screenshots

Before (Current Documentation)

image

After (This PR)

image

Video Demonstration of Local Testing of the Web Pages

Configuration.File._.RamaLama.and.4.more.pages.-.Personal.-.Microsoft_.Edge.2026-04-16.02-27-32.mp4

Terminal Formatting

Native Manpage Structural Alignment Standardized the ramalama.conf.5.md
documentation to perfectly align with the core .1 framework. Stripped out proprietary Docusaurus UI wrappers (e.g., :::note / :::warning) and YAML frontmatter, replacing them with readable Markdown syntax that rendered the man pages good. This guarantees flawless native rendering in both the web portal and the go-md2man terminal output for man pages

Video Demonstration of Local Testing Terminal man pages

olawoyin@OLAWOYIN__mnt_c_Users_DELL_Documents_ramalama_docs.2026-04-16.02-19-38.mp4

Summary by Sourcery

Rewrite and restructure the RamaLama configuration file documentation for Docusaurus, improving readability, navigation, and accuracy while adding a complete configuration example.

Documentation:

  • Convert the manpage-style ramalama.conf documentation to Docusaurus format with frontmatter, sections, notes, and syntax-highlighted code blocks.
  • Clarify configuration options, environment variable overrides, and defaults with organized tables and per-field reference descriptions.
  • Add a full example ramalama.conf file to illustrate typical configuration usage.

@sourcery-ai

sourcery-ai Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Rewrites and restructures the RamaLama configuration file documentation into a Docusaurus-friendly page with frontmatter, clearer sections, tables, TOML code samples, and more precise option descriptions and examples.

File-Level Changes

Change Details Files
Convert legacy manpage-style markdown into Docusaurus-compatible documentation with frontmatter and high-level structure.
  • Add Docusaurus frontmatter including title, sidebar label, description, and SEO keywords.
  • Replace top-level NAME/DESCRIPTION sections with an Overview section and explicit headings for file locations, environment variables, format, and configuration reference.
  • Introduce consistent heading hierarchy (h2/h3/h4) for major topics and per-option documentation.
docs/ramalama.conf.5.md
Clarify and restructure configuration file locations, precedence rules, and environment-variable overrides.
  • Split configuration paths into separate Global and User configuration sections with two-column tables for paths and notes/exceptions.
  • Add an explicit note block describing precedence rules and .d directory ordering and requirements.
  • Document RAMALAMA_CONFIG behavior with a dedicated subsection and example usage.
docs/ramalama.conf.5.md
Document TOML configuration schema with examples and structured per-option reference for the ramalama table and related subtables.
  • Add a general TOML format overview with simple examples and a complete configuration example at the end of the document.
  • For each key under [ramalama], add a dedicated subsection with type, default, valid values, and explanatory text plus TOML snippets.
  • Add detailed descriptions for complex options such as backend, convert_type, gguf_quantization_mode, pull, and runtime, including platform-specific notes and behavior.
docs/ramalama.conf.5.md
Improve and formalize documentation of nested tables such as ramalama.images, ramalama.rag_images, ramalama.http_client, ramalama.provider, ramalama.benchmarks, and ramalama.user.
  • Convert inline notes about images to structured sections that explain how to override runtime-specific images via [[ramalama.images]] and [[ramalama.rag_images]] with clear examples.
  • Introduce dedicated sections for ramalama.http_client, ramalama.provider.openai, ramalama.benchmarks, and ramalama.user including types, defaults, and examples.
  • Clarify semantics of user and benchmark settings (e.g., no_missing_gpu_prompt, storage_folder) and how they interact with other fields and environment variables.
docs/ramalama.conf.5.md
Normalize language, formatting, and presentation for better readability and consistency.
  • Replace informal or repetitive text with concise descriptions and standardized phrases describing type, default, behavior, and environment overrides.
  • Fix grammar, spelling, punctuation, and capitalization throughout, including option descriptions and table text.
  • Use callout blocks (note/warning) and bullet lists where appropriate to highlight platform-specific behavior, usage guidance, and recommendations (e.g., temperature guidelines, backend behavior).
docs/ramalama.conf.5.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • Several sections that were originally documented as array-of-tables (e.g. [[ramalama.http_client]], [[ramalama.provider]], [[ramalama.provider.openai]], [[ramalama.benchmarks]], [[ramalama.user]]) are now presented as single tables (e.g. [ramalama.http_client], [ramalama.provider.openai]); please double-check the actual config schema and keep the TOML notation consistent so users don’t adopt an invalid structure.
  • In a few option descriptions the declared type or structure is confusing or inconsistent (e.g. ramalama.provider.openai is described as Type: string but then used as a table, port is a string but is conceptually numeric); consider tightening these to match the real types expected by the parser.
  • There are a couple of small phrasing/format issues that could be cleaned up for clarity and polish (for example, “As mentioned above that the configuration file uses…” under Configuration Format, and the missing space in **Type:**string for port).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Several sections that were originally documented as array-of-tables (e.g. `[[ramalama.http_client]]`, `[[ramalama.provider]]`, `[[ramalama.provider.openai]]`, `[[ramalama.benchmarks]]`, `[[ramalama.user]]`) are now presented as single tables (e.g. `[ramalama.http_client]`, `[ramalama.provider.openai]`); please double-check the actual config schema and keep the TOML notation consistent so users don’t adopt an invalid structure.
- In a few option descriptions the declared type or structure is confusing or inconsistent (e.g. `ramalama.provider.openai` is described as `Type: string` but then used as a table, `port` is a string but is conceptually numeric); consider tightening these to match the real types expected by the parser.
- There are a couple of small phrasing/format issues that could be cleaned up for clarity and polish (for example, “As mentioned above that the configuration file uses…” under Configuration Format, and the missing space in `**Type:**string` for `port`).

## Individual Comments

### Comment 1
<location path="docs/ramalama.conf.5.md" line_range="18" />
<code_context>
+## File Locations

-For user specific configuration it reads
+RamaLama searches for configuration files in multiple locations, Files processed later override settings from earlier ones.

-| Paths                                       | Exception |
</code_context>
<issue_to_address>
**suggestion (typo):** Fix comma splice and capitalization in this sentence about configuration file search order.

For example: "RamaLama searches for configuration files in multiple locations. Files processed later override settings from earlier ones."

```suggestion
RamaLama searches for configuration files in multiple locations. Files processed later override settings from earlier ones.
```
</issue_to_address>

### Comment 2
<location path="docs/ramalama.conf.5.md" line_range="61" />
<code_context>
+
+## Configuration Format
+
+As mentioned above that the configuration file uses the [TOML format](https://toml.io). Every option is nested under its table, with no bare options allowed.
+
+**Basic TOML structure:**
</code_context>
<issue_to_address>
**suggestion (typo):** Rephrase the awkward "As mentioned above that" construction.

Consider: "As mentioned above, the configuration file uses the [TOML format](https://toml.io)." and keep the rest of the sentence unchanged.

```suggestion
As mentioned above, the configuration file uses the [TOML format](https://toml.io). Every option is nested under its table, with no bare options allowed.
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/ramalama.conf.5.md Outdated
Comment thread docs/ramalama.conf.5.md Outdated

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly updates the ramalama.conf documentation, transitioning it to a more structured Markdown format with detailed configuration references, examples, and environment variable overrides. The review feedback focuses on ensuring the documentation aligns with the technical limitations of the TOMLParser (such as lack of support for inline comments and array-of-tables syntax), correcting field names to match the underlying BaseConfig (e.g., rag_image vs rag_images), and improving grammatical clarity and consistency throughout the document.

Comment thread docs/ramalama.conf.5.md Outdated
engine = "podman"
store = "$HOME/.local/share/ramalama"

[[ramalama.images]]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The TOMLParser in ramalama/toml_parser.py does not support the [[ ]] (array of tables) syntax. It will incorrectly parse this as a section named [ramalama.images]. Since images is defined as a dict[str, str] in BaseConfig, a standard table [ramalama.images] should be used instead.

Suggested change
[[ramalama.images]]
[ramalama.images]

Comment thread docs/ramalama.conf.5.md Outdated
```toml
[ramalama]
backend = "vulkan" # Force Vulkan for all GPUs
backend = "vulkan" # Force Vulkan for all GPUs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The TOMLParser implementation is very strict and does not support inline comments. Including a # after the value will cause _parse_value to fail because the string won't end with a quote or match the expected numeric regex, leading to a ValueError.

Suggested change
backend = "vulkan" # Force Vulkan for all GPUs
backend = "vulkan"

Comment thread docs/ramalama.conf.5.md Outdated

---

#### rag_images (string)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The field name in BaseConfig for the single image string is rag_image (singular). rag_images (plural) is used for the dictionary of overrides. Updating this header improves accuracy.

Suggested change
#### rag_images (string)
#### rag_image

Comment thread docs/ramalama.conf.5.md Outdated
Comment on lines +504 to +506
#### rag_images (table array overrides)

**Type:** table array

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This section refers to the rag_images dictionary. The type should be table and the header should match the field name in the code.

Suggested change
#### rag_images (table array overrides)
**Type:** table array
#### rag_images
**Type:** table

Comment thread docs/ramalama.conf.5.md Outdated
port = "8080"
pull = "newer"

[[ramalama.images]]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Correcting the syntax in the complete example to use a standard table for the images dictionary.

Suggested change
[[ramalama.images]]
[ramalama.images]

Comment thread docs/ramalama.conf.5.md Outdated
## File Locations

For user specific configuration it reads
RamaLama searches for configuration files in multiple locations, Files processed later override settings from earlier ones.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a comma splice here. It should be a period to separate the two independent clauses.

Suggested change
RamaLama searches for configuration files in multiple locations, Files processed later override settings from earlier ones.
RamaLama searches for configuration files in multiple locations. Files processed later override settings from earlier ones.

Comment thread docs/ramalama.conf.5.md Outdated

## Configuration Format

As mentioned above that the configuration file uses the [TOML format](https://toml.io). Every option is nested under its table, with no bare options allowed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The sentence structure is slightly awkward. Removing 'that' and adding a comma makes it more natural.

Suggested change
As mentioned above that the configuration file uses the [TOML format](https://toml.io). Every option is nested under its table, with no bare options allowed.
As mentioned above, the configuration file uses the [TOML format](https://toml.io). Every option is nested under its table, with no bare options allowed.

Comment thread docs/ramalama.conf.5.md Outdated

#### images

**Type:** table array

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The images field is a dict[str, str] in the Python configuration (ramalama/config.py). It should be described as a table rather than a table array to be consistent with TOML terminology and the underlying data structure.

Suggested change
**Type:** table array
**Type:** table

Comment thread docs/ramalama.conf.5.md Outdated

#### port

**Type:**string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Missing space after the colon for consistency with other field definitions.

Suggested change
**Type:**string
**Type:** string

@Olawoyin365

Copy link
Copy Markdown
Author

Hey - I've found 2 issues, and left some high level feedback:

  • Several sections that were originally documented as array-of-tables (e.g. [[ramalama.http_client]], [[ramalama.provider]], [[ramalama.provider.openai]], [[ramalama.benchmarks]], [[ramalama.user]]) are now presented as single tables (e.g. [ramalama.http_client], [ramalama.provider.openai]); please double-check the actual config schema and keep the TOML notation consistent so users don’t adopt an invalid structure.
  • In a few option descriptions the declared type or structure is confusing or inconsistent (e.g. ramalama.provider.openai is described as Type: string but then used as a table, port is a string but is conceptually numeric); consider tightening these to match the real types expected by the parser.
  • There are a couple of small phrasing/format issues that could be cleaned up for clarity and polish (for example, “As mentioned above that the configuration file uses…” under Configuration Format, and the missing space in **Type:**string for port).

Prompt for AI Agents

Please address the comments from this code review:

## Overall Comments
- Several sections that were originally documented as array-of-tables (e.g. `[[ramalama.http_client]]`, `[[ramalama.provider]]`, `[[ramalama.provider.openai]]`, `[[ramalama.benchmarks]]`, `[[ramalama.user]]`) are now presented as single tables (e.g. `[ramalama.http_client]`, `[ramalama.provider.openai]`); please double-check the actual config schema and keep the TOML notation consistent so users don’t adopt an invalid structure.
- In a few option descriptions the declared type or structure is confusing or inconsistent (e.g. `ramalama.provider.openai` is described as `Type: string` but then used as a table, `port` is a string but is conceptually numeric); consider tightening these to match the real types expected by the parser.
- There are a couple of small phrasing/format issues that could be cleaned up for clarity and polish (for example, “As mentioned above that the configuration file uses…” under Configuration Format, and the missing space in `**Type:**string` for `port`).

## Individual Comments

### Comment 1
<location path="docs/ramalama.conf.5.md" line_range="18" />
<code_context>
+## File Locations

-For user specific configuration it reads
+RamaLama searches for configuration files in multiple locations, Files processed later override settings from earlier ones.

-| Paths                                       | Exception |
</code_context>
<issue_to_address>
**suggestion (typo):** Fix comma splice and capitalization in this sentence about configuration file search order.

For example: "RamaLama searches for configuration files in multiple locations. Files processed later override settings from earlier ones."

```suggestion
RamaLama searches for configuration files in multiple locations. Files processed later override settings from earlier ones.

</issue_to_address>

Comment 2

+ +## Configuration Format + +As mentioned above that the configuration file uses the [TOML format](https://toml.io). Every option is nested under its table, with no bare options allowed. + +**Basic TOML structure:** **suggestion (typo):** Rephrase the awkward "As mentioned above that" construction.

Consider: "As mentioned above, the configuration file uses the TOML format." and keep the rest of the sentence unchanged.

As mentioned above, the configuration file uses the [TOML format](https://toml.io). Every option is nested under its table, with no bare options allowed.

</issue_to_address>


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
* [X](https://twitter.com/intent/tweet?text=I%20just%20got%20an%20instant%20code%20review%20from%20%40SourceryAI%2C%20and%20it%20was%20brilliant%21%20It%27s%20free%20for%20open%20source%20and%20has%20a%20free%20trial%20for%20private%20code.%20Check%20it%20out%20https%3A//sourcery.ai)
* [Mastodon](https://mastodon.social/share?text=I%20just%20got%20an%20instant%20code%20review%20from%20%40SourceryAI%2C%20and%20it%20was%20brilliant%21%20It%27s%20free%20for%20open%20source%20and%20has%20a%20free%20trial%20for%20private%20code.%20Check%20it%20out%20https%3A//sourcery.ai)
* [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https://sourcery.ai)
* [Facebook](https://www.facebook.com/sharer/sharer.php?u=https://sourcery.ai)

Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Thanks for the feedback. I’ve reviewed the points raised:

I’ll verify the actual configuration schema in the codebase to ensure correct use of TOML table vs array-of-table notation before making changes.
I’ll correct type inconsistencies (e.g. port, temp, and provider configuration structure) to match expected runtime behavior.
I’ll fix minor formatting and phrasing issues highlighted.

Appreciate the review, I’ll push updates shortly after validating against the actual implementation.

@amkr6207

amkr6207 commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

@Olawoyin365

Thanks for the work on this PR. I reviewed it and found a few major issues that may cause CI/test failures:

  1. docs/ramalama.conf.5.md no longer matches current repo test expectations in test/unit/test_config_documentation.py:

    • parser expects **field**=...
    • parser expects section markers like `[[ramalama]]`
  2. rag_image vs rag_images is inconsistent in the new reference/examples (section naming and example assignment do not match).

  3. "<default store>/benchmarks" should be escaped as "\<default store>/benchmarks" for MDX/docsite safety.

Could you please take a look?

Thanks!

Update: I checked the Packit/COPR logs. CI is currently failing in %check on:

  • test_config_fields_in_manpage
  • test_consistency_between_conf_and_manpage
    from test/unit/test_config_documentation.py.

@Olawoyin365

Copy link
Copy Markdown
Author

@Olawoyin365

Thanks for the work on this PR. I reviewed it and found a few major issues that may cause CI/test failures:

  1. docs/ramalama.conf.5.md no longer matches current repo test expectations in test/unit/test_config_documentation.py:

    • parser expects **field**=...
    • parser expects section markers like `[[ramalama]]`
  2. rag_image vs rag_images is inconsistent in the new reference/examples (section naming and example assignment do not match).

  3. "<default store>/benchmarks" should be escaped as "\<default store>/benchmarks" for MDX/docsite safety.

Could you please take a look?

Thanks!

Update: I checked the Packit/COPR logs. CI is currently failing in %check on:

  • test_config_fields_in_manpage
  • test_consistency_between_conf_and_manpage
    from test/unit/test_config_documentation.py.

Thanks for the detailed review, this is really helpful.

I’m currently going through each of the points you raised. I will revert and push an update once everything is verified. Looking forward to further reviews together

Comment thread docs/ramalama.conf.5.md Outdated
## Configuration Reference

**api**="none"
### ramalama Table

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Olawoyin365 kindly check if this is applicable;
according to the formatting guideline the heading format should be; capitalize only the first word and proper nouns in this case Table doesn't follow that as it is not a proper noun.

Comment thread docs/ramalama.conf.5.md Outdated
**Type:** string
**Default:** `"registry.access.redhat.com/ubi10-micro:latest"`

OCI model car image used when building and pushing models with `--type=car`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Olawoyin365 kindly check if this is applicable;
car image is a Config.Key and according to our formatting guidelines config.keys should be in inline code.

Comment thread docs/ramalama.conf.5.md

**port**="8080"
**Type:** string
**Default:** Based on container engine

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Olawoyin365 kindly check if this is applicable;
all the 'defaults' have back ticks except for this line.

Comment thread docs/ramalama.conf.5.md Outdated
---

The maximum number of times to retry a failed download
### ramalama.http_client Table

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Olawoyin365 kindly check if this is applicable;
according to the formatting guideline the heading format should be; capitalize only the first word and proper nouns in this case Table doesn't follow that as it is not a proper noun.

Comment thread docs/ramalama.conf.5.md Outdated
---

**storage_folder**="\<default store>/benchmarks"
### ramalama.benchmarks Table

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Olawoyin365 kindly check if this is applicable;
according to the formatting guideline the heading format should be; capitalize only the first word and proper nouns in this case Table doesn't follow that as it is not a proper noun.

Comment thread docs/ramalama.conf.5.md Outdated
---

The maximum delay between retry attempts in seconds
### ramalama.provider Table

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Olawoyin365 kindly check if this is applicable;
according to the formatting guideline the heading format should be; capitalize only the first word and proper nouns in this case Table doesn't follow that as it is not a proper noun.

Comment thread docs/ramalama.conf.5.md Outdated
---

`[[ramalama.user]]`
### ramalama.user Table

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Olawoyin365 kindly check if this is applicable;
according to the formatting guideline the heading format should be; capitalize only the first word and proper nouns in this case Table doesn't follow that as it is not a proper noun.

- Fix heading hierarchy for better readability
- Convert plain text tables to proper Markdown tables
- Add TOML code blocks with syntax highlighting
- Fix grammar errors and typos
- Add Docusaurus-compatible note blocks
- Standardize capitalization
- Verify configuration paths and options
- Test backend auto-detection behavior

This improves documentation readability and ensures accuracy
against actual RamaLama behavior.

Fixes: containers#111
Signed-off-by: woyin365 <woyin365@gmail.com>
- Fix heading hierarchy for better readability
- Convert plain text tables to proper Markdown tables
- Add TOML code blocks with syntax highlighting
- Fix grammar errors and typos
- Add Docusaurus-compatible note blocks
- Standardize capitalization
- Verify configuration paths and options
- Test backend auto-detection behavior

This improves documentation readability and ensures accuracy
against actual RamaLama behavior.

Fixes: containers#111
Signed-off-by: woyin365 <woyin365@gmail.com>
- Fix heading hierarchy for better readability
- Convert plain text tables to proper Markdown tables
- Add TOML code blocks with syntax highlighting
- Fix grammar errors and typos
- Add Docusaurus-compatible note blocks
- Standardize capitalization
- Verify configuration paths and options
- Test backend auto-detection behavior

This improves documentation readability and ensures accuracy
against actual RamaLama behavior.

Fixes: containers#111
Signed-off-by: woyin365 <woyin365@gmail.com>
Signed-off-by: woyin365 <woyin365@gmail.com>
Signed-off-by: woyin365 <woyin365@gmail.com>
…structure

Signed-off-by: woyin365 <woyin365@gmail.com>
Signed-off-by: woyin365 <woyin365@gmail.com>
Signed-off-by: woyin365 <woyin365@gmail.com>
@Olawoyin365

Copy link
Copy Markdown
Author

Hi @Njeri-Kimaru

Thanks for taking the time to highlight all of those casing differences

When formatting the documentation pages, I've split the headers into two distinct categories based on the formatting guidelines (I have updated it in our HackMD too):

Conceptual English Headings: For standard topics like ## Environment Variables or ## Configuration Format, I use Title Case (capitalizing the first letter) because they act like standard book chapters or article sections.

Code Literal Headings: For headers that directly reference code or configuration keys (like ### ramalama table or ### RAMALAMA_CONFIG), I preserve the exact programmatic casing (lowercase for TOML tables, ALL-CAPS for bash environment variables).

This ensures users don't accidentally copy-paste a capitalized literal like [Ramalama], which would fail because TOML is case-sensitive! (And for the word "table", since it's just a generic noun, it stays lowercase to follow the sentence-case rule you mentioned perfectly).

Thanks again for the sharp eyes on this, it's really helping to improve the documentation

@Njeri-Kimaru

Copy link
Copy Markdown
Contributor

Hi @Njeri-Kimaru

Thanks for taking the time to highlight all of those casing differences

When formatting the documentation pages, I've split the headers into two distinct categories based on the formatting guidelines (I have updated it in our HackMD too):

Conceptual English Headings: For standard topics like ## Environment Variables or ## Configuration Format, I use Title Case (capitalizing the first letter) because they act like standard book chapters or article sections.

Code Literal Headings: For headers that directly reference code or configuration keys (like ### ramalama table or ### RAMALAMA_CONFIG), I preserve the exact programmatic casing (lowercase for TOML tables, ALL-CAPS for bash environment variables).

This ensures users don't accidentally copy-paste a capitalized literal like [Ramalama], which would fail because TOML is case-sensitive! (And for the word "table", since it's just a generic noun, it stays lowercase to follow the sentence-case rule you mentioned perfectly).

Thanks again for the sharp eyes on this, it's really helping to improve the documentation

You are most welcome @Olawoyin365 and thank you too.

@amkr6207

Copy link
Copy Markdown
Contributor

@Olawoyin365

Thanks for the updates. I re-checked the latest changes.

I still see one major concern:

Could you please revert the test-file changes and keep the fix limited to docs/ramalama.conf.5.md?

@mikebonnet, @rhatdan, @bmahabirbu could you please confirm whether changing test/unit/test_config_documentation.py is appropriate for this issue?

@amkr6207

Copy link
Copy Markdown
Contributor

@Olawoyin365

Thanks for the updates. I re-checked the latest changes.

I still see one major concern:

Could you please revert the test-file changes and keep the fix limited to docs/ramalama.conf.5.md?

@mikebonnet, @rhatdan, @bmahabirbu could you please confirm whether changing test/unit/test_config_documentation.py is appropriate for this issue?

@mikebonnet, @rhatdan, @bmahabirbu could you please confirm whether changing test/unit/test_config_documentation.py is appropriate for this issue?

Comment thread docs/ramalama.conf.5.md
#### openai

**openai**=""
**openai**

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Olawoyin365 kindly check if this is applicable, should it be "openAI"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @praxyfarhana, thanks for the observation. I've used openai (lowercase) specifically where it refers to the TOML configuration key (e.g., [ramalama.provider.openai]), as these keys are consistently lowercase in our configuration schema. Using the exact technical casing ensures users don't face parsing issues in their config files.

However, I've used 'OpenAI' in the descriptive prose where I'm referring to the organization. I believe this distinction helps maintain both technical accuracy and professional grammar.

Comment thread docs/ramalama.conf.5.md

**Type:** string
**Type:** integer
**Default:** `"8080"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Olawoyin365 have noticed some inconsistencies with ports' data type (Default: "8080").

Comment thread docs/ramalama.conf.5.md

**Type:** string
**Type:** float
**Default:** `"0.8"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Olawoyin365 have noticed some inconsistencies with data type (Default: "0.8").

Comment thread docs/ramalama.conf.5.md Outdated

**Type:** string
**Type:** table
**Default:** `""`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Olawoyin365 have noticed some inconsistencies with data type (Default: "").

@Olawoyin365

Olawoyin365 commented Apr 14, 2026

Copy link
Copy Markdown
Author

@Olawoyin365
Thanks for the updates. I re-checked the latest changes.
I still see one major concern:

Could you please revert the test-file changes and keep the fix limited to docs/ramalama.conf.5.md?
@mikebonnet, @rhatdan, @bmahabirbu could you please confirm whether changing test/unit/test_config_documentation.py is appropriate for this issue?

@mikebonnet, @rhatdan, @bmahabirbu could you please confirm whether changing test/unit/test_config_documentation.py is appropriate for this issue?

Thanks for the feedback, @amkr6207.

The changes to test/unit/test_config_documentation.py were made because this test acts as a documentation linter. Specifically, I had to update the subsections_with_fields list and adjust the regex logic to handle the new [ramalama.provider.openai] nested structure added. When I updated ramalama.conf.5.md to improve its accuracy, the existing test regexes failed because they didn't account for the new structure and improved key descriptions. Updating the validation suite alongside the documentation is a practice to ensure CI passes and that the docs remain in sync with the codebase. Without these changes, the automated tests would flag several 'undocumented fields' or formatting errors that we have already addressed.

As you have also suggested, I'm happy to wait for the maintainers (@mikebonnet, @rhatdan, @bmahabirbu) to confirm if changes to the test/unit/test_config_documentation.py is an accepted practice.

@Olawoyin365

Copy link
Copy Markdown
Author

Hi @praxyfarhana, You're right that port and temp represent numeric values. However, in the RamaLama implementation (
ramalama/config.py), these fields are currently defined as strings in the BaseConfig class. That is, The reason they are strings is that RamaLama stores them as raw text from the configuration source and only converts them to numbers when they are actually used.

The documentation in this PR is intentionally aligned with the codebase to ensure users understand how the configuration is initially parsed and stored from TOML/Environment sources. I've corrected the temp type designation in the manpage to string to be consistent with the other fields and the implementation. Thank you for the detailed review

@Ritika-Bhambri Ritika-Bhambri left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Olawoyin365, great progress on the formatting! The documentation will look much cleaner with these changes.

While looking at how these changes interact with the CI pipeline, I noticed an edge case in the test suite that we should probably future-proof against regarding the provider and benchmarks sections.

The issue:
The parser in test/unit/test_config_documentation.py appears to rely on regex-based extraction of documented fields (e.g., matching field_name). It effectively assumes that any bolded field corresponds to a top-level [ramalama] config unless it is explicitly excluded via the subsections_with_fields handling.

Currently, provider and benchmarks seem to be missing from that exclusion logic in get_documented_fields_in_manpage(). Because of this, if a nested field is documented using the fieldname syntax, the test may incorrectly treat it as a top-level global field.

Why this does not fail CI currently:
The api_key formatting passes CI because api_key exists at the top level of BaseConfig. Since the test compares sets of documented vs. actual config fields, this doesn’t trigger a failure. However, if a provider-specific field like model or base_url were added, this could cause the test to fail.

Additionally, it seems the parser only matches one level of sections (e.g., [[ramalama.

]]) and does not fully track deeper nested sections like [[ramalama.provider.openai]]. Because of this, once the section context is lost, nested fields such as api_key may end up being interpreted as top-level fields during parsing.

Inconsistency:
It looks like benchmarks is already handled in get_documented_fields_in_conf(), but not in get_documented_fields_in_manpage(), which introduces an inconsistency between the two parsers.

Suggestion:
To avoid future CI issues as documentation expands, we could:

Option A: Use backticks (e.g., api_key) for nested fields so they are ignored by the parser
Option B: Update the test suite to include provider and benchmarks in the subsection exclusion logic (and potentially improve handling of nested sections)

It is not a blocker for this PR, but maybe worth addressing to make the documentation pipeline more robust.

Great work on the documentation improvements!

@rhatdan

rhatdan commented Apr 15, 2026

Copy link
Copy Markdown
Member

Please verify tat the man pages actually generate look good.

man ./*.1

@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Manpage generation now pipes Markdown through a new preprocessor (docs/clean_for_man.py) before existing sed and gomd2man steps. The configuration manpage was expanded into a full TOML reference, docsite conversion adds a targeted MDX rewrite, and tests were adjusted to read UTF‑8 and recognize provider subsections.

Changes

Cohort / File(s) Summary
Build system / Make rules
docs/Makefile
Manpage targets (%.1, %.5, %.7) now run python3 docs/clean_for_man.py $< piped into the existing sed substitutions, feeding $(GOMD2MAN) -in /dev/stdin -out $@; removed passing $< to sed.
Preprocessor script
docs/clean_for_man.py
New CLI script with clean_markdown(content, filename) -> str: strips YAML frontmatter, converts Docusaurus admonitions (:::note/:::warning) to bold man-style headings, and conditionally rewrites pipe tables into bulleted lists when ramalama.conf is in the filename; configures stdout for UTF-8 and prints usage on missing arg.
Configuration manpage
docs/ramalama.conf.5.md
Complete rewrite into a detailed TOML configuration reference: overview, search paths, env examples, per-field docs (Type/Default/Env), nested tables, and a full example.
Docsite postprocessing
docsite/convert_manpages.py
Added a targeted postprocessing replace to avoid a JSX compilation issue in an MDX string for storage_folder and inserted a blank line prior to the existing NAME removal regex.
Tests
test/unit/test_config_documentation.py
Tests now open docs with encoding="utf-8"; subsection exclusions expanded to include provider and provider.openai; regexes loosened to match backticked ramalama/ramalama.<section> with one-or-more backticks and dot-separated nested subsection paths.

Sequence Diagram(s)

sequenceDiagram
    participant Makefile
    participant Cleaner as "docs/clean_for_man.py"
    participant Sed as "sed transforms"
    participant GOMD as "GOMD2MAN"
    participant Man as "Manpage"

    Makefile->>Cleaner: run python3 docs/clean_for_man.py $<
    Cleaner-->>Makefile: processed markdown (stdout)
    Makefile->>Sed: pipe stdout into sed substitutions
    Sed-->>Makefile: transformed markdown (stdout)
    Makefile->>GOMD: GOMD2MAN -in /dev/stdin -out $@
    GOMD-->>Man: generated manpage file
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I nibble frontmatter, tidy each note,
Turn blocks to headings and tables to groves,
A hop through Make, a piped delight,
Cleaned, sedded, and sent into night,
Docs flutter neatly — carrots and odes. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: improving configuration documentation formatting and accuracy, which aligns with the primary objective of restructuring ramalama.conf.5.md for Docusaurus.
Description check ✅ Passed The PR description clearly relates to the changeset, detailing restructuring of configuration documentation, fixes to tables and formatting, addition of code blocks, and alignment with native manpage rendering.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
docs/ramalama.conf.5.md (1)

639-642: ⚠️ Potential issue | 🟡 Minor

Type/Default format inconsistency for temp.

The type is documented as float but the default value uses string formatting with quotes ("0.8"). This inconsistency was also flagged in past review comments.

If temp is truly a float in the code, the default should be documented as 0.8 (without quotes). If it's stored as a string, then Type: string would be more accurate.

💡 Suggested fix (if temp is a float)
 **Type:** float 
-**Default:** `"0.8"`
+**Default:** `0.8`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/ramalama.conf.5.md` around lines 639 - 642, The documentation shows the
setting temp with Type: float but Default: "0.8" (string); fix this by making
the representation consistent: if temp is a numeric float in code, change the
documented Default value for temp from "0.8" to 0.8 (remove quotes); if temp is
actually stored as a string in code, update the documented Type for temp from
float to string; adjust only the temp entry so Type and Default match the code.
🧹 Nitpick comments (3)
docs/clean_for_man.py (3)

4-6: Consider adding type hints for better maintainability.

As per the coding guidelines, type hints are encouraged. Adding them would improve code clarity.

✨ Proposed enhancement
-def clean_markdown(content, filename):
+def clean_markdown(content: str, filename: str) -> str:
     # Strip frontmatter
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/clean_for_man.py` around lines 4 - 6, Add type hints to the
clean_markdown function signature and its return type to follow the project
guidelines: change def clean_markdown(content, filename): to include types
(e.g., content: str, filename: str) and annotate the return type (-> str);
update any internal variable annotations if helpful and ensure imports for
typing are added only if you use types like Optional or Union.

20-21: Fix ruff E701: multiple statements on one line.

The static analysis tool flagged these lines for having multiple statements on a single line, which violates ruff formatting rules.

♻️ Proposed fix
-        if len(lines) < 3: return match.group(0)
-        if '|' not in lines[0] or '-' not in lines[1]: return match.group(0)
+        if len(lines) < 3:
+            return match.group(0)
+        if '|' not in lines[0] or '-' not in lines[1]:
+            return match.group(0)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/clean_for_man.py` around lines 20 - 21, Split the two single-line if
statements into separate multi-line statements to satisfy ruff E701: replace "if
len(lines) < 3: return match.group(0)" with a standard if block (if len(lines) <
3:\n    return match.group(0)) and similarly replace "if '|' not in lines[0] or
'-' not in lines[1]: return match.group(0)" with an if block (if '|' not in
lines[0] or '-' not in lines[1]:\n    return match.group(0)); keep the exact
conditions and the return of match.group(0) using the same variables (lines,
match) to preserve behavior.

26-26: Fix ruff E701: multiple statements on one line.

♻️ Proposed fix
-            if not cols: continue
+            if not cols:
+                continue
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/clean_for_man.py` at line 26, The single-line conditional "if not cols:
continue" combines two statements and triggers ruff E701; fix it by converting
it into a proper if-block that keeps the condition on its own line ending with a
colon and moves the follow-up statement to the next indented line (i.e., check
the variable cols and place the continue on its own indented line), updating the
code path that references cols to use this two-line form.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/clean_for_man.py`:
- Around line 43-48: The script reads sys.argv[1] unguarded which raises
IndexError when no CLI argument is provided; update the __main__ block to
validate arguments before using sys.argv by checking len(sys.argv) >= 2 (or
try/except IndexError) and print a concise usage/help message then exit with
non-zero status; ensure the filename variable is only assigned after validation
and that file open still uses encoding='utf-8' so behavior of filename,
open(...) and content remains unchanged.

---

Duplicate comments:
In `@docs/ramalama.conf.5.md`:
- Around line 639-642: The documentation shows the setting temp with Type: float
but Default: "0.8" (string); fix this by making the representation consistent:
if temp is a numeric float in code, change the documented Default value for temp
from "0.8" to 0.8 (remove quotes); if temp is actually stored as a string in
code, update the documented Type for temp from float to string; adjust only the
temp entry so Type and Default match the code.

---

Nitpick comments:
In `@docs/clean_for_man.py`:
- Around line 4-6: Add type hints to the clean_markdown function signature and
its return type to follow the project guidelines: change def
clean_markdown(content, filename): to include types (e.g., content: str,
filename: str) and annotate the return type (-> str); update any internal
variable annotations if helpful and ensure imports for typing are added only if
you use types like Optional or Union.
- Around line 20-21: Split the two single-line if statements into separate
multi-line statements to satisfy ruff E701: replace "if len(lines) < 3: return
match.group(0)" with a standard if block (if len(lines) < 3:\n    return
match.group(0)) and similarly replace "if '|' not in lines[0] or '-' not in
lines[1]: return match.group(0)" with an if block (if '|' not in lines[0] or '-'
not in lines[1]:\n    return match.group(0)); keep the exact conditions and the
return of match.group(0) using the same variables (lines, match) to preserve
behavior.
- Line 26: The single-line conditional "if not cols: continue" combines two
statements and triggers ruff E701; fix it by converting it into a proper
if-block that keeps the condition on its own line ending with a colon and moves
the follow-up statement to the next indented line (i.e., check the variable cols
and place the continue on its own indented line), updating the code path that
references cols to use this two-line form.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 68f61dd8-21dc-45c7-b53e-2c363c85eb0b

📥 Commits

Reviewing files that changed from the base of the PR and between 2ad61ac and 7bcd48c.

📒 Files selected for processing (5)
  • docs/Makefile
  • docs/clean_for_man.py
  • docs/ramalama.conf.5.md
  • docsite/convert_manpages.py
  • test/unit/test_config_documentation.py

Comment thread docs/clean_for_man.py Outdated
@Olawoyin365
Olawoyin365 force-pushed the fix-config-doc-formatting branch from 7bcd48c to 78745bd Compare April 15, 2026 20:53

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/ramalama.conf.5.md`:
- Line 796: The documentation uses the array TOML table notation
`[[ramalama.user]]` but `user` is a single nested instance (see UserConfig and
the ramalama.config.py declaration user: UserConfig =
field(default_factory=UserConfig); change the doc to use the single table
notation for ramalama.user (i.e., replace the double-bracket table with a
single-bracket table) so the TOML matches the UserConfig structure.
- Around line 743-745: The TOML example is invalid: replace the array table
[[ramalama.provider]] and string assignment openai = "" with a nested table for
the OpenAI provider and its fields; update the example to use
[ramalama.provider.openai] and include the OpenaiProviderConfig fields (e.g.,
api_key = "your-api-key-here") so the config matches the OpenaiProviderConfig
dataclass used in ramalama/config.py.
- Line 770: Replace the incorrect array-table TOML notation
``[[ramalama.benchmarks]]`` with the single-table form ``[ramalama.benchmarks]``
because the configuration field `benchmarks` is a single `Benchmarks` instance
(see `Benchmarks` and `benchmarks: Benchmarks =
field(default_factory=Benchmarks)`), ensuring the document reflects the proper
nested config structure.
- Around line 354-369: The TOML examples use array-of-tables syntax
`[[ramalama.images]]` but the config expects a mapping (`images: dict[str,
str]`); update both examples to use a single table header ` [ramalama.images]`
instead of double-bracket array notation and keep the same key/value pairs
(including the VLLM and VLLM_<GPU_ENV_VAR> entries like `VLLM` and
`VLLM_CUDA_VISIBLE_DEVICES`) so the examples match the `images` dict in
ramalama/config.py.
- Line 730: The TOML example uses the array-table syntax `[[ramalama.provider]]`
but `provider` is a single nested object (see ProviderConfig and
ramalama.provider), so update the example to use the single-table notation by
replacing the double-bracket table marker with a single-bracket one (i.e.,
`[ramalama.provider]`) so the docs match the configuration type.
- Line 690: The docs use TOML array-table notation ``[[ramalama.http_client]]``
but the runtime config defines a single nested object (http_client:
HTTPClientConfig), so change the documentation to use a single table notation
`[ramalama.http_client]` (replace the double-bracket instance with a
single-bracket one) to accurately reflect the http_client / HTTPClientConfig
shape.
- Around line 760-762: The TOML example incorrectly uses an array-of-tables
marker for the OpenAI provider; replace the double-bracket table header
[[ramalama.provider.openai]] with a single-table header
[ramalama.provider.openai] so the example matches the single-instance
OpenaiProviderConfig used by ramalama.config.py and the ramalama.provider.openai
configuration key.
- Line 86: The TOML table is incorrectly documented as the array-of-tables form
`[[ramalama]]`; change the example to the single-table notation `[ramalama]` so
it matches the implementation and the test examples (replace the symbol
`[[ramalama]]` with `[ramalama]` in the docs/ramalama.conf.5.md entry).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0f393abf-a5f2-43e2-8d3f-b75edc8a1386

📥 Commits

Reviewing files that changed from the base of the PR and between 7bcd48c and 78745bd.

📒 Files selected for processing (4)
  • docs/Makefile
  • docs/clean_for_man.py
  • docs/ramalama.conf.5.md
  • docsite/convert_manpages.py
✅ Files skipped from review due to trivial changes (1)
  • docs/Makefile
🚧 Files skipped from review as they are similar to previous changes (2)
  • docsite/convert_manpages.py
  • docs/clean_for_man.py

Comment thread docs/ramalama.conf.5.md Outdated
Comment thread docs/ramalama.conf.5.md Outdated
Comment thread docs/ramalama.conf.5.md Outdated
Comment thread docs/ramalama.conf.5.md Outdated
Comment thread docs/ramalama.conf.5.md Outdated
Comment thread docs/ramalama.conf.5.md Outdated
Comment thread docs/ramalama.conf.5.md Outdated
Comment thread docs/ramalama.conf.5.md Outdated
@Olawoyin365
Olawoyin365 force-pushed the fix-config-doc-formatting branch from 78745bd to 4afb0cf Compare April 15, 2026 21:05

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/ramalama.conf.5.md`:
- Line 69: Remove the stray lone character "B" that precedes the example block
in the documentation; delete that accidental character so the example starts
cleanly, and verify surrounding spacing/blank line is preserved and no other
stray characters remain.
- Line 86: The doc uses single-bracket backticked section markers like
`[ramalama]` which no longer match the docs parser (it expects double-bracket
markers like `[[ramalama...]]` as asserted in
test_unit/test_config_documentation.py); fix by replacing the single-bracket
backticked markers (e.g., `[ramalama]`) in this file with the double-bracket
form (e.g., `[[ramalama]]`) for all similar entries so the parser/test can
recognize the sections again.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8e2ca3ff-d3e0-4e63-90de-7bb59b556d58

📥 Commits

Reviewing files that changed from the base of the PR and between 78745bd and 4afb0cf.

📒 Files selected for processing (4)
  • docs/Makefile
  • docs/clean_for_man.py
  • docs/ramalama.conf.5.md
  • docsite/convert_manpages.py
✅ Files skipped from review due to trivial changes (1)
  • docs/Makefile
🚧 Files skipped from review as they are similar to previous changes (2)
  • docsite/convert_manpages.py
  • docs/clean_for_man.py

Comment thread docs/ramalama.conf.5.md Outdated

**Example configuration:**

B

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove accidental stray character before example block.

Line 69 contains a lone B, which appears to be an editing artifact and should be removed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/ramalama.conf.5.md` at line 69, Remove the stray lone character "B" that
precedes the example block in the documentation; delete that accidental
character so the example starts cleanly, and verify surrounding spacing/blank
line is preserved and no other stray characters remain.

Comment thread docs/ramalama.conf.5.md
@Olawoyin365
Olawoyin365 force-pushed the fix-config-doc-formatting branch from 4afb0cf to 8b37ad8 Compare April 15, 2026 21:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/unit/test_config_documentation.py (1)

50-55: ⚠️ Potential issue | 🟠 Major

Nested subsection matching is broken for provider.openai in both parsing functions.

Lines 50 and 131 add provider.openai to subsections_with_fields, but the regex patterns at lines 54 and 136 only match a single token after ramalama. using ([a-z_]+). This means section headers like [ramalama.provider.openai] won't be recognized, making the exclusion ineffective.

The regex patterns need to support dotted subsection names:

  • Line 54: Change ([a-z_]+) to ([a-z_]+(?:\.[a-z_]+)*)
  • Line 136: Change ([a-z_]+) to ([a-z_]+(?:\.[a-z_]+)*) and update bracket matching to \[{1,2} and \]{1,2}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/unit/test_config_documentation.py` around lines 50 - 55, The
section-matching regexes are too restrictive and don't recognize dotted
subsection names like "provider.openai"; update the patterns used in the parsing
functions by changing section_pattern (currently
r'^\s*(#?)\s*\[ramalama\.([a-z_]+)\]') to accept dotted names (use
([a-z_]+(?:\.[a-z_]+)*)) and likewise update the other regex used later (the one
around main_section_pattern/second section matcher) to use
([a-z_]+(?:\.[a-z_]+)*) and broaden bracket matching to \[{1,2} and \]{1,2} so
headers like [ramalama.provider.openai] (and single/double bracket variants) are
correctly recognized; update references to section_pattern and the second
section regex in both parsing functions where subsections_with_fields is
checked.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/ramalama.conf.5.md`:
- Around line 18-25: The docs table in docs/ramalama.conf.5.md omits the
$XDG_DATA_HOME-based path that the runtime loader actually checks; update the
table rows to include an entry for $XDG_DATA_HOME/ramalama/ramalama.conf (marked
as Linux / non-Windows defaults) and also mirror this addition where the same
table appears (lines ~30-35) so both $XDG_DATA_HOME/ramalama/ramalama.conf and
$XDG_CONFIG_HOME/ramalama/ramalama.conf are documented alongside the existing
/etc and /usr paths.

---

Outside diff comments:
In `@test/unit/test_config_documentation.py`:
- Around line 50-55: The section-matching regexes are too restrictive and don't
recognize dotted subsection names like "provider.openai"; update the patterns
used in the parsing functions by changing section_pattern (currently
r'^\s*(#?)\s*\[ramalama\.([a-z_]+)\]') to accept dotted names (use
([a-z_]+(?:\.[a-z_]+)*)) and likewise update the other regex used later (the one
around main_section_pattern/second section matcher) to use
([a-z_]+(?:\.[a-z_]+)*) and broaden bracket matching to \[{1,2} and \]{1,2} so
headers like [ramalama.provider.openai] (and single/double bracket variants) are
correctly recognized; update references to section_pattern and the second
section regex in both parsing functions where subsections_with_fields is
checked.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d45d6dae-85c3-4bb4-b5e6-306736051aa8

📥 Commits

Reviewing files that changed from the base of the PR and between 4afb0cf and 8b37ad8.

📒 Files selected for processing (5)
  • docs/Makefile
  • docs/clean_for_man.py
  • docs/ramalama.conf.5.md
  • docsite/convert_manpages.py
  • test/unit/test_config_documentation.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • docsite/convert_manpages.py
  • docs/clean_for_man.py
  • docs/Makefile

Comment thread docs/ramalama.conf.5.md
Comment on lines +18 to 25
| Path | Exception |
|------|----------|
| `/usr/share/ramalama/ramalama.conf` | Linux |
| `/usr/local/share/ramalama/ramalama.conf` | Linux |
| `/etc/ramalama/ramalama.conf` | Linux |
| `/etc/ramalama/ramalama.conf.d/*.conf` | Linux |
| `$HOME/.local/.pipx/venvs/usr/share/ramalama/ramalama.conf` | macOS (pipx installation) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Documented config search paths are missing the $XDG_DATA_HOME location.

The runtime loader includes both $XDG_DATA_HOME/ramalama/ramalama.conf and $XDG_CONFIG_HOME/ramalama/ramalama.conf in non-Windows defaults, but only the latter is documented here. This can mislead users debugging load order.

📝 Suggested table update
 | Path | Notes |
 |------|-------|
+| `$XDG_DATA_HOME/ramalama/ramalama.conf` | User data-dir config |
+| `$XDG_DATA_HOME/ramalama/ramalama.conf.d/*.conf` | User data-dir drop-in files |
 | `$XDG_CONFIG_HOME/ramalama/ramalama.conf` | Primary user config |
 | `$XDG_CONFIG_HOME/ramalama/ramalama.conf.d/*.conf` | User config drop-in files |

Also applies to: 30-35

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/ramalama.conf.5.md` around lines 18 - 25, The docs table in
docs/ramalama.conf.5.md omits the $XDG_DATA_HOME-based path that the runtime
loader actually checks; update the table rows to include an entry for
$XDG_DATA_HOME/ramalama/ramalama.conf (marked as Linux / non-Windows defaults)
and also mirror this addition where the same table appears (lines ~30-35) so
both $XDG_DATA_HOME/ramalama/ramalama.conf and
$XDG_CONFIG_HOME/ramalama/ramalama.conf are documented alongside the existing
/etc and /usr paths.

@Olawoyin365
Olawoyin365 force-pushed the fix-config-doc-formatting branch from 8b37ad8 to 9ede17e Compare April 15, 2026 21:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/unit/test_config_documentation.py (1)

68-75: ⚠️ Potential issue | 🔴 Critical

Don't record nested subsection paths as documented config fields.

documented.add(section_name) now captures nested names like provider.openai, but get_config_fields() only models top-level BaseConfig fields. Since this PR already adds [ramalama.provider.openai] in docs/ramalama.conf.5.md, the test_no_undocumented_fields_in_* checks will report a false extra field. Track nested sections for parsing, but only add top-level section names to documented.

🔧 Proposed fix
         if section_match:
             is_commented = section_match.group(1) == '#'
             section_name = section_match.group(2)
-            documented.add(section_name)
+            if '.' not in section_name:
+                documented.add(section_name)
             # Skip fields if it's a commented nested section OR if it's a subsection with its own fields
             in_commented_nested_section = is_commented or (section_name in subsections_with_fields)
             prev_line_blank = current_line_blank
             continue
         if section_match:
             section_name = section_match.group(1)
             current_section = section_name
-            documented.add(section_name)
+            if '.' not in section_name:
+                documented.add(section_name)
             continue

Also applies to: 147-152

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/unit/test_config_documentation.py` around lines 68 - 75, The test
records nested section names like "provider.openai" into documented via
documented.add(section_name), but get_config_fields() only lists top-level
BaseConfig names; change the logic where section_match is handled (the block
using section_match, section_name, in_commented_nested_section) so that instead
of adding the full section_name you extract and add only the top-level name
(e.g., section_name.split('.', 1)[0]) or skip adding if it contains a dot; keep
tracking nested sections for parsing via in_commented_nested_section, and apply
the same change to the analogous handling later in the file (the block around
the other documented.add usage at lines referenced as 147-152).
🧹 Nitpick comments (1)
docsite/convert_manpages.py (1)

241-243: Make the JSX escape resilient to doc formatting changes.

This exact-string replacement only fixes one formatting variant. A trivial copy change in docs/ramalama.conf.5.md will miss the replacement and bring the MDX build break back.

♻️ Suggested hardening
-    # Prevent JSX compilation error on the website
-    content = content.replace('**storage_folder**="<default store>/benchmarks"', '**storage_folder**="`<default store>`/benchmarks"')
+    # Prevent JSX compilation errors on placeholder paths like <default store>/...
+    content = re.sub(
+        r'(\*\*storage_folder\*\*=")<([^>]+)>(/benchmarks")',
+        r'\1`<\2>`\3',
+        content,
+    )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docsite/convert_manpages.py` around lines 241 - 243, The current exact-string
replace on content is brittle; change it to use a regex-based replacement so any
formatting/quoting/asterisk variations are handled: use re.sub on the variable
content (replace the current content = content.replace(...) line in
convert_manpages.py) to locate the storage_folder assignment and only wrap the
literal <default store> in backticks (preserving surrounding emphasis markers
and quotes) rather than matching the entire exact string; this makes the
transformation resilient to minor doc formatting changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@test/unit/test_config_documentation.py`:
- Around line 68-75: The test records nested section names like
"provider.openai" into documented via documented.add(section_name), but
get_config_fields() only lists top-level BaseConfig names; change the logic
where section_match is handled (the block using section_match, section_name,
in_commented_nested_section) so that instead of adding the full section_name you
extract and add only the top-level name (e.g., section_name.split('.', 1)[0]) or
skip adding if it contains a dot; keep tracking nested sections for parsing via
in_commented_nested_section, and apply the same change to the analogous handling
later in the file (the block around the other documented.add usage at lines
referenced as 147-152).

---

Nitpick comments:
In `@docsite/convert_manpages.py`:
- Around line 241-243: The current exact-string replace on content is brittle;
change it to use a regex-based replacement so any formatting/quoting/asterisk
variations are handled: use re.sub on the variable content (replace the current
content = content.replace(...) line in convert_manpages.py) to locate the
storage_folder assignment and only wrap the literal <default store> in backticks
(preserving surrounding emphasis markers and quotes) rather than matching the
entire exact string; this makes the transformation resilient to minor doc
formatting changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6d6550bc-c0f7-4a0d-8637-d728395f7cd9

📥 Commits

Reviewing files that changed from the base of the PR and between 8b37ad8 and 9ede17e.

📒 Files selected for processing (5)
  • docs/Makefile
  • docs/clean_for_man.py
  • docs/ramalama.conf.5.md
  • docsite/convert_manpages.py
  • test/unit/test_config_documentation.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/Makefile
  • docs/clean_for_man.py

@Olawoyin365
Olawoyin365 force-pushed the fix-config-doc-formatting branch from 9ede17e to 50e2301 Compare April 15, 2026 21:58
@Olawoyin365

Olawoyin365 commented Apr 15, 2026

Copy link
Copy Markdown
Author

Please verify tat the man pages actually generate look good.

man ./*.1

@rhatdan, Thanks for pointing that out. I regenerated and verified the build locally, and the man pages compile successfully and display correctly in the terminal.

Here is a quick recording of the final terminal output.

olawoyin@OLAWOYIN__mnt_c_Users_DELL_Documents_ramalama_docs.2026-04-16.02-19-38.mp4

@Olawoyin365
Olawoyin365 force-pushed the fix-config-doc-formatting branch from 50e2301 to 6e64b7e Compare April 16, 2026 01:14
…preprocessor

Signed-off-by: woyin365 <woyin365@gmail.com>
@github-actions

Copy link
Copy Markdown

A friendly reminder that this PR had no activity for 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants