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

Support heading 3 items in the side-ToC (as option?) #59

Closed
GeertvanHorrik opened this issue Jun 12, 2017 · 11 comments
Closed

Support heading 3 items in the side-ToC (as option?) #59

GeertvanHorrik opened this issue Jun 12, 2017 · 11 comments

Comments

@GeertvanHorrik
Copy link
Contributor

See for example this page:

http://docs.catelproject.com/vnext/reference/Catel.Core/Catel/Argument.htm

Would be extremely useful to have a list of properties / methods on the left side as well. I can create a PR if you are interested.

@FransBouma
Copy link
Owner

The page you link to shows a ToC that's showing only the H2? H3's as well as H2's... I've tried that initially but it didn't look great.

@GeertvanHorrik
Copy link
Contributor Author

The thing is that H1 is not supported in the ToC as well. So we can only have top-levels as docs. But then it would only show Properties, Methods, etc. If I make these H1, then it just looks like big pile of members.

As an additional option (off by default)?

@FransBouma
Copy link
Owner

H1 is the page title, so the type you're generating the docs for. H2's are then the sections in the page, like properties, methods. I see your point of adding H3's for this particular case, but I really have to see the HTML and layout. As I said, I tried to add it (as a bigger ToC helps discoverability) but never got a layout which really looked OK, it was always a mess.

@GeertvanHorrik
Copy link
Contributor Author

Let me introduce the option in a fork and you can always decide whether you want to support this or not.

@GeertvanHorrik
Copy link
Contributor Author

I am currently making the following changes:

  1. Instead of tracking just h2, track all h elements in a list
  2. Create a hierarchy at the end (covered with unit tests)
  3. Add a MaxToCLevel (defaults to 2)

This way we can easily extend the behavior (e.g. I can pass in 3, and it should auto generate 3 levels, etc)

@FransBouma
Copy link
Owner

Ok, but with what HTML? :) Say I have 4 levels, how will that look like?

@GeertvanHorrik
Copy link
Contributor Author

That's up to the one that wants to include 4 levels ;-)

I am just adding the technical possibility to deal with multiple levels of headings (instead of just h2). Once that is done, we can simple see how it deals with these levels.

@FransBouma
Copy link
Owner

Ok. Building the hierarchy can be tricky though, as well as keeping track if which element belongs to what: there can be an H2 and an H4, but no H3 between them. I think it can be done without the need of building a hierarchy at the end, as the file is parsed from top to bottom, so you know what the current 'top' / previous element level is.

@GeertvanHorrik
Copy link
Contributor Author

I have unit tests for that scenario :)

@GeertvanHorrik
Copy link
Contributor Author

image

@FransBouma
Copy link
Owner

Cool! :)

I have unit tests for that scenario :)

Famous Last Words (tm) ;)

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

No branches or pull requests

2 participants