Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

frappe-printing-templates冰沙印刷模板

Agent Skill

frappe-printing-templates 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,632

周安装

68

GitHub Stars

16

下载量

544
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/lubusin/agent-skills --skill frappe-printing-templates

简介

frappe-printing-templates 用于查找、检索和筛选相关信息,适合快速定位候选结果。

  • 适用于根据关键词或任务场景从来源线索中获取信息的场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前需确认权限范围和维护状态,注意可能触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Frappe Printing & Templates

Create print formats, email templates, and document templates using Jinja in Frappe.

When to use

  • Creating custom print formats for documents
  • Building email templates with dynamic content
  • Generating PDFs from documents
  • Using Jinja templating in web pages
  • Configuring letter heads for branding
  • Using the Print Format Builder

Inputs required

  • Target DocType for the print format
  • Layout requirements (fields, tables, headers)
  • Whether format is standard (version controlled) or custom (DB-stored)
  • Letter Head / branding requirements
  • PDF generation needs

Procedure

0) Choose format type

TypeHow to CreateVersion ControlledCustomizable by User
StandardDeveloper Mode, saved as JSONYesNo
Print Format BuilderDrag-and-drop UINo (DB)Yes
Custom HTML (Jinja)Type "new print format" in awesomebarOptionalDepends

1) Create a Jinja print format

Create via awesomebar → "New Print Format":

  1. Set a unique name
  2. Link to the target DocType
  3. Set "Standard" = "No" (or "Yes" for dev mode export)
  4. Check "Custom Format"
  5. Set Print Format Type = "Jinja"
  6. Write your Jinja HTML
<div class="print-format">
    <h1>{{ doc.name }}</h1>
    <p><strong>{{ _("Customer") }}:</strong> {{ doc.customer }}</p>
    <p><strong>{{ _("Date") }}:</strong> {{ frappe.format_date(doc.transaction_date) }}</p>

    <table class="table table-bordered">
        <thead>
            <tr>
                <th>{{ _("Item") }}</th>
                <th>{{ _("Qty") }}</th>
                <th class="text-right">{{ _("Rate") }}</th>
                <th class="text-right">{{ _("Amount") }}</th>
            </tr>
        </thead>
        <tbody>
            {% for item in doc.items %}
            <tr>
                <td>{{ item.item_name }}</td>
                <td>{{ item.qty }}</td>
                <td class="text-right">{{ frappe.format(item.rate, {'fieldtype': 'Currency'}) }}</td>
                <td class="text-right">{{ frappe.format(item.amount, {'fieldtype': 'Currency'}) }}</td>
            </tr>
            {% endfor %}
        </tbody>
        <tfoot>
            <tr>
                <td colspan="3" class="text-right"><strong>{{ _("Total") }}</strong></td>
                <td class="text-right"><strong>{{ frappe.format(doc.grand_total, {'fieldtype': 'Currency'}) }}</strong></td>
            </tr>
        </tfoot>
    </table>

    {% if doc.terms %}
    <div class="terms">
        <h4>{{ _("Terms & Conditions") }}</h4>
        <p>{{ doc.terms }}</p>
    </div>
    {% endif %}
</div>

<style>
    .print-format { font-family: Arial, sans-serif; }
    .print-format h1 { color: #333; }
    .print-format table { width: 100%; margin-top: 20px; }
</style>

2) Use Frappe Jinja API

Data fetching in templates:

{# Fetch a document #}
{% set customer = frappe.get_doc('Customer', doc.customer) %}
{{ customer.customer_name }}

{# List query (ignores permissions) #}
{% set open_orders = frappe.get_all('Sales Order',
    filters={'customer': doc.customer, 'status': 'To Deliver and Bill'},
    fields=['name', 'grand_total'],
    order_by='creation desc',
    page_length=5) %}

{# Permission-aware list query #}
{% set my_tasks = frappe.get_list('Task',
    filters={'owner': frappe.session.user}) %}

{# Single value lookup #}
{% set company_abbr = frappe.db.get_value('Company', doc.company, 'abbr') %}

{# Settings value #}
{% set timezone = frappe.db.get_single_value('System Settings', 'time_zone') %}

Formatting:

{{ frappe.format(50000, {'fieldtype': 'Currency'}) }}
{{ frappe.format_date('2025-01-15') }}
{{ frappe.format_date(doc.posting_date) }}

Session and context:

{{ frappe.session.user }}
{{ frappe.get_fullname() }}
{{ frappe.lang }}
{{ _("Translatable string") }}

URLs:

<a href="{{ frappe.get_url() }}/app/sales-order/{{ doc.name }}">View Order</a>

3) Build email templates

Dear {{ doc.customer_name }},

Your order {{ doc.name }} has been confirmed.

Items:
{% for item in doc.items %}
- {{ item.item_name }} x {{ item.qty }}
{% endfor %}

Total: {{ frappe.format(doc.grand_total, {'fieldtype': 'Currency'}) }}

Thank you,
{{ frappe.get_fullname() }}

4) Generate PDFs programmatically

import frappe

# Generate PDF
pdf_content = frappe.get_print(
    doctype="Sales Invoice",
    name="SINV-001",
    print_format="Custom Invoice",
    as_pdf=True
)

# Attach PDF to document
frappe.attach_print(
    doctype="Sales Invoice",
    name="SINV-001",
    print_format="Custom Invoice",
    file_name="invoice.pdf"
)

# Send with email
frappe.sendmail(
    recipients=["customer@example.com"],
    subject="Your Invoice",
    message="Please find attached your invoice.",
    attachments=[{
        "fname": "invoice.pdf",
        "fcontent": pdf_content
    }]
)

5) Configure Letter Head

  1. Navigate to Letter Head list → New
  2. Upload company logo and header image
  3. Set as default for the company
  4. Letter Head appears automatically on print formats

6) Use Jinja filters

{{ doc.customer_name|upper }}        {# UPPERCASE #}
{{ doc.notes|truncate(100) }}        {# Truncate text #}
{{ doc.description|striptags }}      {# Remove HTML #}
{{ doc.html_content|safe }}          {# Render raw HTML (trusted only!) #}
{{ items|length }}                   {# Count items #}
{{ items|first }}                    {# First item #}
{{ names|join(', ') }}               {# Join list #}
{{ amount|round(2) }}               {# Round number #}
{{ value|default('N/A') }}          {# Default if undefined #}
{{ data|tojson }}                    {# Convert to JSON #}

7) Template inheritance and macros

{# macros/fields.html #}
{% macro field_row(label, value) %}
<tr>
    <td class="label"><strong>{{ _(label) }}</strong></td>
    <td>{{ value }}</td>
</tr>
{% endmacro %}

{# In print format #}
{% from "macros/fields.html" import field_row %}
<table>
    {{ field_row("Customer", doc.customer_name) }}
    {{ field_row("Date", frappe.format_date(doc.posting_date)) }}
    {{ field_row("Total", frappe.format(doc.grand_total, {'fieldtype': 'Currency'})) }}
</table>

Verification

  • Print format renders correctly in Print View
  • All fields display with proper formatting
  • PDF generation works without errors
  • Email templates render with correct data
  • Letter Head appears on printed documents
  • Translations work in templates (_())
  • No XSS risks from unescaped content

Failure modes / debugging

  • Template syntax error: Check Jinja delimiters ({{}}, {% %}); look for unclosed blocks
  • Field not rendering: Verify field name matches DocType schema; check child table access pattern
  • PDF generation fails: Check wkhtmltopdf installation; verify print format Jinja is valid
  • Styling issues in PDF: Use inline styles; avoid complex CSS; test with Print View first
  • Permission error in template: Use frappe.get_all (no permission check) vs frappe.get_list

Escalation

  • For app-level hooks and structure → frappe-app-development
  • For DocType schema questions → frappe-doctype-development

References

Guardrails

  • Test with actual data: Always preview with real documents; edge cases break templates
  • Handle missing fields gracefully: Use {{doc.field or ''}} or {% if doc.field %}
  • Use get_url() for images: Never hardcode URLs; use {{frappe.utils.get_url()}}/files/...
  • Escape user content: Use {{value | e}} for user-generated content to prevent XSS
  • Keep styling inline: PDF generators don't support external CSS; use inline style attributes

Common Mistakes

MistakeWhy It FailsFix
Wrong Jinja syntaxTemplate error, blank outputUse {{}} for output, {% %} for logic; check closing tags
Missing filtersRaw data displayedUse frappe.format() or frappe.format_date() for formatting
Hardcoded URLsImages/links break across sitesUse {{frappe.utils.get_url()}} for absolute URLs
Accessing child table wrongEmpty or errorUse {% for item in doc.items %} not doc.child_table_name
Complex CSS in print formatStyling lost in PDFUse inline styles, simple layouts, <table> for structure
Not handling None values'None' string in outputUse {{value or ''}} or {% if value %}

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.81%
按下载量换算211

Claude

31.08%
按下载量换算169

Cursor

17.64%
按下载量换算96

Gemini CLI

9.05%
按下载量换算49

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills