-
Notifications
You must be signed in to change notification settings - Fork 4
Rewrite README with code examples #28
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
base: master
Are you sure you want to change the base?
Conversation
README.md
Outdated
@@ -1,21 +1,89 @@ | |||
# React from Markup | |||
# react-from-markup | |||
> Convert static markup into React components, so you can control React props in a static environment. |
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.
I don't think I like this. Would probably prefer to stick with original.
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.
What if it was simply...
Control your React props with HTML
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.
Hm, I'm not sure I would understand what that meant. What about mentioning data-
attrs.
Control your React props with
data-
attributes
Or similar to your original
Declare your React props with
data-
attributes
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 boy, it's been two months and I still haven't moved on this - really sorry!)
I see/like what you're going for, but it also goes beyond data-
props - you can grab a node's textContent
, too, or have rehydratable children.
Just spitballing here. Goes further off the rails, and more I'm-pitching-to-a-VC, the further down the list you go.
Set your React props in your HTML
Set your React props from your CMS
Get your props from the markup
Use React with other templating engines
Use React on any website
React, for when React can't be used
And then the pure honesty version:
React, but very slightly worse, but it works everywhere.
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.
Love the route you've taken here. Have a few quick thoughts, but am inclined to switch over to this pretty quickly - much more approachable.
README.md
Outdated
@@ -1,21 +1,89 @@ | |||
# React from Markup | |||
# react-from-markup | |||
> Convert static markup into React components, so you can control React props in a static environment. |
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.
What if it was simply...
Control your React props with HTML
README.md
Outdated
``` | ||
|
||
`react-from-markup` is intended to make it possible to use React components on these legacy systems, _without changing the way you write your React components_. It provides tools to simplify the mapping from `data-` attributes into React props, and _can even handle React children_. | ||
using a `rehydrator`: |
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.
Pedantic nitpick (sorry in advance!)
rehydrator
isn't a piece of code, especially in the new react-from-markup
world - it's a term. Could we italicize it instead of code
ing it?
README.md
Outdated
} | ||
``` | ||
|
||
This is extremely useful for changing React props in a non-React environment, like a CMS with it’s own templating language. |
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.
(again, sorry)
it's -> its
ShowMore: showMoreRehydrator | ||
}); | ||
``` | ||
|
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.
May need a brief note on markup containers here - don't want to overload the "simple get-up-and-running"-ness here, but without a container, react-from-markup
doesn't do anything.
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.
Added!
@simon360 I've addressed all comments in your PR and tweaked it a bit. Please make sure you check over the todo list before merging! |
Opening for discussion.
This is just a proposal based on our offline discussions regarding focussing the README on code.
If you decide to move forwards with this / something like this, still need to: