Skip to content

Commit

Permalink
[maintenance] small fixes and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Mc-Zen committed May 13, 2024
1 parent 77c00d3 commit d490b60
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 38 deletions.
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@
# Tidy
*Keep it tidy.*

<p>
<a href="https://typst.app/docs/packages/">
<img alt="Typst Package" src="https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FMc-Zen%2Ftidy%2Fmain%2Ftypst.toml&query=%24.package.version&prefix=v&logo=typst&label=package&color=239DAD"/>
</a>
<!-- <a href="https://github.com/Mc-Zen/tidy/actions/workflows/run_tests.yml">
<img alt="Test Status" src="https://github.com/Mc-Zen/tidy/actions/workflows/run_tests.yml/badge.svg"/>
</a> -->
<a href="https://github.com/Mc-Zen/tidy/blob/main/LICENSE">
<img alt="MIT License" src="https://img.shields.io/badge/license-MIT-blue"/>
</a>
<a href="https://raw.githubusercontent.com/Mc-Zen/tidy/main/docs/tidy-guide.pdf" target="_blank">
<img alt="Typst Package" src="https://img.shields.io/badge/manual-.pdf-purple"/>
</a>
</p>
[![Typst Package](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FMc-Zen%2Ftidy%2Fmain%2Ftypst.toml&query=%24.package.version&prefix=v&logo=typst&label=package&color=239DAD)](https://typst.app/universe/package/tidy)
[![MIT License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/Mc-Zen/tidy/blob/main/LICENSE)
[![User Manual](https://img.shields.io/badge/manual-.pdf-purple)](https://raw.githubusercontent.com/Mc-Zen/tidy/main/docs/tidy-guide.pdf)


**tidy** is a package that generates documentation directly in [Typst](https://typst.app/) for your Typst modules. It parses docstring comments similar to javadoc and co. and can be used to easily build a beautiful reference section for the parsed module. Within the docstring you may use (almost) any Typst syntax − so markup, equations and even figures are no problem!

Expand All @@ -34,7 +24,7 @@ The [guide](./docs/tidy-guide.pdf) fully describes the usage of this module and

Using `tidy` is as simple as writing some docstrings and calling:
```typ
#import "@preview/tidy:0.2.0"
#import "@preview/tidy:0.3.0"
#let docs = tidy.parse-module(read("my-module.typ"))
#tidy.show-module(docs, style: tidy.styles.default)
Expand Down
22 changes: 0 additions & 22 deletions docs/tidy-guide.typ
Original file line number Diff line number Diff line change
Expand Up @@ -423,25 +423,3 @@ Let us now "self-document" this package:
omit-private-definitions: true
)
}
= End
#tidy.help("show-module()")
#tidy.help("parse-module()")
#tidy.help("parse-module(label-prefix)")
#pagebreak()
#disable-codly()
#import "/examples/sincx.typ"
#let docs = tidy.parse-module(
read("/examples/sincx.typ"),
scope: (sincx: sincx),
preamble: "#import sincx: *;"
)
#set heading(numbering: none)
#block(width: 10cm, tidy.show-module(docs, show-outline: false))
22 changes: 22 additions & 0 deletions examples/example.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#import "wiggly.typ"
// #import "@preview/tidy:0.1.0":*
#import "/src/tidy.typ":*

#set text(size: 10pt, font: "Calibri")

#show heading.where(level: 1): set text(size: 3em)
#show heading.where(level: 2): set text(size: 2em)
// #show heading.where(level: 3): underline
#show heading.where(level: 3): set text(size: 1.5em, font: "Cascadia Mono")
#show heading.where(level: 3): block.with(below: 2em)
#show heading.where(level: 4): set text(size: 1.3em)
#show heading.where(level: 5): set text(size: 1.2em, font: "Cascadia Mono")

#let docs = parse-module(
read("wiggly.typ"),
name: "wiggly",
scope: (wiggly: wiggly)
)
#show-module(docs, style: styles.default)


2 changes: 1 addition & 1 deletion src/helping.typ
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
/// or suggestions regarding this style.
/// - package-name (string): The name of the package. This is required to give helpful
/// error messages when a symbol cannot be found.
/// - onerror (function): What to do with errors. By default, an assertation is failed.
/// - onerror (function): What to do with errors. By default, an assertion is failed (the document panics).
#let generate-help(
namespace: (".": () => ""),
package-name: "",
Expand Down

0 comments on commit d490b60

Please sign in to comment.