Token导航 LogoToken导航

Agent Skill · 前端设计

frappe-syntax-print(frappe 语法打印)

frappe-syntax-print 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

frappe-syntax-print 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 6,004。

总安装 564周安装 24GitHub Stars 87下载 198核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:frappe-syntax-print(frappe 语法打印)
来源仓库:https://github.com/openaec-foundation/erpnext_anthropic_claude_development_skill_package
仓库路径:skills/frappe-syntax-print
安装命令:
npx skills add https://github.com/openaec-foundation/erpnext_anthropic_claude_development_skill_package --skill frappe-syntax-print
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/openaec-foundation/erpnext_anthropic_claude_development_skill_package --skill frappe-syntax-print

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

frappe-syntax-print 用于处理 GitHub 仓库、Issue、Pull Request 等协作信息,适合整理代码变更与项目状态。适用于围绕仓库状态、代码协作事项进行信息梳理的场景。通过 npx skills add 命令从指定 GitHub 仓库安装并使用。

安装前需确认权限范围和维护状态,注意可能触发联网或命令执行操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/frappe-syntax-print

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/openaec-foundation/erpnext_anthropic_claude_de…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

frappe-syntax-print 怎么安装?

在终端执行 npx skills add https://github.com/openaec-foundation/erpnext_anthropic_claude_development_…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

frappe-syntax-print 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

frappe-syntax-print 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

frappe-syntax-print 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

frappe-syntax-print 用的人多吗?

公开数据是累计安装 564 次,近一周安装 24 次,下载 198 次,GitHub 87 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

frappe-syntax-print 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
frappe-syntax-print

frappe 语法打印 · 本页

56487操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Frappe Print Formats & PDF Generation

Deterministic reference for print formats, Letter Head, and PDF generation in Frappe v14/v15/v16.

When to Use This Skill

USE when:

  • Creating or modifying Print Formats (Jinja or JS)
  • Generating PDFs programmatically (get_pdf, download endpoints)
  • Configuring Letter Head (header/footer) for print output
  • Working with Print Designer (v15+)
  • Implementing page breaks, print CSS, or landscape layouts
  • Building Report Print Formats ({%= %} syntax)

DO NOT USE for:

  • General Jinja template syntax (emails, portals) -- see frappe-syntax-jinja
  • Client Script UI logic -- see frappe-syntax-clientscripts
  • Web views or portal pages -- see frappe-syntax-jinja

Decision Tree: Which Print Format Type?

Need a printable/PDF document?
├─ YES → Is it a Query/Script Report?
│        ├─ YES → Use JS Template ({%= %} microtemplate)
│        │        Set print_format_for = "Report"
│        └─ NO  → Need visual drag-and-drop editor?
│                  ├─ YES → On v15+?
│                  │        ├─ YES → Use Print Designer (WeasyPrint)
│                  │        └─ NO  → NOT available on v14. Use Jinja.
│                  └─ NO  → Need full layout control?
│                           ├─ YES → Use Jinja Print Format (custom_format=1)
│                           └─ NO  → Use Standard Print Format (auto layout)
└─ NO  → This skill does not apply.

Print Format Types

TypeEngineVersionWhen to Use
StandardAuto from DocType field layoutv14+No customization needed
JinjaServer-side Jinja2 (wkhtmltopdf)v14+Full layout control
JS TemplateClient-side microtemplatev14+Report print formats only
Print DesignerWeasyPrint / Chromev15+Visual drag-and-drop builder

Standard Print Format

ALWAYS the default. Frappe auto-generates layout from DocType fields. No code needed. Controlled via Print Settings and field print_hide property.

Jinja Print Format

Set custom_format = 1 on the Print Format document. Full Jinja2 with server-side rendering.

Context variables available in every Jinja Print Format:

VariableTypeContent
docDocumentThe document being printed
metaMetaDocType metadata
layoutlistField layout sections
letter_headstrRendered Letter Head HTML
footerstrRendered footer HTML
print_settingsdictPrint Settings configuration
frappemoduleFull frappe module access

Example — Minimal Jinja Print Format:

<h1>{{ doc.name }}</h1>
<p>Customer: {{ doc.customer_name }}</p>
<p>Date: {{ doc.posting_date | global_date_format }}</p>

<table class="table table-bordered">
  <thead>
    <tr><th>Item</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
  </thead>
  <tbody>
    {% for row in doc.items %}
    <tr>
      <td>{{ row.item_name }}</td>
      <td>{{ row.qty }}</td>
      <td>{{ frappe.utils.fmt_money(row.rate, currency=doc.currency) }}</td>
      <td>{{ frappe.utils.fmt_money(row.amount, currency=doc.currency) }}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>

<p><strong>Grand Total:</strong> {{ frappe.utils.fmt_money(doc.grand_total, currency=doc.currency) }}</p>

JS Template (Report Print Formats)

ONLY for Query Reports and Script Reports. Uses {%= %} microtemplate syntax, NOT Jinja.

// In report's .js file
{%= row.item_name %}
{% if (row.qty > 10) { %}
  <strong>Bulk order</strong>
{% } %}

{% for (var i = 0; i < rows.length; i++) { %}
  <tr>
    <td>{%= rows[i].item_name %}</td>
    <td>{%= rows[i].qty %}</td>
  </tr>
{% } %}

CRITICAL: NEVER mix Jinja {{}} and JS {%= %} syntax. They are completely separate template engines.

Print Designer (v15+ Only)

  • Separate app: bench get-app print_designer
  • Uses WeasyPrint (not wkhtmltopdf)
  • Visual drag-and-drop builder in the browser
  • NEVER attempt to use Print Designer on v14 -- it does not exist

Letter Head

Letter Head provides consistent header/footer across all print formats.

Configuration

FieldPurpose
source"Image" or "HTML"
contentHeader HTML (Jinja-rendered with doc context)
footerFooter HTML (Jinja-rendered, PDF only)
imageHeader image (when source = "Image")
alignImage alignment: Left, Center, Right

IMPORTANT: The footer field only displays in PDF output, never in browser print preview.

Letter Head in Jinja Templates

# Server-side: render Letter Head programmatically
from frappe.utils.print_format import render_letterhead_for_print

letterhead_html = render_letterhead_for_print(
    letter_head_name="My Company",
    doc=doc
)

Dynamic Letter Head Content

Letter Head content and footer fields support Jinja with doc context:

<!-- In Letter Head content field -->
<div style="text-align: right;">
  <strong>{{ doc.company }}</strong><br>
  Date: {{ doc.posting_date | global_date_format }}
</div>

PDF Generation API

See references/pdf-api.md for complete API reference.

Quick Reference

# Generate PDF bytes from HTML
from frappe.utils.pdf import get_pdf
pdf_bytes = get_pdf(html_string, options=None)

# Generate PDF from a specific document + print format
from frappe.utils.print_format import download_pdf
download_pdf(doctype, name, format=None, doc=None, no_letterhead=0)

Download Endpoints

# Single document PDF
GET /api/method/frappe.utils.print_format.download_pdf
    ?doctype=Sales Invoice
    &name=SINV-00001
    &format=My Print Format
    &no_letterhead=0

# Multiple documents in one PDF
GET /api/method/frappe.utils.print_format.download_multi_pdf
    ?doctype=Sales Invoice
    &name=["SINV-00001","SINV-00002"]
    &format=My Print Format

PDF Engine Selection (v15+)

EngineWhenConfig
wkhtmltopdfDefault on v14, fallback on v15+Default
Chromev15+ with Chromium installedpdf_generator = "chrome" on Print Format
WeasyPrintPrint Designer formats onlyAutomatic for Print Designer

ALWAYS use wkhtmltopdf on v14. On v15+, Chrome produces better CSS3 support.


Page Breaks & Print CSS

Page Break Classes

<!-- Force page break after this element -->
<div class="page-break"></div>

<!-- Or use CSS directly -->
<div style="page-break-after: always;"></div>

<!-- Page break before -->
<div style="page-break-before: always;"></div>

Print CSS Classes (Frappe Built-in)

ClassEffect
.print-formatContainer: max-width 8.3in, min-height 11.69in (A4 portrait)
.print-format.landscapeWidth 11.69in (A4 landscape)
.page-breakpage-break-after: always
.print-headingPrint title styling
.hidden-pdfHidden in PDF output only
.visible-pdfVisible in PDF output only

PDF Header/Footer HTML

# In hooks.py — inject header/footer into every PDF
pdf_header_html = "myapp.utils.get_pdf_header"
pdf_body_html = "myapp.utils.get_pdf_body"
pdf_footer_html = "myapp.utils.get_pdf_footer"
<!-- Header/footer elements in print format HTML -->
<div id="header-html">
  <span class="page"></span> of <span class="topage"></span>
</div>

<div id="footer-html">
  <p style="text-align: center; font-size: 9px;">
    Printed on {{ frappe.utils.nowdate() }}
  </p>
</div>

Print CSS Best Practices

/* ALWAYS use relative units for print widths */
@media print {
  .print-format {
    max-width: 100%;
    margin: 0;
    padding: 15mm;
  }

  /* Prevent table rows from splitting across pages */
  tr {
    page-break-inside: avoid;
  }

  /* Constrain images */
  img {
    max-width: 100%;
    height: auto;
  }
}

Custom App Print Formats

Ship a Print Format with Your App

myapp/
└── mymodule/
    └── print_format/
        └── my_custom_format/
            ├── my_custom_format.json   # Print Format doc
            └── my_custom_format.html   # Jinja template

In the JSON file, ALWAYS set:

{
  "doctype": "Print Format",
  "name": "My Custom Format",
  "doc_type": "Sales Invoice",
  "module": "My Module",
  "standard": "Yes",
  "custom_format": 1,
  "print_format_type": "Jinja"
}

ALWAYS set standard = "Yes" and module for app-shipped print formats. This ensures they are recognized as part of the app and not as site-level customizations.


Jinja Filters for Print Formats

FilterPurposeExample
global_date_formatFormat date per system settings`{{doc.posting_date \global_date_format}}`
jsonSerialize to JSON string`{{doc.items \json}}`
lenGet length`{{doc.items \len}}`
intCast to integer`{{value \int}}`
fltCast to float`{{value \flt}}`
markdownRender Markdown to HTML`{{doc.description \markdown}}`
absAbsolute value`{{value \abs}}`

Register Custom Jinja Filters/Methods

# In hooks.py
jinja = {
    "methods": [
        "myapp.utils.jinja.my_custom_method"
    ],
    "filters": [
        "myapp.utils.jinja.my_custom_filter"
    ]
}
# myapp/utils/jinja.py
def my_custom_method(value):
    """Available as {{ my_custom_method(doc.field) }} in templates."""
    return value.upper()

def my_custom_filter(value, arg=None):
    """Available as {{ doc.field | my_custom_filter }} in templates."""
    return f"[{value}]"

Version Compatibility Matrix

Featurev14v15v16
Jinja Print FormatsYesYesYes
JS Report TemplatesYesYesYes
Standard Print FormatsYesYesYes
Letter Head (Image/HTML)YesYesYes
wkhtmltopdfDefaultFallbackFallback
Chrome PDF engineNoYesYes
WeasyPrintNoYesYes
Print Designer appNoYesYes
pdf_header_html hookYesYesYes
download_multi_pdfYesYesYes

Common Anti-Patterns

See references/anti-patterns.md for the complete list with fixes.
  1. NEVER use {{}} in Report Print Formats -- they use {%= %} (JS microtemplate)
  2. NEVER call frappe.get_doc() inside a {% for %} loop in templates -- causes N+1 queries
  3. NEVER put heavy business logic in Jinja templates -- move to Python and pass results
  4. NEVER hardcode page dimensions in CSS -- use .print-format class or relative units
  5. NEVER ignore the no_letterhead parameter when generating PDFs programmatically
  6. NEVER use Print Designer on v14 -- it requires v15+
  7. NEVER embed large base64 images in print templates -- use URLs with max-width: 100%

Reference Files

平台分布

Codex

36.6%
按下载量换算72

Claude

32.31%
按下载量换算64

Cursor

19.44%
按下载量换算38

Gemini CLI

8.97%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills