Skip to content
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

Exploration of new docs build system #6043

Merged
merged 203 commits into from Aug 3, 2020
Merged

Exploration of new docs build system #6043

merged 203 commits into from Aug 3, 2020

Conversation

tmbo
Copy link
Member

@tmbo tmbo commented Jun 18, 2020

Proposed changes:

  • Exploration of new docs build system

  • related to https://github.com/RasaHQ/growth/issues/1436

  • not all pages have been added to the new system. all of them are converted, if you are missing a page you'd like to take a look at you need to add it to newdocs/sidebars.js

To view the page, navigate into newdocs, run yarn to install dependencies and then yarn start. A browser page with the docs should pop up.

The converter and necessary changes to fix some of the markdown issues can be found here RasaHQ/sphinx-markdown-builder#1 - should be extended and adapted to fix more issues.

How to build the MDX docs based on RST

All of the new docs pages have been created automatically. If there are any changes in the RST docs (e.g. by new features or changes merged into master), the MDX docs can be regenerated:

  • checkout and install https://github.com/RasaHQ/sphinx-markdown-builder/pull/1 using git clone git://github.com/RasaHQ/sphinx-markdown-builder.git, git checkout convert-docs and pip install -e . (this should be in your rasa poetry env, e.g. try running poetry shell before the pip install)
  • checkout this branch and cd docs and run make markdown

This will tell sphinx to build the docs and output markdown (instead of the usual HTML). The converter is pretty flexible and if we notice any issues, we can further customize the sphinx-markdown-builder based on the above PR.

While converting, sphinx will create somewhat of an AST and then walk through these nodes. for each node in the doc there is a hook that decides how to convert that node into markdown.

Remaining work before this can be merged is tracked in #6165

TODO

Fixes #6170

@indam23
Copy link
Contributor

indam23 commented Jun 18, 2020

Trying to view it, getting an error that src/css/custom.css is missing

@tmbo
Copy link
Member Author

tmbo commented Jun 18, 2020

@melindaloubser1 should be fixed after you pull - for some reason src/ was in git ignore... 🤷

@indam23
Copy link
Contributor

indam23 commented Jun 18, 2020

Thanks!
So I don't see our docs, just this page:
image

@alwx
Copy link
Contributor

alwx commented Jun 18, 2020

Same. Cannot find any of Rasa pages.

@alwx
Copy link
Contributor

alwx commented Jun 18, 2020

@melindaloubser1 just try to open any of the pages manually. For example: http://localhost:3000/docs/changelog

@indam23
Copy link
Contributor

indam23 commented Jun 18, 2020

ohh thanks!

@tmbo
Copy link
Member Author

tmbo commented Jun 18, 2020

fixed it in a push should be good now 👍

@tmbo
Copy link
Member Author

tmbo commented Jun 18, 2020

thanks for trying this out

@indam23
Copy link
Contributor

indam23 commented Jun 18, 2020

Love the pinned TOC on the right!
(And the collapsible sidebar, obviously 👌)

@erohmensing
Copy link
Contributor

  • also love the pinned toc! (and code headers look nice in the toc)
  • changelog header links have persistent ids (instead of indexed ones) so they won't change when we add new entries above 🙌🏻
  • looking at their docs on versioning, they argue that you shouldnt create new docs for every patch since there shouldn't be new features (fair). Can we build the docs from 1.10.x live like we do master, so we don't have to cut patches for docs updates?
  • i like the previous and next navigators at the bottom of the page
  • would be nice if we could decide per-page if we want depth 1 or 2 on the pinned toc (e.g. changelog), not sure if that is possible

this looks very exciting and promising!

@tmbo
Copy link
Member Author

tmbo commented Jun 19, 2020

my best guess right now is that in the beginning we'll probably not use multi-version and keep a single docs version. we can try to aim more for an approach that integrates changes made into the documentation, e.g. here is an example how python does it https://docs.python.org/3.8/library/functions.html#print:

Changed in version 3.3: Added the flush keyword argument.

@tmbo
Copy link
Member Author

tmbo commented Jul 3, 2020

I've updated the newdocs with a new export, it looks pretty good now. All the things you see in the docs are automatically generated - so we can run this once we are ready even if the rst docs change in the meantime.

@tmbo
Copy link
Member Author

tmbo commented Jul 3, 2020

added some more details to the PR description, explaining how the automatic translation from RST to markdown (MDX) works.

@amn41
Copy link
Contributor

amn41 commented Jul 4, 2020

looks awesome!

@m-vdb
Copy link
Collaborator

m-vdb commented Jul 6, 2020

looks amazing 🤗 just ran it locally and worked like a charm!

pyproject.toml Outdated Show resolved Hide resolved
@m-vdb m-vdb linked an issue Jul 8, 2020 that may be closed by this pull request
33 tasks
@m-vdb m-vdb marked this pull request as ready for review July 9, 2020 07:48
@m-vdb
Copy link
Collaborator

m-vdb commented Jul 9, 2020

Keeping this one open until @erohmensing reports more issues with the auto conversion. We'll try to fix most of them in this PR.

@m-vdb
Copy link
Collaborator

m-vdb commented Aug 3, 2020

@tmbo this is it. we can merge this once the build passes 🚀 I've written a short doc on the new setup to share with the team. Can you take a look here?

@tmbo
Copy link
Member Author

tmbo commented Aug 3, 2020

awesome, very hyped about this 🚀

the page looks good, let's make sure to also include a slide in the squad sync tomorrow to make sure everyone is aware of the most important parts (e.g. docs are in md now) 👍

@m-vdb
Copy link
Collaborator

m-vdb commented Aug 3, 2020

yes will do as soon as you share the slides ✅

@m-vdb m-vdb merged commit d0a5924 into master Aug 3, 2020
@m-vdb m-vdb deleted the new-docs-system branch August 3, 2020 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New docs: changelog generation New docs: initial system setup
8 participants