-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Investigate alternative docs publishing solutions #3161
Comments
@markerikson Docusaurus seems nice. I can try it out this weekend. Would love to contribute |
Sure. @sw-yx has also offered to look into Docusaurus as well. Per my comment above, perhaps it would be simpler to start with the React-Redux docs so we can get a feel for how this would work before trying to tackle the main Redux docs. |
@markerikson Sure. Is there an issue for this? |
Don't have a separate issue set up for the React-Redux repo atm. Lemme clone this over there so we can track it separately. |
Done: reduxjs/react-redux#1031 |
yes |
So let's see. For point of reference, Babel's docs site appears to be built with Docusaurus ( https://github.com/babel/website ), and ReactJS.org is built with Gatsby ( https://github.com/reactjs/reactjs.org ) |
Per comments in reduxjs/react-redux#1031 , I've set up a temp page at https://react-redux-docs.netlify.com , and just created another project at https://redux-docs.netlify.com . We can figure out details of how to work with them as we go. |
I'm a fan of what's going on with Gatsby. I'd be interested in that. The biggest advantage of Gitbook is the rather plain way of describing your docs structure via a Summary.md file. Can we emulate that somehow? It makes it really easy to read the raw markdown on either GitHub or directly on your computer locally. |
Looking at the generated Docusaurus structure in reduxjs/react-redux#1032 , it looks like it relies on a a combination of some ID added to the front matter of each Markdown file, and a JSON config file with an array of IDs in categories. I suppose we could do something fancy with parsing a Markdown list and generating the I have to say that Docusaurus's feature list looks excellent (particularly the versioning and localization aspects), and Babel's docs site looks pretty good as a result. Also, per my questions about redirects, Netlify supports them via a |
There's a lot of custom code to put the React site together with Gatsby; if you can do it with Docusaurus that seems like it would be a lot easier to set up and maintain. |
I know you've spent a bunch of time working on the React docs lately. Got any summary on what kinds of custom features they have set up? I don't think we need anything too fancy. Versioning and localization look like a couple of the trickiest bits we would want. Looking at the list of existing Docusaurus-based sites linked from its home page, I can see a form of the "Bootstrap effect" showing up in that most of them are just recolors of the default theme. But, I'm okay with that for now - function over form :) Note that all this commentary doesn't mean that I'm saying we're definitely choosing Docusaurus - it's just that the first person to pop in with a PR for React-Redux did so for Docusaurus, the list of features it offers seems pretty good, and it seems to fit the criteria I listed above. Again, part of the point of this is that I don't have time to experiment with this different tools myself. I have a decent idea what I want the final workflow and functionality to be like, so I'm mostly caring about the result. If someone who's got Gatsby experience wants to throw together a PR for React-Redux so that we can compare, go for it! |
I've just merged #3165 , which contains the major work to set up a Docusaurus build for our docs. They're currently visible at https://redux-docs.netlify.com/ . Our next step is to figure out what is missing, broken, or otherwise lacking in parity compared to the current docs. From there, we can also start figuring out any actual improvements we want to make. Purely off the top of my head, a couple items from each category:
|
That site looks nice!
Pretty much everything is "custom" in that in Gatsby you start with a boilerplate at most. There's no real "Gatsby but for docs only" that you upgrade in a framework-like way. You have more control but more responsibility as well. Aside from the layout there are some custom plugins here: https://github.com/reactjs/reactjs.org/tree/master/plugins Brian (and many other helpful people) have contributed a fair amount upstream for some of the markdown plugins to add line highlighting and things like that: https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-embed-snippet |
@markerikson Which of the points you mentioned are of higher priority? I could look into implementing some of them for Docusaurus. The codesandbox embeds support sound interesting and useful. @sveinpg mentioned them to me before too. |
@yangshun : getting the URLs to match exactly would be highest priority. There's thousands of external links pointing to the existing docs page, and the simplest thing here is to make sure our new site matches the old structure exactly when it goes live. I want to shuffle things around later, but we need to get everything matched up as-is first. The FAQ "short anchor links" were originally implemented by adding a I doubt there's a good automatic way to generate those, and there probably isn't a good way to make the auto-generated right side TOC refer to those anchors if we put them in by hand. But, I'm certainly up for any ideas. (Also, apparently the |
Took a look at this again today. Status:
One blocker I found: it seems that Docusaurus isn't properly parsing Markdown links between pages, like I filed facebook/docusaurus#1137 , and @endiliey is looking at it since I was able to provide a repro. Also, it looks like page URLs are based on the I'd like to continue focusing attention on this and push it forward in the near future. |
Spent all of today working on this, and got some assistance from @endiliey and @ghardin137 . PRs:
Current status:
I think we're actually getting pretty close here. Things I know that still need to be done:
|
Great work @markerikson You, or Tim, should enable the search since you are the maintainer(s) of the project. I created a PR that fixes the hidden title on mobile (#3274) Let me know if there is anything else you need help with. |
Getting real close! @sveinpg set up a 404 page ( #3276 ), and I added redirects from the old docs URLs (#3277 ) and fiddled with landing page formatting on mobile ( #3278 ). @endiliey pointed me at Algolia's "DocSearch" program, which was already set up for React-Redux, so I requested search API keys for Redux and Redux-Starter-Kit. I want to have search enabled before we flip the DNS switch. On that note, DNS will be a 2-part process: I'll need to file a PR against the Other than that, I think the site is probably about ready to go. Might still be a few rough edges somewhere, but should be sufficient to make it live once search is ready. edit Almost forgot, someone was volunteering to do some a11y / style tweaks. Don't have to wait for those to go live, but those will hopefully come in soon. |
I got a response from an Algolia rep this morning. Looks like they need the new site to be live at its final address before they can set up the docs search stuff on their end. So, we'll have to make the DNS switch first and have the new site be live but without search for a bit. I think the last tweak I want to make tonight is to have each of the three docs sites cross-link each other on the front page, below the sales pitch section. I'll try to figure out some good formatting for that. |
Tonight's tweaks:
At this point, I'm just waiting for the |
AAAND we are LIVE at https://redux.js.org !!!Thank you SO much to everyone who's contributed to this! I'll take care of merging the With that, we can now turn our attention to seriously planning a rewrite of the content. Please see #2590 for existing discussion on that topic. I've got a survey asking for feedback at https://docs.google.com/forms/d/e/1FAIpQLSfzIkY3fXZ8PrQKScYMK0YoEgALfAK2qQ0mOj1_ibKv2qDTuQ/viewform . I'll post the results in that thread at some point. |
Just merged the |
I'm still not terribly happy with Gitbook as the solution for publishing our docs.
The good news is that the hosted version of Gitbook at least auto-publishes whenever we push to master, which is a vast improvement over the old docs publishing command we used to have to run manually.
However, there are several problems that still bother me:
I would like someone to investigate switching our docs to be built with some other static site generation solution, such as Docusaurus, Gatsby, or React-Static. I have no particular preference myself, although it would be nice on general principle if the solution was something React-based or similar.
The one thing that the hosted version of Gitbook seems to give us that's neat is the "did this help?" rating at the bottom of each page, but to be honest I don't think we've ever made any actual use of that information.
The content itself is also hosted/published on Gitbook's infrastructure, but there's obviously plenty of other options out there (Netlify being the biggest one, and I think that's the main React docs at https://github.com/reactjs/reactjs.org use - someone confirm?).
Our content is all Markdown already, so I would think it wouldn't be too hard to set up some alternative static site generator tool and start using the docs as the source.
Also, it would be beneficial if there was a good way to publish versioned docs, since we would likely want to use the same solution for React-Redux as well. In fact, perhaps React-Redux would make a better test case, since we don't even have its docs as a published site yet.
One other thought: when we do revamp the main Redux docs content, I would want to start moving around a bunch of our pages - recategorizing existing pages, as well as merging/changing others. It would be really beneficial if there's a good redirect solution as part of this. For example, if "Immutable Update Patterns" got moved from
/structuring-reducers/immutableupdatepatterns
to, say,/reducers/immutable-update-patterns
, then I'd want to have a redirect in place so that external links don't break.Thoughts? Volunteers?
The text was updated successfully, but these errors were encountered: