Feature: Added tab to display README from GitHub repo#12
Open
epoll31 wants to merge 7 commits intodubinc:mainfrom
Open
Feature: Added tab to display README from GitHub repo#12epoll31 wants to merge 7 commits intodubinc:mainfrom
epoll31 wants to merge 7 commits intodubinc:mainfrom
Conversation
|
@epoll31 is attempting to deploy a commit to the Dub Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added a tab that loads the
readme.mdfile from GitHub through the Octokit API (lib/actiona/get-readme.ts).I pass load that into a component name
Readmeincomponents/projects/project-readme.tsxthat uses thereact-markdownpackage. I imported the same plugins using #3 as a referenceFor the code block syntax highlighting I used Shiki v1.3.0 with the 'github-light' theme. I do the actual syntax highlighting in a server action (
lib/actions/code-to-html.ts) instead of as a plugin toreact-markdownwhich makes it very easy to use and customize.For the markdown components, I implemented most of them directly in
components/projects/project-readme.tsxto keep the imports minimal since most of them are simple. However, I did implementCodeincomponents/md/Code.tsxsince it is a bit more complex and requires hooks to perform a call thecodeToHtmlserver action.I checked my markdown implementation using a complete markdown example.
I kept the styling very minimal, but feel free to let me know how you would like them to look and I can add to the styles.
Here are screenshots of the results of that so that you can see what it looked like.









