Skip to content

Conversation

samchon
Copy link
Owner

@samchon samchon commented Jun 26, 2025

=
This pull request introduces a significant refactor of the documentation's code examples, replacing remote file references with local file imports. It also includes the addition of new helper components (LocalSource) to support this transition. The changes improve maintainability and reduce dependency on external URLs.

Refactoring to Use Local File Imports

  • New LocalSource Component: Introduced the LocalSource component in website/src/components/LocalSource.tsx to handle rendering of local code examples. It supports options like filename, showLineNumbers, and highlight. ([website/src/components/LocalSource.tsxR1-R28](https://github.com/samchon/typia/pull/1600/files#diff-6b2285a875907777f86cfdd23524aed7db06cdc56418adafe6439f3737570ca8R1-R28))
  • Helper Function for File Access: Added getLocalSourceFile in website/src/components/internal/getLocalSourceFile.ts to fetch and process local source files. This includes handling .d.ts files and resolving project root paths dynamically. ([website/src/components/internal/getLocalSourceFile.tsR1-R36](https://github.com/samchon/typia/pull/1600/files#diff-4bb86c2c529a6d6b36aea15bd08f9563788c3a85eca3634473d037a486dc3c08R1-R36))

Updates to Documentation Files

  • Replaced RemoteSource with LocalSource: Updated multiple .mdx files to replace RemoteSource with LocalSource for code examples. This change affects documentation for JSON (parse.mdx, schema.mdx, stringify.mdx) and LLM functionalities (application.mdx, chat.mdx, parameters.mdx). ([[1]](https://github.com/samchon/typia/pull/1600/files#diff-a14b2c44786d76ea5e0ecf15add526bc4722fcf1f1a1d3b947968a8b0318b38bR6), [[2]](https://github.com/samchon/typia/pull/1600/files#diff-eedd1f983565f904efb871bd9e77018f5479130bfd574392e150103f0d713f5bR6), [[3]](https://github.com/samchon/typia/pull/1600/files#diff-0d9f48646214fbe9a0062b3d8da92110e14bd62797024b98cc88d277f89cb7e2R8), [[4]](https://github.com/samchon/typia/pull/1600/files#diff-2e637ee7fad1dc9b51092ffdc31a7f619d5a87166f7cf7229f817fd927a73f0bR6), [[5]](https://github.com/samchon/typia/pull/1600/files#diff-ce26840aa7900a0aaedcf7b95dbf7ae2d74c9601147ff8281cf53cb0b454e479L6-R6), [[6]](https://github.com/samchon/typia/pull/1600/files#diff-2a36900e1c87e7693cab0b0033bd11ef3aba9a28f93ba491976e76bf4751b0cdR6))

Minor Adjustments

  • .gitignore Update: Removed !bin entry from .gitignore, likely to align with the new local file usage strategy. ([examples/.gitignoreL1](https://github.com/samchon/typia/pull/1600/files#diff-6940749267f41d54935f96cc3c8e4d291602e9e70d8ac5c17d9da61e8ad305fcL1))

@samchon samchon requested a review from Copilot June 26, 2025 17:25
@samchon samchon self-assigned this Jun 26, 2025
@samchon samchon added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 26, 2025
Copy link
Contributor

@Copilot 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 pull request refactors the documentation code examples to use local file imports by replacing RemoteSource with a newly introduced LocalSource component. It also adds a helper function (getLocalSourceFile) to retrieve local source files and updates the .gitignore file accordingly.

Reviewed Changes

Copilot reviewed 22 out of 90 changed files in this pull request and generated 2 comments.

File Description
website/src/components/LocalSource.tsx Introduces the LocalSource component that compiles and renders local MDX content.
website/src/components/internal/getLocalSourceFile.ts Adds a helper to retrieve local files with caching and pre-build logic.
*.mdx files across docs repositories Replaces RemoteSource with LocalSource for local file display in code examples.
examples/.gitignore Removes the "!bin" exclusion to better support the new local file usage strategy.

@samchon samchon merged commit 5718e2c into master Jun 26, 2025
4 checks passed
@samchon samchon deleted the feat/remote branch June 26, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant