Skip to content

More accessible docs, hosted on GH pages #3893

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

Closed
mjackson opened this issue Sep 17, 2016 · 14 comments
Closed

More accessible docs, hosted on GH pages #3893

mjackson opened this issue Sep 17, 2016 · 14 comments
Assignees
Milestone

Comments

@mjackson
Copy link
Member

Instead of building to a single-page app on the v4 branch and deploying to now, we should build the website to a bunch of static HTML files in the docs dir so we can serve it with GitHub pages. Then the router docs will live at https://reacttraining.github.io/react-router.

@ryanflorence
Copy link
Member

agreed. can we point it at the v4 branch or do we need to merge this code t
master?
On Sat, Sep 17, 2016 at 9:15 AM Michael Jackson [email protected]
wrote:

Instead of building to a single-page app on the v4 branch and deploying to
now, we should build the website to a bunch of static HTML files in the
docs dir so we can serve it with GitHub pages. Then the router docs will
live at https://reacttraining.github.io/react-router.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#3893, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AAGHaCJ8tbTTLOBLwg8DoG_FALErR0Bsks5qrBI9gaJpZM4J_o0M
.

@timdorr
Copy link
Member

timdorr commented Sep 17, 2016

It would live on the gh-pages branch. Redux has a one-liner to publish to that branch via gitbook. Feel free to copy that structure here.

@timdorr timdorr added this to the v4.0.0 milestone Sep 17, 2016
@timdorr timdorr added the docs label Sep 17, 2016
@mjackson mjackson changed the title Build the website to docs dir [v4] [v4] Build the website to docs dir Sep 27, 2016
@mjackson mjackson changed the title [v4] Build the website to docs dir Build the website to docs dir Sep 27, 2016
@kitze
Copy link

kitze commented Sep 28, 2016

@timdorr it doesn't have to be specifically on the gh-pages branch anymore. You can point GitHub pages to any branch :)

@mjackson
Copy link
Member Author

Yep, @kitze has the right idea. I'd like to be able to just build to our docs dir and then point GH pages there.

@timdorr
Copy link
Member

timdorr commented Sep 28, 2016

No, that doesn't work. They would be in HTML format, so they wouldn't be rendered nicely when viewing on GitHub. And you would need to clutter up the master branch with built assets and build commits.

We blow away the git history on every build of the gh-pages branch on Redux for this exact reason. Keeping the docs in plain markdown under /docs has lowered the barrier to entry significantly and allowed just about anyone to participate in their development. Now, the 4.0 docs are obviously more complex than Redux's, but they should be accessible to as many people as possible, not only to read but to contribute changes back. The current structure impedes that IMHO.

I'm willing to do the heavy lifting, but there really should be a /docs with plain markdown, a /examples with example code, and a /website to build it all.

Btw, I hope this doesn't come off as harsh. Ryan worked really hard on the docs site and it's great as a result. I think most of my suggestions boil down to just moving some stuff around. But I do think it's important to allow anyone to peek under the hood without much trouble and be able to simply contribute back.

@markdalgleish
Copy link
Member

If you're interested, I actually built a webpack plugin for this exact purpose, which I personally use to render universal React Router sites to static HTML: https://github.com/markdalgleish/static-site-generator-webpack-plugin

@mjackson
Copy link
Member Author

@timdorr If you've got a strong opinion on this I'd love to leave this up to you. I'm not too familiar w what you guys are doing in the Redux repo, but if it's working well for you and you're able to host w/out hacks on GH pages and you think it'd be easier for people to contribute then let's just do that. Only reason I suggested we build to docs is it seems like the smallest step to get from where we are now to a statically generated folder of HTML files.

Agree that the current docs structure makes it difficult for people to contribute and find stuff.

@mjackson
Copy link
Member Author

I should be clear that I don't want to do exactly what Redux are doing. I'm not a huge fan of gitbook. :P

@mjackson mjackson changed the title Build the website to docs dir More accessible docs, hosted on GH pages Sep 28, 2016
@DavidWells
Copy link

I highly highly recommend using phenomic.io for this.

100% react powered static site and plug in something like algolia for search https://community.algolia.com/docsearch/

For an example implementation checkout https://github.com/serverless/site/tree/master/src

@thangngoc89
Copy link

thangngoc89 commented Sep 28, 2016

@mjackson Phenomic is looking for upgrading to react router v4. I think this is a good chance for us to investigate react router v4. Can I give it a try?

@MoOx
Copy link

MoOx commented Sep 28, 2016

I also think that Phenomic would be a good fit: you don't have to care about webpack config since the setup create something for you. You just have to write some React component and some markdown & boom, you got a website.
If you are interested, Phenomic does some dogfooding and have it's docs here https://github.com/MoOx/phenomic/tree/master/docs
You mainly have a source folder for components/layouts etc & a content folder for the markdown (obviously, all of the paths can be adjusted).

We can try to make a PR for you with basic layouts so we can iterate together (should be easy to do, obviously you can still close the PR the project does not fit for you). What do you think?

@MoOx
Copy link

MoOx commented Sep 28, 2016

Note that Phenomic provides out of the box offline support via Service Worker ("just" require https, but easy to do with free cloudflare account + github pages). Users can access your website even when they are in a plane. How cool?

@timdorr
Copy link
Member

timdorr commented Sep 28, 2016

@mjackson

I should be clear that I don't want to do exactly what Redux are doing. I'm not a huge fan of gitbook. :P

Yep, I'm not saying that either. It's more about getting the same spirit of openness that Redux has to it's docs. For instance, git blame on any doc file and you'll see the majority of them aren't even written by Dan or myself. In fact, @markerikson just wrote a freaking novel's worth of new docs for the project and has even more up his sleeve. The best docs are the ones you don't have to write 😄

Interestingly, the gitbook team is attempting to reach out to the community more, which is awesome. While it's a good source of inspiration, it's ultimately not a good tool for this project, as we need live examples to really make it shine. I think the existing website tooling is pretty good for the job at the moment.

@alisd23 alisd23 added the v4 label Nov 1, 2016
@timdorr timdorr removed the v4 label Nov 1, 2016
@mjackson
Copy link
Member Author

mjackson commented Jan 20, 2017

OK, I think we can close this one now. We're just going to host the docs at reacttraining.com, so no need to generate everything to static files.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants