Skip to content

Comments

Refactor R catalog code into modular architecture#75

Merged
Thiyaghessan merged 2 commits intomainfrom
iss74
Jan 20, 2026
Merged

Refactor R catalog code into modular architecture#75
Thiyaghessan merged 2 commits intomainfrom
iss74

Conversation

@Thiyaghessan
Copy link
Collaborator

  • Create modular R structure in catalogs/R/:

    • config.R: Centralized constants, URLs, regex patterns
    • validators.R: Input validation with informative errors
    • extractors.R: Year/month/path extraction and filtering
    • url_builders.R: S3 and archive URL construction
    • buttons.R: HTML button generation
    • catalog_builders.R: Series-specific catalog building
    • nccs_catalog.R: Main entry point
  • Add shared Quarto config (catalogs/_quarto.yml) with:

    • Consolidated library directory (_shared-libs)
    • Shared CSS styles (catalogs/styles/catalog.css)
  • Add testing infrastructure:

    • GitHub Actions CI workflow (.github/workflows/build.yml)
    • testthat tests for R functions (catalogs/tests/)
  • Add JSDoc documentation to all JS modules

  • Fix CSS syntax error in www/header.html

  • Add .gitattributes for generated files

  • Clean up dead code in build-catalogs.R

  • Simplify catalog .qmd files to use shared config

root and others added 2 commits January 20, 2026 14:36
- Create modular R structure in catalogs/R/:
  - config.R: Centralized constants, URLs, regex patterns
  - validators.R: Input validation with informative errors
  - extractors.R: Year/month/path extraction and filtering
  - url_builders.R: S3 and archive URL construction
  - buttons.R: HTML button generation
  - catalog_builders.R: Series-specific catalog building
  - nccs_catalog.R: Main entry point

- Add shared Quarto config (catalogs/_quarto.yml) with:
  - Consolidated library directory (_shared-libs)
  - Shared CSS styles (catalogs/styles/catalog.css)

- Add testing infrastructure:
  - GitHub Actions CI workflow (.github/workflows/build.yml)
  - testthat tests for R functions (catalogs/tests/)

- Add JSDoc documentation to all JS modules
- Fix CSS syntax error in www/header.html
- Add .gitattributes for generated files
- Clean up dead code in build-catalogs.R
- Simplify catalog .qmd files to use shared config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Thiyaghessan Thiyaghessan merged commit 9fb3136 into main Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant