OpenZeppelin / cairo-contracts

OpenZeppelin Contracts written in Cairo for Starknet, a decentralized ZK Rollup
https://docs.openzeppelin.com/contracts-cairo
MIT License
800 stars 322 forks source link

Update docs navbar #838

Closed martriay closed 6 months ago

martriay commented 7 months ago

Fixes #749. Work in progress.

martriay commented 7 months ago

Comment by @ericnordelo:

Looking better already! A couple of comments:

  • I think the Wizard should be right after Overview because it is a powerful tool and people can easily miss it this way.
  • I would remove the See Also section if it contains only the Contracts for Solidity entry.
  • If we have Learn and Modules, we should avoid collapsing all the sections by default IMO, and leave at least these two open by default (UI)
martriay commented 6 months ago
  • I think the Wizard should be right after Overview because it is a powerful tool and people can easily miss it this way.

👍

  • I would remove the See Also section if it contains only the Contracts for Solidity entry.

👍

  • If we have Learn and Modules, we should avoid collapsing all the sections by default IMO, and leave at least these two open by default (UI)

The setting is global and I couldn't fine a more granular way of doing it. If I remove the auto-collapse, every level (down to API pages) gets expanded and it looks really bad.

image

ericnordelo commented 6 months ago

The setting is global and I couldn't fine a more granular way of doing it. If I remove the auto-collapse, every level (down to API pages) gets expanded and it looks really bad.

You can change this line in antora.yml:

page-sidebar-collapse-default: true

to

page-sidebar-collapse-default: 'Access Control,Accounts,Introspection,Security,Tokens,ERC20,ERC721,Upgrades'

I know it is a little verbose, but I think it should work. I could create a PR to the docsite repo with another option for specifying open sections instead of collapsed ones by default, but in the meantime, we can have this.

martriay commented 6 months ago

The setting is global and I couldn't fine a more granular way of doing it. If I remove the auto-collapse, every level (down to API pages) gets expanded and it looks really bad.

You can change this line in antora.yml:

page-sidebar-collapse-default: true

to

page-sidebar-collapse-default: 'Access Control,Accounts,Introspection,Security,Tokens,ERC20,ERC721,Upgrades'

I know it is a little verbose, but I think it should work. I could create a PR to the docsite repo with another option for specifying open sections instead of collapsed ones by default, but in the meantime, we can have this.

This is what I wanted! Thanks, couldn't find it in the docs (and searched for the page-sidebar-collapse-default setting specifically, even in their repo). How did you find it? Fixed it btw.

ericnordelo commented 6 months ago

This is what I wanted! Thanks, couldn't find it in the docs (and searched for the page-sidebar-collapse-default setting specifically, even in their repo). How did you find it? Fixed it btw.

That is a custom attribute with custom logic in our docsite repo, and I remembered a commit I saw from fran a little ago, so I looked for it, and found this PR with a very nice description of the feature.