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

Documentation page using mkdocs #75

Merged
merged 9 commits into from
Oct 23, 2020
Merged

Conversation

cgarciae
Copy link
Contributor

@cgarciae cgarciae commented Oct 21, 2020

Hey, I've been using Einops, loving it.

I thought it would be cool for the project to have a Reference API page so I ported some mkdocs boilerplate files from a Jax library I maintain. Its very basic, you can improve upon it. Check a preview of the site here.

Features

  • Readme as the main page.
  • All 3 tutorial rendered with mkdocs-jupyter.
  • Reference API for:
    • asnumpy
    • parse_shape
    • rearrange
    • reduce
    • repeat

The only change to the core code I made is converting the docs from Numpy-style to Google-style + markdown since that is what mkdocs supports.

Local serving

You can test the site locally via:

bash scripts/run-docs.sh

Deployment

You can deploy the docs to the github.io site with:

bash scripts/deploy-docs.sh

Dev Dependencies

For this I used:

mkdocs = "^1.1.2"
mkdocs-material = "^6.1.0"
mkdocstrings = "^0.13.6"
mkdocs-jupyter = "^0.15.1"

I can add the files for a poetry project I used if you wish.

@arogozhnikov
Copy link
Owner

Sorry for delay, this looks amazing!

Some comments:

  • mkdocs-jupyter - wow, didn't know about that

Can we keep current format of code in docstrings? Like

"""
>>> 1 + 2
3
"""

Because this way it gets tested.

@cgarciae
Copy link
Contributor Author

Hey, I added the >>> back, I thought they screwed the formatting but works perfectly:

https://cgarciae.github.io/einops/api/rearrange/

I left some white spaces between groups of code for readability, should I remove them?

@arogozhnikov arogozhnikov merged commit be0cc2b into arogozhnikov:master Oct 23, 2020
@arogozhnikov
Copy link
Owner

Voila!
https://arogozhnikov.github.io/einops

Will try to find some time during weekend to get better formatting for the website

@arogozhnikov
Copy link
Owner

@cgarciae kudos for showing mkdocs and setting it up!

@cgarciae
Copy link
Contributor Author

Awesome!

Check out Mkdocs Material which is doing most of the heavy lifting for the aesthetics.

@cgarciae cgarciae mentioned this pull request Oct 25, 2020
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.

2 participants