Skip to content

Commit

Permalink
Small corrections in README.md and manual
Browse files Browse the repository at this point in the history
  • Loading branch information
tingerrr committed Mar 19, 2024
1 parent 9342b62 commit 1902f5a
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 11 deletions.
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ gen` to generate a new manual and examples.

The examples inside the docs currently don't make it easy to simplify this without generating them
manually the whole time. Typst is missing a feature or plugin that allows embedding whole other
typst documents at the moment.
Typst documents at the moment.

That being said, it's fine to leave this step out on a PR and have me generate it once the rest of
the PR is done.

[typst]: https://github.com/typst/typst
[typst-test]: https://github.com/tingerrr/typst-test
[just]: https://just.systems/
[nushell]: https://www.nushell.sh/
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# hydra
Hydra is a [typst] package allowing you to easily display the heading like elements anywhere in your
document. In short, it will show you the currently active element only when it is not visible.
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
Expand Down Expand Up @@ -34,8 +35,10 @@ For a more in-depth description of hydra's functionality and the reference read
## Contribution
For contributing, please take a look [CONTRIBUTING][contrib].

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

[ex]: examples/example.png
[manual]: doc/manual.pdf
[contrib]: CONTRIBUTING.md

[typst]: https://github.com/typst/typst
Binary file modified doc/manual.pdf
Binary file not shown.
5 changes: 2 additions & 3 deletions doc/manual.typ
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

#show: project.with(
package: package,
subtitle: [/ˈhaɪdrə/ \ Of headings and headers],
date: datetime.today(),
abstract: [
A package for querying and displaying heading-like elements.
],
abstract: package.description,
)

#[
Expand Down
6 changes: 4 additions & 2 deletions doc/template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
v(4em)

align(center, {
block(text(weight: 700, 1.75em, package.name))
block(text(weight: 700, 1.75em, eastern, package.name))
if subtitle != none {
block(subtitle)
}
Expand Down Expand Up @@ -56,7 +56,7 @@
show terms: set par(justify: false)
show raw.where(block: true): set par(justify: false)

// abstract
// outline
page({
show outline.entry: it => if it.level == 1 {
strong(it)
Expand Down Expand Up @@ -85,6 +85,8 @@
it
}

show link: set text(eastern)

set table(stroke: none)
show table: pad.with(x: 1em)

Expand Down
39 changes: 39 additions & 0 deletions tests/redundancy-block/test.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Synopsis:
// - both the first and second part of the document should give the same result
// - page 4 and 5 don't contain a header, just like 1 and 2 don't

#import "/src/lib.typ": hydra

#set page(header: context hydra())

#let inner = it => {
set text(2em, weight: "bold")
v(8em)
if it.numbering != none [
Chapter #counter(heading).display()
#v(.5em)
]
it.body
v(0.5em)
}

#[
#show heading.where(level: 1) : it => pagebreak(weak: true) + block(inner(it))
= First
#hide[.]

= Second
#hide[.]
#pagebreak()
#pagebreak()
]

#[
#show heading.where(level: 1) : it => pagebreak(weak: true) + inner(it)
= First Again
#hide[.]

= Second Again
#hide[.]
#pagebreak()
]

0 comments on commit 1902f5a

Please sign in to comment.