Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

big-todo:0.2.0 #17

Merged
merged 4 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages/preview/big-todo-0.2.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

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 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.

For more information, please refer to <http://unlicense.org/>
35 changes: 35 additions & 0 deletions packages/preview/big-todo-0.2.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Big-TODO

Create clearly visible TODOs in your document, and add an outline to keep track of them.

## Usage

Import the package

```typst
import "@preview/big-todo:0.2.0": *
```

And use the `todo` function to create a TODO, and the put the `todo_outline` somewhere to keep track of them.

```typst
= Pirates

Pirates, a term often associated with seafaring outlaws, have left an indelible mark on world history. The term conjures images of Jolly Roger flags, eye patches, and treasure chests, but the reality of piracy is more complex and varied than its romanticized image suggests. Historically, pirates were motivated by wealth, adventure, or desperation and were not confined to the seas of the Caribbean but roamed the waters of the Mediterranean, the South China Sea, and the Atlantic Ocean. Pirate societies were notorious for their flouting of societal norms, and many pirate ships operated under democratic principles, offering crew members an equal share in the spoils and voting rights on important decisions. To get a better picture, it's worth looking into how the social structures onboard these pirate vessels contrasted with those on merchant or navy vessels of the same era. #todo([Research and provide more _detail_ on #underline[pirate ship] governance and societal norms ])

Pirates' influence on history extends beyond their shipboard societies, however. Many pirates played important roles in global trade, war, and politics, often acting as privateers for countries at war. At times, they acted as de facto naval forces, protecting their patron countries' interests or disrupting those of their enemies. During the Golden Age of Piracy, roughly from 1650 to 1720, pirates were a major force in the Atlantic and the Caribbean #todo("other seas?", inline: true), attacking the heavily laden ships of the Spanish Empire and others. They have also impacted popular culture, inspiring countless books, movies, and games. But their story is not finished. Modern-day piracy, especially off the coast of Somalia, has become a significant issue in international shipping.

#todo_outline
```

![Screenshot of above Example](screenshot.png "Screenshot of above Example")

The `todo` function has the follwin parameters and defaults:

| Parameter | Default | Type | Description |
| ------------ | ------- | ------- | ------------------------------------------------------------ |
| `body` | / | Content | Content of the todo |
| `inline` | false | Boolean | If true, the todo will be inline, otherwise it will be block |
| `big_text` | 40pt | Length | Size of the `! TODO !` text |
| `small_text` | 15pt | Length | Size of the content |
| `gap` | 2mm | Length | Gap between the `! TODO !` text and the content |
32 changes: 32 additions & 0 deletions packages/preview/big-todo-0.2.0/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//Function to insert TODO
#let todo(body, inline: false, big_text: 40pt, small_text: 15pt, gap: 2mm) = {
if inline {
set text(fill: red, size: small_text, weight: "bold")
box([TODO: #body
#place()[
#set text(size: 0pt)
#figure(kind: "todo", supplement: "", caption: body, [])
]])
}
else {
set text(size: 0pt) //to hide default figure text, figures is only used for outline as only headings and figures can used for outlining at this point
figure(kind: "todo", supplement: "", outlined: true, caption: body)[
#block()[
#set text(fill: red, size: big_text, weight: "bold")
! TODO !
]
#v(gap)
#block[
#set text(fill: red, size: small_text, weight: "bold")
#body
]
#v(gap)
]
}
}

//Function to insert TODOs outline
#let todo_outline = outline(
title: [TODOs],
target: figure.where(kind: "todo")
)
Binary file added packages/preview/big-todo-0.2.0/screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions packages/preview/big-todo-0.2.0/typst.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "big-todo"
version = "0.2.0"
entrypoint = "lib.typ"
authors = ["Raik Rohde"]
license = "Unlicense"
description = "Package to insert clear TODOs. Optionallay with an outline."
Sett17 marked this conversation as resolved.
Show resolved Hide resolved