# 카테고리/태그별 약관 일괄 적용

**URL:** https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323
**Category:** Feature
**Tags:** completed, disco-toc
**Created:** [7월 25, 2022, 7:54오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323 "2022-07-25T07:54:40Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![albert\_vu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/albert_vu/32/278482_2.png) [@albert\_vu](https://meta.discourse.org/u/albert_vu)
#### Post date: [7월 25, 2022, 7:54오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/1 "2022-07-25T07:54:40Z")

</div>

안녕하세요, TOC를 여러 주제에 일괄 적용할 수 있는 방법이 있을까요? 최근에 TOC 구성 요소를 설치했는데, 기존 주제에 수동으로 적용하는 건 좀 번거롭네요 🥲

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [7월 25, 2022, 9:02오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/2 "2022-07-25T09:02:20Z")

</div>

한 번 더 확인해볼게요. 하지만 현재는 불가능하지 않을까요? 수동으로 수정해야 하는 건 충분히 이해합니다. 🙂 아직 남은 건 몇 개인가요?

---

<div class="post-metadata">

### Author: ![albert\_vu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/albert_vu/32/278482_2.png) [@albert\_vu](https://meta.discourse.org/u/albert_vu)
#### Post date: [7월 25, 2022, 9:15오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/3 "2022-07-25T09:15:01Z")

</div>

솔직히 현재 그런 경우가 많지는 않은 것 같습니다. 하지만 팀에서 향후 릴리스에 이 기능을 구현하는 것을 고려해 주시면 정말 좋겠습니다 🤞

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [7월 25, 2022, 5:57오후 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/4 "2022-07-25T17:57:25Z")

</div>

@albert\_vu님의 아이디어가 너무 훌륭해서 이제 추가되었습니다: 🙂👍

> <https://github.com/discourse/DiscoTOC/pull/42>
>
> This PR adds two settings. 
> 
> One allows admins to select a list of categories …that will automatically enable the TOC if the topic category matches.
> The other does the same but with tags. 
> 
> Note that the topic still needs to have the other requirements for TOC, such as having headings. Also, this will still only apply to the first post.
> 
> This PR also moves some setting descriptions to the appropriate place. 
> 
> It also uses \`pretender\` for the tests instead of generating the fixture manually.

---

<div class="post-metadata">

### Author: ![albert\_vu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/albert_vu/32/278482_2.png) [@albert\_vu](https://meta.discourse.org/u/albert_vu)
#### Post date: [7월 26, 2022, 6:29오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/5 "2022-07-26T06:29:45Z")

</div>

좋아요 😄 그러면 제가 테마 컴포넌트를 직접 업데이트해야 하나요?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [7월 26, 2022, 6:36오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/6 "2022-07-26T06:36:11Z")

</div>

확인해 보시면 이미 처리된 걸 알게 되실 거예요. 🙂👍

다만, 새로운 기능을 원하시는 분들을 위해, 커스터마이즈 페이지에서 테마 컴포넌트를 업데이트할 수 있습니다:

 ![update discotoc](https://global.discourse-cdn.com/meta/original/4X/0/d/c/0dce537eb9a4c6a42eb1571edb4168f2f1be801a.jpeg)

---

<div class="post-metadata">

### Author: ![albert\_vu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/albert_vu/32/278482_2.png) [@albert\_vu](https://meta.discourse.org/u/albert_vu)
#### Post date: [7월 26, 2022, 7:10오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/7 "2022-07-26T07:10:45Z")

</div>

음, 사용자가 자신의 주제에 목차를 원하지 않는 시나리오가 떠올랐는데, 이를 되돌리는 방법이 있을까요? 🤔

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [7월 26, 2022, 7:14오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/8 "2022-07-26T07:14:42Z")

</div>

태그 요소를 좋아하니까, 목차(TOC)에 전용 태그를 붙였다가 원치 않을 때는 다시 제거하는 방식도 가능할 것 같아요?

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [7월 26, 2022, 7:41오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/9 "2022-07-26T07:41:56Z")

</div>

자동화라는 아이디어는 거의 모든 상황, 모든 곳에서 좋아합니다.

아직 DiscoTOC를 업데이트하지는 않았지만, TOC가 카테고리에서 가져오는 경우 툴바에서 TOC를 삽입할 수 있는 옵션을 제거할 수 있다면 정말 멋진 기능이 될 것 같습니다. 마치 케이크 위에 올려진 체리처럼요. 😉

또는 @albert_vu 님이 요청한 것의 정반대인 작업을 할 수도 있습니다. 제가 말하는 것을 이해하신다면, `!toc`와 같은 것을 삽입할 수 있는 옵션을 추가하는 방식이죠.

다만 일반 사용자들에게는 혼란을 줄 수 있습니다.

저는 그 정도는 감당할 수 있지만, 헤더가 하나나 두 개뿐인 경우 TOC는 거의 필요하지 않습니다. TOC가 있으면 긴 게시글을 아래까지 스크롤해야만… discourse 용어로 말하면… 음, 날짜를 스크롤할 수 있는 기능을 발견하게 되거든요. 하지만 제 생각에는 꽤 드문 가장자리 사례(edge case)입니다.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [10월 16, 2023, 7:26오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/10 "2023-10-16T07:26:11Z")

</div>

> [@Jagster](#):
>
> 그 점은 받아들일 수 있지만, 제목이 하나나 두 개뿐인 경우에는 목차(TOC)가 꽤 불필요합니다.

그 문제를 해결할 수 있는 테마 설정인 `TOC min heading`(기본값 3)이 있습니다. 👍 이 설정을 적용하면 최소 조건을 충족하지 않는 주제에서는 목차가 표시되지 않습니다.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [10월 16, 2023, 7:26오전 UTC](https://meta.discourse.org/t/bulk-apply-tocs-by-category-tag/282323/11 "2023-10-16T07:26:36Z")

</div>


