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

Allow overriding styles and paragraph properties for table of contents #652

Open
nikitavbv opened this issue Sep 2, 2023 · 0 comments
Open

Comments

@nikitavbv
Copy link

First of all, thank you for maintaining this crate! It is really useful!

Is your feature request related to a problem? Please describe.

When creating a table of contents, it is created with a specific style (i.e., normal text without any additional formatting and "..." as tab leader):

Screenshot 2023-09-02 at 11 13 46 PM

If a different style is needed (for example, bold text and no tab leader) it is not possible to set, because:

Describe the solution you'd like

TOC item paragraph customization can be solved by allowing user to specify a mapping of levels to style names (that would be used instead of ToC{level}). In addition to that, logic in build can be updated to skip adding style if style with such name is already present (that would allow the user to customize the style by creating ToC{level} style themself).

Customizing the paragraph tab is a bit more difficult but can be solved by allowing the user to set a custom tab (per level) by calling a function on TableOfContents or by providing a way for user to set Paragraph instance which will be later be cloned per each TOC item (or by setting a factory of Paragraph).

Describe alternatives you've considered

It does not seem that there are any alternative solutions here. If there are - please let me know!

Additional context

Please let me know what you think about possible solutions, and I will be happy to submit an MR for this!

Thank you!

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

1 participant