Skip to content
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

[2.x] Breaking: Change configuration option docs.table_of_contents to docs.sidebar.table_of_contents #1584

Conversation

caendesilva
Copy link
Member

Abstract

This changes the configuration option docs.table_of_contents to docs.sidebar.table_of_contents in order to normalize the configuration API. It targets HydePHP v2.x via #1568.

Upgrade guide

Move the table_of_contents option's array in the config/docs.php file into the sidebar array in the same file.

Before

return [
  'sidebar' => [
      // ...
  ],

  'table_of_contents' => [
    'enabled' => true,
    'min_heading_level' => 2,
    'max_heading_level' => 4,
  ],
];

After

return [
  'sidebar' => [
      // ...
  
    'table_of_contents' => [
        'enabled' => true,
        'min_heading_level' => 2,
        'max_heading_level' => 4,
    ],
  ],
];

….table_of_contents`

Breaking: This changes the configuration option `docs.table_of_contents` to `docs.sidebar.table_of_contents` in order to normalize the configuration API.
@caendesilva caendesilva added the WTD Calls What The Diff label Feb 22, 2024
@caendesilva caendesilva marked this pull request as ready for review February 22, 2024 18:57
Copy link

what-the-diff bot commented Feb 22, 2024

PR Summary

  • Updates to Configuration Settings
    Updated settings in the config/docs.php and packages/framework/config/docs.php, including addition of a new 'table_of_contents' setting. This allows users to enable or disable the table of contents, and adjust the minimum and maximum heading levels displayed.

  • Changes to Documentation Pages
    The configuration for documentation pages in docs/creating-content/documentation-pages.md has been revised. The 'table_of_contents' array has been updated to now being under the 'sidebar' array, facilitating better organization and easy navigation.

  • Enhancement of Views and Actions
    The settings in packages/framework/resources/views/components/docs/sidebar-item.blade.php and packages/framework/src/Framework/Actions/GeneratesTableOfContents.php have been altered to reflect changes to the new 'table_of_contents' configuration. This will ensure correct generation of tables of content based on the updated settings.

  • Modifications in Documentation Page Objects and Tests
    Changes have been made in packages/framework/src/Pages/DocumentationPage.php, packages/framework/tests/Feature/MarkdownServiceTest.php, and packages/framework/tests/Unit/DocumentationPageTest.php to support the updated 'table_of_contents' settings. These modifications ensure consistency across the codebase and assure appropriate testing against the new configuration.

@caendesilva caendesilva merged commit 00a245e into improved-navigation-internals Feb 22, 2024
6 checks passed
@caendesilva caendesilva deleted the normalize-navigation-configuration-api branch February 22, 2024 18:58
@caendesilva caendesilva mentioned this pull request Jun 27, 2024
74 tasks
@caendesilva caendesilva removed the WTD Calls What The Diff label Jun 30, 2024
@caendesilva caendesilva added this to the v2 milestone Jul 9, 2024
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