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

[Feature] Site wide Index/Table Of Contents #129

Open
Patitotective opened this issue Sep 7, 2022 · 8 comments
Open

[Feature] Site wide Index/Table Of Contents #129

Patitotective opened this issue Sep 7, 2022 · 8 comments

Comments

@Patitotective
Copy link

I really like nimib and it looks super cool to make quick documents. But also I thought it would be really nice to have some kind of index showing all the available documents to read (avoiding having to list them yourself, i.e.: https://pietroppeter.github.io/nblog).
It could be implemented as a menu button (like GitHub does with readme files) or as a sidebar.
I'm really new to nimib so I don't really know if this is already possible and if it is, please let me know.

Thanks for making this awesome project. ❤️

@HugoGranstrom
Copy link
Collaborator

Thanks for the kind words :D

Just so I understand you correctly, what you want is not the per-page TOC suggested in #58, but instead for the entire site like nimiBook has?

@Patitotective
Copy link
Author

Patitotective commented Sep 7, 2022

Yes, similar to nimiBook.
A TOC of all the documents in the (srcDir, I guess) directory, as I said it could be implemented as a sidebar (nimiBook) or as a menu button in the header bar (here's a GIF to illustrate, though in the GIF it is a per-page TOC, not a TOC for the whole site, as I'd like :p).
nimib
Thanks.

@pietroppeter pietroppeter changed the title [Feature] Table Of Contents [Feature] Site wide Index/Table Of Contents Sep 8, 2022
@pietroppeter
Copy link
Owner

Hi, thanks also from my side. ❤️

regarding the feature of a site wide index/table of contents, it is something that it is not currently possible in nimib, but it is appropriate for the library and so such an feature request is welcome.

Still not sure about which api to use, have some thoughts maybe I will use this issue later to share what are the current ideas on this. One of the tricky aspect is that we should support both document-wide toc and site-wide toc and we will want an api and a UI design that will be able to account for both (not necessarily the same api). The other tricky aspect is that a site-wide index needs data from outside the current document and not sure yet where to put this (two options come to mind: a specific [nimib.toc] section in nimib.toml that needs to be updated manually or a shared project json that gets updated automatically when publishing a document, see also #17).

Such a feature should also play well with other projects built on nimib such as nimibook. Indeed my idea would be to work on something like this first by building some more generic static site generator based on nimib first as an external project.

@Patitotective
Copy link
Author

Hmm, I see.
I agree that this feature could be implemented in a static site generator and not nimib as it is right now.
Thank you, anyways. Hope to see nimib grow soon :]
❤️

@HugoGranstrom
Copy link
Collaborator

Such a feature should also play well with other projects built on nimib such as nimibook. Indeed my idea would be to work on something like this first by building some more generic static site generator based on nimib first as an external project.

IMO the default nimib theme is basically a static site generator already, it just lacks a few things like this. Having a solid default theme is important. This could be useful for many themes as well to build on, so we don't end up with every static site generator rolling their own system. But some themes, like nimiBook, have other needs. There we want the explicit TOC, so it wouldn't necessarily have to use this feature which IMO should be automatic (all files in the docs-folder and subfolders are included automatically).

@pietroppeter
Copy link
Owner

IMO the default nimib theme is basically a static site generator already, it just lacks a few things like this.
well that is debatable :)

for me nimib at the moment is more of a single document creator and indeed the difference between a tool like pandoc and a Static Site generator is really all of the stuff that are: "a few things like this".

anyway the idea for me is first to experiment outside of nimib building the missing SSG functionalities and later decide what to bring inside nimib.

Having a solid default theme is important.

absolutely agree

some themes, like nimiBook, have other needs ... so it wouldn't necessarily have to use this feature

yes that's is also right, but it would not be bad if the feature is used also by nimibook. a less important requirement

this feature which IMO should be automatic (all files in the docs-folder and subfolders are included automatically).

that is indeed an option and probably relatively easy to create something like this. it could actually be a postprocessor that would add toc data later to an already created html. and we could probably keep this self contained from the rest of nimib so that we could experiment in nimib itself...

@HugoGranstrom
Copy link
Collaborator

OK yes, you are making a lot of good points :D

anyway the idea for me is first to experiment outside of nimib building the missing SSG functionalities and later decide what to bring inside nimib.

Sounds sensible 👍

it could actually be a postprocessor that would add toc data later to an already created html. and we could probably keep this self contained from the rest of nimib so that we could experiment in nimib itself...

This is a really interesting concept in general as well. Adding HTML-comments or something:

<!--nimibPlaceholderTOC-->

This could be useful in many different ways for postprocessing :)

@Patitotective
Copy link
Author

The other tricky aspect is that a site-wide index needs data from outside the current document and not sure yet where to put this (two options come to mind: a specific [nimib.toc] section in nimib.toml that needs to be updated manually or a shared project json that gets updated automatically when publishing a document, see also #17).

I think there should be both manual and automatic options.

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

3 participants