# Discourse에서 shortcodes와 비슷한 기능이 있을까요?

**URL:** https://meta.discourse.org/t/something-like-shortcodes-for-discourse/191993
**Category:** Support
**Created:** [5월 29, 2021, 2:35오전 UTC](https://meta.discourse.org/t/something-like-shortcodes-for-discourse/191993 "2021-05-29T02:35:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [5월 29, 2021, 2:35오전 UTC](https://meta.discourse.org/t/something-like-shortcodes-for-discourse/191993/1 "2021-05-29T02:35:39Z")

</div>

최근에 마크다운에서 JSX를 사용하여 동적 컴포넌트를 임베드할 수 있게 해주는 [MDX](https://mdxjs.com/)를 발견했습니다.

Discourse 게시글에서도 비슷한 기능을 구현하는 것이 얼마나 어려운지 궁금합니다.

사용자가 게시글에 숏코드와 유사한 스니펫을 임베드하여 포럼에서 게임을 시작할 수 있도록 하고 싶습니다:

```plaintext
Here's today's game. Let's see who can get the best score.

[game type="whatever" prop2="something" expires="midnight"]

```

해당 태그는 동적 JavaScript 게임으로 대체됩니다. 점수는 데이터베이스에 저장되거나(또는 백엔드에서 Firebase로 전송됩니다).

이와 유사한 기능이 존재하는지, 또는 이를 구현하는 방법에 대한 아이디어를 줄 수 있는 오픈소스 플러그인이 있는지 아시는 분이 계신가요?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [5월 29, 2021, 7:07오전 UTC](https://meta.discourse.org/t/something-like-shortcodes-for-discourse/191993/2 "2021-05-29T07:07:33Z")

</div>

bbcode 플러그인과 [Topic Template Placeholder Text 테마 컴포넌트](https://meta.discourse.org/t/topic-template-placeholder-text-theme-component/149053)가 시작점으로 제공되지만, [디스코urs 플러그인 만들기 입문 가이드 1부: 기본 플러그인 만들기](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-1-creating-a-basic-plugin/30515)에 대해 상당한 이해가 필요합니다

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [5월 29, 2021, 8:49오전 UTC](https://meta.discourse.org/t/something-like-shortcodes-for-discourse/191993/3 "2021-05-29T08:49:17Z")

</div>

감사합니다. 제가 찾고 있는 것의 예시가 있을 것 같은 [캘린더 플러그인](https://github.com/discourse/discourse-calendar)을 찾았습니다 ([커스텀 마크다운 태그](https://github.com/discourse/discourse-calendar/blob/main/assets/javascripts/lib/discourse-markdown/discourse-calendar.js.es6) 및 일부 백엔드 컨트롤러). 또한 [마크다운 확장 가이드](https://meta.discourse.org/t/developers-guide-to-markdown-extensions/66023)도 찾았지만, 아직 자세히 읽지는 않았습니다.

모달에 iframe을 로드하고 `postMessage`를 사용하여 점수를 전달할 수 있다면, 게임을 사이트의 MDX 페이지에도 임베드할 수 있을 것 같습니다. 실험을 해볼 예정입니다.
