Examples
Learn how to use GloST through practical examples. These examples demonstrate common patterns for rendering multilingual text with annotations.
What You’ll Find Here
Ruby Annotations
Learn how to render text with ruby annotations (furigana, pinyin, romanization) using GloST React components.
Progressive Display
Implement the 5-level progressive disclosure system to gradually reveal linguistic information.
Multi-Language Text
Work with multiple languages in a single document, handling different scripts and transcription systems.
Dialogues & Conversations
Create and render conversational dialogues with speaker attribution, perfect for language learning scenarios.
Quick Start
Install the packages:
npm install @glotblocks/glost @glotblocks/glost-reactCreate a simple word with ruby annotation:
import { SimpleRubyWord } from "@glotblocks/glost-react";
import { createJapaneseWord } from "@glotblocks/glost";
const word = createJapaneseWord({
text: "日本語",
transcription: {
furigana: { text: "にほんご", system: "furigana" }
},
translation: "Japanese language"
});
function Example() {
return (
<SimpleRubyWord
word={word}
transcriptionSystem="furigana"
rubyPosition="over"
showDefinition
/>
);
}Package Overview
| Package | Purpose |
|---|---|
glost | Core types, document creation, tree traversal |
@glotblocks/glost-react | React components for rendering with ruby annotations |
@glotblocks/glost-dialogue | Dialogue and conversation support |
@glotblocks/glost-processor | Unified-style processor for plugins |
Live Examples
Check out the GloST Playground for interactive examples you can run locally.
Last updated on