-
Notifications
You must be signed in to change notification settings - Fork 1k
Migrate docs site from Jekyll to DocFX #1642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Remove Jekyll site files (docs/_config.yml, _layouts/default.html, assets/style.css) - Add DocFX config and inputs (docs/docfx.json, docs/api/, docs/toc.yml and many new documentation pages) - Add GitHub Actions workflow to build & deploy DocFX site (.github/workflows/docfx-gh-pages.yml) - Update README and in-repo docs to reference DocFX-driven documentation and new doc paths - Add docs assets placeholder and documentation content (application-integration, configuration, numbers, dates-and-times, performance, testing, troubleshooting, etc.) - Update .gitignore to exclude DocFX build/worktree/artifacts and generated API YAML files Prepare repository for DocFX-based multi-version documentation and GitHub Pages deployment.
- application-integration: remove optional global using lines and add a concrete HumanizingMetadataProvider example + registration. - collection-humanization: add culture-keyed collection formatter example and full Oxford-style implementation; recommend startup registration. - configuration: expand Configurator examples (formatters, collection formatters, number converters), clarify strategy/registry usage, testing guidance, and restore/reset patterns. - dates-and-times: show TimeSpan.Humanize usage with custom separators/toWords and simplify ordinal example API. - enumerations: document UseEnumDescriptionPropertyLocator and recommend startup registration and test restoration. - heading: replace CultureContext with explicit try/finally culture swap, rename Short/FromShortHeading to Abbreviated/FromAbbreviatedHeading. - inflector: prefer Kebaberize in examples and update normalization recommendations. - numbers: clarify ToWords supports whole numbers (int/long) and move fractional guidance to tips. - performance: replace CultureScope sample with explicit try/finally culture switch and add tip to always restore culture. - string-transformations: remove global transformer registry guidance, add RemoveDiacritics implementation and a Slug/ToSlug helper, encourage extension helpers for reuse. - testing: prefer capturing/restoring Configurator values in IDisposable fixtures and update sample tests accordingly; update checklist item for restoring settings. - troubleshooting: update test guidance to capture/restore configuration instead of calling Configurator.Reset(). - v3-namespace-migration: fix README link and remove stray Configurator.Localisation lines. - readme: minor wording tweak (use "40" instead of "forty").
…nd invoke it from workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request restructures Humanizer's documentation from Jekyll to DocFX, consolidating the README from a comprehensive feature showcase into a concise landing page, and organizing detailed content into modular guides. The changes include:
- Replacing Jekyll-based GitHub Pages with a DocFX documentation site
- Condensing the 1,100+ line README to ~100 lines focused on installation and navigation
- Creating focused documentation pages for features, operations, localization, and integration
- Implementing multi-version documentation build infrastructure with versioning support
Reviewed Changes
Copilot reviewed 34 out of 36 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
readme.md |
Streamlined from feature manual to concise navigation hub |
docs/toc.yml |
New DocFX table of contents defining site structure |
docs/docfx.json |
DocFX configuration for metadata and build settings |
docs/*.md |
New feature guides (testing, performance, troubleshooting, etc.) |
docs/v3-namespace-migration.md |
Removed obsolete configuration examples |
docs/index.md |
Updated landing page linking to reorganized guides |
.github/workflows/docfx-gh-pages.yml |
New GitHub Actions workflow for documentation builds |
.github/workflows/scripts/build-docfx.sh |
Multi-version documentation build script |
.gitignore |
Added DocFX-specific exclusions |
Jekyll files (_config.yml, _layouts/, assets/css/) |
Removed Jekyll scaffolding |
| foreach (var item in items) | ||
| { | ||
| item.DisplayAge = item.Created.Humanize(); | ||
| item.DisplayCount = item.Count.ToQuantity("élément"); |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] ToQuantity expects the base word to be singular (e.g., "élément") and will pluralize it. However, this example doesn't show proper usage since French pluralization requires proper vocabulary setup. The code should demonstrate calling ToQuantity with the correct culture or clarify that the vocabulary must be configured for French.
|
@copilot address the code review comments, including this one: Inside the release loop the script unconditionally executes docfx metadata and docfx build in every rel/* worktree. Existing release branches were created before this migration and still contain the Jekyll docs layout (no docs/docfx.json, different target frameworks). When such a branch is fetched the commands here will fail and the whole GitHub Pages workflow aborts, preventing documentation from publishing. Consider skipping branches that do not contain DocFX configuration or handling failures per branch so older releases do not block the deployment. |
|
@clairernovotny I've opened a new pull request, #1643, to work on those changes. Once the pull request is ready, I'll request review from you. |
…acy release branches (#1643) Co-authored-by: clairernovotny <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 34 out of 36 changed files in this pull request and generated 6 comments.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 34 out of 36 changed files in this pull request and generated 5 comments.
|
@copilot address all of the remaining feedback/comments/suggestions and verify that ToQuantity as well |
|
@clairernovotny I've opened a new pull request, #1644, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: clairernovotny <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
@clairernovotny I've opened a new pull request, #1645, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: clairernovotny <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 33 out of 35 changed files in this pull request and generated 5 comments.
| foreach (var item in items) | ||
| { | ||
| item.DisplayAge = item.Created.Humanize(); | ||
| // ToQuantity expects a singular word and handles pluralization automatically |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states 'ToQuantity expects a singular word,' but ToQuantity is an extension method on int, not string. The correct usage shown would be item.Count.ToQuantity(\"élément\") where the first parameter is the singular word. Consider clarifying this example to show the correct signature: \"élément\".ToQuantity(item.Count) instead, which matches the typical usage pattern seen throughout the codebase.
| // ToQuantity expects a singular word and handles pluralization automatically | |
| // ToQuantity is an extension method on int; pass the singular word as the argument (e.g., item.Count.ToQuantity("élément")) |
|
|
||
| ```csharp | ||
| 21.Ordinalize(); // "21st" | ||
| "car".ToQuantity(2).Ordinalize(); // "2nd cars" |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example \"car\".ToQuantity(2).Ordinalize() is incorrect. ToQuantity returns a string, and Ordinalize is not a string extension method. The correct pattern would be 2.Ordinalize() + \" cars\" or just \"car\".ToQuantity(2) without the Ordinalize call. This example will not compile and should be removed or corrected.
| "car".ToQuantity(2).Ordinalize(); // "2nd cars" | |
| 2.Ordinalize() + " cars"; // "2nd cars" |
| ## Culture-specific behavior | ||
|
|
||
| Most languages beyond English require a culture-specific vocabulary. Humanizer ships with many built-in vocabularies—for example, `Humanizer.Core.fr` for French. Ensure you set `CultureInfo.CurrentUICulture` or pass a culture explicitly when working across locales. | ||
|
|
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example implies that French pluralization is built-in by setting CurrentUICulture, but the preceding section states 'Humanizer ships with many built-in vocabularies—for example, Humanizer.Core.fr for French.' For clarity, explicitly mention that the Humanizer.Core.fr package must be installed for this example to work, as pluralization vocabularies are not culture-aware by default in the base package.
| > **Note:** To use French pluralization, you must install the `Humanizer.Core.fr` NuGet package: | |
| > ``` | |
| > dotnet add package Humanizer.Core.fr | |
| > ``` |
| var beverages = new[] { "coffee", "tea", "water" }; | ||
| string text = beverages.Humanize(); // "coffee, tea, and water" | ||
| text.ToQuantity(3, ShowQuantityAs.Words); // "three coffee, tea, and water" |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example text.ToQuantity(3, ShowQuantityAs.Words) produces misleading output. ToQuantity is meant to be called on a singular noun (e.g., \"item\".ToQuantity(3) → "3 items"), not on an already-formatted list. The example output "three coffee, tea, and water" is grammatically incorrect and doesn't demonstrate proper usage. Consider replacing this with a clearer example or removing it entirely.
| var beverages = new[] { "coffee", "tea", "water" }; | |
| string text = beverages.Humanize(); // "coffee, tea, and water" | |
| text.ToQuantity(3, ShowQuantityAs.Words); // "three coffee, tea, and water" | |
| var beverage = "beverage"; | |
| beverage.ToQuantity(3, ShowQuantityAs.Words); // "three beverages" | |
| // Or, to pluralize each item in a collection: | |
| var beverages = new[] { "coffee", "tea", "water" }; | |
| var pluralized = beverages.Select(b => b.ToQuantity(3, ShowQuantityAs.Words)); | |
| pluralized.Humanize(); // "three coffees, three teas, and three waters" |
| backup.ToString(); // "10.5 GB" | ||
| backup.ToString("#.## MB"); // "10752 MB" | ||
| backup.Humanize("0.00 TB"); // "0.01 TB" | ||
| backup.ToFullWords(); // "ten point five gigabytes" |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example suggests that ToFullWords() converts numeric values to words ("ten point five"), but based on the original readme, ToFullWords() converts unit abbreviations to full words (e.g., "GB" → "gigabytes") without converting the numeric portion. The expected output should be "10.5 gigabytes" not "ten point five gigabytes". Correct the example output.
| backup.ToFullWords(); // "ten point five gigabytes" | |
| backup.ToFullWords(); // "10.5 gigabytes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 39 out of 41 changed files in this pull request and generated 1 comment.
| <?xml version="1.0" encoding="utf-8"?> | ||
| <configuration> | ||
| <packageSources> | ||
| <clear /> | ||
| <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> | ||
| <add key="DocFX" value="https://docfx.pkgs.visualstudio.com/docfx/_packaging/docs-public-packages/nuget/v3/index.json" /> | ||
| </packageSources> | ||
| <activePackageSource> | ||
| <add key="All" value="(Aggregate source)" /> | ||
| </activePackageSource> | ||
| </configuration> No newline at end of file |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the build and validation guidance in the coding guidelines, changes to NuGet.config should never be committed. The guidance explicitly states: "If you need to reference those newly built packages, create or update NuGet.config to use that package output path as a package source--but never commit changes to that file."
This nuget.config file adds a DocFX package source which appears to be related to documentation build requirements. While this may be necessary for DocFX, it violates the stated guideline. Consider:
- Adding
nuget.configto.gitignoreto prevent accidental commits - Documenting the DocFX package source requirement in a README or setup guide instead
- Using a different mechanism (like a checked-in template or environment-specific configuration) if DocFX requires this source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 53 out of 58 changed files in this pull request and generated 5 comments.
| ```csharp | ||
| "Ready to ship".DehumanizeTo<OrderStatus>(); // OrderStatus.ReadyToShip | ||
| "ready_to_ship".DehumanizeTo<OrderStatus>(); // OrderStatus.ReadyToShip | ||
| "Awaiting fulfilment".DehumanizeTo<OrderStatus>(); // OrderStatus.AwaitingFulfillment |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: "fulfilment" should be "fulfillment" (American English, consistent with the rest of the documentation).
| { | ||
| item.DisplayAge = item.Created.Humanize(); | ||
| // ToQuantity expects a singular word and handles pluralization automatically | ||
| item.DisplayCount = item.Count.ToQuantity("élément"); |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example shows calling ToQuantity on a string ("élément"), but according to the Humanizer API, ToQuantity is an extension method on strings that takes a number. The correct usage should be "élément".ToQuantity(item.Count) rather than item.Count.ToQuantity("élément").
|
|
||
| ```csharp | ||
| 21.Ordinalize(); // "21st" | ||
| "car".ToQuantity(2).Ordinalize(); // "2nd cars" |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code example shows calling Ordinalize() on a string returned by ToQuantity, but Ordinalize() is a method on integers, not strings. This example appears to be incorrect. It should be something like 2.Ordinalize() to get "2nd", or the example should be corrected to show valid usage.
| { | ||
| PendingPayment, | ||
|
|
||
| [Description("Awaiting fulfilment")] |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: "fulfilment" should be spelled "fulfillment" (American English spelling). Since the rest of the documentation uses American English conventions, this should be consistent.
| } | ||
|
|
||
| OrderStatus.PendingPayment.Humanize(); // "Pending payment" | ||
| OrderStatus.AwaitingFulfillment.Humanize(); // "Awaiting fulfilment" |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: "fulfilment" should be "fulfillment" (American English, consistent with the rest of the documentation).
- Add DocFxMarkdownGen configuration for Markdown generation - Update build script to handle API documentation and metadata - Create sidebar for API version navigation - Introduce styles for API version picker - Update README and AGENTS.md with tooling expectations - Remove unused CSS for API pages - Add new configuration for DFMG and API version defaults
This pull request introduces a major overhaul to the documentation build and deployment process, switching from Jekyll/GitHub Pages to DocFX for multi-version API documentation. It adds a GitHub Actions workflow to automate building and deploying documentation for both the main branch and release branches, generates a comprehensive API reference, and provides new integration guides for using Humanizer in various .NET application types. The old Jekyll configuration and layouts are removed to support this migration.
DocFX migration and automation:
.github/workflows/docfx-gh-pages.ymlto automate building and deploying DocFX-based documentation to GitHub Pages, supporting both main and release branches for multi-version docs..github/workflows/scripts/build-docfx.shto build documentation for all release branches using Git worktrees, aggregate results, and generate aversions.jsonmanifest for the site.Documentation content updates:
docs/api/index.mdanddocs/api/toc.ymlto provide a generated API reference for the Humanizer assembly, including a detailed table of contents for namespaces, types, and members. [1] [2]docs/application-integration.md, a comprehensive guide on integrating Humanizer into web, desktop, background, CLI, and logging scenarios, including code samples and best practices.docs/assets/README.mdto describe the purpose of the documentation assets folder for DocFX resources.Removal of legacy Jekyll files:
docs/_config.ymlanddocs/_layouts/default.html) as part of the migration to DocFX. [1] [2]