A Teable plugin that renders Markdown content.
- π Markdown Rendering - Renders Markdown content from selected table cells
- π¨ Enhanced Styling - Custom styling with GitHub-flavored Markdown support
- π Theme Support - Full light/dark mode compatibility with automatic theme detection
- π Internationalization - Complete i18n support (English/Chinese)
- π GitHub-Flavored Markdown - Support for tables, code blocks, and extended syntax
- π― Code Highlighting - Syntax highlighting
- π± Responsive Design - Optimized for all screen sizes
- π Custom Components - Enhanced callouts, tables, and blockquotes
- β‘ Performance Optimized - Built with React Query for efficient data fetching
- Next.js 14.2.14 - React full-stack framework with App Router
- React 18.2.0 - UI library with modern React features
- TypeScript 5 - Type-safe JavaScript superset
@teable/sdk- Plugin bridge and UI configuration@teable/openapi- API client and type definitions@teable/core- Core type definitions and utilities@teable/ui-lib- Teable official UI component library@teable/next-themes- Theme switching support
react-markdown- Markdown rendering with React componentsremark-gfm- GitHub-flavored Markdown supportshiki- Syntax highlighting enginegithub-markdown-css- GitHub-style Markdown CSStailwindcss- Atomic CSS framework@tailwindcss/typography- Typography utilities
@tanstack/react-query- Server state management and cachingreact-i18next- Internationalization frameworki18next- Core internationalization library
- Node.js 18+
- npm or yarn
- Teable account with API access
npm installnpm run dev -p 3000Visit http://localhost:3000 to view the plugin.
npm run buildnpm startnpm run optimize
npm run build:optimizedsrc/
βββ app/ # Next.js App Router
β βββ page.tsx # Main app entry with i18n and theme setup
β βββ Main.tsx # Theme and QueryClient integration
β βββ layout.tsx # Root layout component
β βββ globals.css # Global styles and CSS variables
βββ components/
β βββ MarkdownRenderer.tsx # Main Markdown rendering component
β βββ MarkdownPages.tsx # Page wrapper component
β βββ context/ # React Context providers
β β βββ EnvProvider.tsx # Environment variable injection
β β βββ I18nProvider.tsx # Internationalization provider
β β βββ types.ts # TypeScript type definitions
β βββ markdown/ # Custom Markdown components
β β βββ CustomComponents.tsx # Enhanced Markdown component mappings
β β βββ CodeBlock.tsx # Syntax-highlighted code blocks
β β βββ Callout.tsx # Custom callout components
β β βββ TableOfContents.tsx # TOC generation
β βββ ui/ # UI utility components
β βββ Icons.tsx # Custom icon components
βββ hooks/ # Custom React hooks
β βββ useInitApi.ts # API initialization
β βββ useViewId.ts # View ID management
βββ styles/ # Styling
β βββ markdown.css # Markdown-specific styles
β βββ custom-enhancements.css # Custom component styles
βββ locales/ # Internationalization files
β βββ en.json # English translations
β βββ zh.json # Chinese translations
βββ scripts/ # Build and optimization scripts
βββ optimize-assets.js # Asset optimization
The plugin reads configuration from URL parameters via EnvProvider.tsx:
baseId- Teable base identifierpluginId- Plugin identifierpluginInstallId- Plugin installation IDtableId- Target table for Markdown contentshareId,positionId,positionType- UI positioninglang,theme- Localization and theme settings
The plugin automatically:
- Reads Teable configuration from URL parameters
- Sets up theme detection and switching
- Initializes internationalization with proper language detection
- Configures API clients with authentication
- CSS Variables - Comprehensive theme system with HSL color values
- Responsive Design - Mobile-first approach with breakpoints
- Component Isolation - Scoped styles for custom components
- Dark Mode Support - Automatic theme detection and switching
- Callouts - Color-coded information boxes with hover effects
- Code Blocks - Syntax highlighting with copy buttons and line numbers
- Tables - Enhanced styling with hover states and responsive design
- Blockquotes - Custom styling with decorative elements
Supported languages:
- English (en)
- Chinese (zh)
- Create translation file in
src/locales/[lang].json - Update
I18nProvider.tsxresources configuration - Add language-specific content to components
import { usePluginBridge } from '@teable/sdk';
const bridge = usePluginBridge();
// Listen for selection changes
bridge.on('syncSelection', handleSelection);
// Get selected cell content
const result = await bridge.getSelectionRecords(selection);The plugin uses Teable's OpenAPI with automatic authentication:
import { openApi } from '@teable/openapi';
// All API calls are automatically authenticated
const data = await openApi.getTableRecords(tableId, viewId);# Analyze bundle size
npm run analyze
# Build with asset optimization
npm run build:optimized- Build the plugin:
npm run build - Deploy to your hosting service
- Configure in Teable with proper URL parameters
- Test plugin functionality in Teable environment
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.