Skip to content

Commit

Permalink
hydra:0.6.0 (#1753)
Browse files Browse the repository at this point in the history
  • Loading branch information
tingerrr authored Feb 19, 2025
1 parent 2c84952 commit 273c790
Show file tree
Hide file tree
Showing 13 changed files with 969 additions and 0 deletions.
84 changes: 84 additions & 0 deletions packages/preview/hydra/0.6.0/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# [unreleased](https://github.com/tingerrr/hydra/releases/tags/)

## Changed

## Fixed

---

# [v0.6.0](https://github.com/tingerrr/hydra/releases/tags/v0.6.0)

## Breaking Changes
- Removed `hydra.dir`
- Removed `hydra.binding`
- Bumped MSTV to `v0.12.0`

## Changed
- Renamed `context` to `hydra-context`
- Renamed `hydra-selector` to `full-selector`
- Renamed `sanitized-selector` to `hydra-selector`

---

# [v0.5.2](https://github.com/tingerrr/hydra/releases/tags/v0.5.2)
## Fixed
- Fixed a panic on the development version of typst caused by an outdated version of oxifmt

---

# [v0.5.1](https://github.com/tingerrr/hydra/releases/tags/v0.5.1)
## Fixed
- hydra no longer considers candidates on pages after the current page (https://github.com/tingerrr/hydra/pull/21)

---

# [v0.5.0](https://github.com/tingerrr/hydra/releases/tags/v0.5.0)
## Added
- `use-last` parameter on `hydra` for a more LaTeX style heading look up, thanks @freundTech!
- `hydra` now has a new `use-last` parameter
- `context` now has a new `use-last` field
- **BREAKING CHANGE** `candidates` now has a new `last` field containing a suitable match for the last primary candidate on this page

---

# [v0.4.0](https://github.com/tingerrr/hydra/releases/tags/v0.4.0)
Almost all changes in this release are **BREAKING CHANGES**.

## Added
- internal util functions and dictionaries for recreating `auto` fallbacks used within the typst
compiler
- `core.get-text-dir` - returns the text direction
- `core.get-binding` - returns the page binding
- `core.get-top-margin` - returns the absolute top margin
- `util.text-direction` - returns the text direction for a given language
- `util.page-binding` - returns the page binding for a given text direction

## Removed
- various parameters on `hydra` have been removed
- `paper` has been removed in favor of get rule
- `page-size` has been removed in favor of get rule
- `top-margin` has been removed in favor of get rule
- `loc` has been removed in favor of user provided context
- internal util dictionary for page sizes

## Changed
- hydra now requires a minimum Typst compiler version of `0.11.0`
- `hydra` is now contextual
- most internal functions are now contextual
- the internal context dictionary now holds a `anchor-loc` instead of a `loc`
- `get-anchor-pos` has been renamed to `locate-last-anchor`
- the internal `page-sizes` dictionary was changed to function
- various parameters on `hydra` are now auto by default
- `prev-filter`
- `next-filter`
- `display`
- `dir`
- `binding`

---

# [v0.3.0](https://github.com/tingerrr/hydra/releases/tags/v0.3.0)

# [v0.2.0](https://github.com/tingerrr/hydra/releases/tags/v0.2.0)

# [v0.1.0](https://github.com/tingerrr/hydra/releases/tags/v0.1.0)
21 changes: 21 additions & 0 deletions packages/preview/hydra/0.6.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 - 2025 tinger <tinger@tinger.dev>

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.
44 changes: 44 additions & 0 deletions packages/preview/hydra/0.6.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# hydra
Hydra is a Typst package allowing you to easily display the heading like elements anywhere in your
document. It's primary focus is to provide the reader with a reminder of where they currently are in
your document only when it is needed.

## Example
```typst
#import "@preview/hydra:0.6.0": hydra
#set page(paper: "a7", margin: (y: 4em), numbering: "1", header: context {
if calc.odd(here().page()) {
align(right, emph(hydra(1)))
} else {
align(left, emph(hydra(2)))
}
line(length: 100%)
})
#set heading(numbering: "1.1")
#show heading.where(level: 1): it => pagebreak(weak: true) + it
= Introduction
#lorem(50)
= Content
== First Section
#lorem(50)
== Second Section
#lorem(100)
```
![thumbnail]

## Documentation
For a more in-depth description of hydra's functionality and the reference read its [manual].

## Contribution
For contributing, please take a look [CONTRIBUTING][contrib].

## Etymology
The package name hydra /ˈhaɪdrə/ is a word play on headings and headers, inspired by the monster in
greek and roman mythology resembling a serpent with many heads.

[thumbnail]: assets/images/thumbnail.png
[manual]: assets/manual.pdf
[contrib]: CONTRIBUTING.md
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/preview/hydra/0.6.0/assets/manual.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions packages/preview/hydra/0.6.0/src/_pkgs.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#import "@preview/oxifmt:0.2.1"
Loading

0 comments on commit 273c790

Please sign in to comment.