Add Quarto HTML+Typst business report templates.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
_output/
|
||||
*.pdf
|
||||
*.html
|
||||
!.gitignore
|
||||
.DS_Store
|
||||
*.typ
|
||||
!templates/**/*.typ
|
||||
/.quarto/
|
||||
|
||||
**/*.quarto_ipynb
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Rhino
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
37
README.md
Normal file
37
README.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Business Report Templates
|
||||
|
||||
Quarto templates for Kimia Razi Persian (RTL) business reports.
|
||||
|
||||
One `.qmd` source renders to:
|
||||
|
||||
- **HTML** — simple RTL reading layout (no PDF chrome)
|
||||
- **PDF** — via Typst (`format: typst`), with print-oriented layout
|
||||
|
||||
## Requirements
|
||||
|
||||
- [Quarto](https://quarto.org/) 1.9+ (bundles Typst)
|
||||
- Fonts in `assets/fonts/` (`IRNazanin`, `IRZar`, `IRLotus`)
|
||||
|
||||
## Quick start
|
||||
|
||||
```bash
|
||||
quarto render examples/travel-report.qmd
|
||||
```
|
||||
|
||||
Outputs land in `_output/` (HTML + PDF).
|
||||
|
||||
## Project layout
|
||||
|
||||
```
|
||||
_quarto.yml
|
||||
styles/report.css # HTML RTL theme
|
||||
templates/typst/ # Typst PDF partials
|
||||
assets/fonts/ # Persian fonts
|
||||
assets/logo.png
|
||||
examples/travel-report.qmd
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- HTML does **not** visually match the PDF (no sidebar/header parity; tables may differ).
|
||||
- This repo is separate from `typst-templates` (pure Typst PDF library).
|
||||
29
_quarto.yml
Normal file
29
_quarto.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
project:
|
||||
type: default
|
||||
output-dir: _output
|
||||
|
||||
format:
|
||||
html:
|
||||
lang: fa
|
||||
dir: rtl
|
||||
theme: none
|
||||
css: styles/report.css
|
||||
embed-resources: true
|
||||
toc: false
|
||||
typst:
|
||||
lang: fa
|
||||
mainfont: IRNazanin
|
||||
fontsize: 13pt
|
||||
papersize: a4
|
||||
margin:
|
||||
left: 2cm
|
||||
right: 2cm
|
||||
top: 2.5cm
|
||||
bottom: 2.5cm
|
||||
page-numbering: "۱"
|
||||
font-paths:
|
||||
- assets/fonts
|
||||
template-partials:
|
||||
- templates/typst/typst-template.typ
|
||||
- templates/typst/typst-show.typ
|
||||
- templates/typst/page.typ
|
||||
BIN
assets/fonts/IRLotus.ttf
Normal file
BIN
assets/fonts/IRLotus.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/IRNazanin-Bold.ttf
Normal file
BIN
assets/fonts/IRNazanin-Bold.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/IRNazanin-Italic.ttf
Normal file
BIN
assets/fonts/IRNazanin-Italic.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/IRNazanin.ttf
Normal file
BIN
assets/fonts/IRNazanin.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/IRTitr.ttf
Normal file
BIN
assets/fonts/IRTitr.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/IRZar-Bold.ttf
Normal file
BIN
assets/fonts/IRZar-Bold.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/IRZar.ttf
Normal file
BIN
assets/fonts/IRZar.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/IRlotus-Bold.ttf
Normal file
BIN
assets/fonts/IRlotus-Bold.ttf
Normal file
Binary file not shown.
BIN
assets/logo.png
Normal file
BIN
assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 564 KiB |
101
examples/travel-report.qmd
Normal file
101
examples/travel-report.qmd
Normal file
@@ -0,0 +1,101 @@
|
||||
---
|
||||
title: "گزارش مأموریت"
|
||||
subtitle: "دپارتمان جوهر"
|
||||
company: "کیمیا رازی"
|
||||
logofile: "../assets/logo.png"
|
||||
sidebarfont: IRZar
|
||||
author:
|
||||
- name: دیاکو سلطانپور
|
||||
email: diaco@kimiarazi.com
|
||||
affiliations: کیمیا رازی - واحد جوهر
|
||||
report-date: "شروع: ۰۵/۰۲/۲۷ پایان: ۰۵/۰۲/۲۸"
|
||||
destinations:
|
||||
- کاشی آسیا
|
||||
purpose: "تست آزمایشی جوهرهای کیمیا رازی برای خط پولیش/پرسلان"
|
||||
format:
|
||||
html:
|
||||
include-before-body:
|
||||
- text: |
|
||||
<dl class="report-meta">
|
||||
<dt>مقصد</dt><dd>کاشی آسیا</dd>
|
||||
<dt>هدف مأموریت</dt><dd>تست آزمایشی جوهرهای کیمیا رازی برای خط پولیش/پرسلان</dd>
|
||||
<dt>تیم اعزامی</dt><dd>دیاکو سلطانپور</dd>
|
||||
<dt>تاریخ</dt><dd>شروع: ۰۵/۰۲/۲۷ — پایان: ۰۵/۰۲/۲۸</dd>
|
||||
</dl>
|
||||
typst: default
|
||||
---
|
||||
|
||||
# گزارش مأموریت
|
||||
|
||||
این شرکت دو کوره برای کاشی کف و یک کوره برای پرسلان و پولیشی دارد و تولید روزانه آن حدود ۱۲ هزار متر مربع است. چهار ماشین چاپ دیجیتال دارد. دستگاه Tecnoferrari با هدهای ۱۰۰۲ و Xaar ۱۰۰۳ و دو دستگاه NKT با هدهای Xaar ۲۰۰۲.
|
||||
|
||||
سه دستگاه خط ۱، ۲ و ۳ با جوهر کیمیا رازی کار میکند:
|
||||
|
||||
- آبی: KRCY-1100T
|
||||
- قهوهای: KRBR-1200T
|
||||
- عسلی: KRHN-1700T
|
||||
- مشکی: KRBK-1300T
|
||||
|
||||
و یک دستگاه (خط ۴) از اسفند سال گذشته با ترکیب کیمیا رازی و اینکرا:
|
||||
|
||||
- آبی کیمیا رازی: KRCY-1100T
|
||||
- قهوهای اینکرا: IK-RB715
|
||||
- زرد طلایی اینکرا: IK-YE328
|
||||
- مشکی اینکرا: IK-BK913G
|
||||
|
||||
در خط ۴ دمای کوره تا حدود ۱۲۲۰ درجه سانتیگراد بالا برده شده و به همین دلیل، شدت رنگ جوهرها کاهش یافته است. برای بهبود کیفیت چاپ، جوهرهای جدید با شدت رنگ و پایداری بیشتر در دمای بالا در نظر گرفته شدهاند که در این گزارش، نتایج تستهای اولیه آنها ارائه شده است.
|
||||
|
||||
## شرایط تست
|
||||
|
||||
نمونهها در شرایط زیر روی لعاب مات پرسلان در کوره خط ۴ تست شدند:
|
||||
|
||||
| پارامتر | مقدار |
|
||||
| --- | --- |
|
||||
| دما | 1217 °C |
|
||||
| سیکل | 75' |
|
||||
| لعاب | مات پرسلان |
|
||||
| غلظت نمونه | ۳٪ وزنی |
|
||||
| مقدار اعمال شده | 400 µL |
|
||||
|
||||
# نتایج
|
||||
|
||||
## قهوهای
|
||||
|
||||
| کد نمونه | نتیجه |
|
||||
| --- | --- |
|
||||
| KRBR-1201T | شدت رنگ بیشتر |
|
||||
| KRBR-1202T | شدت رنگ بیشتر |
|
||||
| ICJ/408 | شدت رنگ بیشتر |
|
||||
|
||||
بین نمونههای قهوهای، ICJ/408 بیشترین شدت رنگ را دارد. کد KRBR-1202T به نمونه رفرنس نزدیکتر است.
|
||||
|
||||
## زرد طلایی
|
||||
|
||||
| کد نمونه | نتیجه |
|
||||
| --- | --- |
|
||||
| KRBG-1600T | تم رنگ تیرهتر |
|
||||
| KRHN-1700T | تم رنگ تیرهتر |
|
||||
| KRGY-1900T | تم رنگ تیرهتر |
|
||||
| KRGY-1901T | مشابه رفرنس (کمی تیرهتر) |
|
||||
| KRYL-1400T | زردی بیشتر |
|
||||
|
||||
## مشکی
|
||||
|
||||
| کد نمونه | نتیجه |
|
||||
| --- | --- |
|
||||
| ICJ/610 | تم سبز |
|
||||
| ICJ/EH600 | تم قهوهای |
|
||||
| ICJ/EH630 | تم قهوهای |
|
||||
| ICJ/EH680 | کمترین شدت رنگ، تم قهوهای |
|
||||
| KRBL-1300T | تم سبز |
|
||||
| KRBL-1314T | بیشترین شدت رنگ |
|
||||
|
||||
با توجه به تستهای انجام شده، نمونههای KRBR-1202T (قهوهای)، KRGY-1901T (زرد طلایی) و KRBL-1314T (مشکی) به عنوان کاندید جایگزینی جوهرهای اینکرا در نظر گرفته شدند.
|
||||
|
||||
نتایج تستها به رویت آقای حسنی مدیر کارخانه، مهندس حری مدیر تولید و آقای مهندس عظیمی سرپرست خط رسید و صورتجلسهای در این خصوص تنظیم شد.
|
||||
با نظر آقای مهندس حری قرار شد نمونههایی که شدت رنگ بیشتری دارند با پلاتر هم تست شوند. تست پلاتر در کیمیا رازی انجام و نمونه جهت پخت در کوره کاشی آسیا ارسال شد.
|
||||
نتایج نمونههای تست پلاتر مشابه نمونههای تست سملر هستند. آقای مهندس حری در تماس تلفنی تأیید کردند که نمونههای تست شده از جوهرهای فعلی (اینکرا) شرایط بهتری دارند.
|
||||
|
||||
# پیوست
|
||||
|
||||
صورت جلسه در پیوست گزارش آمده است.
|
||||
88
styles/report.css
Normal file
88
styles/report.css
Normal file
@@ -0,0 +1,88 @@
|
||||
@font-face {
|
||||
font-family: "IRNazanin";
|
||||
src: url("../assets/fonts/IRNazanin.ttf") format("truetype");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "IRNazanin";
|
||||
src: url("../assets/fonts/IRNazanin-Bold.ttf") format("truetype");
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
html {
|
||||
direction: rtl;
|
||||
lang: fa;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "IRNazanin", "Tahoma", sans-serif;
|
||||
font-size: 1.05rem;
|
||||
line-height: 1.7;
|
||||
max-width: 48rem;
|
||||
margin: 2rem auto;
|
||||
padding: 0 1.25rem;
|
||||
color: #1a1a1a;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
h1, h2, h3 {
|
||||
font-weight: bold;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
h1.title {
|
||||
font-size: 1.75rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 1.1rem;
|
||||
color: #444;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.quarto-title-meta,
|
||||
.quarto-title-meta-contents {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.report-meta {
|
||||
margin: 1.5rem 0;
|
||||
padding: 1rem 1.25rem;
|
||||
background: #f6f6f6;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.report-meta dt {
|
||||
font-weight: bold;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.report-meta dd {
|
||||
margin: 0.15rem 0 0.5rem 0;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 1rem 0;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid #ccc;
|
||||
padding: 0.4rem 0.6rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
code {
|
||||
direction: ltr;
|
||||
unicode-bidi: embed;
|
||||
}
|
||||
53
templates/typst/page.typ
Normal file
53
templates/typst/page.typ
Normal file
@@ -0,0 +1,53 @@
|
||||
#set page(
|
||||
paper: $if(papersize)$"$papersize$"$else$"a4"$endif$,
|
||||
$if(margin)$
|
||||
margin: ($for(margin/pairs)$$margin.key$: $margin.value$,$endfor$),
|
||||
$else$
|
||||
margin: (left: 2cm, right: 2cm, top: 2.5cm, bottom: 2.5cm),
|
||||
$endif$
|
||||
numbering: $if(page-numbering)$"$page-numbering$"$else$"۱"$endif$,
|
||||
header: context {
|
||||
if counter(page).get().first() > 1 [
|
||||
#set text(size: 11pt)
|
||||
#grid(
|
||||
columns: (auto, 1fr, auto),
|
||||
gutter: 8pt,
|
||||
align: (right, right, left),
|
||||
$if(logofile)$
|
||||
image("$logofile$", height: 16pt),
|
||||
$endif$
|
||||
$if(company)$
|
||||
[#h(6pt)$company$$if(subtitle)$ | $subtitle$$endif$],
|
||||
$else$
|
||||
[],
|
||||
$endif$
|
||||
[],
|
||||
)
|
||||
#line(length: 100%, stroke: 0.5pt)
|
||||
]
|
||||
},
|
||||
background: place(
|
||||
dx: -64%,
|
||||
dy: 73%,
|
||||
rotate(
|
||||
-90deg,
|
||||
{
|
||||
set text(size: 13pt$if(sidebarfont)$, font: ("$sidebarfont$",)$endif$)
|
||||
grid(
|
||||
columns: (30%, 30%, 5%),
|
||||
rows: 20pt,
|
||||
align: top,
|
||||
[#h(1fr) $if(title)$$title$$endif$ $if(destinations)$$for(destinations)$$destinations$$sep$ - $endfor$$endif$ #h(5fr)],
|
||||
[#h(1fr) $if(by-author)$$for(by-author)$$it.name.literal$$sep$ - $endfor$$endif$ #h(4fr)],
|
||||
grid.cell(
|
||||
fill: black,
|
||||
align: center,
|
||||
stroke: 1pt,
|
||||
text(fill: white, context counter(page).display("۱/۱", both: true)),
|
||||
),
|
||||
grid.hline(start: 0),
|
||||
)
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
61
templates/typst/typst-show.typ
Normal file
61
templates/typst/typst-show.typ
Normal file
@@ -0,0 +1,61 @@
|
||||
#show: doc => article(
|
||||
$if(title)$
|
||||
title: [$title$],
|
||||
$endif$
|
||||
$if(subtitle)$
|
||||
subtitle: [$subtitle$],
|
||||
$endif$
|
||||
$if(company)$
|
||||
company: [$company$],
|
||||
$endif$
|
||||
$if(destinations)$
|
||||
destinations: (
|
||||
$for(destinations)$
|
||||
[$destinations$],
|
||||
$endfor$
|
||||
),
|
||||
$endif$
|
||||
$if(purpose)$
|
||||
purpose: [$purpose$],
|
||||
$endif$
|
||||
$if(logofile)$
|
||||
logo: "$logofile$",
|
||||
$endif$
|
||||
$if(by-author)$
|
||||
authors: (
|
||||
$for(by-author)$
|
||||
$if(it.name.literal)$
|
||||
( name: [$it.name.literal$],
|
||||
affiliation: [$for(it.affiliations)$$it.name$$sep$, $endfor$],
|
||||
email: [$it.email$] ),
|
||||
$endif$
|
||||
$endfor$
|
||||
),
|
||||
$endif$
|
||||
$if(report-date)$
|
||||
date: [$report-date$],
|
||||
$endif$
|
||||
$if(lang)$
|
||||
lang: "$lang$",
|
||||
$endif$
|
||||
$if(region)$
|
||||
region: "$region$",
|
||||
$endif$
|
||||
$if(mainfont)$
|
||||
font: ("$mainfont$",),
|
||||
$endif$
|
||||
$if(fontsize)$
|
||||
fontsize: $fontsize$,
|
||||
$endif$
|
||||
$if(section-numbering)$
|
||||
sectionnumbering: "$section-numbering$",
|
||||
$endif$
|
||||
$if(toc)$
|
||||
toc: $toc$,
|
||||
$endif$
|
||||
$if(toc-title)$
|
||||
toc_title: [$toc-title$],
|
||||
$endif$
|
||||
toc_depth: $toc-depth$,
|
||||
doc,
|
||||
)
|
||||
136
templates/typst/typst-template.typ
Normal file
136
templates/typst/typst-template.typ
Normal file
@@ -0,0 +1,136 @@
|
||||
#let article(
|
||||
title: none,
|
||||
subtitle: none,
|
||||
authors: none,
|
||||
keywords: (),
|
||||
date: none,
|
||||
abstract-title: none,
|
||||
abstract: none,
|
||||
thanks: none,
|
||||
cols: 1,
|
||||
lang: "fa",
|
||||
region: none,
|
||||
font: none,
|
||||
fontsize: 13pt,
|
||||
title-size: 1.5em,
|
||||
subtitle-size: 1.25em,
|
||||
heading-family: none,
|
||||
heading-weight: "bold",
|
||||
heading-style: "normal",
|
||||
heading-color: black,
|
||||
heading-line-height: 0.65em,
|
||||
mathfont: none,
|
||||
codefont: none,
|
||||
linestretch: 1,
|
||||
sectionnumbering: none,
|
||||
linkcolor: none,
|
||||
citecolor: none,
|
||||
filecolor: none,
|
||||
toc: false,
|
||||
toc_title: none,
|
||||
toc_depth: none,
|
||||
toc_indent: 1.5em,
|
||||
company: none,
|
||||
destinations: none,
|
||||
purpose: none,
|
||||
logo: none,
|
||||
doc,
|
||||
) = {
|
||||
set document(title: title, keywords: keywords)
|
||||
set document(
|
||||
author: authors.map(author => content-to-string(author.name)).join(", ", last: " و "),
|
||||
) if authors != none and authors != ()
|
||||
|
||||
set text(lang: lang, dir: rtl, size: fontsize)
|
||||
set text(font: font) if font != none
|
||||
set par(justify: true, leading: linestretch * 0.65em)
|
||||
set align(right)
|
||||
set heading(numbering: sectionnumbering)
|
||||
|
||||
show math.equation: set text(font: mathfont) if mathfont != none
|
||||
show raw: set text(font: codefont) if codefont != none
|
||||
show link: set text(fill: rgb(content-to-string(linkcolor))) if linkcolor != none
|
||||
show ref: set text(fill: rgb(content-to-string(citecolor))) if citecolor != none
|
||||
|
||||
let dest-text = if destinations == none {
|
||||
""
|
||||
} else if type(destinations) == array {
|
||||
destinations.join(" - ")
|
||||
} else {
|
||||
destinations
|
||||
}
|
||||
|
||||
let author-names = if authors == none or authors == () {
|
||||
""
|
||||
} else {
|
||||
authors.map(a => content-to-string(a.name)).join(" - ")
|
||||
}
|
||||
|
||||
// Title block
|
||||
block(width: 100%)[
|
||||
#grid(
|
||||
columns: (1fr, auto),
|
||||
align: (right, left),
|
||||
[
|
||||
#set par(leading: 0.9em, spacing: 0em)
|
||||
#if company != none {
|
||||
text(21pt, weight: "bold", company)
|
||||
if subtitle != none {
|
||||
text(14pt)[ | #subtitle]
|
||||
}
|
||||
linebreak()
|
||||
}
|
||||
#if title != none {
|
||||
text(14pt, weight: "bold", title)
|
||||
}
|
||||
],
|
||||
if logo != none {
|
||||
image(logo, height: 1.8cm)
|
||||
} else {
|
||||
[]
|
||||
},
|
||||
)
|
||||
]
|
||||
|
||||
v(12pt)
|
||||
align(center, line(length: 100%))
|
||||
text(1.4em, weight: "bold", [اطلاعات کلی])
|
||||
v(8pt)
|
||||
|
||||
let meta-row(label, value) = if value != none and value != "" {
|
||||
grid(
|
||||
columns: (8em, 1fr),
|
||||
gutter: 1em,
|
||||
align: (right, right),
|
||||
[#label],
|
||||
[#strong(value)],
|
||||
)
|
||||
}
|
||||
|
||||
stack(
|
||||
spacing: 12pt,
|
||||
meta-row([مقصد:], dest-text),
|
||||
meta-row([هدف مأموریت:], purpose),
|
||||
meta-row([تیم اعزامی:], author-names),
|
||||
meta-row([تاریخ:], date),
|
||||
)
|
||||
|
||||
v(24pt)
|
||||
align(center, line(length: 100%))
|
||||
v(12pt)
|
||||
|
||||
if toc {
|
||||
let title = if toc_title == none { auto } else { toc_title }
|
||||
block(above: 0em, below: 2em)[
|
||||
#outline(title: title, depth: toc_depth, indent: toc_indent)
|
||||
]
|
||||
}
|
||||
|
||||
doc
|
||||
}
|
||||
|
||||
#set table(
|
||||
inset: 6pt,
|
||||
stroke: 0.5pt + gray,
|
||||
align: center,
|
||||
)
|
||||
Reference in New Issue
Block a user