kodemoapp/player
소개
Kodemo 문서를 읽기 위한 React 컴포넌트입니다.
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalKodemo
Kodemo is a new format for more engaging and interactive technical documentation. It's great for tutorials and walkthroughs.
- 🔗 Learn more at kodemo.com
- 👉 Try a live demo
- 👀 Follow @kodemoapp
Kodemo Player
This repo contains the @kodemo/player package which is responsible for rendering and navigating Kodemo documents. The player is a React component and it needs to be provided with a valid Kodemo document.
Installation
To install and integrate @kodemo/player please follow the docs at https://kodemo.com/docs/player.
TLDR?
- Install @kodemo/player using your package manager of choice:
npm i @kodemo/player # yarn add @kodemo/player
- Import and render the
KodemoPlayercomponent:
import React from 'react'
import ReactDOM from 'react-dom/client'
import { KodemoPlayer } from '@kodemo/player';
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<KodemoPlayer json={{
story: '<h1>Example Document</h1>',
subjects: {
f992151a: {
type: 'code',
name: 'file.js',
language: "javascript",
versions: {
e60944c4: { value: 'const a = 123;', },
}
}
}
}}></KodemoPlayer>
</React.StrictMode>
)
Development Setup
If you want to make changes to the @kodemo/player source here's how:
- Clone this repository
- Run
yarn install - Run
yarn devto start the development server - Open the URL from the dev server output and 💥
Other scripts
# run tests
yarn test
# build a new release
yarn build
Adding New Subject Types
Each subject in Kodemo is its own React component. You can easily add your own subject types by following these steps:
- Create your subject component in the subjects directory. I recommend using AbstractSubject as a starting point.
- Export your subject from subjects/index.ts.
- Add your subject to enum/SubjectType.ts.
Terminology
If you're planning to work with the Kodemo source here are a few key concepts and names that are good to know about.
- The
storyis the main body text of the documentation. Subjectsare the individual pieces of content that the documentation covers. A subject can be an image, code, etc.- Subjects can have multiple
versions. Each version represents a variant of the same subject. For example, multiple versions are used to animate lines being added or removed from code. - The
timelineis the bar with vertical line segments that indicate which subject that will become active when scrolling. Effectsare keywords within the story that are linked to a specific subject version. They form the relationship between the story and subjects.
관련 프로젝트 살펴보기
불러오는 중…