Enabling sticky position TOC in .md files #11800

Open
opened 2025-11-02 09:48:13 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @denis-migdal on GitHub (Oct 6, 2023).

Feature Description

Currently, we can enable a TOC in markdown pages thanks to :

---
gitea: none
include_toc: true
---

However, for long pages it would be better to have a right-align sticky TOC, e.g. through an option like :

---
gitea: none
include_toc: true
toc_position: float
---

Currently I inject the following CSS through a WebExtension :

.file-view.markup.markdown > details:first-child {
	position:fixed; /* position sticky seems to cause issue in the instance of gitea I use */
	right:0em;
	top: 60px;
	z-index: 100;
	background: var(--color-box-body);
	border: 1px solid gray;
	border-radius: 5px;
	padding: 10px;
	padding-right:20px;
	margin-bottom: 0px;
	& > ul { margin-bottom:0px
	} }

Screenshots

No response

Originally created by @denis-migdal on GitHub (Oct 6, 2023). ### Feature Description Currently, we can enable a TOC in markdown pages thanks to : ```` --- gitea: none include_toc: true --- ```` However, for long pages it would be better to have a right-align sticky TOC, e.g. through an option like : ```` --- gitea: none include_toc: true toc_position: float --- ```` Currently I inject the following CSS through a WebExtension : ````css .file-view.markup.markdown > details:first-child { position:fixed; /* position sticky seems to cause issue in the instance of gitea I use */ right:0em; top: 60px; z-index: 100; background: var(--color-box-body); border: 1px solid gray; border-radius: 5px; padding: 10px; padding-right:20px; margin-bottom: 0px; & > ul { margin-bottom:0px } } ```` ### Screenshots _No response_
GiteaMirror added the type/proposal label 2025-11-02 09:48:13 -06:00
Author
Owner

@silverwind commented on GitHub (Oct 6, 2023):

Markdown TOC should be rewritten to a button in the header like GitHub has, then we can sticky this header. In-Content TOC is too problematic.

@silverwind commented on GitHub (Oct 6, 2023): Markdown TOC should be rewritten to a button in the header like GitHub has, then we can sticky this header. In-Content TOC is too problematic.
Author
Owner

@buhtz commented on GitHub (Dec 13, 2023):

As a user I see much value in having the TOC as content instead of being a button somewhere.

btw: I was not able to find include_toc in the Gitea docu. I would like to know how much I can modify it. e.g. I want to have it unfolded by default.

@buhtz commented on GitHub (Dec 13, 2023): As a user I see much value in having the TOC as content instead of being a button somewhere. btw: I was not able to find `include_toc` in the Gitea docu. I would like to know how much I can modify it. e.g. I want to have it unfolded by default.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11800