2 KiB
Configuration Guide
GemReader uses a TOML-based configuration file to customize the application behavior. The configuration file is named config.toml and should be placed in the same directory where you run the application.
Default Configuration File
The default config.toml file looks like this:
title = "GemReader"
Available Configuration Options
title
- Type: String
- Default: "GemReader"
- Description: Sets the title displayed at the top of the application interface
default_file
- Type: String
- Default: "" (empty)
- Description: Sets the default markdown file to open when no file is provided as a command-line argument
Configuration Loading
The application attempts to load the configuration file when it starts. If the file is not found or contains errors, the application will continue to run with default settings.
The configuration is loaded using the Viper library, which supports:
- Loading from
config.tomlin the current directory - Environment variable overrides (with
GEMREADER_prefix) - Default fallback values
Example Advanced Configuration
While the current version only supports the title configuration, future versions may support additional options:
title = "My Markdown Viewer"
# These options are planned for future releases:
# theme = "dark" # Color theme (dark/light)
# toc_enabled = true # Whether to generate table of contents
# line_numbers = false # Show line numbers
# wrap_text = true # Wrap long lines
Troubleshooting
Configuration File Not Found
If the application starts but the custom title isn't displayed, ensure that:
- The
config.tomlfile exists in the current working directory - The file has the correct format and valid TOML syntax
- The application has read permissions for the file
Invalid Configuration
If the configuration file contains invalid TOML syntax, the application will log an error and use default values instead.