Module:ConfigRepository: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
 
(11 intermediate revisions by the same user not shown)
Line 50: Line 50:


     -- IMPORTANT: "Logo" is processed automatically whenever it is called as a key by the Template Blueprint, in such a way that it does not need to be declared for any templates in this repository
     -- IMPORTANT: "Logo" is processed automatically whenever it is called as a key by the Template Blueprint, in such a way that it does not need to be declared for any templates in this repository
}
-- Global field patterns used in multiple templates
p.fieldPatterns = {
    itemDelimiter = ";%s*",  -- Matches semicolon followed by optional whitespace
    websitePattern = "^https?://[^%s]+"  -- Matches URLs starting with http:// or https://
}
-- Global field processors for reusable field definitions
p.fieldProcessors = {
    website = {
        list = { mode = 'bullet_custom', bulletChar = '🔗', postProcess = 'website' }
    }
}
}


Line 99: Line 112:
p.dateFormatting = {
p.dateFormatting = {
     useShortMonthNames = true
     useShortMonthNames = true
}
-- Global campaigns configuration
-- Campaigns are defined centrally and specify which templates they can be applied to
p.campaigns = {
    ASP2025 = {
        name = "ASP 2025 Pro Bono Service Provider",
        applicable_templates = {"Person", "Organization"},
        json_config = "ASP2025"
    }
}
}


Line 201: Line 224:
             -- Patterns for event navigation detection
             -- Patterns for event navigation detection
             seriesNumber = "^([%w%s]+)%s+(%d+)$",    -- e.g., "ICANN 76"
             seriesNumber = "^([%w%s]+)%s+(%d+)$",    -- e.g., "ICANN 76"
             seriesYear = "^([%w%s]+)%s+(%d%d%d%d)$"  -- e.g., "IGF 2023"
             seriesYear = "^([%w%s]+)%s+(%d%d%d%d)$", -- e.g., "IGF 2023"
            itemDelimiter = p.fieldPatterns.itemDelimiter,
            websitePattern = p.fieldPatterns.websitePattern
         },
         },
         fields = {
         fields = {
Line 212: Line 237:
             {key="venue", label="Venue"},
             {key="venue", label="Venue"},
             {key="organizer", label="Organizer"},
             {key="organizer", label="Organizer"},
             {keys={"website", "url"}, label=p.fieldLabels.website},
             {keys={"website", "url"}, label=p.fieldLabels.website, list=p.fieldProcessors.website.list},
         },
         },
         semantics = {
         semantics = {
Line 240: Line 265:
     LibraryInterview = {
     LibraryInterview = {
         meta = {
         meta = {
             description = "Library Interview template"
             description = "Library Interview template",
            page_creator = false
         },
         },
         categories = { -- Default categories
         categories = { -- Default categories
Line 302: Line 328:
             norm_type = {
             norm_type = {
                 {canonical = "Act", category = "Acts"},
                 {canonical = "Act", category = "Acts"},
                {canonical = "Agreement", category = "Agreements"},
                {canonical = "Framework", category = "Frameworks"},
                 {canonical = "Law", category = "Laws"},
                 {canonical = "Law", category = "Laws"},
                 {canonical = "Regulation", category = "Regulations"},
                 {canonical = "Regulation", category = "Regulations"},
Line 338: Line 366:
             {key="norm_status", label="Status"}, -- Key used in templatedata
             {key="norm_status", label="Status"}, -- Key used in templatedata
             {key="official_text", label="Official text"},
             {key="official_text", label="Official text"},
             {key="related_norm", label="Related Norms"},
             {key="related_norm", label="Related Norms", list="bullet"},
             {key="parent_framework", label="Parent legal framework", autoWikiLink=true},
             {key="parent_framework", label="Parent legal framework", autoWikiLink=true},
             {key="norm_language", label="Language"}
             {key="norm_language", label="Language"}
Line 431: Line 459:
                     category = "Standards development organization"}
                     category = "Standards development organization"}
             }
             }
        },
        patterns = {
            itemDelimiter = p.fieldPatterns.itemDelimiter,
            websitePattern = p.fieldPatterns.websitePattern
         },
         },
         fields = {
         fields = {
Line 439: Line 471:
             {key="city", label=p.fieldLabels.city},
             {key="city", label=p.fieldLabels.city},
             {key="date_founded", label="Founded"},
             {key="date_founded", label="Founded"},
             {key="founders", label="Founders"},
             {key="founders", label="Founders", autoWikiLink=true, list="bullet"},
             {key="ownership", label="Ownership", autoWikiLink=true},
             {key="ownership", label="Ownership", autoWikiLink=true},
             {key="subsidiaries", label="Subsidiaries"},
             {key="subsidiaries", label="Subsidiaries", list="bullet"},
             {keys={"website", "url"}, label=p.fieldLabels.website},
             {keys={"website", "url"}, label=p.fieldLabels.website, list=p.fieldProcessors.website.list},
         },
         },
         semantics = {
         semantics = {
Line 478: Line 510:
         },
         },
         creatorFields = {"PAGE_NAME", "OCCUPATION", "COUNTRY"},
         creatorFields = {"PAGE_NAME", "OCCUPATION", "COUNTRY"},
        variants = {
            ASP2025 = {
                name = "Person (ASP 2025)",
                state = true,
                campaign_template = "ASP2025",
                description = "Person template with ASP 2025 campaign integration"
            }
        },
         mappings = {
         mappings = {
             -- REVIEW Community (Property:Has governance community)
             -- REVIEW Community (Property:Has governance community)
             community = {
             community = {
                -- Broad definition
                {canonical = "Internet Governance Community",
                    synonyms = {"ig", "internet governance"},
                    category = "Internet Governance Community"},
                 -- ICANN-related communities
                 -- ICANN-related communities
                 {canonical = "ICANN Community",
                 {canonical = "ICANN Community",
                     synonyms = {"icann", "community"},
                     synonyms = {"icann", "community"},
                     category = "ICANN Community"},
                     category = "ICANN Community"},
                 {canonical = "ICANN Staff",
                 {canonical = "ICANN Staff", -- Category provided via "badge-icann-staff"
                     synonyms = {"staff", "icann org"},
                     synonyms = {"staff", "icann org"},},
                    category = "ICANN Staff"},
                 -- Technical communities
                 -- Technical communities
                 {canonical = "Technical Community",
                 {canonical = "Technical Community",
Line 533: Line 560:
         fields = {
         fields = {
             {key="community", label="Community"},
             {key="community", label="Community"},
             {key="icann_group", label="ICANN group", autoWikiLink=true}, -- (Property:Has ICANN affiliation)
             {key="icann_group", label="ICANN SO/AC", autoWikiLink=true}, -- (Property:Has ICANN affiliation)
             {key="organization", label="Organization", autoWikiLink=true, list="bullet"},
             {key="organization", label="Organization", autoWikiLink=true, list="bullet"},
             {key="region", label=p.fieldLabels.region, list="bullet"},
             {key="region", label=p.fieldLabels.region, list="bullet"},
             {key="country", label=p.fieldLabels.country},
             {key="country", label=p.fieldLabels.country},
             {key="languages", label="Languages", list = { mode = 'bullet_custom', bulletChar = '🗣️', postProcess = 'language' }},
             {key="languages", label="Languages", list = { mode = 'bullet_custom', bulletChar = '🗣️', postProcess = 'language' }},
             {key="website", label=p.fieldLabels.website, list = { mode = 'bullet_custom', bulletChar = '🔗', postProcess = 'website' }},
             {key="website", label=p.fieldLabels.website, list=p.fieldProcessors.website.list},
             {key="soi", label="SOI"},
             {key="soi", label="SOI"},
             {key="userbox", label="Achievements"},
             {key="userbox", label="Achievements"},
Line 544: Line 571:
         },
         },
         patterns = {
         patterns = {
             itemDelimiter = ";%s*", -- Matches semicolon followed by optional whitespace; used for splitting multi-value fields
             itemDelimiter = p.fieldPatterns.itemDelimiter,
             websitePattern = "^https?://[^%s]+"  -- Matches URLs starting with http:// or https:// followed by non-whitespace chars
             websitePattern = p.fieldPatterns.websitePattern
         },
         },
         semantics = {
         semantics = {
Line 735: Line 762:
         patterns = {
         patterns = {
             tldExtension="%.([^%.]+)$",  -- Extracts the TLD part after the last dot (e.g., "com" from "example.com")
             tldExtension="%.([^%.]+)$",  -- Extracts the TLD part after the last dot (e.g., "com" from "example.com")
             countryDelimiter="([^;]+)"  -- Matches any sequence of characters not containing semicolons; used for country parsing
             countryDelimiter="([^;]+)",   -- Matches any sequence of characters not containing semicolons; used for country parsing
            itemDelimiter = p.fieldPatterns.itemDelimiter,
            websitePattern = p.fieldPatterns.websitePattern
         },
         },
         fields = {
         fields = {
Line 750: Line 779:
             {key="ascii", label="Punycode"},
             {key="ascii", label="Punycode"},
             {key="registry", label="Registry", autoWikiLink=true},
             {key="registry", label="Registry", autoWikiLink=true},
             {key="website", label=p.fieldLabels.website},
             {key="website", label=p.fieldLabels.website, list=p.fieldProcessors.website.list},
             {keys={"RVC", "PIC"}, label = "PIC/RVC"}
             {keys={"RVC", "PIC"}, label = "PIC/RVC"}
         },
         },