Our terminology around documents, nested, and types is confusing

Đang mở
#226 1 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tài liệu
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu bằng cách xem xét thuật ngữ và cách đặt tên được đề xuất trong issue này cùng với phần thảo luận liên quan trong #225. Công việc được xem là hoàn tất khi đã thống nhất thuật ngữ và cập nhật nhất quán ở mọi nơi mà dự án ghi lại hoặc cung cấp các khái niệm này, nhưng các tệp bị ảnh hưởng và phạm vi chính xác không được xác định ở đây.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

meta: feedback-wanted meta: never-stale

This is coming from #225. All of these things are different within the context of Contentlayer:

  • Document is a generated piece of content.
  • Document Type is a group of content of a similar shape.
  • Nested Type is a repeatable group of content using within document types
  • Type is an auto-generated TS type for every document and its nested types.

Aside from the nuance of difference between "document" and "nested" (covered in #225), I'm finding our use of "type" to clash with our heavy use of TypeScript and in auto-generating TS type definitions.

If we were to pursue #225, we could simplify our terminology like so:

  • Model or Content Type is a group of any type of content.
  • Document is the generated data file.
  • Type is the generated TS definition.

Example: A Post model defines the shape of content in the content/posts directory. Contentlayer processes this content according to the model definition, and then generates a document for every post, along with a TS type definition.

Ngôn ngữ chính
TypeScript
Star
3.5k
Fork
192
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của contentlayerdev/contentlayer

Tất cả issue của contentlayerdev/contentlayer

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.