Code Monkey home page Code Monkey logo

hydra's Introduction

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.

Some of hydra's features rely on the size of the top-margin, if you use a different page size than a4 or a custom top margin for your pages, make sure to configure hydra, otherwise those cheks may not work.

Example

#import "@preview/hydra:0.3.0": hydra

#set page(header: hydra() + line(length: 100%))
#set heading(numbering: "1.1")
#show heading.where(level: 1): it => pagebreak(weak: true) + it

= Introduction
#lorem(750)

= Content
== First Section
#lorem(500)
== Second Section
#lorem(250)
== Third Section
#lorem(500)

= Annex
#lorem(10)

ex1 ex2 ex3 ex4 ex5

Documentation

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

Contribution

Testing

This package serves as my real-world test for typst-test, it is not required for contributions, but encouraged as it speeds up the review process.

Other than that tests can be run using the following command structure for each test:

test=...
typst --root . "tests/typ/${test}.typ" "tests/out/${test}/{n}.png"
# some command to compare images in tests/ref/${test} and tests/out/${test}

Examples and manual

Furthermore, I use just and nushell to run common commands. It's once again not required, as I'll generate those myself if you don't on a PR, but if you already use both you can run the example and manual generation using just gen.

hydra's People

Contributors

tingerrr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.