|
Download docs/contributing.md from Leon4gr45/termix: direct link, hf CLI and curl.
- Browser
- Download file 3.21 kB
-
https://huggingface.co/spaces/Leon4gr45/termix/resolve/main/docs/contributing.md
- Command line
-
hf download hf://spaces/Leon4gr45/termix/docs/contributing.md
-
curl -L -o contributing.md https://huggingface.co/spaces/Leon4gr45/termix/resolve/main/docs/contributing.md
3.21 kB
Contributing
Thank you for your interest in contributing to BentoPDF! This guide will help you get started.
Getting Started
Prerequisites
- Node.js 18+
- npm 9+
- Git
Setup
# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/bentopdf.git
cd bentopdf
# Install dependencies
npm install
# Start development server
npm run dev
Project Structure
bentopdf/
βββ src/
β βββ js/
β β βββ config/ # Tool definitions
β β βββ logic/ # Tool page logic
β β βββ utils/ # Shared utilities
β β βββ ui.ts # UI helpers
β βββ pages/ # Tool HTML pages
β βββ css/ # Styles
βββ public/
β βββ locales/ # Translations
β βββ pymupdf-wasm/ # WASM modules
βββ docs/ # Documentation (VitePress)
βββ scripts/ # Build scripts
Adding a New Tool
Step 1: Create the Logic File
Create src/js/logic/your-tool-page.ts:
import { showLoader, hideLoader, showAlert } from '../ui.js';
import { state } from '../state.js';
document.addEventListener('DOMContentLoaded', () => {
// Your tool logic here
});
Step 2: Create the HTML Page
Create src/pages/your-tool.html following the existing tool templates.
Step 3: Register the Tool
Add to src/js/config/tools.ts:
{
href: import.meta.env.BASE_URL + 'your-tool.html',
name: 'Your Tool',
icon: 'ph-icon-name',
subtitle: 'Description of your tool.',
}
Step 4: Add to Build Config
Add the page to vite.config.ts:
'your-tool': resolve(__dirname, 'src/pages/your-tool.html'),
Step 5: Add Translations
Add entries to all locale files in public/locales/:
{
"yourTool": {
"name": "Your Tool",
"subtitle": "Description"
}
}
Code Style
- Use TypeScript for all new code
- Follow existing patterns for consistency
- Run
npm run formatbefore committing - No comments in production code (comments removed during build)
Pull Request Process
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Test thoroughly:
npm run build - Submit a PR with a clear description
Translation
See TRANSLATION.md for adding new languages.
Contributor License Agreement
Before your PR can be merged, you'll need to sign our CLA:
Getting Help
License
BentoPDF is dual-licensed:
- AGPL-3.0 for open-source projects where you share your full source code publicly
- Commercial License for proprietary/closed-source applications - Get Lifetime License for $49
By contributing, you agree that your contributions will be licensed under these terms.