diff --git a/Cargo.lock b/Cargo.lock index 360df31ab..3f9d1e08c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2613,6 +2613,7 @@ dependencies = [ "ttf-parser", "two-face", "typed-arena", + "typst-assets", "typst-macros", "typst-syntax", "typst-timing", @@ -2624,6 +2625,11 @@ dependencies = [ "wasmi", ] +[[package]] +name = "typst-assets" +version = "0.10.0" +source = "git+https://github.com/typst/typst-assets?rev=79e1c84#79e1c84788fb23f34755b8ebb300dcd9bc4af77f" + [[package]] name = "typst-cli" version = "0.10.0" @@ -2658,6 +2664,7 @@ dependencies = [ "tar", "tempfile", "typst", + "typst-assets", "typst-macros", "typst-pdf", "typst-render", @@ -2668,6 +2675,11 @@ dependencies = [ "zip", ] +[[package]] +name = "typst-dev-assets" +version = "0.10.0" +source = "git+https://github.com/typst/typst-dev-assets?rev=1dba4be#1dba4bea22e5e19597fbf5f321b047ff7626e2d0" + [[package]] name = "typst-docs" version = "0.10.0" @@ -2685,6 +2697,8 @@ dependencies = [ "syntect", "typed-arena", "typst", + "typst-assets", + "typst-dev-assets", "typst-render", "unicode_names2", "unscanny", @@ -2698,6 +2712,7 @@ dependencies = [ "comemo", "libfuzzer-sys", "typst", + "typst-assets", "typst-render", "typst-syntax", ] @@ -2741,6 +2756,7 @@ dependencies = [ "svg2pdf", "ttf-parser", "typst", + "typst-assets", "typst-macros", "typst-timing", "unicode-properties", @@ -2812,6 +2828,8 @@ dependencies = [ "tiny-skia", "ttf-parser", "typst", + "typst-assets", + "typst-dev-assets", "typst-ide", "typst-pdf", "typst-render", diff --git a/Cargo.toml b/Cargo.toml index a0d89057a..99a1b4325 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,8 @@ typst-render = { path = "crates/typst-render" } typst-svg = { path = "crates/typst-svg" } typst-syntax = { path = "crates/typst-syntax" } typst-timing = { path = "crates/typst-timing" } +typst-assets = { git = "https://github.com/typst/typst-assets", rev = "79e1c84" } +typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", rev = "1dba4be" } az = "1.2" base64 = "0.21.2" bitflags = { version = "2", features = ["serde"] } diff --git a/assets/files/1-writing-app.png b/assets/files/1-writing-app.png deleted file mode 100644 index 8e0d88361..000000000 Binary files a/assets/files/1-writing-app.png and /dev/null differ diff --git a/assets/files/1-writing-upload.png b/assets/files/1-writing-upload.png deleted file mode 100644 index 51d6bee4c..000000000 Binary files a/assets/files/1-writing-upload.png and /dev/null differ diff --git a/assets/files/2-formatting-autocomplete.png b/assets/files/2-formatting-autocomplete.png deleted file mode 100644 index e66a55205..000000000 Binary files a/assets/files/2-formatting-autocomplete.png and /dev/null differ diff --git a/assets/files/3-advanced-paper.png b/assets/files/3-advanced-paper.png deleted file mode 100644 index a8710a186..000000000 Binary files a/assets/files/3-advanced-paper.png and /dev/null differ diff --git a/assets/files/3-advanced-team-settings.png b/assets/files/3-advanced-team-settings.png deleted file mode 100644 index ce29269ba..000000000 Binary files a/assets/files/3-advanced-team-settings.png and /dev/null differ diff --git a/assets/files/SExpressions.sublime-syntax b/assets/files/SExpressions.sublime-syntax deleted file mode 100644 index 31c830a40..000000000 --- a/assets/files/SExpressions.sublime-syntax +++ /dev/null @@ -1,73 +0,0 @@ -%YAML 1.2 ---- -name: S Expressions -file_extensions: ["sexp"] -scope: source.sexpr - -contexts: - main: - - match: '(;+).*$' - scope: comment.line.sexpr - captures: - 1: punctuation.definition.comment.sexpr - - match: '#;' - scope: punctuation.definition.comment.sexpr - push: comment - - match: '#\|' - scope: punctuation.definition.comment.sexpr - push: block_comment - - - match: '"' - scope: punctuation.definition.string.begin.sexpr - push: string_unquote - - match: '\d+\.\d+' - scope: constant.numeric.float.sexpr - - match: '\d+' - scope: constant.numeric.integer.sexpr - - match: '\w+' - scope: constant.other.sexpr - - match: '\(' - scope: punctuation.section.parens.begin.sexpr - push: main_rparen - - match: '\)' - scope: invalid.illegal.stray-paren-end - - string_unquote: - - meta_scope: string.quoted.double.sexpr - - match: '""' - scope: constant.character.escape.sexpr - - match: '"' - scope: punctuation.definition.string.end.sexpr - pop: true - - main_rparen: - - match: '\)' - scope: punctuation.section.parens.end.sexpr - pop: true - - include: main - - comment: - - meta_scope: comment.block.sexpr - - match: '\(' - set: comment_rparen - - comment_lparen: - - meta_scope: comment.block.sexpr - - match: '\(' - push: comment_rparen - - match: '\)' - scope: invalid.illegal.stray-paren-end - - comment_rparen: - - meta_scope: comment.block.sexpr - - match: '\)' - pop: true - - include: comment - - block_comment: - - meta_scope: comment.block.sexpr - - match: '#\|' - push: block_comment - - match: '\|#' - scope: punctuation.definition.comment.sexpr - pop: true diff --git a/assets/files/bad.bib b/assets/files/bad.bib deleted file mode 100644 index 41b4d63df..000000000 --- a/assets/files/bad.bib +++ /dev/null @@ -1,6 +0,0 @@ -@article{arrgh, - title = {An‐arrgh‐chy: The Law and Economics of Pirate Organization}, - author = {Leeson, Peter T.}, - crossref = {polecon}, - date = {19XXX-XX-XX}, -} diff --git a/assets/files/bad.csv b/assets/files/bad.csv deleted file mode 100644 index 2c2696e96..000000000 --- a/assets/files/bad.csv +++ /dev/null @@ -1,4 +0,0 @@ -A,B -1,2 -3,4,5 -6,7 diff --git a/assets/files/bad.json b/assets/files/bad.json deleted file mode 100644 index cd5d0366b..000000000 --- a/assets/files/bad.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "valid": true, - "invalid": True -} diff --git a/assets/files/bad.svg b/assets/files/bad.svg deleted file mode 100644 index b7828a619..000000000 --- a/assets/files/bad.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/assets/files/bad.toml b/assets/files/bad.toml deleted file mode 100644 index ac326d8fa..000000000 --- a/assets/files/bad.toml +++ /dev/null @@ -1 +0,0 @@ -"only a string" diff --git a/assets/files/bad.txt b/assets/files/bad.txt deleted file mode 100644 index bb50896be..000000000 Binary files a/assets/files/bad.txt and /dev/null differ diff --git a/assets/files/bad.xml b/assets/files/bad.xml deleted file mode 100644 index 7fa6a6ede..000000000 --- a/assets/files/bad.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 1 - diff --git a/assets/files/bad.yaml b/assets/files/bad.yaml deleted file mode 100644 index 8910432ee..000000000 --- a/assets/files/bad.yaml +++ /dev/null @@ -1 +0,0 @@ -this_will_break: [) diff --git a/assets/files/chinese.svg b/assets/files/chinese.svg deleted file mode 100644 index b643e033a..000000000 --- a/assets/files/chinese.svg +++ /dev/null @@ -1,4 +0,0 @@ - - 此文本为中文。 - The text above is in Chinese. - diff --git a/assets/files/cylinder.svg b/assets/files/cylinder.svg deleted file mode 100644 index 32f691cb1..000000000 --- a/assets/files/cylinder.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/assets/files/data.csv b/assets/files/data.csv deleted file mode 100644 index 3fce663fa..000000000 --- a/assets/files/data.csv +++ /dev/null @@ -1,3 +0,0 @@ -0..2,small -3..5,medium -6..,big diff --git a/assets/files/data.html b/assets/files/data.html deleted file mode 100644 index a4d1903ea..000000000 --- a/assets/files/data.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Example document - - -

Hello, world!

- - diff --git a/assets/files/data.xml b/assets/files/data.xml deleted file mode 100644 index 9ae409eee..000000000 --- a/assets/files/data.xml +++ /dev/null @@ -1,7 +0,0 @@ - - 1 - - World - World - - diff --git a/assets/files/details.toml b/assets/files/details.toml deleted file mode 100644 index 56cf166d8..000000000 --- a/assets/files/details.toml +++ /dev/null @@ -1,3 +0,0 @@ -title = "Secret project" -version = 2 -authors = ["Mr Robert", "Miss Enola"] diff --git a/assets/files/diagram.svg b/assets/files/diagram.svg deleted file mode 100644 index dc42e068d..000000000 --- a/assets/files/diagram.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - -Height -Height -Height -Height -Without family -With non-existing family -Time - -Curve - diff --git a/assets/files/docs.svg b/assets/files/docs.svg deleted file mode 100644 index 3b3588963..000000000 --- a/assets/files/docs.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/assets/files/example.xml b/assets/files/example.xml deleted file mode 100644 index 1e5d19c94..000000000 --- a/assets/files/example.xml +++ /dev/null @@ -1,22 +0,0 @@ - - -
- 2022 Budget approved - John Doe - 2022-12-19 - -

The 2022 budget has been approved by the Senate.

-

The budget is $1.2 trillion.

-

It is expected to be signed by the President next week.

-
-
-
- Tigers win the World Series - Jane Doe - 2022-12-20 - -

The Tigers have won the World Series.

-

They beat the Giants 4 to 3.

-
-
-
diff --git a/assets/files/f2t.jpg b/assets/files/f2t.jpg deleted file mode 100644 index 15065b08c..000000000 Binary files a/assets/files/f2t.jpg and /dev/null differ diff --git a/assets/files/glacier.jpg b/assets/files/glacier.jpg deleted file mode 100644 index a1d1c5117..000000000 Binary files a/assets/files/glacier.jpg and /dev/null differ diff --git a/assets/files/graph.png b/assets/files/graph.png deleted file mode 100644 index 069b0cbc2..000000000 Binary files a/assets/files/graph.png and /dev/null differ diff --git a/assets/files/halcyon.tmTheme b/assets/files/halcyon.tmTheme deleted file mode 100644 index 36f2d66a1..000000000 --- a/assets/files/halcyon.tmTheme +++ /dev/null @@ -1,865 +0,0 @@ - - - - - author - Brittany Chiang - colorSpaceName - sRGB - name - ayu - semanticClass - halcyon - settings - - - settings - - background - #1d2433 - foreground - #a2aabc - caret - #FFCC66 - findHighlight - #8695b7 - findHighlightForeground - #d7dce2 - guide - #2f3b54 - activeGuide - #2f3b54 - stackGuide - #2f3b54 - gutter - #1d2433 - gutterForeground - #8695b755 - inactiveBackground - #1d2433 - inactiveSelection - #2f3b54 - invisibles - #6679a4 - lineHighlight - #2f3b54 - popupCss - - html, body { - background-color: #1d2433; - font-size: 12px; - color: #a2aabc; - padding: 0; - } - body { - padding: 5px; - } - div { - padding-bottom: -3px; - } - b, strong { - font-weight: normal; - } - a { - color: rgba(92, 207, 230, .7); - line-height: 16px; - } - .type { - color: #ef6b73; - } - .name { - color: #ffd580; - } - .param { - color: #FFD580; - } - .current { - text-decoration: underline; - } - - selection - #2f3b54 - selectionBorder - #a2aabc35 - shadow - #00000010 - - - - name - Comments - scope - comment, punctuation.definition.comment - settings - - fontStyle - italic - foreground - #8695b799 - - - - name - Variable - scope - variable - settings - - foreground - #a2aabc - - - - name - Keyword - scope - keyword, keyword.operator - settings - - foreground - #FFAE57 - - - - name - Storage - scope - storage.type, storage.modifier - settings - - foreground - #c3a6ff - - - - name - Operator, Misc - scope - constant.other.color, meta.tag, punctuation.separator.inheritance.php, punctuation.section.embedded, keyword.other.substitution - settings - - foreground - #5ccfe6 - - - - name - Tag - scope - entity.name.tag, meta.tag.sgml - settings - - foreground - #5ccfe6 - - - - name - Git Gutter Deleted - scope - markup.deleted.git_gutter - settings - - foreground - #ef6b73 - - - - name - Function, Special Method, Block Level - scope - entity.name, entity.name.class, entity.other.inherited-class, variable.function, support.function, keyword.other.special-method, meta.block-level - settings - - foreground - #FFD580 - - - - name - Other Variable, String Link - scope - support.other.variable, string.other.link - settings - - foreground - #ef6b73 - - - - name - Number, Constant, Function Argument, Tag Attribute, Embedded - scope - constant.numeric, constant.language, constant.character, keyword.other.unit - settings - - foreground - #c3a6ff - - - - name - Number, Constant, Function Argument, Tag Attribute, Embedded - scope - support.constant, meta.jsx.js, punctuation.section, string.unquoted.label - settings - - foreground - #a2aabc - - - - name - String, Symbols, Inherited Class, Markup Heading - scope - string, keyword.other.template, constant.other.symbol, constant.other.key, entity.other.inherited-class, markup.heading, markup.inserted.git_gutter, meta.group.braces.curly - settings - - fontStyle - normal - foreground - #bae67e - - - - name - Class, Support - scope - entity.name.type.class, support.type, support.class, support.orther.namespace.use.php, meta.use.php, support.other.namespace.php, markup.changed.git_gutter - settings - - foreground - #5ccfe6 - - - - name - Sub-methods - scope - entity.name.module.js, variable.import.parameter.js, variable.other.class.js - settings - - foreground - #5ccfe6 - - - - name - Language methods - scope - variable.language - settings - - fontStyle - italic - foreground - #5ccfe6 - - - - name - Invalid - scope - invalid, invalid.illegal - settings - - foreground - #ef6b73 - - - - name - Deprecated - scope - invalid.deprecated - settings - - background - #FFAE57 - foreground - #d7dce2 - - - - name - Html punctuations tags - scope - punctuation.definition.tag.end, punctuation.definition.tag.begin, punctuation.definition.tag, meta.group.braces.curly.js, meta.property-value, meta.jsx.js - settings - - foreground - #a2aabc - - - - name - Attributes - scope - entity.other.attribute-name, meta.attribute-with-value.style, constant.other.color.rgb-value, meta.at-rule.media, support.constant.mathematical-symbols, - punctuation.separator.key-value - settings - - foreground - #FFAE57 - - - - name - Inserted - scope - markup.inserted - settings - - foreground - #bae67e - - - - name - Deleted - scope - markup.deleted - settings - - foreground - #5ccfe6 - - - - name - Changed - scope - markup.changed - settings - - foreground - #FFAE57 - - - - name - Regular Expressions and Escape Characters - scope - string.regexp, constant.character.escape - settings - - foreground - #95E6CB - - - - name - URL - scope - *url*, *link*, *uri* - settings - - fontStyle - underline - - - - name - Search Results Nums - scope - constant.numeric.line-number.find-in-files - match - settings - - foreground - #8695b7 - - - - name - Search Results Lines - scope - entity.name.filename.find-in-files - settings - - foreground - #bae67e - - - - name - Decorators - scope - tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js - settings - - fontStyle - italic - foreground - #ffd580 - - - - name - ES7 Bind Operator - scope - constant.other.object.key - settings - - foreground - #5ccfe6 - - - - name - entity.name.method - scope - entity.name.method - settings - - fontStyle - italic - foreground - #ffd580 - - - - name - meta.method.js - scope - entity.name.function, variable.function.constructor - settings - - foreground - #ffd580 - - - - name - Markup - Italic - scope - markup.italic - settings - - fontStyle - italic - foreground - #ef6b73 - - - - name - Markup - Bold - scope - markup.bold - settings - - fontStyle - bold - foreground - #ef6b73 - - - - name - Markup - Underline - scope - markup.underline - settings - - fontStyle - underline - foreground - #c3a6ff - - - - name - Markup - Strike - scope - markup.strike - settings - - fontStyle - strike - foreground - #ffd580 - - - - name - Markup - Quote - scope - markup.quote - settings - - fontStyle - italic - foreground - #80D4FF - - - - name - Markup - Raw Block - scope - markup.raw.block - settings - - foreground - #FFAE57 - - - - name - Markup - Table - scope - markup.table - settings - - background - #1d2433aa - foreground - #5ccfe6 - - - - name - Markdown - Plain - scope - text.html.markdown, punctuation.definition.list_item.markdown - settings - - foreground - #a2aabc - - - - name - Markdown - Markup Raw Inline - scope - text.html.markdown markup.raw.inline - settings - - foreground - #5ccfe6 - - - - name - Markdown - Line Break - scope - text.html.markdown meta.dummy.line-break - settings - - foreground - #8695b7 - - - - name - Markdown - Heading - scope - markdown.heading, markup.heading | markup.heading entity.name, markup.heading.markdown punctuation.definition.heading.markdown - settings - - foreground - #bae67e - - - - name - Markdown - Blockquote - scope - markup.quote, punctuation.definition.blockquote.markdown - settings - - fontStyle - italic - foreground - #80D4FF - - - - name - Markdown - Link - scope - string.other.link.title.markdown - settings - - fontStyle - underline - foreground - #ffd580 - - - - name - Markdown - Raw Block Fenced - scope - markup.raw.block.fenced.markdown - settings - - background - #d7dce210 - foreground - #a2aabc - - - - name - Markdown - Fenced Bode Block - scope - punctuation.definition.fenced.markdown, variable.language.fenced.markdown - settings - - background - #d7dce210 - foreground - #8695b7 - - - - name - Markdown - Fenced Language - scope - variable.language.fenced.markdown - settings - - fontStyle - - foreground - #8695b7 - - - - name - Markdown - Separator - scope - meta.separator - settings - - background - #d7dce210 - fontStyle - bold - foreground - #8695b7 - - - - name - JSON Key - Level 0 - scope - source.json meta.structure.dictionary.json string.quoted.double.json - meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json punctuation.definition.string - meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #5ccfe6 - - - - name - JSON Key - Level 1 - scope - source.json meta meta.structure.dictionary.json string.quoted.double.json - meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta.structure.dictionary.json punctuation.definition.string - meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #5ccfe6 - - - - name - JSON Key - Level 2 - scope - source.json meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #ffae57 - - - - name - JSON Key - Level 3 - scope - source.json meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #5ccfe6 - - - - name - JSON Key - Level 4 - scope - source.json meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #ffae57 - - - - name - JSON Key - Level 5 - scope - source.json meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #5ccfe6 - - - - name - JSON Key - Level 6 - scope - source.json meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #ffae57 - - - - name - JSON Key - Level 7 - scope - source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #5ccfe6 - - - - name - JSON Key - Level 8 - scope - source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #ffae57 - - - - name - AceJump Label - Blue - scope - acejump.label.blue - settings - - background - #5ccfe6 - foreground - #d7dce2 - - - - name - AceJump Label - Green - scope - acejump.label.green - settings - - background - #bae67e - foreground - #d7dce2 - - - - name - AceJump Label - Orange - scope - acejump.label.orange - settings - - background - #FFAE57 - foreground - #d7dce2 - - - - name - AceJump Label - Purple - scope - acejump.label.purple - settings - - background - #ef6b73 - foreground - #d7dce2 - - - - name - SublimeLinter Warning - scope - sublimelinter.mark.warning - settings - - foreground - #5ccfe6 - - - - name - SublimeLinter Gutter Mark - scope - sublimelinter.gutter-mark - settings - - foreground - #d7dce2 - - - - name - SublimeLinter Error - scope - sublimelinter.mark.error - settings - - foreground - #ef6b73 - - - - name - GitGutter Ignored - scope - markup.ignored.git_gutter - settings - - foreground - #8695b7 - - - - name - GitGutter Untracked - scope - markup.untracked.git_gutter - settings - - foreground - #8695b7 - - - - name - GutterColor - scope - gutter_color - settings - - foreground - #d7dce2 - - - - uuid - 0e709986-46a0-40a0-b3bf-c8dfe525c455 - - diff --git a/assets/files/hello.txt b/assets/files/hello.txt deleted file mode 100644 index af5626b4a..000000000 --- a/assets/files/hello.txt +++ /dev/null @@ -1 +0,0 @@ -Hello, world! diff --git a/assets/files/hello.wasm b/assets/files/hello.wasm deleted file mode 100755 index eddd73876..000000000 Binary files a/assets/files/hello.wasm and /dev/null differ diff --git a/assets/files/logo.svg b/assets/files/logo.svg deleted file mode 100644 index 8864aa678..000000000 --- a/assets/files/logo.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/assets/files/molecular.jpg b/assets/files/molecular.jpg deleted file mode 100644 index 888905f8f..000000000 Binary files a/assets/files/molecular.jpg and /dev/null differ diff --git a/assets/files/monday.json b/assets/files/monday.json deleted file mode 100644 index 10a07d303..000000000 --- a/assets/files/monday.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "temperature": 18.5, - "unit": "C", - "weather": "sunny" -} diff --git a/assets/files/monkey.svg b/assets/files/monkey.svg deleted file mode 100644 index 0e8c11240..000000000 --- a/assets/files/monkey.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/files/pattern.svg b/assets/files/pattern.svg deleted file mode 100644 index 0a46c0b6d..000000000 --- a/assets/files/pattern.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/assets/files/plugin-oob.wasm b/assets/files/plugin-oob.wasm deleted file mode 100755 index 6afb74362..000000000 Binary files a/assets/files/plugin-oob.wasm and /dev/null differ diff --git a/assets/files/rhino.png b/assets/files/rhino.png deleted file mode 100644 index f9d47dd39..000000000 Binary files a/assets/files/rhino.png and /dev/null differ diff --git a/assets/files/scifi-authors.yaml b/assets/files/scifi-authors.yaml deleted file mode 100644 index dd1c48432..000000000 --- a/assets/files/scifi-authors.yaml +++ /dev/null @@ -1,11 +0,0 @@ -"Arthur C. Clarke": - - title: Against the Fall of Night - published: "1978" - - title: The songs of distant earth - published: "1986" - -"Isaac Asimov": - - title: Quasar, Quasar, Burning Bright - published: "1977" - - title: Far as Human Eye Could See - published: 1987 diff --git a/assets/files/tetrahedron.svg b/assets/files/tetrahedron.svg deleted file mode 100644 index 00d842ce3..000000000 --- a/assets/files/tetrahedron.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/assets/files/tiger.jpg b/assets/files/tiger.jpg deleted file mode 100644 index 74dc5e0b6..000000000 Binary files a/assets/files/tiger.jpg and /dev/null differ diff --git a/assets/files/toml-types.toml b/assets/files/toml-types.toml deleted file mode 100644 index aaed23ee5..000000000 --- a/assets/files/toml-types.toml +++ /dev/null @@ -1,14 +0,0 @@ -string = "wonderful" -integer = 42 -float = 3.14 -boolean = true -date_time = 2023-02-01T15:38:57Z -date_time2 = 2023-02-01T15:38:57 -date = 2023-02-01 -time = 15:38:57 -array = [1, "string", 3.0, false] -inline_table = { first = "amazing", second = "greater" } - -[table] -element = 5 -others = [false, "indeed", 7] diff --git a/assets/files/tuesday.json b/assets/files/tuesday.json deleted file mode 100644 index 3ce8e7406..000000000 --- a/assets/files/tuesday.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "temperature": 14.5, - "unit": "C", - "weather": "windy" -} diff --git a/assets/files/typing.jpg b/assets/files/typing.jpg deleted file mode 100644 index 1cfe563db..000000000 Binary files a/assets/files/typing.jpg and /dev/null differ diff --git a/assets/files/works.bib b/assets/files/works.bib deleted file mode 100644 index d3bd14cde..000000000 --- a/assets/files/works.bib +++ /dev/null @@ -1,105 +0,0 @@ -@article{netwok, - title={At-scale impact of the {Net Wok}: A culinarically holistic investigation of distributed dumplings}, - author={Astley, Rick and Morris, Linda}, - journal={Armenian Journal of Proceedings}, - volume={61}, - pages={192--219}, - year={2020}, - publisher={Automattic Inc.} -} - -@www{issue201, - title={Use of ids field creates unstable references}, - author={{cfr42}}, - url={https://github.com/plk/biblatex/issues/201}, - date={2014-02-02/2014-02-07}, - ids={unstable, github} -} - -@article{arrgh, - title={The Pirate Organization}, - author={Leeson, Peter T.}, -} - -@article{quark, - title={The Quark Organization}, - author={Leeson, Peter T.}, -} - -@misc{distress, - title={An Insight into Bibliographical Distress}, - author={Aldrin, Buzz} -} - -@article{glacier-melt, - author = {Regine Hock}, - title ={Glacier melt: a review of processes and their modelling}, - journal = {Progress in Physical Geography: Earth and Environment}, - volume = {29}, - number = {3}, - pages = {362-391}, - year = {2005}, - doi = {10.1191/0309133305pp453ra}, -} - -@book{tolkien54, - maintitle = {The Lord of the Rings}, - title = {The Fellowship of the Ring}, - author = {J. R. R. Tolkien}, - date = {1954-07-29}, - publisher = {Allen & Unwin}, - location = {London}, - volume = {1}, -} - -@book{DBLP:books/lib/Knuth86a, - author = {Donald Ervin Knuth}, - title = {Computer modern typefaces}, - publisher = {Addison-Wesley}, - year = {1986}, - url = {https://www.worldcat.org/oclc/13157596}, - isbn = {0201134462}, - timestamp = {Fri, 17 Jul 2020 16:12:40 +0200}, - biburl = {https://dblp.org/rec/books/lib/Knuth86a.bib}, - bibsource = {dblp computer science bibliography, https://dblp.org} -} - -@article{sharing, - title = {Do sharing people behave differently? An empirical evaluation of the distinctive mobility patterns of free-floating car-sharing members}, - volume = {42}, - pages = {449--469}, - number = {3}, - journal = {Transportation}, - author = {Kopp, Johanna and Gerike, Regine and Axhausen, Kay W.}, - year = {2015} -} - -@book{restful, - location = {Sebastopol, {CA}, {USA}}, - edition = {1}, - title = {{RESTful} Web Services}, - pagetotal = {448}, - publisher = {O'Reilly Media}, - author = {Richardson, Leonard and Ruby, Sam}, - year = {2008} -} - -@article{mcintosh_anxiety, - title = {Anxiety and Health Problems Related to Air Travel}, - volume = {5}, - issn = {1195-1982}, - pages = {198--204}, - number = {4}, - journal = {Journal of Travel Medicine}, - author = {{McIntosh}, Iain B. and Swanson, Vivien and Power, Kevin G. and Raeside, Fiona and Dempster, Craig}, - year = {2006} -} - -@book{psychology25, - location = {New York, {NY}, {USA}}, - edition = {1}, - title = {The psychology of selling and advertising}, - publisher = {{McGraw}-Hill Book Co.}, - author = {Strong, Edward}, - year = {1925} -} diff --git a/assets/files/works_too.bib b/assets/files/works_too.bib deleted file mode 100644 index fd80f8f5b..000000000 --- a/assets/files/works_too.bib +++ /dev/null @@ -1,17 +0,0 @@ -@article{keshav2007read, - title = {How to read a paper}, - author = {Keshav, Srinivasan}, - journal = {ACM SIGCOMM Computer Communication Review}, - volume = {37}, - number = {3}, - pages = {83--84}, - year = {2007}, - publisher = {ACM New York, NY, USA} -} - -@Article{Zee04, - author = {Zee, Jay}, - journal = {The Black Album}, - title = {I've got $99$ problems, I am {S}toked to say}, - year = {2004}, -} diff --git a/assets/files/yaml-types.yaml b/assets/files/yaml-types.yaml deleted file mode 100644 index ad4ddb96f..000000000 --- a/assets/files/yaml-types.yaml +++ /dev/null @@ -1,9 +0,0 @@ -null_key: [null, ~] -"string": text -integer: 5 -float: 1.12 -mapping: { '1': "one", '2': "two"} -seq: [1, 2, 3, 4] -bool: false -true: bool -1: ok diff --git a/assets/files/zoo.csv b/assets/files/zoo.csv deleted file mode 100644 index 42ff06c7d..000000000 --- a/assets/files/zoo.csv +++ /dev/null @@ -1,4 +0,0 @@ -Name,Species,Weight,Length -Debby,Rhinoceros,1900kg,390cm -Fluffy,Tiger,115kg,310cm -Sleepy,Dolphin,150kg,180cm diff --git a/assets/files/zoo.json b/assets/files/zoo.json deleted file mode 100644 index 3b5a7ffc1..000000000 --- a/assets/files/zoo.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "name": "Debby", - "species": "Rhinoceros", - "weight": 1900, - "length": 390 - }, - { - "name": "Fluffy", - "species": "Tiger", - "weight": 115, - "length": 310 - }, - { - "name": "Sleepy", - "species": "Dolphin", - "weight": 150, - "length": 180 - } -] diff --git a/assets/fonts/DejaVuSansMono-Bold.ttf b/assets/fonts/DejaVuSansMono-Bold.ttf deleted file mode 100644 index 8184ced8c..000000000 Binary files a/assets/fonts/DejaVuSansMono-Bold.ttf and /dev/null differ diff --git a/assets/fonts/DejaVuSansMono-BoldOblique.ttf b/assets/fonts/DejaVuSansMono-BoldOblique.ttf deleted file mode 100644 index 754dca732..000000000 Binary files a/assets/fonts/DejaVuSansMono-BoldOblique.ttf and /dev/null differ diff --git a/assets/fonts/DejaVuSansMono-Oblique.ttf b/assets/fonts/DejaVuSansMono-Oblique.ttf deleted file mode 100644 index 4c858d401..000000000 Binary files a/assets/fonts/DejaVuSansMono-Oblique.ttf and /dev/null differ diff --git a/assets/fonts/DejaVuSansMono.ttf b/assets/fonts/DejaVuSansMono.ttf deleted file mode 100644 index f5786022f..000000000 Binary files a/assets/fonts/DejaVuSansMono.ttf and /dev/null differ diff --git a/assets/fonts/FiraMath-Regular.otf b/assets/fonts/FiraMath-Regular.otf deleted file mode 100644 index f1f9d40c2..000000000 Binary files a/assets/fonts/FiraMath-Regular.otf and /dev/null differ diff --git a/assets/fonts/IBMPlexSans-Bold.ttf b/assets/fonts/IBMPlexSans-Bold.ttf deleted file mode 100644 index e5389d833..000000000 Binary files a/assets/fonts/IBMPlexSans-Bold.ttf and /dev/null differ diff --git a/assets/fonts/IBMPlexSans-Light.ttf b/assets/fonts/IBMPlexSans-Light.ttf deleted file mode 100644 index b3d035d5d..000000000 Binary files a/assets/fonts/IBMPlexSans-Light.ttf and /dev/null differ diff --git a/assets/fonts/IBMPlexSans-Medium.ttf b/assets/fonts/IBMPlexSans-Medium.ttf deleted file mode 100644 index 9395402b0..000000000 Binary files a/assets/fonts/IBMPlexSans-Medium.ttf and /dev/null differ diff --git a/assets/fonts/IBMPlexSans-Regular.ttf b/assets/fonts/IBMPlexSans-Regular.ttf deleted file mode 100644 index b5819647e..000000000 Binary files a/assets/fonts/IBMPlexSans-Regular.ttf and /dev/null differ diff --git a/assets/fonts/IBMPlexSansCondensed-Regular.ttf b/assets/fonts/IBMPlexSansCondensed-Regular.ttf deleted file mode 100644 index 6e1e04381..000000000 Binary files a/assets/fonts/IBMPlexSansCondensed-Regular.ttf and /dev/null differ diff --git a/assets/fonts/IBMPlexSansDevanagari-Regular.ttf b/assets/fonts/IBMPlexSansDevanagari-Regular.ttf deleted file mode 100644 index 5d7c8f0f1..000000000 Binary files a/assets/fonts/IBMPlexSansDevanagari-Regular.ttf and /dev/null differ diff --git a/assets/fonts/IBMPlexSerif-Regular.ttf b/assets/fonts/IBMPlexSerif-Regular.ttf deleted file mode 100644 index 7d6dc5c14..000000000 Binary files a/assets/fonts/IBMPlexSerif-Regular.ttf and /dev/null differ diff --git a/assets/fonts/InriaSerif-Bold.ttf b/assets/fonts/InriaSerif-Bold.ttf deleted file mode 100644 index d0874eacf..000000000 Binary files a/assets/fonts/InriaSerif-Bold.ttf and /dev/null differ diff --git a/assets/fonts/InriaSerif-BoldItalic.ttf b/assets/fonts/InriaSerif-BoldItalic.ttf deleted file mode 100644 index 5ed2fc711..000000000 Binary files a/assets/fonts/InriaSerif-BoldItalic.ttf and /dev/null differ diff --git a/assets/fonts/InriaSerif-Italic.ttf b/assets/fonts/InriaSerif-Italic.ttf deleted file mode 100644 index b1bc8d4af..000000000 Binary files a/assets/fonts/InriaSerif-Italic.ttf and /dev/null differ diff --git a/assets/fonts/InriaSerif-Regular.ttf b/assets/fonts/InriaSerif-Regular.ttf deleted file mode 100644 index c61a18b12..000000000 Binary files a/assets/fonts/InriaSerif-Regular.ttf and /dev/null differ diff --git a/assets/fonts/LinLibertine_R.ttf b/assets/fonts/LinLibertine_R.ttf deleted file mode 100644 index e1dc2243a..000000000 Binary files a/assets/fonts/LinLibertine_R.ttf and /dev/null differ diff --git a/assets/fonts/LinLibertine_RB.ttf b/assets/fonts/LinLibertine_RB.ttf deleted file mode 100644 index 7eaeb0fd8..000000000 Binary files a/assets/fonts/LinLibertine_RB.ttf and /dev/null differ diff --git a/assets/fonts/LinLibertine_RBI.ttf b/assets/fonts/LinLibertine_RBI.ttf deleted file mode 100644 index 3902980f7..000000000 Binary files a/assets/fonts/LinLibertine_RBI.ttf and /dev/null differ diff --git a/assets/fonts/LinLibertine_RI.ttf b/assets/fonts/LinLibertine_RI.ttf deleted file mode 100644 index d0c800cc4..000000000 Binary files a/assets/fonts/LinLibertine_RI.ttf and /dev/null differ diff --git a/assets/fonts/NewCM10-Bold.otf b/assets/fonts/NewCM10-Bold.otf deleted file mode 100644 index cfd285945..000000000 Binary files a/assets/fonts/NewCM10-Bold.otf and /dev/null differ diff --git a/assets/fonts/NewCM10-BoldItalic.otf b/assets/fonts/NewCM10-BoldItalic.otf deleted file mode 100644 index ae87120fb..000000000 Binary files a/assets/fonts/NewCM10-BoldItalic.otf and /dev/null differ diff --git a/assets/fonts/NewCM10-Italic.otf b/assets/fonts/NewCM10-Italic.otf deleted file mode 100644 index 3706d147c..000000000 Binary files a/assets/fonts/NewCM10-Italic.otf and /dev/null differ diff --git a/assets/fonts/NewCM10-Regular.otf b/assets/fonts/NewCM10-Regular.otf deleted file mode 100644 index a2a6f9a97..000000000 Binary files a/assets/fonts/NewCM10-Regular.otf and /dev/null differ diff --git a/assets/fonts/NewCMMath-Book.otf b/assets/fonts/NewCMMath-Book.otf deleted file mode 100644 index 45e4da341..000000000 Binary files a/assets/fonts/NewCMMath-Book.otf and /dev/null differ diff --git a/assets/fonts/NewCMMath-Regular.otf b/assets/fonts/NewCMMath-Regular.otf deleted file mode 100644 index ef6623c9f..000000000 Binary files a/assets/fonts/NewCMMath-Regular.otf and /dev/null differ diff --git a/assets/fonts/NotoColorEmoji.ttf b/assets/fonts/NotoColorEmoji.ttf deleted file mode 100644 index 2c1f10435..000000000 Binary files a/assets/fonts/NotoColorEmoji.ttf and /dev/null differ diff --git a/assets/fonts/NotoSansArabic-Regular.ttf b/assets/fonts/NotoSansArabic-Regular.ttf deleted file mode 100644 index 94eead4c0..000000000 Binary files a/assets/fonts/NotoSansArabic-Regular.ttf and /dev/null differ diff --git a/assets/fonts/NotoSansSymbols2-Regular.ttf b/assets/fonts/NotoSansSymbols2-Regular.ttf deleted file mode 100644 index 429a51d56..000000000 Binary files a/assets/fonts/NotoSansSymbols2-Regular.ttf and /dev/null differ diff --git a/assets/fonts/NotoSansThai-Regular.ttf b/assets/fonts/NotoSansThai-Regular.ttf deleted file mode 100644 index ced12d665..000000000 Binary files a/assets/fonts/NotoSansThai-Regular.ttf and /dev/null differ diff --git a/assets/fonts/NotoSerifCJKjp-Regular.otf b/assets/fonts/NotoSerifCJKjp-Regular.otf deleted file mode 100644 index 6daac2061..000000000 Binary files a/assets/fonts/NotoSerifCJKjp-Regular.otf and /dev/null differ diff --git a/assets/fonts/NotoSerifCJKkr-Regular.otf b/assets/fonts/NotoSerifCJKkr-Regular.otf deleted file mode 100644 index b79606bbb..000000000 Binary files a/assets/fonts/NotoSerifCJKkr-Regular.otf and /dev/null differ diff --git a/assets/fonts/NotoSerifCJKsc-Bold.otf b/assets/fonts/NotoSerifCJKsc-Bold.otf deleted file mode 100644 index c291490e1..000000000 Binary files a/assets/fonts/NotoSerifCJKsc-Bold.otf and /dev/null differ diff --git a/assets/fonts/NotoSerifCJKsc-Regular.otf b/assets/fonts/NotoSerifCJKsc-Regular.otf deleted file mode 100644 index 4f8e54046..000000000 Binary files a/assets/fonts/NotoSerifCJKsc-Regular.otf and /dev/null differ diff --git a/assets/fonts/NotoSerifCJKtc-Bold.otf b/assets/fonts/NotoSerifCJKtc-Bold.otf deleted file mode 100644 index 73a2135ec..000000000 Binary files a/assets/fonts/NotoSerifCJKtc-Bold.otf and /dev/null differ diff --git a/assets/fonts/NotoSerifCJKtc-Regular.otf b/assets/fonts/NotoSerifCJKtc-Regular.otf deleted file mode 100644 index 7f6da6f79..000000000 Binary files a/assets/fonts/NotoSerifCJKtc-Regular.otf and /dev/null differ diff --git a/assets/fonts/NotoSerifHebrew-Bold.ttf b/assets/fonts/NotoSerifHebrew-Bold.ttf deleted file mode 100644 index e7cbd93ae..000000000 Binary files a/assets/fonts/NotoSerifHebrew-Bold.ttf and /dev/null differ diff --git a/assets/fonts/NotoSerifHebrew-Regular.ttf b/assets/fonts/NotoSerifHebrew-Regular.ttf deleted file mode 100644 index 27893f102..000000000 Binary files a/assets/fonts/NotoSerifHebrew-Regular.ttf and /dev/null differ diff --git a/assets/fonts/PTSans-Regular.ttf b/assets/fonts/PTSans-Regular.ttf deleted file mode 100644 index 5222968fb..000000000 Binary files a/assets/fonts/PTSans-Regular.ttf and /dev/null differ diff --git a/assets/fonts/Roboto-Regular.ttf b/assets/fonts/Roboto-Regular.ttf deleted file mode 100644 index 500b1045b..000000000 Binary files a/assets/fonts/Roboto-Regular.ttf and /dev/null differ diff --git a/assets/fonts/TwitterColorEmoji.ttf b/assets/fonts/TwitterColorEmoji.ttf deleted file mode 100644 index a8f829ac5..000000000 Binary files a/assets/fonts/TwitterColorEmoji.ttf and /dev/null differ diff --git a/assets/fonts/Ubuntu-Regular.ttf b/assets/fonts/Ubuntu-Regular.ttf deleted file mode 100644 index f98a2dab8..000000000 Binary files a/assets/fonts/Ubuntu-Regular.ttf and /dev/null differ diff --git a/crates/typst-cli/Cargo.toml b/crates/typst-cli/Cargo.toml index 9f0f280ea..ab9ed6f2e 100644 --- a/crates/typst-cli/Cargo.toml +++ b/crates/typst-cli/Cargo.toml @@ -21,6 +21,7 @@ doc = false [dependencies] typst = { workspace = true } +typst-assets = { workspace = true, features = ["fonts"] } typst-macros = { workspace = true } typst-pdf = { workspace = true } typst-render = { workspace = true } diff --git a/crates/typst-cli/src/fonts.rs b/crates/typst-cli/src/fonts.rs index 4ea9f446a..a5e454edb 100644 --- a/crates/typst-cli/src/fonts.rs +++ b/crates/typst-cli/src/fonts.rs @@ -107,8 +107,8 @@ impl FontSearcher { /// Add fonts that are embedded in the binary. #[cfg(feature = "embed-fonts")] fn add_embedded(&mut self) { - let mut process = |bytes: &'static [u8]| { - let buffer = typst::foundations::Bytes::from_static(bytes); + for data in typst_assets::fonts() { + let buffer = typst::foundations::Bytes::from_static(data); for (i, font) in Font::iter(buffer).enumerate() { self.book.push(font.info().clone()); self.fonts.push(FontSlot { @@ -117,28 +117,6 @@ impl FontSearcher { font: OnceLock::from(Some(font)), }); } - }; - - macro_rules! add { - ($filename:literal) => { - process(include_bytes!(concat!("../../../assets/fonts/", $filename))); - }; } - - // Embed default fonts. - add!("LinLibertine_R.ttf"); - add!("LinLibertine_RB.ttf"); - add!("LinLibertine_RBI.ttf"); - add!("LinLibertine_RI.ttf"); - add!("NewCMMath-Book.otf"); - add!("NewCMMath-Regular.otf"); - add!("NewCM10-Regular.otf"); - add!("NewCM10-Bold.otf"); - add!("NewCM10-Italic.otf"); - add!("NewCM10-BoldItalic.otf"); - add!("DejaVuSansMono.ttf"); - add!("DejaVuSansMono-Bold.ttf"); - add!("DejaVuSansMono-Oblique.ttf"); - add!("DejaVuSansMono-BoldOblique.ttf"); } } diff --git a/crates/typst-docs/Cargo.toml b/crates/typst-docs/Cargo.toml index bb32aaf22..af661bfb9 100644 --- a/crates/typst-docs/Cargo.toml +++ b/crates/typst-docs/Cargo.toml @@ -19,6 +19,8 @@ cli = ["clap", "typst-render", "serde_json"] [dependencies] typst = { workspace = true } +typst-assets = { workspace = true, features = ["fonts"] } +typst-dev-assets = { workspace = true } comemo = { workspace = true } ecow = { workspace = true } heck = { workspace = true } diff --git a/crates/typst-docs/src/html.rs b/crates/typst-docs/src/html.rs index 0ec0ddf02..6c47b8df3 100644 --- a/crates/typst-docs/src/html.rs +++ b/crates/typst-docs/src/html.rs @@ -17,7 +17,7 @@ use typst::{Library, World}; use unscanny::Scanner; use yaml_front_matter::YamlFrontMatter; -use crate::{contributors, OutlineItem, Resolver, FILE_DIR, FONTS, LIBRARY}; +use crate::{contributors, OutlineItem, Resolver, FONTS, LIBRARY}; /// HTML documentation. #[derive(Serialize)] @@ -250,8 +250,8 @@ impl<'a> Handler<'a> { } fn handle_image(&self, link: &str) -> String { - if let Some(file) = FILE_DIR.get_file(link) { - self.resolver.image(link, file.contents()) + if let Some(data) = typst_dev_assets::get(link) { + self.resolver.image(link, data) } else if let Some(url) = self.resolver.link(link) { url } else { @@ -451,11 +451,12 @@ impl World for DocWorld { fn file(&self, id: FileId) -> FileResult { assert!(id.package().is_none()); - Ok(FILE_DIR - .get_file(id.vpath().as_rootless_path()) - .unwrap_or_else(|| panic!("failed to load {:?}", id.vpath())) - .contents() - .into()) + Ok(Bytes::from_static( + typst_dev_assets::get_by_name( + &id.vpath().as_rootless_path().to_string_lossy(), + ) + .unwrap_or_else(|| panic!("failed to load {:?}", id.vpath())), + )) } fn font(&self, index: usize) -> Option { diff --git a/crates/typst-docs/src/lib.rs b/crates/typst-docs/src/lib.rs index 0a69523e0..5439ad1b5 100644 --- a/crates/typst-docs/src/lib.rs +++ b/crates/typst-docs/src/lib.rs @@ -20,6 +20,7 @@ use serde::de::DeserializeOwned; use serde::Deserialize; use serde_yaml as yaml; use typst::diag::{bail, StrResult}; +use typst::foundations::Bytes; use typst::foundations::{ CastInfo, Category, Func, Module, ParamInfo, Repr, Scope, Smart, Type, Value, FOUNDATIONS, @@ -36,8 +37,6 @@ use typst::visualize::VISUALIZE; use typst::Library; static DOCS_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/../../docs"); -static FILE_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/../../assets/files"); -static FONT_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/../../assets/fonts"); static GROUPS: Lazy> = Lazy::new(|| { let mut groups: Vec = yaml("reference/groups.yml"); @@ -67,9 +66,9 @@ static LIBRARY: Lazy> = Lazy::new(|| { }); static FONTS: Lazy<(Prehashed, Vec)> = Lazy::new(|| { - let fonts: Vec<_> = FONT_DIR - .files() - .flat_map(|file| Font::iter(file.contents().into())) + let fonts: Vec<_> = typst_assets::fonts() + .chain(typst_dev_assets::fonts()) + .flat_map(|data| Font::iter(Bytes::from_static(data))) .collect(); let book = FontBook::from_fonts(&fonts); (Prehashed::new(book), fonts) diff --git a/crates/typst-pdf/Cargo.toml b/crates/typst-pdf/Cargo.toml index 3dcddbb0d..dd71b61e9 100644 --- a/crates/typst-pdf/Cargo.toml +++ b/crates/typst-pdf/Cargo.toml @@ -17,6 +17,7 @@ bench = false [dependencies] typst = { workspace = true } +typst-assets = { workspace = true } typst-macros = { workspace = true } typst-timing = { workspace = true } base64 = { workspace = true } diff --git a/crates/typst-pdf/src/color.rs b/crates/typst-pdf/src/color.rs index f0d483cf3..4c35d9a23 100644 --- a/crates/typst-pdf/src/color.rs +++ b/crates/typst-pdf/src/color.rs @@ -19,13 +19,13 @@ const OKLAB_B: Name<'static> = Name(b"B"); // The ICC profiles. static SRGB_ICC_DEFLATED: Lazy> = - Lazy::new(|| deflate(include_bytes!("icc/sRGB-v4.icc"))); + Lazy::new(|| deflate(typst_assets::icc::S_RGB_V4)); static GRAY_ICC_DEFLATED: Lazy> = - Lazy::new(|| deflate(include_bytes!("icc/sGrey-v4.icc"))); + Lazy::new(|| deflate(typst_assets::icc::S_GREY_V4)); // The PostScript functions for color spaces. static OKLAB_DEFLATED: Lazy> = - Lazy::new(|| deflate(minify(include_str!("postscript/oklab.ps")).as_bytes())); + Lazy::new(|| deflate(minify(include_str!("oklab.ps")).as_bytes())); /// The color spaces present in the PDF document #[derive(Default)] diff --git a/crates/typst-pdf/src/icc/sGrey-v4.icc b/crates/typst-pdf/src/icc/sGrey-v4.icc deleted file mode 100644 index 2187b6786..000000000 Binary files a/crates/typst-pdf/src/icc/sGrey-v4.icc and /dev/null differ diff --git a/crates/typst-pdf/src/icc/sRGB-v4.icc b/crates/typst-pdf/src/icc/sRGB-v4.icc deleted file mode 100644 index d9f3c055b..000000000 Binary files a/crates/typst-pdf/src/icc/sRGB-v4.icc and /dev/null differ diff --git a/crates/typst-pdf/src/postscript/oklab.ps b/crates/typst-pdf/src/oklab.ps similarity index 100% rename from crates/typst-pdf/src/postscript/oklab.ps rename to crates/typst-pdf/src/oklab.ps diff --git a/crates/typst/Cargo.toml b/crates/typst/Cargo.toml index 01f6e7c68..77809ed11 100644 --- a/crates/typst/Cargo.toml +++ b/crates/typst/Cargo.toml @@ -16,6 +16,7 @@ doctest = false bench = false [dependencies] +typst-assets = { workspace = true } typst-macros = { workspace = true } typst-syntax = { workspace = true } typst-timing = { workspace = true } diff --git a/crates/typst/assets/CGATS001Compat-v2-micro.icc b/crates/typst/assets/CGATS001Compat-v2-micro.icc deleted file mode 100644 index b5a73495b..000000000 Binary files a/crates/typst/assets/CGATS001Compat-v2-micro.icc and /dev/null differ diff --git a/crates/typst/assets/cj_linebreak_data.postcard b/crates/typst/assets/cj_linebreak_data.postcard deleted file mode 100644 index 910dd1676..000000000 Binary files a/crates/typst/assets/cj_linebreak_data.postcard and /dev/null differ diff --git a/crates/typst/assets/icudata.postcard b/crates/typst/assets/icudata.postcard deleted file mode 100644 index a1fdbd480..000000000 Binary files a/crates/typst/assets/icudata.postcard and /dev/null differ diff --git a/crates/typst/src/layout/inline/linebreak.rs b/crates/typst/src/layout/inline/linebreak.rs index 1f00dc206..3c3416ed4 100644 --- a/crates/typst/src/layout/inline/linebreak.rs +++ b/crates/typst/src/layout/inline/linebreak.rs @@ -10,51 +10,28 @@ use super::Preparation; use crate::syntax::link_prefix; use crate::text::{Lang, TextElem}; -/// Generated by the following command: -/// -/// ```sh -/// icu4x-datagen --locales full \ -/// --format blob \ -/// --keys-for-bin target/debug/typst \ -/// --out crates/typst-library/assets/icudata.postcard \ -/// --overwrite -/// ``` -/// -/// Install icu_datagen with `cargo install icu_datagen`. -static ICU_DATA: &[u8] = include_bytes!("../../../assets/icudata.postcard"); - -/// Generated by the following command: -/// -/// ```sh -/// icu4x-datagen --locales zh ja \ -/// --format blob \ -/// --keys segmenter/line@1 \ -/// --out crates/typst-library/assets/cj_linebreak_data.postcard \ -/// --overwrite -/// ``` -/// -/// The used icu_datagen should be patched by -/// https://github.com/peng1999/icu4x/commit/b9beb6cbf633d61fc3d7983e5baf7f4449fbfae5 -static CJ_LINEBREAK_DATA: &[u8] = - include_bytes!("../../../assets/cj_linebreak_data.postcard"); - /// The general line break segmenter. static SEGMENTER: Lazy = Lazy::new(|| { - let provider = BlobDataProvider::try_new_from_static_blob(ICU_DATA).unwrap(); + let provider = + BlobDataProvider::try_new_from_static_blob(typst_assets::icu::ICU).unwrap(); LineSegmenter::try_new_lstm_with_buffer_provider(&provider).unwrap() }); /// The line break segmenter for Chinese/Japanese text. static CJ_SEGMENTER: Lazy = Lazy::new(|| { - let provider = BlobDataProvider::try_new_from_static_blob(ICU_DATA).unwrap(); - let cj_blob = BlobDataProvider::try_new_from_static_blob(CJ_LINEBREAK_DATA).unwrap(); + let provider = + BlobDataProvider::try_new_from_static_blob(typst_assets::icu::ICU).unwrap(); + let cj_blob = + BlobDataProvider::try_new_from_static_blob(typst_assets::icu::ICU_CJ_SEGMENT) + .unwrap(); let cj_provider = ForkByKeyProvider::new(cj_blob, provider); LineSegmenter::try_new_lstm_with_buffer_provider(&cj_provider).unwrap() }); /// The Unicode line break properties for each code point. static LINEBREAK_DATA: Lazy> = Lazy::new(|| { - let provider = BlobDataProvider::try_new_from_static_blob(ICU_DATA).unwrap(); + let provider = + BlobDataProvider::try_new_from_static_blob(typst_assets::icu::ICU).unwrap(); let deser_provider = provider.as_deserializing(); icu_properties::maps::load_line_break(&deser_provider).unwrap() }); diff --git a/crates/typst/src/loading/csv.rs b/crates/typst/src/loading/csv.rs index 101b3812a..4548bbd7b 100644 --- a/crates/typst/src/loading/csv.rs +++ b/crates/typst/src/loading/csv.rs @@ -16,7 +16,7 @@ use crate::World; /// /// # Example /// ```example -/// #let results = csv("data.csv") +/// #let results = csv("example.csv") /// /// #table( /// columns: 2, diff --git a/crates/typst/src/loading/read.rs b/crates/typst/src/loading/read.rs index 50772beec..7ffdbd3af 100644 --- a/crates/typst/src/loading/read.rs +++ b/crates/typst/src/loading/read.rs @@ -16,7 +16,7 @@ use crate::World; /// # Example /// ```example /// An example for a HTML file: \ -/// #let text = read("data.html") +/// #let text = read("example.html") /// #raw(text, lang: "html") /// /// Raw bytes: diff --git a/crates/typst/src/visualize/color.rs b/crates/typst/src/visualize/color.rs index 29bd3fca1..f51875bc8 100644 --- a/crates/typst/src/visualize/color.rs +++ b/crates/typst/src/visualize/color.rs @@ -36,10 +36,8 @@ const ANGLE_EPSILON: f32 = 1e-5; /// to convert from CMYK to RGB. It is based on the CGATS TR 001-1995 /// specification. See /// https://github.com/saucecontrol/Compact-ICC-Profiles#cmyk. -static CGATS001_COMPACT_PROFILE: Lazy> = Lazy::new(|| { - let bytes = include_bytes!("../../assets/CGATS001Compat-v2-micro.icc"); - Profile::new_from_slice(bytes, false).unwrap() -}); +static CMYK_TO_XYZ: Lazy> = + Lazy::new(|| Profile::new_from_slice(typst_assets::icc::CMYK_TO_XYZ, false).unwrap()); /// The target sRGB profile. static SRGB_PROFILE: Lazy> = Lazy::new(|| { @@ -50,7 +48,7 @@ static SRGB_PROFILE: Lazy> = Lazy::new(|| { static TO_SRGB: Lazy = Lazy::new(|| { qcms::Transform::new_to( - &CGATS001_COMPACT_PROFILE, + &CMYK_TO_XYZ, &SRGB_PROFILE, qcms::DataType::CMYK, qcms::DataType::RGB8, diff --git a/docs/tutorial/1-writing.md b/docs/tutorial/1-writing.md index de2af62ff..23fdb6753 100644 --- a/docs/tutorial/1-writing.md +++ b/docs/tutorial/1-writing.md @@ -9,7 +9,7 @@ you create a new project on the Typst app. You'll be taken to the editor where you see two panels: A source panel where you compose your document and a preview panel where you see the rendered document. -![Typst app screenshot](1-writing-app.png) +![Typst app screenshot](screenshots/1-writing-app.png) You already have a good angle for your report in mind. So let's start by writing the introduction. Enter some text in the editor panel. You'll notice that the @@ -77,7 +77,7 @@ click the button with the arrow in the top-right corner. This opens the upload dialog, in which you can pick files to upload from your computer. Select an image file for your report. -![Upload dialog](1-writing-upload.png) +![Upload dialog](screenshots/1-writing-upload.png) We have seen before that specific symbols (called _markup_) have specific meaning in Typst. We can use `=`, `-`, `+`, and `_` to create headings, lists diff --git a/docs/tutorial/2-formatting.md b/docs/tutorial/2-formatting.md index 58095f94e..a0fb3a98e 100644 --- a/docs/tutorial/2-formatting.md +++ b/docs/tutorial/2-formatting.md @@ -82,7 +82,7 @@ hitting the Escape key and opened again by typing `#` or hitting right arguments for functions. Most suggestions come with a small description of what they do. -![Autocomplete panel](2-formatting-autocomplete.png) +![Autocomplete panel](screenshots/2-formatting-autocomplete.png) ## Set up the page { #page-setup } Back to set rules: When writing a rule, you choose the function depending on diff --git a/docs/tutorial/3-advanced.md b/docs/tutorial/3-advanced.md index 2393a4740..92aafbad7 100644 --- a/docs/tutorial/3-advanced.md +++ b/docs/tutorial/3-advanced.md @@ -16,7 +16,7 @@ left toolbar and create a team. Finally, click on the new team and go to its settings by clicking 'manage team' next to the team name. Now you can invite your supervisor by email. -![The team settings](3-advanced-team-settings.png) +![The team settings](screenshots/3-advanced-team-settings.png) Next, move your project into the team: Open it, going to its settings by choosing the gear icon in the left toolbar and selecting your new team from the @@ -489,7 +489,7 @@ We are now in compliance with all of these styles and can submit the paper to the conference! The finished paper looks like this: The finished paper diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 92c72f56a..2a1210670 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -8,6 +8,8 @@ publish = false [dev-dependencies] typst = { workspace = true } +typst-assets = { workspace = true, features = ["fonts"] } +typst-dev-assets = { workspace = true } typst-pdf = { workspace = true } typst-render = { workspace = true } typst-svg = { workspace = true } diff --git a/tests/fuzz/Cargo.toml b/tests/fuzz/Cargo.toml index 1b9e6b26b..ddad37d6a 100644 --- a/tests/fuzz/Cargo.toml +++ b/tests/fuzz/Cargo.toml @@ -9,6 +9,7 @@ cargo-fuzz = true [dependencies] typst = { workspace = true } +typst-assets = { workspace = true, features = ["fonts"] } typst-render = { workspace = true } typst-syntax = { workspace = true } comemo = { workspace = true } diff --git a/tests/fuzz/src/compile.rs b/tests/fuzz/src/compile.rs index 883b9ea32..2d445bf53 100644 --- a/tests/fuzz/src/compile.rs +++ b/tests/fuzz/src/compile.rs @@ -10,8 +10,6 @@ use typst::text::{Font, FontBook}; use typst::visualize::Color; use typst::{Library, World}; -const FONT: &[u8] = include_bytes!("../../../assets/fonts/LinLibertine_R.ttf"); - struct FuzzWorld { library: Prehashed, book: Prehashed, @@ -21,7 +19,8 @@ struct FuzzWorld { impl FuzzWorld { fn new(text: &str) -> Self { - let font = Font::new(FONT.into(), 0).unwrap(); + let data = typst_assets::fonts().next().unwrap(); + let font = Font::new(Bytes::from_static(data), 0).unwrap(); let book = FontBook::from_fonts([&font]); Self { library: Prehashed::new(Library::default()), diff --git a/tests/src/benches.rs b/tests/src/benches.rs index 8a521419d..1bcdb528d 100644 --- a/tests/src/benches.rs +++ b/tests/src/benches.rs @@ -10,7 +10,6 @@ use typst::{Library, World}; use unscanny::Scanner; const TEXT: &str = include_str!("../typ/compiler/bench.typ"); -const FONT: &[u8] = include_bytes!("../../assets/fonts/LinLibertine_R.ttf"); main!( bench_decode, @@ -87,9 +86,9 @@ struct BenchWorld { impl BenchWorld { fn new() -> Self { - let font = Font::new(FONT.into(), 0).unwrap(); + let data = typst_assets::fonts().next().unwrap(); + let font = Font::new(Bytes::from_static(data), 0).unwrap(); let book = FontBook::from_fonts([&font]); - Self { library: Prehashed::new(Library::default()), book: Prehashed::new(book), diff --git a/tests/src/tests.rs b/tests/src/tests.rs index 05b53a735..2be5bc180 100644 --- a/tests/src/tests.rs +++ b/tests/src/tests.rs @@ -15,6 +15,7 @@ mod metadata; use self::metadata::*; +use std::borrow::Cow; use std::collections::{HashMap, HashSet}; use std::ffi::OsStr; use std::fmt::Write as _; @@ -47,8 +48,6 @@ const REF_DIR: &str = "ref"; const PNG_DIR: &str = "png"; const PDF_DIR: &str = "pdf"; const SVG_DIR: &str = "svg"; -const FONT_DIR: &str = "../assets/fonts"; -const ASSET_DIR: &str = "../assets"; /// Arguments that modify test behaviour. /// @@ -269,17 +268,10 @@ struct FileSlot { impl TestWorld { fn new(print: PrintConfig) -> Self { - // Search for fonts. - let mut fonts = vec![]; - for entry in WalkDir::new(FONT_DIR) - .sort_by_file_name() - .into_iter() - .filter_map(|e| e.ok()) - .filter(|entry| entry.file_type().is_file()) - { - let data = fs::read(entry.path()).unwrap(); - fonts.extend(Font::iter(data.into())); - } + let fonts: Vec<_> = typst_assets::fonts() + .chain(typst_dev_assets::fonts()) + .flat_map(|data| Font::iter(Bytes::from_static(data))) + .collect(); Self { print, @@ -310,7 +302,7 @@ impl World for TestWorld { slot.source .get_or_init(|| { let buf = read(&system_path(id)?)?; - let text = String::from_utf8(buf)?; + let text = String::from_utf8(buf.into_owned())?; Ok(Source::new(id, text)) }) .clone() @@ -320,7 +312,12 @@ impl World for TestWorld { fn file(&self, id: FileId) -> FileResult { self.slot(id, |slot| { slot.buffer - .get_or_init(|| read(&system_path(id)?).map(Bytes::from)) + .get_or_init(|| { + read(&system_path(id)?).map(|cow| match cow { + Cow::Owned(buf) => buf.into(), + Cow::Borrowed(buf) => Bytes::from_static(buf), + }) + }) .clone() }) } @@ -379,19 +376,21 @@ fn system_path(id: FileId) -> FileResult { } /// Read a file. -fn read(path: &Path) -> FileResult> { +fn read(path: &Path) -> FileResult> { // Basically symlinks `assets/files` to `tests/files` so that the assets // are within the test project root. - let mut resolved = path.to_path_buf(); - if path.starts_with("files/") { - resolved = Path::new(ASSET_DIR).join(path); + let resolved = path.to_path_buf(); + if let Ok(suffix) = path.strip_prefix("assets/") { + return typst_dev_assets::get(&suffix.to_string_lossy()) + .map(Cow::Borrowed) + .ok_or_else(|| FileError::NotFound(path.into())); } let f = |e| FileError::from_io(e, path); if fs::metadata(&resolved).map_err(f)?.is_dir() { Err(FileError::IsDirectory) } else { - fs::read(&resolved).map_err(f) + fs::read(&resolved).map(Cow::Owned).map_err(f) } } diff --git a/tests/typ/bugs/1597-cite-footnote.typ b/tests/typ/bugs/1597-cite-footnote.typ index 394f7ea9c..cc231e2a7 100644 --- a/tests/typ/bugs/1597-cite-footnote.typ +++ b/tests/typ/bugs/1597-cite-footnote.typ @@ -9,4 +9,4 @@ #footnote[@netwok] #show bibliography: none -#bibliography("/files/works.bib") +#bibliography("/assets/bib/works.bib") diff --git a/tests/typ/bugs/870-image-rotation.typ b/tests/typ/bugs/870-image-rotation.typ index 56c3da1d0..5d7b5597b 100644 --- a/tests/typ/bugs/870-image-rotation.typ +++ b/tests/typ/bugs/870-image-rotation.typ @@ -2,5 +2,5 @@ // https://github.com/image-rs/image/issues/1045 --- -// Files is from https://magnushoff.com/articles/jpeg-orientation/ -#image("/files/f2t.jpg", width: 10pt) +// File is from https://magnushoff.com/articles/jpeg-orientation/ +#image("/assets/images/f2t.jpg", width: 10pt) diff --git a/tests/typ/bugs/bibliography-math.typ b/tests/typ/bugs/bibliography-math.typ index 2f3dabcde..3aab4b888 100644 --- a/tests/typ/bugs/bibliography-math.typ +++ b/tests/typ/bugs/bibliography-math.typ @@ -1,4 +1,4 @@ #set page(width: 200pt) @Zee04 -#bibliography("/files/works_too.bib", style: "mla") +#bibliography("/assets/bib/works_too.bib", style: "mla") diff --git a/tests/typ/bugs/cite-locate.typ b/tests/typ/bugs/cite-locate.typ index c576c45e8..699bb085d 100644 --- a/tests/typ/bugs/cite-locate.typ +++ b/tests/typ/bugs/cite-locate.typ @@ -20,4 +20,4 @@ #context [Citation @distress on page #here().page()] #pagebreak() -#bibliography("/files/works.bib", style: "chicago-notes") +#bibliography("/assets/bib/works.bib", style: "chicago-notes") diff --git a/tests/typ/bugs/cite-show-set.typ b/tests/typ/bugs/cite-show-set.typ index a4111c9a3..f476dd496 100644 --- a/tests/typ/bugs/cite-show-set.typ +++ b/tests/typ/bugs/cite-show-set.typ @@ -6,4 +6,4 @@ A @netwok @arrgh. B #cite() #cite(). #show bibliography: none -#bibliography("/files/works.bib") +#bibliography("/assets/bib/works.bib") diff --git a/tests/typ/bugs/hide-meta.typ b/tests/typ/bugs/hide-meta.typ index 10c95e593..8d2c7cb66 100644 --- a/tests/typ/bugs/hide-meta.typ +++ b/tests/typ/bugs/hide-meta.typ @@ -7,7 +7,7 @@ A pirate. @arrgh \ #set text(2pt) #hide[ A @arrgh pirate. - #bibliography("/files/works.bib") + #bibliography("/assets/bib/works.bib") ] --- diff --git a/tests/typ/bugs/new-cm-svg.typ b/tests/typ/bugs/new-cm-svg.typ index 06cd45326..eeafcbbdb 100644 --- a/tests/typ/bugs/new-cm-svg.typ +++ b/tests/typ/bugs/new-cm-svg.typ @@ -1,2 +1,2 @@ #set text(font: "New Computer Modern") -#image("/files/diagram.svg") +#image("/assets/images/diagram.svg") diff --git a/tests/typ/bugs/pagebreak-bibliography.typ b/tests/typ/bugs/pagebreak-bibliography.typ index bfc782501..257043a37 100644 --- a/tests/typ/bugs/pagebreak-bibliography.typ +++ b/tests/typ/bugs/pagebreak-bibliography.typ @@ -2,4 +2,4 @@ --- #pagebreak(weak: true) -#bibliography("/files/works.bib") +#bibliography("/assets/bib/works.bib") diff --git a/tests/typ/coma.typ b/tests/typ/coma.typ index 32a683088..8ca08ddb9 100644 --- a/tests/typ/coma.typ +++ b/tests/typ/coma.typ @@ -21,4 +21,4 @@ Die Tiefe eines Knotens _v_ ist die Länge des eindeutigen Weges von der Wurzel zu _v_, und die Höhe von _v_ ist die Länge eines längsten (absteigenden) Weges von _v_ zu einem Blatt. Die Höhe des Baumes ist die Höhe der Wurzel. -#align(center, image("/files/graph.png", width: 75%)) +#align(center, image("/assets/images/graph.png", width: 75%)) diff --git a/tests/typ/compiler/bytes.typ b/tests/typ/compiler/bytes.typ index 284ef7739..a9249bddd 100644 --- a/tests/typ/compiler/bytes.typ +++ b/tests/typ/compiler/bytes.typ @@ -2,7 +2,7 @@ // Ref: false --- -#let data = read("/files/rhino.png", encoding: none) +#let data = read("/assets/images/rhino.png", encoding: none) #test(data.len(), 232243) #test(data.slice(0, count: 5), bytes((137, 80, 78, 71, 13))) #test(str(data.slice(1, 4)), "PNG") diff --git a/tests/typ/compiler/import.typ b/tests/typ/compiler/import.typ index fb7a06b81..5c3a05c93 100644 --- a/tests/typ/compiler/import.typ +++ b/tests/typ/compiler/import.typ @@ -189,8 +189,8 @@ --- // Some non-text stuff. -// Error: 9-27 file is not valid utf-8 -#import "/files/rhino.png" +// Error: 9-35 file is not valid utf-8 +#import "/assets/images/rhino.png" --- // Unresolved import. diff --git a/tests/typ/compiler/plugin-oob.typ b/tests/typ/compiler/plugin-oob.typ index 4bc162124..4d1ba2053 100644 --- a/tests/typ/compiler/plugin-oob.typ +++ b/tests/typ/compiler/plugin-oob.typ @@ -2,13 +2,13 @@ // Ref: false --- -#let p = plugin("/files/plugin-oob.wasm") +#let p = plugin("/assets/plugins/plugin-oob.wasm") // Error: 2-14 plugin tried to read out of bounds: pointer 0x40000000 is out of bounds for read of length 1 #p.read_oob() --- -#let p = plugin("/files/plugin-oob.wasm") +#let p = plugin("/assets/plugins/plugin-oob.wasm") // Error: 2-27 plugin tried to write out of bounds: pointer 0x40000000 is out of bounds for write of length 3 #p.write_oob(bytes("xyz")) diff --git a/tests/typ/compiler/plugin.typ b/tests/typ/compiler/plugin.typ index 53d96f713..e727355ff 100644 --- a/tests/typ/compiler/plugin.typ +++ b/tests/typ/compiler/plugin.typ @@ -2,7 +2,7 @@ // Ref: false --- -#let p = plugin("/files/hello.wasm") +#let p = plugin("/assets/plugins/hello.wasm") #test(p.hello(), bytes("Hello from wasm!!!")) #test(p.double_it(bytes("hey!")), bytes("hey!.hey!")) #test( @@ -11,26 +11,26 @@ ) --- -#let p = plugin("/files/hello.wasm") +#let p = plugin("/assets/plugins/hello.wasm") // Error: 2-20 plugin function takes 0 arguments, but 1 was given #p.hello(bytes("")) --- -#let p = plugin("/files/hello.wasm") +#let p = plugin("/assets/plugins/hello.wasm") // Error: 10-14 expected bytes, found boolean // Error: 27-29 expected bytes, found integer #p.hello(true, bytes(()), 10) --- -#let p = plugin("/files/hello.wasm") +#let p = plugin("/assets/plugins/hello.wasm") // Error: 2-17 plugin errored with: This is an `Err` #p.returns_err() --- -#let p = plugin("/files/hello.wasm") +#let p = plugin("/assets/plugins/hello.wasm") // Error: 2-16 plugin panicked: wasm `unreachable` instruction executed #p.will_panic() diff --git a/tests/typ/compiler/set.typ b/tests/typ/compiler/set.typ index b317e60c8..23b3a7c60 100644 --- a/tests/typ/compiler/set.typ +++ b/tests/typ/compiler/set.typ @@ -40,7 +40,7 @@ Hello *#x* // Test relative path resolving in layout phase. #let choice = ("monkey.svg", "rhino.png", "tiger.jpg") #set enum(numbering: n => { - let path = "/files/" + choice.at(n - 1) + let path = "/assets/images/" + choice.at(n - 1) move(dy: -0.15em, image(path, width: 1em, height: 1em)) }) diff --git a/tests/typ/compiler/show-text.typ b/tests/typ/compiler/show-text.typ index 7837bb46a..a42abfb26 100644 --- a/tests/typ/compiler/show-text.typ +++ b/tests/typ/compiler/show-text.typ @@ -88,6 +88,6 @@ World --- // Test absolute path in layout phase. -#show "GRAPH": image("/files/graph.png") +#show "GRAPH": image("/assets/images/graph.png") The GRAPH has nodes. diff --git a/tests/typ/compute/data.typ b/tests/typ/compute/data.typ index ae964b3d2..03b17aed6 100644 --- a/tests/typ/compute/data.typ +++ b/tests/typ/compute/data.typ @@ -3,28 +3,28 @@ --- // Test reading plain text files -#let data = read("/files/hello.txt") +#let data = read("/assets/text/hello.txt") #test(data, "Hello, world!\n") --- -// Error: 18-38 file not found (searched at files/missing.txt) -#let data = read("/files/missing.txt") +// Error: 18-44 file not found (searched at assets/text/missing.txt) +#let data = read("/assets/text/missing.txt") --- -// Error: 18-34 file is not valid utf-8 -#let data = read("/files/bad.txt") +// Error: 18-40 file is not valid utf-8 +#let data = read("/assets/text/bad.txt") --- // Test reading CSV data. // Ref: true #set page(width: auto) -#let data = csv("/files/zoo.csv") +#let data = csv("/assets/data/zoo.csv") #let cells = data.at(0).map(strong) + data.slice(1).flatten() #table(columns: data.at(0).len(), ..cells) --- // Test reading CSV data with dictionary rows enabled. -#let data = csv("/files/zoo.csv", row-type: dictionary) +#let data = csv("/assets/data/zoo.csv", row-type: dictionary) #test(data.len(), 3) #test(data.at(0).Name, "Debby") #test(data.at(2).Weight, "150kg") @@ -35,28 +35,28 @@ #csv("nope.csv") --- -// Error: 6-22 failed to parse CSV (found 3 instead of 2 fields in line 3) -#csv("/files/bad.csv") +// Error: 6-28 failed to parse CSV (found 3 instead of 2 fields in line 3) +#csv("/assets/data/bad.csv") --- // Test error numbering with dictionary rows. -// Error: 6-22 failed to parse CSV (found 3 instead of 2 fields in line 3) -#csv("/files/bad.csv", row-type: dictionary) +// Error: 6-28 failed to parse CSV (found 3 instead of 2 fields in line 3) +#csv("/assets/data/bad.csv", row-type: dictionary) --- // Test reading JSON data. -#let data = json("/files/zoo.json") +#let data = json("/assets/data/zoo.json") #test(data.len(), 3) #test(data.at(0).name, "Debby") #test(data.at(2).weight, 150) --- -// Error: 7-24 failed to parse JSON (expected value at line 3 column 14) -#json("/files/bad.json") +// Error: 7-30 failed to parse JSON (expected value at line 3 column 14) +#json("/assets/data/bad.json") --- // Test reading TOML data. -#let data = toml("/files/toml-types.toml") +#let data = toml("/assets/data/toml-types.toml") #test(data.string, "wonderful") #test(data.integer, 42) #test(data.float, 3.14) @@ -93,12 +93,12 @@ )) --- -// Error: 7-24 failed to parse TOML (expected `.`, `=` at line 1 column 16) -#toml("/files/bad.toml") +// Error: 7-30 failed to parse TOML (expected `.`, `=` at line 1 column 16) +#toml("/assets/data/bad.toml") --- // Test reading YAML data -#let data = yaml("/files/yaml-types.yaml") +#let data = yaml("/assets/data/yaml-types.yaml") #test(data.len(), 9) #test(data.null_key, (none, none)) #test(data.string, "text") @@ -111,12 +111,12 @@ #test(data.at("1"), "ok") --- -// Error: 7-24 failed to parse YAML (did not find expected ',' or ']' at line 2 column 1, while parsing a flow sequence at line 1 column 18) -#yaml("/files/bad.yaml") +// Error: 7-30 failed to parse YAML (did not find expected ',' or ']' at line 2 column 1, while parsing a flow sequence at line 1 column 18) +#yaml("/assets/data/bad.yaml") --- // Test reading XML data. -#let data = xml("/files/data.xml") +#let data = xml("/assets/data/hello.xml") #test(data, (( tag: "data", attrs: (:), @@ -140,5 +140,5 @@ ),)) --- -// Error: 6-22 failed to parse XML (found closing tag 'data' instead of 'hello' in line 3) -#xml("/files/bad.xml") +// Error: 6-28 failed to parse XML (found closing tag 'data' instead of 'hello' in line 3) +#xml("/assets/data/bad.xml") diff --git a/tests/typ/compute/eval-path.typ b/tests/typ/compute/eval-path.typ index c02bdfb11..863b62031 100644 --- a/tests/typ/compute/eval-path.typ +++ b/tests/typ/compute/eval-path.typ @@ -2,13 +2,13 @@ --- // Test absolute path. -#eval("image(\"/files/tiger.jpg\", width: 50%)") +#eval("image(\"/assets/images/tiger.jpg\", width: 50%)") --- #show raw: it => eval(it.text, mode: "markup") ``` -#show emph: image("/files/tiger.jpg", width: 50%) +#show emph: image("/assets/images/tiger.jpg", width: 50%) _Tiger!_ ``` diff --git a/tests/typ/layout/clip.typ b/tests/typ/layout/clip.typ index d20609d82..3ca74556c 100644 --- a/tests/typ/layout/clip.typ +++ b/tests/typ/layout/clip.typ @@ -52,7 +52,7 @@ First! width: 20pt, height: 20pt, clip: true, - image("/files/rhino.png", width: 30pt) + image("/assets/images/rhino.png", width: 30pt) ) --- // Test clipping with `radius`, but without `stroke`. @@ -64,5 +64,5 @@ First! width: 20pt, height: 20pt, clip: true, - image("/files/rhino.png", width: 30pt) + image("/assets/images/rhino.png", width: 30pt) ) diff --git a/tests/typ/layout/grid-3.typ b/tests/typ/layout/grid-3.typ index 89bcb90f1..a6c72d6cb 100644 --- a/tests/typ/layout/grid-3.typ +++ b/tests/typ/layout/grid-3.typ @@ -23,7 +23,7 @@ columns: 4 * (1fr,), row-gutter: 10pt, column-gutter: (0pt, 10%), - align(top, image("/files/rhino.png")), + align(top, image("/assets/images/rhino.png")), align(top, rect(inset: 0pt, fill: eastern, align(right)[LoL])), [rofl], [\ A] * 3, diff --git a/tests/typ/layout/hide.typ b/tests/typ/layout/hide.typ index 2cd8333e0..ede65c700 100644 --- a/tests/typ/layout/hide.typ +++ b/tests/typ/layout/hide.typ @@ -4,15 +4,15 @@ AB #h(1fr) CD \ #hide[A]B #h(1fr) C#hide[D] --- -Hidden: +Hidden: #hide[#line(length: 100%)] #line(length: 100%) --- -Hidden: +Hidden: #hide(table(rows: 2, columns: 2)[a][b][c][d]) #table(rows: 2, columns: 2)[a][b][c][d] --- -Hidden: +Hidden: #hide[ #polygon((20%, 0pt), (60%, 0pt), @@ -30,7 +30,7 @@ Hidden: width: 100%, ) -Hidden: +Hidden: #hide[ #grid( columns: (1fr, 1fr, 2fr), @@ -53,7 +53,7 @@ Hidden: ) --- -Hidden: +Hidden: #hide[ - 1 - 2 @@ -71,6 +71,6 @@ Hidden: --- Hidden: -#hide(image("/files/tiger.jpg", width: 5cm, height: 1cm,)) +#hide(image("/assets/images/tiger.jpg", width: 5cm, height: 1cm,)) -#image("/files/tiger.jpg", width: 5cm, height: 1cm,) +#image("/assets/images/tiger.jpg", width: 5cm, height: 1cm,) diff --git a/tests/typ/layout/pad.typ b/tests/typ/layout/pad.typ index f7b47142c..0eff58762 100644 --- a/tests/typ/layout/pad.typ +++ b/tests/typ/layout/pad.typ @@ -22,7 +22,7 @@ Hi #box(pad(left: 10pt)[A]) there // Test that the pad element doesn't consume the whole region. #set page(height: 6cm) #align(left)[Before] -#pad(10pt, image("/files/tiger.jpg")) +#pad(10pt, image("/assets/images/tiger.jpg")) #align(right)[After] --- diff --git a/tests/typ/layout/par-bidi.typ b/tests/typ/layout/par-bidi.typ index ea3711ab6..f708df6a8 100644 --- a/tests/typ/layout/par-bidi.typ +++ b/tests/typ/layout/par-bidi.typ @@ -41,7 +41,7 @@ Lריווח #h(1cm) R --- // Test inline object. #set text(lang: "he") -קרנפיםRh#box(image("/files/rhino.png", height: 11pt))inoחיים +קרנפיםRh#box(image("/assets/images/rhino.png", height: 11pt))inoחיים --- // Test whether L1 whitespace resetting destroys stuff. diff --git a/tests/typ/layout/par-indent.typ b/tests/typ/layout/par-indent.typ index 324ff44a4..e807d74d1 100644 --- a/tests/typ/layout/par-indent.typ +++ b/tests/typ/layout/par-indent.typ @@ -9,10 +9,10 @@ The first paragraph has no indent. But the second one does. -#box(image("/files/tiger.jpg", height: 6pt)) +#box(image("/assets/images/tiger.jpg", height: 6pt)) starts a paragraph, also with indent. -#align(center, image("/files/rhino.png", width: 1cm)) +#align(center, image("/assets/images/rhino.png", width: 1cm)) = Headings - And lists. diff --git a/tests/typ/layout/place-background.typ b/tests/typ/layout/place-background.typ index 3a7a06b92..afee0622e 100644 --- a/tests/typ/layout/place-background.typ +++ b/tests/typ/layout/place-background.typ @@ -7,7 +7,7 @@ dx: -10pt, dy: -10pt, image( - "/files/tiger.jpg", + "/assets/images/tiger.jpg", fit: "cover", width: 100% + 20pt, height: 100% + 20pt, diff --git a/tests/typ/layout/place-float-columns.typ b/tests/typ/layout/place-float-columns.typ index 0e5c6d0c2..e2b88d460 100644 --- a/tests/typ/layout/place-float-columns.typ +++ b/tests/typ/layout/place-float-columns.typ @@ -8,7 +8,7 @@ #figure( placement: bottom, caption: [A glacier], - image("/files/glacier.jpg", width: 50%), + image("/assets/images/glacier.jpg", width: 50%), ) #lorem(45) #figure( diff --git a/tests/typ/layout/place-float-figure.typ b/tests/typ/layout/place-float-figure.typ index 7256a4ebf..4d76fd8f3 100644 --- a/tests/typ/layout/place-float-figure.typ +++ b/tests/typ/layout/place-float-figure.typ @@ -9,7 +9,7 @@ #figure( placement: bottom, caption: [A glacier #footnote[Lots of Ice]], - image("/files/glacier.jpg", width: 80%), + image("/assets/images/glacier.jpg", width: 80%), ) #lorem(40) @@ -17,5 +17,5 @@ #figure( placement: top, caption: [An important], - image("/files/diagram.svg", width: 80%), + image("/assets/images/diagram.svg", width: 80%), ) diff --git a/tests/typ/layout/place.typ b/tests/typ/layout/place.typ index 6f79e3e13..d426e07fe 100644 --- a/tests/typ/layout/place.typ +++ b/tests/typ/layout/place.typ @@ -5,7 +5,7 @@ #place(bottom + center)[© Typst] = Placement -#place(right, image("/files/tiger.jpg", width: 1.8cm)) +#place(right, image("/assets/images/tiger.jpg", width: 1.8cm)) Hi there. This is \ a placed element. \ Unfortunately, \ diff --git a/tests/typ/layout/transform.typ b/tests/typ/layout/transform.typ index 3a674282e..f74ec2b0d 100644 --- a/tests/typ/layout/transform.typ +++ b/tests/typ/layout/transform.typ @@ -31,13 +31,13 @@ nor #xetex! // Test combination of scaling and rotation. #set page(height: 80pt) #align(center + horizon, - rotate(20deg, scale(70%, image("/files/tiger.jpg"))) + rotate(20deg, scale(70%, image("/assets/images/tiger.jpg"))) ) --- // Test setting rotation origin. #rotate(10deg, origin: top + left, - image("/files/tiger.jpg", width: 50%) + image("/assets/images/tiger.jpg", width: 50%) ) --- diff --git a/tests/typ/math/content.typ b/tests/typ/math/content.typ index e04ebb305..739377ae1 100644 --- a/tests/typ/math/content.typ +++ b/tests/typ/math/content.typ @@ -2,7 +2,7 @@ --- // Test images and font fallback. -#let monkey = move(dy: 0.2em, image("/files/monkey.svg", height: 1em)) +#let monkey = move(dy: 0.2em, image("/assets/images/monkey.svg", height: 1em)) $ sum_(i=#emoji.apple)^#emoji.apple.red i + monkey/2 $ --- diff --git a/tests/typ/meta/bibliography-full.typ b/tests/typ/meta/bibliography-full.typ index cebe7e0d9..9b652cd2c 100644 --- a/tests/typ/meta/bibliography-full.typ +++ b/tests/typ/meta/bibliography-full.typ @@ -2,4 +2,4 @@ --- #set page(paper: "a6", height: 170mm) -#bibliography("/files/works.bib", full: true) +#bibliography("/assets/bib/works.bib", full: true) diff --git a/tests/typ/meta/bibliography-ordering.typ b/tests/typ/meta/bibliography-ordering.typ index 970d66d0e..4732ad68e 100644 --- a/tests/typ/meta/bibliography-ordering.typ +++ b/tests/typ/meta/bibliography-ordering.typ @@ -13,4 +13,4 @@ @sharing @restful -#bibliography("/files/works.bib") +#bibliography("/assets/bib/works.bib") diff --git a/tests/typ/meta/bibliography.typ b/tests/typ/meta/bibliography.typ index 0ce4b7f73..107f790e1 100644 --- a/tests/typ/meta/bibliography.typ +++ b/tests/typ/meta/bibliography.typ @@ -5,13 +5,13 @@ = Details See also @arrgh #cite(, supplement: [p.~22]), @arrgh[p.~4], and @distress[p.~5]. -#bibliography("/files/works.bib") +#bibliography("/assets/bib/works.bib") --- // Test unconventional order. #set page(width: 200pt) #bibliography( - "/files/works.bib", + "/assets/bib/works.bib", title: [Works to be cited], style: "chicago-author-date", ) @@ -29,7 +29,7 @@ And quark! @quark = Multiple Bibs Now we have multiple bibliographies containing @glacier-melt @keshav2007read -#bibliography(("/files/works.bib", "/files/works_too.bib")) +#bibliography(("/assets/bib/works.bib", "/assets/bib/works_too.bib")) --- // Test ambiguous reference. @@ -37,8 +37,8 @@ Now we have multiple bibliographies containing @glacier-melt @keshav2007read // Error: 1-7 label occurs in the document and its bibliography @arrgh -#bibliography("/files/works.bib") +#bibliography("/assets/bib/works.bib") --- -// Error: 15-55 duplicate bibliography keys: netwok, issue201, arrgh, quark, distress, glacier-melt, tolkien54, DBLP:books/lib/Knuth86a, sharing, restful, mcintosh_anxiety, psychology25 -#bibliography(("/files/works.bib", "/files/works.bib")) +// Error: 15-65 duplicate bibliography keys: netwok, issue201, arrgh, quark, distress, glacier-melt, tolkien54, DBLP:books/lib/Knuth86a, sharing, restful, mcintosh_anxiety, psychology25 +#bibliography(("/assets/bib/works.bib", "/assets/bib/works.bib")) diff --git a/tests/typ/meta/cite-footnote.typ b/tests/typ/meta/cite-footnote.typ index 071a68d7d..c6eff59d7 100644 --- a/tests/typ/meta/cite-footnote.typ +++ b/tests/typ/meta/cite-footnote.typ @@ -2,4 +2,4 @@ Hello @netwok And again: @netwok #pagebreak() -#bibliography("/files/works.bib", style: "chicago-notes") +#bibliography("/assets/bib/works.bib", style: "chicago-notes") diff --git a/tests/typ/meta/cite-form.typ b/tests/typ/meta/cite-form.typ index 3c11e1f63..343981d70 100644 --- a/tests/typ/meta/cite-form.typ +++ b/tests/typ/meta/cite-form.typ @@ -7,4 +7,4 @@ Nothing: #cite(, form: none) #cite(, form: "prose") say stuff. -#bibliography("/files/works.bib", style: "apa") +#bibliography("/assets/bib/works.bib", style: "apa") diff --git a/tests/typ/meta/cite-group.typ b/tests/typ/meta/cite-group.typ index 3bb0046d1..331c87cac 100644 --- a/tests/typ/meta/cite-group.typ +++ b/tests/typ/meta/cite-group.typ @@ -16,4 +16,4 @@ A @netwok @arrgh @quark B. \ A @netwok @arrgh @quark, B. #set text(0pt) -#bibliography("/files/works.bib") +#bibliography("/assets/bib/works.bib") diff --git a/tests/typ/meta/figure.typ b/tests/typ/meta/figure.typ index 7d618d062..b6c1bfd6a 100644 --- a/tests/typ/meta/figure.typ +++ b/tests/typ/meta/figure.typ @@ -13,7 +13,7 @@ We can clearly see that @fig-cylinder and ) #figure( - pad(y: -6pt, image("/files/cylinder.svg", height: 2cm)), + pad(y: -6pt, image("/assets/images/cylinder.svg", height: 2cm)), caption: [The basic shapes.], numbering: "I", ) @@ -30,7 +30,7 @@ We can clearly see that @fig-cylinder and table( columns: 2, [Second cylinder], - image("/files/cylinder.svg"), + image("/assets/images/cylinder.svg"), ), caption: "A table containing images." ) diff --git a/tests/typ/meta/footnote-container.typ b/tests/typ/meta/footnote-container.typ index 562831a92..2fa14fac1 100644 --- a/tests/typ/meta/footnote-container.typ +++ b/tests/typ/meta/footnote-container.typ @@ -4,7 +4,7 @@ // Test footnote in caption. Read the docs #footnote[https://typst.app/docs]! #figure( - image("/files/graph.png", width: 70%), + image("/assets/images/graph.png", width: 70%), caption: [ A graph #footnote[A _graph_ is a structure with nodes and edges.] ] diff --git a/tests/typ/meta/footnote-table.typ b/tests/typ/meta/footnote-table.typ index 8256dc586..a52d28bad 100644 --- a/tests/typ/meta/footnote-table.typ +++ b/tests/typ/meta/footnote-table.typ @@ -12,7 +12,7 @@ [This cell #footnote[This footnote is not on the same page] breaks over multiple pages.], - image("/files/tiger.jpg"), + image("/assets/images/tiger.jpg"), ) #table( diff --git a/tests/typ/meta/link.typ b/tests/typ/meta/link.typ index f93189cbc..dd5bffa88 100644 --- a/tests/typ/meta/link.typ +++ b/tests/typ/meta/link.typ @@ -54,7 +54,7 @@ My cool #box(move(dx: 0.7cm, dy: 0.7cm, rotate(10deg, scale(200%, mylink)))) // Link containing a block. #link("https://example.com/", block[ My cool rhino - #box(move(dx: 10pt, image("/files/rhino.png", width: 1cm))) + #box(move(dx: 10pt, image("/assets/images/rhino.png", width: 1cm))) ]) --- diff --git a/tests/typ/meta/query-figure.typ b/tests/typ/meta/query-figure.typ index 590c8e876..1fe823726 100644 --- a/tests/typ/meta/query-figure.typ +++ b/tests/typ/meta/query-figure.typ @@ -24,7 +24,7 @@ } #figure( - image("/files/glacier.jpg"), + image("/assets/images/glacier.jpg"), caption: [Glacier melting], ) @@ -36,6 +36,6 @@ ) #figure( - image("/files/tiger.jpg"), + image("/assets/images/tiger.jpg"), caption: [Tiger world], ) diff --git a/tests/typ/meta/ref.typ b/tests/typ/meta/ref.typ index e01bc941b..4cc824d75 100644 --- a/tests/typ/meta/ref.typ +++ b/tests/typ/meta/ref.typ @@ -26,13 +26,13 @@ As seen in @intro, we proceed. = Intro #figure( - image("/files/cylinder.svg", height: 1cm), + image("/assets/images/cylinder.svg", height: 1cm), caption: [A cylinder.], supplement: "Fig", ) #figure( - image("/files/tiger.jpg", height: 1cm), + image("/assets/images/tiger.jpg", height: 1cm), caption: [A tiger.], supplement: "Tig", ) diff --git a/tests/typ/text/baseline.typ b/tests/typ/text/baseline.typ index e00e9230b..c8fbb19df 100644 --- a/tests/typ/text/baseline.typ +++ b/tests/typ/text/baseline.typ @@ -9,4 +9,4 @@ Our cockatoo was one of the that ever learned to mimic a human voice. --- -Hey #box(baseline: 40%, image("/files/tiger.jpg", width: 1.5cm)) there! +Hey #box(baseline: 40%, image("/assets/images/tiger.jpg", width: 1.5cm)) there! diff --git a/tests/typ/text/linebreak-obj.typ b/tests/typ/text/linebreak-obj.typ index 50254df10..ebf55f155 100644 --- a/tests/typ/text/linebreak-obj.typ +++ b/tests/typ/text/linebreak-obj.typ @@ -7,7 +7,7 @@ They can look for the details in @netwok, which is the authoritative source. -#bibliography("/files/works.bib") +#bibliography("/assets/bib/works.bib") --- // Test punctuation after math equations. diff --git a/tests/typ/text/quote.typ b/tests/typ/text/quote.typ index 0fd96ff58..1573438cf 100644 --- a/tests/typ/text/quote.typ +++ b/tests/typ/text/quote.typ @@ -30,7 +30,7 @@ And I quote: #quote(attribution: [René Descartes])[cogito, ergo sum]. #quote(attribution: )[In a hole in the ground there lived a hobbit.] #set text(0pt) -#bibliography("/files/works.bib") +#bibliography("/assets/bib/works.bib") --- // Citation-format: label or numeric @@ -39,7 +39,7 @@ And I quote: #quote(attribution: [René Descartes])[cogito, ergo sum]. #quote(attribution: )[In a hole in the ground there lived a hobbit.] #set text(0pt) -#bibliography("/files/works.bib", style: "ieee") +#bibliography("/assets/bib/works.bib", style: "ieee") --- // Citation-format: note @@ -48,7 +48,7 @@ And I quote: #quote(attribution: [René Descartes])[cogito, ergo sum]. #quote(attribution: )[In a hole in the ground there lived a hobbit.] #set text(0pt) -#bibliography("/files/works.bib", style: "chicago-notes") +#bibliography("/assets/bib/works.bib", style: "chicago-notes") --- // Citation-format: author-date or author @@ -57,4 +57,4 @@ And I quote: #quote(attribution: [René Descartes])[cogito, ergo sum]. #quote(attribution: )[In a hole in the ground there lived a hobbit.] #set text(0pt) -#bibliography("/files/works.bib", style: "apa") +#bibliography("/assets/bib/works.bib", style: "apa") diff --git a/tests/typ/text/raw-syntaxes.typ b/tests/typ/text/raw-syntaxes.typ index 5863e648c..e6c46924b 100644 --- a/tests/typ/text/raw-syntaxes.typ +++ b/tests/typ/text/raw-syntaxes.typ @@ -3,7 +3,7 @@ --- #set page(width: 180pt) #set text(6pt) -#set raw(syntaxes: "/files/SExpressions.sublime-syntax") +#set raw(syntaxes: "/assets/syntaxes/SExpressions.sublime-syntax") ```sexp (defun factorial (x) diff --git a/tests/typ/text/raw-theme.typ b/tests/typ/text/raw-theme.typ index 71b59688b..d6cda221c 100644 --- a/tests/typ/text/raw-theme.typ +++ b/tests/typ/text/raw-theme.typ @@ -3,7 +3,7 @@ --- #set page(width: 180pt) #set text(6pt) -#set raw(theme: "/files/halcyon.tmTheme") +#set raw(theme: "/assets/themes/halcyon.tmTheme") #show raw: it => { set text(fill: rgb("a2aabc")) rect( diff --git a/tests/typ/text/shaping.typ b/tests/typ/text/shaping.typ index 3a8d54110..4a2b4f1e3 100644 --- a/tests/typ/text/shaping.typ +++ b/tests/typ/text/shaping.typ @@ -2,6 +2,7 @@ --- // Test separation by script. +#set text(font: ("Linux Libertine", "IBM Plex Sans Devanagari")) ABCअपार्टमेंट // This is how it should look like. @@ -13,12 +14,12 @@ ABCअपार्टमेंट --- // A forced `latn` script inhibits Devanagari font features. -#set text(script: "latn") +#set text(font: ("Linux Libertine", "IBM Plex Sans Devanagari"), script: "latn") ABCअपार्टमेंट --- // A forced `deva` script enables Devanagari font features. -#set text(script: "deva") +#set text(font: ("Linux Libertine", "IBM Plex Sans Devanagari"), script: "deva") ABCअपार्टमेंट --- diff --git a/tests/typ/visualize/image.typ b/tests/typ/visualize/image.typ index 0e256eb86..a7965b2de 100644 --- a/tests/typ/visualize/image.typ +++ b/tests/typ/visualize/image.typ @@ -4,24 +4,24 @@ // Test loading different image formats. // Load an RGBA PNG image. -#image("/files/rhino.png") +#image("/assets/images/rhino.png") // Load an RGB JPEG image. #set page(height: 60pt) -#image("../../files/tiger.jpg") +#image("../../assets/images/tiger.jpg") --- // Test configuring the size and fitting behaviour of images. // Set width and height explicitly. -#box(image("/files/rhino.png", width: 30pt)) -#box(image("/files/rhino.png", height: 30pt)) +#box(image("/assets/images/rhino.png", width: 30pt)) +#box(image("/assets/images/rhino.png", height: 30pt)) // Set width and height explicitly and force stretching. -#image("/files/monkey.svg", width: 100%, height: 20pt, fit: "stretch") +#image("/assets/images/monkey.svg", width: 100%, height: 20pt, fit: "stretch") // Make sure the bounding-box of the image is correct. -#align(bottom + right, image("/files/tiger.jpg", width: 40pt, alt: "A tiger")) +#align(bottom + right, image("/assets/images/tiger.jpg", width: 40pt, alt: "A tiger")) --- // Test all three fit modes. @@ -30,24 +30,24 @@ columns: (1fr, 1fr, 1fr), rows: 100%, gutter: 3pt, - image("/files/tiger.jpg", width: 100%, height: 100%, fit: "contain"), - image("/files/tiger.jpg", width: 100%, height: 100%, fit: "cover"), - image("/files/monkey.svg", width: 100%, height: 100%, fit: "stretch"), + image("/assets/images/tiger.jpg", width: 100%, height: 100%, fit: "contain"), + image("/assets/images/tiger.jpg", width: 100%, height: 100%, fit: "cover"), + image("/assets/images/monkey.svg", width: 100%, height: 100%, fit: "stretch"), ) --- // Does not fit to remaining height of page. #set page(height: 60pt) Stuff -#image("/files/rhino.png") +#image("/assets/images/rhino.png") --- // Test baseline. -A #box(image("/files/tiger.jpg", height: 1cm, width: 80%)) B +A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B --- // Test advanced SVG features. -#image("/files/pattern.svg") +#image("/assets/images/pattern.svg") --- // Error: 8-29 file not found (searched at typ/visualize/path/does/not/exist) @@ -58,8 +58,8 @@ A #box(image("/files/tiger.jpg", height: 1cm, width: 80%)) B #image("./image.typ") --- -// Error: 2-25 failed to parse SVG (found closing tag 'g' instead of 'style' in line 4) -#image("/files/bad.svg") +// Error: 2-33 failed to parse SVG (found closing tag 'g' instead of 'style' in line 4) +#image("/assets/images/bad.svg") --- // Test parsing from svg data @@ -71,12 +71,12 @@ A #box(image("/files/tiger.jpg", height: 1cm, width: 80%)) B --- // Test format auto detect -#image.decode(read("/files/tiger.jpg", encoding: none), width: 80%) +#image.decode(read("/assets/images/tiger.jpg", encoding: none), width: 80%) --- // Test format manual -#image.decode(read("/files/tiger.jpg", encoding: none), format: "jpg", width: 80%) +#image.decode(read("/assets/images/tiger.jpg", encoding: none), format: "jpg", width: 80%) --- -// Error: 2-83 failed to decode image (Format error decoding Png: Invalid PNG signature.) -#image.decode(read("/files/tiger.jpg", encoding: none), format: "png", width: 80%) +// Error: 2-91 failed to decode image (Format error decoding Png: Invalid PNG signature.) +#image.decode(read("/assets/images/tiger.jpg", encoding: none), format: "png", width: 80%) diff --git a/tests/typ/visualize/svg-text.typ b/tests/typ/visualize/svg-text.typ index 11283a76f..6f0a758e3 100644 --- a/tests/typ/visualize/svg-text.typ +++ b/tests/typ/visualize/svg-text.typ @@ -4,7 +4,7 @@ #set page(width: 250pt) #figure( - image("/files/diagram.svg"), + image("/assets/images/diagram.svg"), caption: [A textful diagram], ) @@ -13,6 +13,6 @@ #show image: set text(font: ("Roboto", "Noto Serif CJK SC")) #figure( - image("/files/chinese.svg"), + image("/assets/images/chinese.svg"), caption: [Bilingual text] )