Skip to content

Commit 87e7f7a

Browse files
committed
Merge branch 'main' into translation-in-single-file
2 parents 4be5444 + bd05fb2 commit 87e7f7a

File tree

6 files changed

+74
-72
lines changed

6 files changed

+74
-72
lines changed

crates/typst-library/src/pdf/embed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::foundations::{
1010
use crate::introspection::Locatable;
1111
use crate::World;
1212

13-
/// A file that will be embedded into the output PDF.
13+
/// 出力されるPDFに埋め込まれるファイル。
1414
///
1515
/// This can be used to distribute additional files that are related to the PDF
1616
/// within it. PDF readers will display the files in a file listing.

docs/reference/export/pdf.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
1-
PDF files focus on accurately describing documents visually, but also have
2-
facilities for annotating their structure. This hybrid approach makes
3-
them a good fit for document exchange: They render exactly the same on every
4-
device, but also support extraction of a document's content and structure (at
5-
least to an extent). Unlike PNG files, PDFs are not bound to a specific
6-
resolution. Hence, you can view them at any size without incurring a loss of
7-
quality.
1+
PDFファイルは文書を視覚的に正確に記述することに重点を置いていますが、文書構造に注釈をつける機能も備えています。
2+
このハイブリッドなアプローチにより、
3+
PDFファイルは文書交換に適した形式となっています。
4+
どの端末でもまったく同じ見た目で表示される一方、
5+
内容や構造を(少なくともある程度は)抽出することも可能であるためです。
6+
PNGファイルとは異なり、PDFファイルは特定の解像度に縛られません。
7+
これによって、品質を損なうことなく任意のサイズでファイルを閲覧することができます。
88

9-
# PDF standards
10-
The International Standards Organization (ISO) has published the base PDF
11-
standard and various standards that extend it to make PDFs more suitable for
12-
specific use-cases. By default, Typst exports PDF 1.7 files. Adobe Acrobat 8 and
13-
later as well as all other commonly used PDF viewers are compatible with this
14-
PDF version.
9+
# PDF規格
10+
国際標準化機構(ISO)は、基本となるPDF規格に加え、
11+
特定の用途により適した形でPDFを利用できるようにする各種拡張規格を公開しています。
12+
TypstはデフォルトでPDF 1.7形式のファイルをエクスポートします。
13+
Adobe Acrobat 8以降および一般的に使用されているほとんどのPDFビューアーは
14+
このPDFバージョンとの互換性があります。
1515

1616
## PDF/A
17-
Typst optionally supports emitting PDF/A-conformant files. PDF/A files are
18-
geared towards maximum compatibility with current and future PDF tooling. They
19-
do not rely on difficult-to-implement or proprietary features and contain
20-
exhaustive metadata. This makes them suitable for long-term archival.
17+
TypstはオプションでPDF/A準拠ファイルの出力をサポートしています。
18+
PDF/Aファイルは、現在および将来のPDF用ツールとの最大限の互換性を目的として設計された形式です。
19+
この形式は実装が困難な機能や独自仕様に依存せず、網羅的なメタデータを含みます。
20+
これにより、長期的なアーカイブに適した形式となっています。
2121

22-
The PDF/A Standard has multiple versions (_parts_ in ISO terminology) and most
23-
parts have multiple profiles that indicate the file's conformance level.
24-
Currently, Typst supports these PDF/A output profiles:
22+
PDF/A規格には複数のバージョン(ISOにおける用語では _パート_)があり、
23+
ほとんどのパートにはファイルの適合レベルを示す複数のプロファイルが存在します。
24+
現在、Typstは以下のPDF/A出力プロファイルをサポートしています。
2525

26-
- PDF/A-2b: The basic conformance level of ISO 19005-2. This version of PDF/A is
27-
based on PDF 1.7 and results in self-contained, archivable PDF files.
26+
- PDF/A-2b: ISO 19005-2における基本適合レベル。
27+
このPDF/AバージョンはPDF 1.7を基盤としており、自己完結型でアーカイブ可能なPDFファイルを生成します。
2828

29-
- PDF/A-3b: The basic conformance level of ISO 19005-3. This version of PDF/A is
30-
based on PDF 1.7 and results in archivable PDF files that can contain
31-
arbitrary other related files as [attachments]($pdf.embed). The only
32-
difference between it and PDF/A-2b is the capability to embed
33-
non-PDF/A-conformant files within.
29+
- PDF/A-3b: ISO 19005-3における基本適合レベル。
30+
このPDF/AバージョンはPDF 1.7を基盤としており、
31+
任意の関連ファイルを[添付ファイル]($pdf.embed)として含むことができるアーカイブ可能なPDFファイルを生成します。
32+
PDF/A-2bとの違いは、
33+
PDF/A非準拠のファイルを埋め込む機能がある点のみです。
3434

35-
When choosing between exporting PDF/A and regular PDF, keep in mind that PDF/A
36-
files contain additional metadata, and that some readers will prevent the user
37-
from modifying a PDF/A file. Some features of Typst may be disabled depending on
38-
the PDF standard you choose.
35+
PDF/Aと通常のPDFのどちらをエクスポートするかを選択する際には、
36+
PDF/Aファイルには追加のメタデータが含まれ、
37+
また一部のリーダーはユーザーによるPDF/Aファイルの修正を阻止することに留意してください。
38+
一部のTypstの機能は、選択したPDF規格によっては無効化される場合があります。
3939

40-
# Exporting as PDF
41-
## Command Line
42-
PDF is Typst's default export format. Running the `compile` or `watch`
43-
subcommand without specifying a format will create a PDF. When exporting to PDF,
44-
you have the following configuration options:
40+
# PDF形式でのエクスポート
41+
## コマンドライン
42+
PDFはTypstのデフォルトのエクスポート形式です。
43+
`compile`または`watch`サブコマンドをフォーマットを指定せずに実行すると、PDFが作成されます。
44+
PDF形式でエクスポートする際には、以下の設定オプションが指定可能です。
4545

46-
- Which PDF standards Typst should enforce conformance with by specifying
47-
`--pdf-standard` followed by one or multiple comma-separated standards. Valid
48-
standards are `1.7`, `a-2b`, and `a-3b`. By default, Typst outputs
49-
PDF-1.7-compliant files.
46+
- `--pdf-standard`の後に1つまたは複数のカンマ区切りの規格を指定することで、
47+
Typstが準拠を強制するPDF規格を指定します。
48+
指定可能な規格は`1.7``a-2b``a-3b`です。
49+
デフォルトではPDF 1.7に準拠したファイルが出力されます。
5050

51-
- Which pages to export by specifying `--pages` followed by a comma-separated
52-
list of numbers or dash-separated number ranges. Ranges can be half-open.
53-
Example: `2,3,7-9,11-`.
51+
- `--pages` の後に、カンマ区切りのページ番号またはダッシュによる番号範囲を指定することで、エクスポートするページを指定します。
52+
範囲指定は半開区間にすることもできます。
53+
例:`2,3,7-9,11-`
5454

55-
## Web App
56-
Click the quick download button at the top right to export a PDF with default
57-
settings. For further configuration, click "File" > "Export as" > "PDF" or click
58-
the downwards-facing arrow next to the quick download button and select "Export
59-
as PDF". When exporting to PDF, you have the following configuration options:
55+
## Webアプリ
56+
右上のクイックダウンロードボタンをクリックすると、デフォルト設定でPDFがエクスポートされます。
57+
さらに設定を行う場合は、「File」>「Export as」>「PDF」を選択するか、
58+
クイックダウンロードボタンの横にある下向き矢印をクリックして「Export as PDF」を選択します。
59+
PDF形式でエクスポートする際には、以下の設定項目を指定できます。
6060

61-
- Which PDF standards Typst should enforce conformance with. By default, Typst
62-
outputs PDF-1.7-compliant files. Valid additional standards are `A-2b` and
63-
`A-3b`.
61+
- Typstが準拠を強制するPDF規格。
62+
デフォルトではPDF 1.7準拠のファイルが出力されます。
63+
指定可能な追加規格は`A-2b``A-3b`です。
6464

65-
- Which pages to export. Valid options are "All pages", "Current page", and
66-
"Custom ranges". Custom ranges are a comma-separated list of numbers or
67-
dash-separated number ranges. Ranges can be half-open. Example: `2,3,7-9,11-`.
65+
- エクスポートするページ。有効なオプションは「All pages(全てのページ)」、「Current page(現在のページ)」、および「Custom ranges(カスタム範囲)」です。
66+
カスタム範囲は、カンマ区切りの番号リストまたはダッシュで区切られた番号範囲です。
67+
範囲は半開区間にすることもできます。例:`2,3,7-9,11-`
6868

69-
# PDF-specific functionality
70-
Typst exposes PDF-specific functionality in the global `pdf` module. See below
71-
for the definitions it contains.
69+
# PDF固有の機能
70+
Typstでは、グローバルな`pdf`モジュールを通じてPDFに特化した機能を提供しています。
71+
そのモジュールに含まれる定義については、以下を参照してください。

website/src/components/templates/BaseTemplate.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { FC, PropsWithChildren } from "hono/jsx";
2+
import { baseUrl, typstOfficialUrl } from "../../metadata";
23
import { Translation, t } from "../../translations";
34
import type { Page } from "../../types/model";
45
import { getTranslationStatus } from "../../utils/translationStatus";
@@ -42,6 +43,9 @@ export const BaseTemplate: FC<BaseTemplateProps> = ({
4243
const route = page.route;
4344
const outline = page.outline;
4445
const translationStatus = getTranslationStatus(route);
46+
const absoluteRouteUrl = new URL(route, baseUrl).toString();
47+
const faviconUrl = new URL("/assets/favicon.png", baseUrl).toString();
48+
const typstOfficialRouteUrl = new URL(route, typstOfficialUrl).toString();
4549
return (
4650
<html lang={t("lang")} class="scroll-pt-24">
4751
<head>
@@ -52,26 +56,20 @@ export const BaseTemplate: FC<BaseTemplateProps> = ({
5256
<meta name="description" content={description} />
5357
<meta name="viewport" content="width=device-width,initial-scale=1" />
5458
<meta name="theme-color" content="#239dad" />
55-
<meta
56-
property="og:url"
57-
content={`https://typst-jp.github.io${route}`}
58-
/>
59+
<meta property="og:url" content={absoluteRouteUrl} />
5960
<meta
6061
property="og:title"
6162
content={`${title}${t("documentationTitle")}`}
6263
/>
6364
<meta property="og:site_name" content="Typst" />
6465
<meta property="og:description" content={description} />
6566
<meta property="og:type" content="" />
66-
<meta
67-
property="og:image"
68-
content="https://typst-jp.github.io/assets/favicon.png"
69-
/>
67+
<meta property="og:image" content={faviconUrl} />
7068
<meta property="og:image:width" content="1200" />
7169
<meta property="og:image:height" content="630" />
7270
<meta name="twitter:site" content="@typstapp" />
7371
<meta name="twitter:card" content="summary_large_image" />
74-
<link rel="canonical" href={`https://typst-jp.github.io${route}`} />
72+
<link rel="canonical" href={absoluteRouteUrl} />
7573
<meta name="robots" content="index, follow" />
7674
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
7775
<meta
@@ -187,7 +185,7 @@ export const BaseTemplate: FC<BaseTemplateProps> = ({
187185
{translationStatus !== "community" && (
188186
<div class="flex">
189187
<a
190-
href={`https://typst.app${route}`}
188+
href={typstOfficialRouteUrl}
191189
target="_blank"
192190
rel="noopener noreferrer"
193191
class="inline-flex items-center text-sm underline text-gray-400 hover:text-gray-600 transition-colors"
@@ -206,7 +204,7 @@ export const BaseTemplate: FC<BaseTemplateProps> = ({
206204

207205
{translationStatus !== "community" && (
208206
<a
209-
href={`https://typst.app${route}`}
207+
href={typstOfficialRouteUrl}
210208
target="_blank"
211209
rel="noopener noreferrer"
212210
class="group inline-flex items-center px-3 py-2 rounded-md border border-gray-200 bg-white hover:border-gray-500 hover:bg-gray-50 transition-all duration-200 w-fit"

website/src/metadata.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export const githubOrganizationUrl = "https://github.com/typst-jp";
77
export const githubRepositoryUrl =
88
"https://github.com/typst-jp/typst-jp.github.io";
99
export const discordServerUrl = "https://discord.gg/9xF7k4aAuH";
10+
export const baseUrl = "https://typst-jp.github.io/";

website/translation-status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
"/docs/reference/data-loading/toml/": "translated",
160160
"/docs/reference/data-loading/xml/": "untranslated",
161161
"/docs/reference/data-loading/yaml/": "untranslated",
162-
"/docs/reference/pdf/": "untranslated",
162+
"/docs/reference/pdf/": "translated",
163163
"/docs/reference/pdf/embed/": "untranslated",
164164
"/docs/reference/html/": "untranslated",
165165
"/docs/reference/html/elem/": "untranslated",

website/vite.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import devServer from "@hono/vite-dev-server";
77
import ssg from "@hono/vite-ssg";
88
import tailwindcss from "@tailwindcss/vite";
99
import { defineConfig } from "vite";
10+
import { baseUrl } from "./src/metadata";
1011

1112
// typst-docsが生成したドキュメントのアセットをassets/docsにシンボリックリンクする
1213
const assetsDocsPath = resolve(__dirname, "../assets/docs/");
@@ -15,17 +16,19 @@ const publicAssetsDocsPath = resolve(__dirname, "./public/assets/docs/");
1516
rmSync(publicAssetsDocsPath, { recursive: true, force: true });
1617
symlinkSync(assetsDocsPath, publicAssetsDocsPath, "dir");
1718

19+
const sitemapUrl = new URL("/sitemap.xml", baseUrl).href;
20+
1821
export default defineConfig({
1922
plugins: [
2023
tailwindcss(),
2124
ssg({
2225
plugins: [
2326
sitemapPlugin({
24-
baseUrl: "https://typst-jp.github.io/",
27+
baseUrl,
2528
}),
2629
robotsTxtPlugin({
2730
rules: [{ userAgent: "*", allow: ["/"] }],
28-
sitemapUrl: "https://typst-jp.github.io/sitemap.xml",
31+
sitemapUrl,
2932
}),
3033
],
3134
}),

0 commit comments

Comments
 (0)