-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Automatically generate tutorial app from Markdown #2732
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
Open
infomiho
wants to merge
60
commits into
main
Choose a base branch
from
miho-tutorial-app-from-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 36 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
af0573b
Tutorial app from Markdown WIP
infomiho f30e545
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho f25bca5
Cleanup
infomiho a7d35a6
Parse diffs
infomiho 04287c7
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho c29048e
Edit diff DX
infomiho 373e563
Move patches outside of Markdown. Implement fixing broken diffs
infomiho 8cf25a8
Cleanup
infomiho 778602d
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho 72c0964
Cleanup
infomiho 2a41ada
Named patches WIP
infomiho e7546b5
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho 10c1f1c
Update TutorialAction component
infomiho d00d7db
Update TutorialAction design
infomiho 6a4a290
Stop using write action
infomiho 0a2f90f
Cleanup
infomiho 3ce2ca3
Cleanup
infomiho de1ad8a
Cleanup
infomiho 1110026
Restructure
infomiho eee3f77
Refactor. Add edit step command.
infomiho 3ea8530
Branded types, cleanup
infomiho c20ea08
Revert change to search-and-replace.ts
infomiho 1348c89
Cleanup TutorialAction
infomiho 69149ae
Cleanup
infomiho 7ba6f4a
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho d981153
Update styles
infomiho 66b0fa8
Fixes patch fixing bug. Update patches.
infomiho 8b3fe23
PR comments
infomiho 5ad4372
Cleanup
infomiho f0d6ec3
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho 6522952
Formatting
infomiho 80095ad
PR comments
infomiho f81a05d
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho 4e964f3
Refactor code
infomiho dc7fd21
Rename folder and update README
infomiho 845e146
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho 4aa1173
PR comments
infomiho 3af974a
Update naming
infomiho 04f9ade
Move app init into a separate action
infomiho b3f9aae
PR comments
infomiho 551679d
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho 1814a72
Update README
infomiho a2d043f
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho ec4ec93
PR comments
infomiho fe58646
PR comments
infomiho 6390e92
PR comments
infomiho 939c066
Add unit tests
infomiho db7d68c
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho aea3c6d
Update code block language
infomiho 7c03e0c
Cleanup README
infomiho 9ecdbd6
Wrap all steps with <TutorialAction> component
infomiho a28fa0c
Merge branch 'main' into miho-tutorial-app-from-docs
infomiho f78f56a
PR comments
infomiho 19aec40
Update sort and filter fn names
infomiho 85ff579
Extract example MDX files
infomiho f65fb22
Remove Git explanantion and update action name
infomiho 7a1a3da
Update actions to action types
infomiho 9dff3f1
Handle both md and mdx extensions
infomiho 0ef5164
Update naming
infomiho 6c3935d
Cleanup JSDoc
infomiho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
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.
Aha, so TutorialAction has no content/children. I don't know why I thought that the content below (the code block) would go into the component itself, but that wouldn't make much sense, would it? Maybe semantically it would, but it would make problems for rendering here or something?
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.
Well one thing is that these files are really
.mdx
not.md
.It's basically markdown and JSX in javascript.
In the end the whole this file gets converted to pure javascript, same as
.jsx/.tsx
files.So it should be possible to insert all of the content related to
<TutorialAction/>
as its children.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.
Yep, at first I put the content inside - but it proved problematic for other plugins (
auto-js
) dealing with the Markdown AST. I opted for the simplest solution of not wrapping it, even thought... it would be pretty sweet to see the action text wrapped with a red border. Maybe in some next version of this system...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.
Ha ok! I wonder if we could document this somewhere for the person looking at it int he future, maybe attempting to do this improvement?
Btw what was the issue with auto-js for example?
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.
Oh yeah, now that I tested it again I remembered what was wrong. I was trying to parse the children of
<TutorialAction>
way back when I had different actions for creating file and applying patches.This would try to parse the code block but sometimes it would fail (I forget the exact error) and I found it working with blocks without
auto-js
transformation.Now that we only use patches, we are no longer parsing the children - we can actually wrap each code block with
<TutorialAction>
now 😄Uh oh!
There was an error while loading. Please reload this page.
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.
Wrapped all steps now properly, it renders like this now and it works :)