Skip to main content

토론 범주 양식의 구문

YAML 구문을 사용하여 토론 범주 양식의 필드를 정의할 수 있습니다.

토론 범주 양식에 대한 YAML 구문 정보

YAML 양식 정의 파일을 /.github/DISCUSSION_TEMPLATE/리포지토리의 폴더에 추가하여 사용자 지정 토론 범주 양식을 만들 수 있습니다. YAML을 처음 사용하며 자세히 알아보려는 경우 “Y분 안에 YAML 알아보기”를 참조하세요.

이름은 토론 범주 중 하나의 슬러그와 일치해야 합니다. 예를 들어 "공지" 범주에 대한 템플릿은 .github/DISCUSSION_TEMPLATE/announcements.yml이어야 합니다.

각 필드에 대해 입력 형식, 유효성 검사 및 기본 레이블을 정의할 수 있습니다.

커뮤니티 구성원이 토론 양식을 작성하면 각 입력에 대한 응답이 마크다운으로 변환되어 토론 본문에 추가됩니다. 커뮤니티 구성원은 토론 양식으로 만든 토론을 편집할 수 있으며, 다른 사용자는 다른 방법을 통해 만든 토론과 상호 작용할 수 있습니다.

이 예제 YAML 구성 파일은 일반 토론 범주 양식을 정의합니다.

YAML
title: "[General] "
labels: ["General Introduction"]
body:
  - type: markdown
    attributes:
      value: |
        This is text that will show up in the template!
  - type: textarea
    id: improvements
    attributes:
      label: Top 3 improvements
      description: "What are the top 3 improvements we could make to this project?"
      value: |
        1.
        2.
        3.
        ...
      render: bash
    validations:
      required: true
  - type: markdown
    attributes:
      value: |
        ## Markdown header
        And some more markdown
  - type: input
    id: has-id
    attributes:
      label: Suggestions
      description: A description about suggestions to help you
    validations:
      required: true
  - type: dropdown
    id: download
    attributes:
      label: Which area of this project could be most improved?
      options:
        - Documentation
        - Pull request review time
        - Bug fix time
        - Release cadence
    validations:
      required: true
  - type: checkboxes
    attributes:
      label: Check that box!
      options:
        - label: This one!
          required: true
        - label: I won't stop you if you check this one, too
  - type: markdown
    attributes:
      value: |
        ### The thrilling conclusion
        _to our template_

최상위 구문

토론 범주 양식의 구성 파일에는 body키가 포함되어야 하며, body에는 Markdown이 아닌 필드가 1개 이상 포함되어야 합니다.

YAML
body:
- type: input
  id: suggestion
  attributes:
    label: Suggestion
    description: "How might we make this project better?"
    placeholder: "Adding a CODE_OF_CONDUCT.md file would be a great idea."
  validations:
    required: true

각 문제 양식에 대해 다음 최상위 키를 설정할 수 있습니다.

Key설명필수Type
body토론 양식의 입력 형식에 대한 정의입니다.Required배열
labels이 템플릿을 사용하여 만든 토론에 자동으로 추가될 레이블입니다.선택 사항배열 또는 쉼표로 구분된 문자열
title토론 제출 양식에 미리 채워지는 기본 제목입니다.선택 사항문자열

양식에 필드를 추가하려면 body키에 양식 요소 배열을 포함해야 합니다. 사용 가능한 요소 및 해당 구문 목록은 "GitHub 양식 스키마 구문"을 참조하세요.