review: tighten triggers, add license, polish README
This commit is contained in:
11
README.md
11
README.md
@@ -11,23 +11,22 @@ When you say things like *"exportier mal das PDF"*, *"regenerate the PDF"*, or *
|
|||||||
In Claude Code, on each device:
|
In Claude Code, on each device:
|
||||||
|
|
||||||
```
|
```
|
||||||
/plugin marketplace add https://gitea.<your-domain>/jlmak/claude-md-to-pdf
|
/plugin marketplace add https://YOUR_GITEA_HOST/jlmak/claude-md-to-pdf
|
||||||
/plugin install md-to-pdf@claude-md-to-pdf
|
/plugin install md-to-pdf@claude-md-to-pdf
|
||||||
```
|
```
|
||||||
|
|
||||||
(Replace `gitea.<your-domain>` with your Gitea host. The repo can also be installed from a local clone — see "Local install" below.)
|
(Replace `YOUR_GITEA_HOST` with your Gitea hostname, e.g. `git.example.com`. The repo can also be installed from a local clone — see "Local install" below.)
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Node.js with `npx` on `PATH` (the skill calls `npx --yes md-to-pdf`).
|
- Node.js with `npx` on `PATH` (the skill calls `npx --yes md-to-pdf`).
|
||||||
|
- On first invocation, `md-to-pdf` will download Chromium via Puppeteer (~150MB). Allow extra time and ensure outbound HTTPS to `googleapis.com` is permitted in restricted networks.
|
||||||
|
|
||||||
## How style is chosen
|
## How style is chosen
|
||||||
|
|
||||||
The skill walks upward from the source `.md` file looking for a `.md-to-pdf.config.js`. If found, it's used. Otherwise the bundled default — A4, 15/12mm margins, 5pt fixed-layout tables, system sans-serif at 11pt — is used. The bundled default lives at:
|
To override the default style, drop a `.md-to-pdf.config.js` next to your Markdown file (or anywhere upward in the directory tree). Project-local config always wins.
|
||||||
|
|
||||||
```
|
If no override is found, the bundled default is used — A4, 15/12mm margins, 5pt fixed-layout tables, system sans-serif at 11pt.
|
||||||
plugins/md-to-pdf/skills/md-to-pdf/default.config.js
|
|
||||||
```
|
|
||||||
|
|
||||||
## Local install (no Gitea remote yet)
|
## Local install (no Gitea remote yet)
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"name": "md-to-pdf",
|
"name": "md-to-pdf",
|
||||||
"description": "Regenerate a PDF from a Markdown file on natural-language request (e.g. 'exportier mal das PDF', 'regenerate the PDF'). Uses project-local .md-to-pdf.config.js when present, otherwise a bundled default styled for A4 with small tables.",
|
"description": "Regenerate a PDF from a Markdown file on natural-language request (e.g. 'exportier mal das PDF', 'regenerate the PDF'). Uses project-local .md-to-pdf.config.js when present, otherwise a bundled default styled for A4 with small tables.",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
|
"license": "MIT",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Jean-Luc Makiola",
|
"name": "Jean-Luc Makiola",
|
||||||
"email": "mail@jeanlucmakiola.de"
|
"email": "mail@jeanlucmakiola.de"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: md-to-pdf
|
name: md-to-pdf
|
||||||
description: Use when the user asks to export, regenerate, build, or "make" a PDF from a Markdown file. Triggers on phrases like "exportier mal das PDF", "mach das als PDF", "regenerate the PDF", "PDF neu generieren", "convert this markdown to pdf". Do NOT trigger on requests to read, open, or display an existing PDF.
|
description: Use when the user asks to export, regenerate, build, or "make" a PDF from a Markdown file. Triggers on phrases like "exportier mal das PDF", "mach das als PDF", "regenerate the PDF", "PDF neu generieren", "convert this markdown to pdf". Do NOT trigger on requests to read, open, display, summarize, preview, or render a PDF or Markdown file inline.
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ Regenerate a PDF from a Markdown file using the user's preferred styling. The sk
|
|||||||
|
|
||||||
## When This Skill Applies
|
## When This Skill Applies
|
||||||
|
|
||||||
Trigger when the user wants a Markdown file converted to PDF — typical phrasings: "exportier mal", "mach mir das als PDF", "PDF regenerieren", "regenerate the PDF", "convert to pdf". Do **not** trigger when the user just wants to view, read, or open an existing PDF.
|
Trigger when the user wants a Markdown file converted to PDF — typical phrasings: "exportier mal", "mach mir das als PDF", "PDF regenerieren", "regenerate the PDF", "convert to pdf". Do **not** trigger when the user wants to view, read, open, summarize, preview, or render a PDF or Markdown file inline (no conversion intended).
|
||||||
|
|
||||||
## Procedure
|
## Procedure
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ Trigger when the user wants a Markdown file converted to PDF — typical phrasin
|
|||||||
Resolve in this order — stop at the first that yields a single unambiguous file:
|
Resolve in this order — stop at the first that yields a single unambiguous file:
|
||||||
|
|
||||||
1. A `.md` path explicitly named in the user's most recent message.
|
1. A `.md` path explicitly named in the user's most recent message.
|
||||||
2. The `.md` file the assistant most recently read or wrote in this session.
|
2. The `.md` file the assistant most recently read or wrote in this session, **only if a single such file is unambiguously most recent**. If multiple files were touched and you cannot identify one with confidence, fall through to rule 3.
|
||||||
3. The single most-recently-modified `.md` file in the current working directory (`ls -t *.md | head -1` semantics).
|
3. The single most-recently-modified `.md` file in the current working directory (`ls -t *.md | head -1` semantics).
|
||||||
|
|
||||||
If none of these resolves to one file, **ask** the user which file to convert. Do not guess.
|
If none of these resolves to one file, **ask** the user which file to convert. Do not guess.
|
||||||
|
|||||||
Reference in New Issue
Block a user