@jojovms/scripto 0.0.2 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,58 +1,62 @@
1
- # Scriptō - Elegant Markdown Viewer
1
+ # Scriptō - React Markdown Viewer
2
2
 
3
- [**🚀 Live Demo**](https://shijoshaji.github.io/Scripto/)
3
+ [**🚀 Live Demo**](https://shijoshaji.github.io/Scripto/) | [**📦 NPM Package**](https://www.npmjs.com/package/@jojovms/scripto)
4
4
 
5
- **Scriptō** is a beautiful, lightweight, and offline-capable Markdown viewer designed for simplicity and elegance. It runs entirely in your browser with no backend required.
5
+ **Scriptō** is a beautiful, lightweight, and simple Markdown viewer component for React.
6
6
 
7
7
  > "Simple, elegant visualization — where every mark becomes meaning."
8
8
 
9
9
  ## ✨ Features
10
10
 
11
- ### 📂 **Instant Preview**
12
- - **Drag & Drop**: Simply drop any `.md` or `.markdown` file to view it instantly.
13
- - **File Picker**: Browse files from your local system.
14
-
15
- ### 🔗 **Remote Fetching**
16
- - **URL Support**: Load Markdown files directly from the web.
17
- - **Smart GitHub Support**: Automatically converts standard GitHub file URLs (blob) to raw format for seamless viewing.
18
- - **Query Params**: Share links easily using `?url=YOUR_LINK` (e.g., `index.html?url=https://raw.github...`).
19
-
20
- ### 🎨 **Visual Experience**
21
- - **Glassmorphism Design**: Modern, translucent UI with vibrant background animations.
22
- - **Theme Toggle**: Switch between the default **Cosmic Dark** mode and a clean **Pastel Light** mode.
23
- - **Responsive**: Perfectly optimized for desktops, tablets, and mobile devices.
24
-
25
- ### 🔊 **Accessibility**
26
- - **Read Aloud**: Integrated Text-to-Speech engine reads your document out loud.
27
- - **Visual Feedback**: Pulse animation indicates when audio is playing.
28
-
29
- ### 📤 **Export & Share**
30
- - **Rich Text Copy**: Copy your Markdown as formatted Rich Text (HTML) to paste directly into Word, Docs, or emails with styles preserved.
31
- - **Save as PDF**: Export your document as a clean, styled PDF. (Optimized for both Light and Dark modes).
32
-
33
- ## 🚀 How to Use
34
-
35
- ### Local Usage
36
- 1. Download the repository.
37
- 2. Double-click `index.html` to open it in your browser.
38
- 3. **Note**: Some browsers might restrict URL fetching (CORS) when running from `file://`. For full features, run a simple local server:
39
- ```bash
40
- # Python 3
41
- python -m http.server 8000
42
- ```
43
-
44
- ### Hosting (GitHub Pages)
45
- This app is "Static-Ready". You can deploy it directly to GitHub Pages, Vercel, or Netlify with zero configuration.
46
-
47
- ## 🛠️ Tech Stack
48
- - **Core**: HTML5, Vanilla CSS3, Vanilla JavaScript (ES6+).
49
- - **Libraries** (via CDN):
50
- - [Marked.js](https://marked.js.org/) (Markdown Parser)
51
- - [DOMPurify](https://github.com/cure53/DOMPurify) (Security/Sanitization)
52
- - [Ionicons](https://ionic.io/ionicons) (Icons)
53
- - **Fonts**: [Outfit](https://fonts.google.com/specimen/Outfit) (Google Fonts).
11
+ - **Beautiful UI**: Modern, glassmorphism design with vibrant background animations.
12
+ - **Instant Preview**: Drag & drop or paste URLs to view `.md` files instantly.
13
+ - **Rich Text Copy**: Copy Markdown as formatted HTML to paste directly into emails/docs.
14
+ - **Accessibility**: Integrated Text-to-Speech (Read Aloud).
15
+ - **Export**: Save documents as clean PDF files.
16
+ - **Theming**: Built-in Dark and Light modes.
17
+
18
+ ## 📦 Installation
19
+
20
+ ```bash
21
+ npm install @jojovms/scripto
22
+ ```
23
+
24
+ ## 🚀 Usage
25
+
26
+ Import the component and the styles in your React application:
27
+
28
+ ```jsx
29
+ import React from 'react';
30
+ import { Scripto } from '@jojovms/scripto';
31
+ import '@jojovms/scripto/dist/style.css'; // Don't forget the styles!
32
+
33
+ function App() {
34
+ return (
35
+ <div style={{ height: '100vh', width: '100%' }}>
36
+ {/* Basic Usage */}
37
+ <Scripto />
38
+
39
+ {/* Or load a file from a URL */}
40
+ <Scripto url={`${window.location.origin}/docs/walkthrough.md`} />
41
+ or
42
+ <Scripto url="https://raw.githubusercontent.com/jojovms/scripto/main/README.md" />
43
+ </div>
44
+ );
45
+ }
46
+
47
+ export default App;
48
+ ```
49
+
50
+ > **Note**: The `Scripto` component is designed to take up the full height of its container. Ensure the parent container has a defined height (e.g., `100vh`).
51
+
52
+ ## 🛠️ Props
53
+
54
+ | Prop | Type | Description |
55
+ |------|------|-------------|
56
+ | `url` | `string` | Optional. A direct URL to a Markdown file to load on mount. Supports raw URLs or GitHub blob URLs. |
54
57
 
55
58
  ## 👨‍💻 Credits
59
+
56
60
  Created by [Shijo Shaji](https://bio.link/shijoshaji).
57
61
 
58
62
  ---