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

TOC: Support unnumbered titles #4860

Closed
2 tasks done
Cerallin opened this issue Jan 5, 2022 · 5 comments · Fixed by #4871
Closed
2 tasks done

TOC: Support unnumbered titles #4860

Cerallin opened this issue Jan 5, 2022 · 5 comments · Fixed by #4871

Comments

@Cerallin
Copy link
Contributor

Cerallin commented Jan 5, 2022

Check List

Please check followings before submitting a new feature request.

  • I have already read Docs page
  • I have already searched existing issues

Feature Request

I was using hexo-generator-pandoc to generate HTML files.
Markdown in the form of

### First Title

### Unnumbered title

will be rendered to

<h3 id="first-title">First title</h3>

<h3 id="unnumbered-title" class="unnumbered">Unnumbered title</h3>

Is there any solution to unnumber titles in TOC? A common usage scenario is writing with the heading "Reference".

Others

@SukkaW SukkaW added the question Needs help in usage label Jan 6, 2022
@Cerallin
Copy link
Contributor Author

Cerallin commented Jan 8, 2022

I've read the TOC part of the codes in hexo and hexo-utils and made sure that unnumbered titles were not supported. @SukkaW May I contribute to adding this feature?

P.S. I've also read the docs and was noticed that features about min_depth were not documented.

@yoshinorin
Copy link
Member

@Cerallin

I don't understand what is difference between toc#list_number and unnumbered.
Would you please explain more detail?

@Cerallin
Copy link
Contributor Author

I don't understand what is difference between toc#list_number and unnumbered. Would you please explain more detail?

Sorry for the ambiguous statements. What I am trying to express could be compared with LaTeX.

Something in tex like this

\section{Title}
\section*{Unnumbered Title}

will be rendered as

1. Title
Unnumbered Title

in which Unnumbered title is not numbered, does not have a 2. before it.

The feature I want is to control the list_number of each heading by adding class unnumbered, which is automatically generated by pandoc.

@yoshinorin yoshinorin added feature-request and removed question Needs help in usage labels Jan 11, 2022
@yoshinorin
Copy link
Member

@Cerallin

The feature I want is to control the list_number of each heading by adding class unnumbered, which is automatically generated by pandoc.

OK, I understand.

May I contribute to adding this feature?

Sure, you can contribute :)
We can't promise to merge it, but we will review it if you submit a PR.

@yoshinorin
Copy link
Member

refs: hexojs/hexo-util#269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants