GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
GenerallyPositive.DigestRulesConfig Class Reference

Loads and saves the named DigestRuleSets used by HtmlToOptimizedMarkdown, stored as ./LLMDigestRules.yaml so site-specific tuning can be edited without recompiling. More...

Public Member Functions

DigestRuleSet SelectFor (string url, string ruleSetName=null)
 Picks the rule set to use for url : an explicit ruleSetName wins if it exists, otherwise the first non-generic rule set whose DomainPatterns match the URL, otherwise "generic". User rule sets take precedence over GPAL ones with the same name. Any field left empty on the selected rule set falls back to "generic"'s value.

Static Public Member Functions

static DigestRulesConfig Load (GPALFile file=null)
 Loads the digest rules config, refreshing the GPAL-managed section from Default while preserving the user section verbatim, and upgrading an older on-disk format in place. Falls back to Default if the file cannot be read. If file is provided it becomes the new default path for this session.
static void Save (GPALFile file=null)
 Writes a fresh config (GPAL defaults, empty user section) to the file as a starter for editing. If file is provided it becomes the new default path for this session.
static DigestRulesConfig Default ()
 Built-in rule sets, used when ./LLMDigestRules.yaml does not exist. Call DigestRulesConfig.Save() to write them out as a starting point for tuning.

Properties

static string CurrentSchemaVersion [get]
 Version stamped into the file, taken from the GPAL assembly version so the rules file records which build last wrote it. Falls back to the executing assembly version if GPAL.Version is not yet initialized.
string Version = null [get, set]
 Version of the loaded/saved file. Null or empty means a pre-versioning (legacy) file.
List< DigestRuleSetRuleSets = new List<DigestRuleSet>() [get, set]
 GPAL-managed rule sets. Refreshed from Default on every load; edits here are not preserved.
List< DigestRuleSetUserRuleSets = new List<DigestRuleSet>() [get, set]
 User-owned rule sets. GPAL never modifies, removes, or re-adds these. Moving a GPAL rule set here "adopts" it.

Detailed Description

Loads and saves the named DigestRuleSets used by HtmlToOptimizedMarkdown, stored as ./LLMDigestRules.yaml so site-specific tuning can be edited without recompiling.

Definition at line 60 of file DigestRules.cs.

Member Function Documentation

◆ Default()

DigestRulesConfig GenerallyPositive.DigestRulesConfig.Default ( )
static

Built-in rule sets, used when ./LLMDigestRules.yaml does not exist. Call DigestRulesConfig.Save() to write them out as a starting point for tuning.

Definition at line 279 of file DigestRules.cs.

◆ Load()

DigestRulesConfig GenerallyPositive.DigestRulesConfig.Load ( GPALFile file = null)
static

Loads the digest rules config, refreshing the GPAL-managed section from Default while preserving the user section verbatim, and upgrading an older on-disk format in place. Falls back to Default if the file cannot be read. If file is provided it becomes the new default path for this session.

Definition at line 108 of file DigestRules.cs.

◆ Save()

void GenerallyPositive.DigestRulesConfig.Save ( GPALFile file = null)
static

Writes a fresh config (GPAL defaults, empty user section) to the file as a starter for editing. If file is provided it becomes the new default path for this session.

Definition at line 170 of file DigestRules.cs.

◆ SelectFor()

DigestRuleSet GenerallyPositive.DigestRulesConfig.SelectFor ( string url,
string ruleSetName = null )

Picks the rule set to use for url : an explicit ruleSetName wins if it exists, otherwise the first non-generic rule set whose DomainPatterns match the URL, otherwise "generic". User rule sets take precedence over GPAL ones with the same name. Any field left empty on the selected rule set falls back to "generic"'s value.

Definition at line 240 of file DigestRules.cs.

Property Documentation

◆ CurrentSchemaVersion

string GenerallyPositive.DigestRulesConfig.CurrentSchemaVersion
staticget

Version stamped into the file, taken from the GPAL assembly version so the rules file records which build last wrote it. Falls back to the executing assembly version if GPAL.Version is not yet initialized.

Definition at line 69 of file DigestRules.cs.

◆ RuleSets

List<DigestRuleSet> GenerallyPositive.DigestRulesConfig.RuleSets = new List<DigestRuleSet>()
getset

GPAL-managed rule sets. Refreshed from Default on every load; edits here are not preserved.

Definition at line 78 of file DigestRules.cs.

◆ UserRuleSets

List<DigestRuleSet> GenerallyPositive.DigestRulesConfig.UserRuleSets = new List<DigestRuleSet>()
getset

User-owned rule sets. GPAL never modifies, removes, or re-adds these. Moving a GPAL rule set here "adopts" it.

Definition at line 81 of file DigestRules.cs.

◆ Version

string GenerallyPositive.DigestRulesConfig.Version = null
getset

Version of the loaded/saved file. Null or empty means a pre-versioning (legacy) file.

Definition at line 75 of file DigestRules.cs.


The documentation for this class was generated from the following file: