auto create markdown file from parser interface
This commit is contained in:
1 parent
f143f1e511
commit
8434cf78ed
8 files changed
+2446
-866
No files matched your search
@@ -15,16 +15,37 @@ Download or place a video file in the `/docs/public` directory. Several options
|
||||
|
||||
Choose any method to download your video and save it to `/docs/public` directory.
|
||||
|
||||
### Step 2: Create a Markdown File
|
||||
### Step 2: Start the Development Server
|
||||
|
||||
Create a markdown file in `/docs` directory. The filename should match the video filename with `[xxx]` removed and spaces replaced with underscores.
|
||||
Run the following command in the project directory:
|
||||
|
||||
```bash
|
||||
pnpm run dev
|
||||
```
|
||||
|
||||
This starts the VitePress development server and WebSocket server for communication.
|
||||
|
||||
### Step 3: Use the Downloader Interface
|
||||
|
||||
1. Open the VitePress website in your browser
|
||||
2. Enter your video filename in the textbox (e.g. `my video [abc123].mp4`, `presentation.webm`, `my-video [xyz].mpeg`)
|
||||
3. Press Enter or click Submit
|
||||
|
||||
The app will:
|
||||
- Load the markdown matching the submitted video filename.
|
||||
- If it exists: process the video — extract screenshots for timestamps, insert images, and save the markdown.
|
||||
- If it does not exist: create the markdown and exit. Edit the new file (add frontmatter or timestamps), then run the Downloader again.
|
||||
|
||||
#### Create/Edit the Markdown File
|
||||
|
||||
You may let the Downloader create the markdown file automatically, or create it yourself by placing a file in the `/docs` directory. The filename should match the video filename with any bracketed ID removed and spaces replaced with underscores, for example:
|
||||
|
||||
For example:
|
||||
- Video file: `my video [abc123].mp4` → Markdown file: `my_video.md`
|
||||
- Video file: `presentation.webm` → Markdown file: `presentation.md`
|
||||
- Video file: `my-video [xyz].mpeg` → Markdown file: `my-video.md`
|
||||
|
||||
The markdown file content can be:
|
||||
If the file is newly created by the Downloader, you will need to edit the markdown to provide the content or timestamps the app will use. After editing, run the Downloader again to regenerate screenshots and update image references.
|
||||
|
||||
The markdown file content can be one of the following:
|
||||
|
||||
**Option A: YAML Frontmatter (for auto-generating timestamps)**
|
||||
|
||||
@@ -58,28 +79,6 @@ Velit euismod blandit proin arcu magna.
|
||||
|
||||
Timestamps should be in `M:SS` or `MM:SS` format on their own line. They will be converted to timestamped screenshot references.
|
||||
|
||||
### Step 3: Start the Development Server
|
||||
|
||||
Run the following command in the project directory:
|
||||
|
||||
```bash
|
||||
pnpm run dev
|
||||
```
|
||||
|
||||
This starts the VitePress development server and WebSocket server for communication.
|
||||
|
||||
### Step 4: Use the Downloader Interface
|
||||
|
||||
1. Open the VitePress website in your browser
|
||||
2. Enter your video filename in the textbox (e.g. `my video [abc123].mp4`, `presentation.webm`, `my-video [xyz].mpeg`)
|
||||
3. Press Enter or click Submit
|
||||
|
||||
The app will:
|
||||
- Load the video
|
||||
- Extract screenshots at specified timestamps
|
||||
- Replace timestamp lines with embedded screenshot images
|
||||
- Save the updated markdown file
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
@@ -100,7 +99,7 @@ group-similar.js # Script for deduplicating similar screenshots
|
||||
## Dependencies
|
||||
|
||||
- Node.js and pnpm
|
||||
- VitePress for web UI
|
||||
- [VitePress](https://vitepress.dev) for web UI
|
||||
- WebSocket for real-time communication between browser and server
|
||||
- gray-matter for parsing YAML frontmatter
|
||||
- [Sharp](https://github.com/lovell/sharp) for image processing (screenshot manipulation)
|
||||
- `gray-matter` for parsing YAML frontmatter
|
||||
- [`sharp`](https://github.com/lovell/sharp) for image processing (screenshot manipulation)
|
||||
Reference in new issue
Block a user