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

Group members in docs by classmethods, methods, attributes #778

Merged

Conversation

Projects
None yet
2 participants
@cburgdorf
Copy link
Contributor

commented Jul 9, 2019

What was wrong?

One of the things that annoys me when looking at the API docs is that methods, classmethods and attributes do visually not stand much apart.

image

By default sphinx orders all members alphabetically and so methods, classmethods and attributes end up mixed and it's really hard to tell them apart.

How was it fixed?

We can combine two things to improve the situation:

  1. We can tell sphinx to order members groupwise

  2. We can add css pseudo elements to inject headlines for each group

image

To-Do

  • Clean up commit history

Cute Animal Picture

put a cute animal picture link inside the parentheses

@cburgdorf cburgdorf force-pushed the cburgdorf:christoph/docs/groupwise-members branch from e828645 to 69d19c5 Jul 9, 2019

@cburgdorf

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2019

Just noting that the design of the three headlines could be tweaked if someone has ideas. I simply copied the style from the class header.

I think the separation of classmethods, methods and properties is quite a big win and a pretty common thing to find in docs.

Here are some examples:

Tensorflow:

image

Angular:

image

Rust:

image

@cburgdorf cburgdorf requested a review from carver Jul 10, 2019

@pipermerriam
Copy link
Member

left a comment

Looks like a nice improvement

@cburgdorf cburgdorf merged commit 81251e8 into ethereum:master Jul 10, 2019

32 checks passed

ci/circleci: docker-image-build-test Your tests passed on CircleCI!
Details
ci/circleci: py36-docs Your tests passed on CircleCI!
Details
ci/circleci: py36-eth1-core Your tests passed on CircleCI!
Details
ci/circleci: py36-eth1-plugins Your tests passed on CircleCI!
Details
ci/circleci: py36-eth2-core Your tests passed on CircleCI!
Details
ci/circleci: py36-eth2-integration Your tests passed on CircleCI!
Details
ci/circleci: py36-eth2-plugins Your tests passed on CircleCI!
Details
ci/circleci: py36-integration Your tests passed on CircleCI!
Details
ci/circleci: py36-lightchain_integration Your tests passed on CircleCI!
Details
ci/circleci: py36-lint Your tests passed on CircleCI!
Details
ci/circleci: py36-long_run_integration Your tests passed on CircleCI!
Details
ci/circleci: py36-p2p Your tests passed on CircleCI!
Details
ci/circleci: py36-rpc-blockchain Your tests passed on CircleCI!
Details
ci/circleci: py36-rpc-state-byzantium Your tests passed on CircleCI!
Details
ci/circleci: py36-rpc-state-constantinople Your tests passed on CircleCI!
Details
ci/circleci: py36-rpc-state-frontier Your tests passed on CircleCI!
Details
ci/circleci: py36-rpc-state-homestead Your tests passed on CircleCI!
Details
ci/circleci: py36-rpc-state-petersburg Your tests passed on CircleCI!
Details
ci/circleci: py36-rpc-state-spurious_dragon Your tests passed on CircleCI!
Details
ci/circleci: py36-rpc-state-tangerine_whistle Your tests passed on CircleCI!
Details
ci/circleci: py36-wheel-cli Your tests passed on CircleCI!
Details
ci/circleci: py37-eth1-core Your tests passed on CircleCI!
Details
ci/circleci: py37-eth1-plugins Your tests passed on CircleCI!
Details
ci/circleci: py37-eth2-core Your tests passed on CircleCI!
Details
ci/circleci: py37-eth2-integration Your tests passed on CircleCI!
Details
ci/circleci: py37-eth2-plugins Your tests passed on CircleCI!
Details
ci/circleci: py37-lint Your tests passed on CircleCI!
Details
ci/circleci: py37-p2p Your tests passed on CircleCI!
Details
ci/circleci: py37-rpc-state-quadratic Your tests passed on CircleCI!
Details
ci/circleci: py37-rpc-state-sstore Your tests passed on CircleCI!
Details
ci/circleci: py37-rpc-state-zero_knowledge Your tests passed on CircleCI!
Details
ci/circleci: py37-wheel-cli Your tests passed on CircleCI!
Details

@cburgdorf cburgdorf referenced this pull request Jul 11, 2019

Merged

Fix bug in API docs layout #794

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.