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

Fix toc render bug, miss closing tags, fix #73 #75

Merged
merged 6 commits into from
Feb 24, 2023

Conversation

pietroppeter
Copy link
Owner

@pietroppeter pietroppeter commented Feb 24, 2023

fix #73

  • added a nice test that replicates the bug (I like how I am counting opening and closing tags)
  • fix is to make sure than when next entry is at a lower level we close the appropriate number of times (a new entry might only be a single level above, but when going down the gap could be bigger than 1)
  • refactored name of modules: tocs.nim -> toc_dsl.nim and renders.nim -> toc_render.nim
  • unrelated: fixed gitignore to improve all executables and better ignore of docs stuff (note that putting .exe in first line would NOT work)

@pietroppeter
Copy link
Owner Author

pietroppeter commented Feb 24, 2023

should be all good, not sure if you want to give a look @HugoGranstrom. I would say we can merge this (and later also #71, I have to recall if there is something else I wanted to do there or not) and then we can tag a new release. What do you think?

well, just one very minor things I have noticed looking at PR preview: in last chapter there is a next arrow pointing to start of book (it does not seem to replicate in current scinim, I guess it might be linked to the existence of a draft chapter as last element?), see https://ed49d7c2b58457b5394a--nimibook.netlify.app/tocexample/back_to_parent.html

@HugoGranstrom
Copy link
Collaborator

Looks good to me 👍

well, just one very minor things I have noticed looking at PR preview: in last chapter there is a next arrow pointing to start of book (it does not seem to replicate in current scinim, I guess it might be linked to the existence of a draft chapter as last element?)

Hehe, I've noticed it as well. I consider it an easter egg 🤣 But I agree that it has something to do with a draft as the last chapter.

@pietroppeter pietroppeter merged commit 090c8c5 into main Feb 24, 2023
@pietroppeter pietroppeter deleted the fix-toc-render-bug branch February 24, 2023 16:04
@pietroppeter
Copy link
Owner Author

well, now that it is deployed it gives an error page: https://pietroppeter.github.io/nimibook/tocexample/back_to_parent.html -> https://pietroppeter.github.io/nimibook/.html

@pietroppeter
Copy link
Owner Author

(opened an issue but it will wait for next release: #76 )

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.

Indentation of entries in sidebar in generated HTML is incorrect after sub-sections
2 participants