Skip to content

docs: fix duplicate code block syntax in example sections#357

Open
guesung wants to merge 2 commits intotoss:mainfrom
guesung:docs/fix-duplicate-code-block-syntax
Open

docs: fix duplicate code block syntax in example sections#357
guesung wants to merge 2 commits intotoss:mainfrom
guesung:docs/fix-duplicate-code-block-syntax

Conversation

@guesung
Copy link
Copy Markdown
Contributor

@guesung guesung commented Apr 1, 2026

Summary

  • Fix duplicate markdown code block syntax (````tsx + ```tsx) in 5 documentation files
  • Remove orphaned empty code blocks left after examples
  • Fix tsxp typo in useNetworkStatus.md

Affected files

  • packages/core/src/hooks/useMap/useMap.md
  • packages/mobile/src/hooks/useBodyScrollLock/useBodyScrollLock.md
  • packages/mobile/src/hooks/useNetworkStatus/useNetworkStatus.md
  • packages/mobile/src/hooks/usePageVisibility/usePageVisibility.md
  • packages/mobile/src/hooks/useScrollDirection/useScrollDirection.md

Before / After

Before After
image image

Test plan

  • Verify code examples render correctly in VitePress docs

Copilot AI review requested due to automatic review settings April 1, 2026 02:26
@autofix-troubleshooter
Copy link
Copy Markdown

Hi! I'm the autofix logoautofix.ci troubleshooter bot.

It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃

Copy link
Copy Markdown

Copilot AI left a 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 PR fixes malformed markdown fences in hook documentation examples so code samples render correctly (removing duplicated/open-ended code blocks and correcting a language tag typo).

Changes:

  • Remove duplicate code fence openers (````tsx + ```tsx) and orphaned empty code blocks in affected docs.
  • Normalize example code blocks to a single valid ```tsx fence.
  • Fix the tsxp typo to tsx in useNetworkStatus.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/hooks/useMap/useMap.md Removes duplicate/orphaned code fences around the example.
packages/mobile/src/hooks/useBodyScrollLock/useBodyScrollLock.md Removes duplicate/orphaned code fences around the example.
packages/mobile/src/hooks/useNetworkStatus/useNetworkStatus.md Fixes tsxptsx and removes duplicate/orphaned code fences.
packages/mobile/src/hooks/usePageVisibility/usePageVisibility.md Removes duplicate/orphaned code fences around the example.
packages/mobile/src/hooks/useScrollDirection/useScrollDirection.md Removes duplicate/orphaned code fences around the example (also reveals an existing Interface/signature mismatch noted in comments).
Comments suppressed due to low confidence (1)

packages/mobile/src/hooks/useScrollDirection/useScrollDirection.md:33

  • The example destructures { direction, position }, but the Interface section above currently declares function useScrollDirection(): void; and doesn’t show the options parameter. This makes the docs inconsistent with the actual hook API (it returns a state object and accepts options.throttleMs). Please update the Interface signature to match the implementation/usage so generated docs don’t mislead consumers.
function Header() {
  const { direction, position } = useScrollDirection();

  // Hide header on scroll down
  const isHidden = direction === 'down' && position > 100;

@guesung guesung force-pushed the docs/fix-duplicate-code-block-syntax branch from 0e5592c to 52fb202 Compare April 1, 2026 04:42
Copy link
Copy Markdown
Collaborator

@kimyouknow kimyouknow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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.

4 participants