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

Switch to docute documentation site generator #1976

Closed
wants to merge 5 commits into from

Conversation

sebinbenjamin
Copy link
Contributor

@sebinbenjamin sebinbenjamin commented Nov 18, 2019

Sets up docute to replace readthedocs. Fixes #1974

@lovell I've tried to include everything from https://sharp.pixelplumbing.com . Please have a look.

Peek 2019-11-18 16-20

Tasks

  • Retrieves versioned markdown files from GitHub, via jsdelivr
  • Customise URL router to redirect to existing readthedocs URLs
  • Define navigation bar (with logo) and sidebar
  • Custom Footer
  • Sends anonymous usage data to GA .
  • Verify correctness of links in all pages.

I think the following might also be good. I could create a seperate issue/PR if they will be useful.

Additional

@sebinbenjamin sebinbenjamin marked this pull request as ready for review November 18, 2019 10:52
@sebinbenjamin
Copy link
Contributor Author

sebinbenjamin commented Nov 18, 2019

Note: Links are currently pointed to my forked branch https://github.com/sebinbenjamin/sharp/edit/master/docs as I needed a new tag v0.23.4-alpha for testing. Needs to be changed before closing the PR.

Also do share the GA Tracking ID.

@coveralls
Copy link

coveralls commented Nov 18, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 98b3872 on sebinbenjamin:master into d0feb41 on lovell:master.

@lovell
Copy link
Owner

lovell commented Nov 18, 2019

This is amazing, thank you.

For the previous versions, readthedocs will be going away, so ideally these will come from GitHub too. The markdown files in docs/ are all tagged by version so I was hoping we could use something like https://docute.org/guide/customization#versioning for this.

The GA code is UA-13034748-12 (this is the user_analytics_code from https://sharp.pixelplumbing.com/en/stable/readthedocs-data.js)

Sadly documentationjs does not produce page titles for markdown output but we could define a custom plugin to replace the <!-- Generated by ... with <h1 class="page-title">Name of API section</h1> a bit like the example in https://docute.org/guide/plugin

<svg xmlns="http://www.w3.org/2000/svg" viewBox="86 86 50 49.636" width="50" height="49.636" fill="none" stroke-width="7.275"><path d="M101.7 103.953l18.204-2.437M100.4 120.38l18.854-2.524m0 0V99.652m0-13.652v15.603l16.253-2.175m-32.724 1.78v20.154m.217 14.273v-15.603l-16.253 2.176" stroke="#9c0"/><path d="M119.264 133.46v-15.604l16.253-2.174m-32.782-27.478v15.603l-16.253 2.176" stroke="#090"/></svg>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can the copyright and licensing notice remain in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ! Missed it. Sorry about that.

@sebinbenjamin
Copy link
Contributor Author

For the previous versions, readthedocs will be going away, so ideally these will come from GitHub too. The markdown files in docs/ are all tagged by version so I was hoping we could use something like https://docute.org/guide/customization#versioning for this.

I tried versioning but got stuck with the file name requirement. I think that docute by default wants the landing page markdown file to be named as README.md, but we have it named as index.md for readthedocs. I am not very familiar with vue.js components/plugins, but am guessing from this code that we would not be able to override it. I could try putting up a feature request at docute for a custom default landing page filename. 🤔

The GA code is UA-13034748-12 (this is the user_analytics_code from https://sharp.pixelplumbing.com/en/stable/readthedocs-data.js)

Thanks. I'll just put the this in.

Sadly documentationjs does not produce page titles for markdown output but we could define a custom plugin to replace the <!-- Generated by ... with <h1 class="page-title">Name of API section</h1> a bit like the example in https://docute.org/guide/plugin

Nice. Let me check it.

@lovell
Copy link
Owner

lovell commented Jan 6, 2020

I've merged this to the wit WIP branch via commit 3925689

Rather than provide docs for loads of older versions, I've added @since tags to some of the API to indicate the version from which it was made available.

These new docs, for the forthcoming v0.24.0 release, can be temporarily viewed at https://pixelplumbing-sharp.firebaseapp.com/ for now. I've configured Firebase to handle all the redirects - see https://github.com/lovell/sharp/blob/wit/docs/firebase.json#L22

I'll update the main documentation URL to point to this after sharp v0.24.0 is released.

Thanks again for all your help with this @sebinbenjamin - I think this PR makes you the 100th contributor to sharp!

@lovell lovell closed this Jan 6, 2020
@sebinbenjamin sebinbenjamin changed the title [WIP] Switch to docute documentation site generator Switch to docute documentation site generator Jan 7, 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.

Docs: switch from readthedocs to docute
3 participants