From db54d3037a63e1f7f2c674b7134b3ffa439c4b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20d=27Herbais=20de=20Thun?= Date: Tue, 5 Aug 2025 22:21:52 +0000 Subject: [PATCH 1/2] codly:1.3.1 --- packages/preview/codly/1.3.1/.gitignore | 8 + packages/preview/codly/1.3.1/LICENSE | 21 + packages/preview/codly/1.3.1/README.md | 239 + .../codly/1.3.1/assets/annotations.png | Bin 0 -> 124096 bytes .../codly/1.3.1/assets/codly-disable.png | Bin 0 -> 112483 bytes .../codly/1.3.1/assets/codly-offset.png | Bin 0 -> 87339 bytes .../codly/1.3.1/assets/codly-range.png | Bin 0 -> 65454 bytes packages/preview/codly/1.3.1/assets/crab.png | Bin 0 -> 51071 bytes packages/preview/codly/1.3.1/assets/demo.png | Bin 0 -> 50894 bytes .../codly/1.3.1/assets/highlight-ref.png | Bin 0 -> 118741 bytes .../preview/codly/1.3.1/assets/highlights.png | Bin 0 -> 114164 bytes .../preview/codly/1.3.1/assets/line-ref.png | Bin 0 -> 122346 bytes .../codly/1.3.1/assets/offset-from.png | Bin 0 -> 108539 bytes .../codly/1.3.1/assets/smart-indent.png | Bin 0 -> 216659 bytes .../codly/1.3.1/bench/test-codly-12/main.typ | 14007 ++++++++++++++++ .../1.3.1/bench/test-codly-main/main.typ | 14007 ++++++++++++++++ packages/preview/codly/1.3.1/codly.typ | 607 + packages/preview/codly/1.3.1/docs.pdf | Bin 0 -> 1209126 bytes packages/preview/codly/1.3.1/src/args.json | 460 + packages/preview/codly/1.3.1/src/args.typ | 129 + packages/preview/codly/1.3.1/src/lib.typ | 2161 +++ .../preview/codly/1.3.1/src/typst-small.png | Bin 0 -> 482 bytes packages/preview/codly/1.3.1/typst.toml | 13 + 23 files changed, 31652 insertions(+) create mode 100644 packages/preview/codly/1.3.1/.gitignore create mode 100644 packages/preview/codly/1.3.1/LICENSE create mode 100644 packages/preview/codly/1.3.1/README.md create mode 100644 packages/preview/codly/1.3.1/assets/annotations.png create mode 100644 packages/preview/codly/1.3.1/assets/codly-disable.png create mode 100644 packages/preview/codly/1.3.1/assets/codly-offset.png create mode 100644 packages/preview/codly/1.3.1/assets/codly-range.png create mode 100644 packages/preview/codly/1.3.1/assets/crab.png create mode 100644 packages/preview/codly/1.3.1/assets/demo.png create mode 100644 packages/preview/codly/1.3.1/assets/highlight-ref.png create mode 100644 packages/preview/codly/1.3.1/assets/highlights.png create mode 100644 packages/preview/codly/1.3.1/assets/line-ref.png create mode 100644 packages/preview/codly/1.3.1/assets/offset-from.png create mode 100644 packages/preview/codly/1.3.1/assets/smart-indent.png create mode 100644 packages/preview/codly/1.3.1/bench/test-codly-12/main.typ create mode 100644 packages/preview/codly/1.3.1/bench/test-codly-main/main.typ create mode 100644 packages/preview/codly/1.3.1/codly.typ create mode 100644 packages/preview/codly/1.3.1/docs.pdf create mode 100644 packages/preview/codly/1.3.1/src/args.json create mode 100644 packages/preview/codly/1.3.1/src/args.typ create mode 100644 packages/preview/codly/1.3.1/src/lib.typ create mode 100644 packages/preview/codly/1.3.1/src/typst-small.png create mode 100644 packages/preview/codly/1.3.1/typst.toml diff --git a/packages/preview/codly/1.3.1/.gitignore b/packages/preview/codly/1.3.1/.gitignore new file mode 100644 index 0000000000..77cfdcc281 --- /dev/null +++ b/packages/preview/codly/1.3.1/.gitignore @@ -0,0 +1,8 @@ +# added by typst-test +tests/*/out/** +tests/*/diff/** +test*.png +record-*.json +_*@bench/ +report/ +.DS_STORE \ No newline at end of file diff --git a/packages/preview/codly/1.3.1/LICENSE b/packages/preview/codly/1.3.1/LICENSE new file mode 100644 index 0000000000..f4687cbe64 --- /dev/null +++ b/packages/preview/codly/1.3.1/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) [2023] [Sébastien d'Herbais de Thun, et al.] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/preview/codly/1.3.1/README.md b/packages/preview/codly/1.3.1/README.md new file mode 100644 index 0000000000..cc8dc5234d --- /dev/null +++ b/packages/preview/codly/1.3.1/README.md @@ -0,0 +1,239 @@ +# Codly: simple yet beautiful and powerful code blocks + +

+ + Documentation + + + MIT License + + +

+ +Codly superchargescode blocks for your Typst documents. It allows you to add annotations, skip lines, customize numberings, add language icons, and much more. Codly is even better with its companion package [`codly-languages`](https://typst.app/universe/package/codly-languages) which provides a wide range of language icons and colors to choose from. + +A full set of documentation can be found [in the repo](https://raw.githubusercontent.com/Dherse/codly/main/docs.pdf). + +![Example](./assets/demo.png) + +````typ +#import "@preview/codly:1.3.1": * +#import "@preview/codly-languages:0.1.1": * +#show: codly-init.with() + +#codly(languages: codly-languages) +```rust +pub fn main() { + println!("Hello, world!"); +} +``` +```` + +### Setup + +To start using codly, you need to initialize codly using a show rule, this need only be done once per document: + +```typ +#show: codly-init.with() +``` + +Then you *can* configure codly with your parameters: + +```typ +#codly( + languages: ( + rust: (name: "Rust", icon: "🦀", color: rgb("#CE412B")), + ) +) +``` + +--- +**Note**: Any parameter that you leave blank will use the previous values (or the default value if never set) similar to a `set` rule in regular typst. But the changes are always global unless you use the provided `codly.local` function. To get a full list of all settings, see the [documentation](https://raw.githubusercontent.com/Dherse/codly/main/docs.pdf). + +--- + +Then you just need to add a code block and it will be automatically displayed correctly: + +```` +```rust +pub fn main() { + println!("Hello, world!"); +} +``` +```` + +![Crab](./assets/crab.png) + +### Disabling & Enabling + +To locally disable codly, you can just do the following, you can then later re-enable it using the `codly` configuration function. + +```typ +#codly-disable() +``` + +![codly-disable](./assets/codly-disable.png) + +Alternatively, you can use the `no-codly` function to achieve the same effect locally: + +````typ +#no-codly[ + ```typ + I will be displayed using the normal raw blocks. + ``` +] +```` + +### Smart indentation + +By default Codly ships with `smart-indent` enabled, this means that Codly will automatically detect the indentation of your code block and adjust the horizontal offset on line wrapping accordingly. This can be disabled using the `smart-indent` parameter. + +```typ +#codly(smart-indent: false) +``` + +![smart-ident](./assets/smart-indent.png) + +### Referencing code blocks + +Codly offers a wide range of features for referencing code blocks, lines, highlights, and annotations. This is done using: +- the line shorthand `@