-
Notifications
You must be signed in to change notification settings - Fork 729
sheen-id:0.1.0 #3169
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
Open
fepfitra
wants to merge
15
commits into
typst:main
Choose a base branch
from
fepfitra:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
sheen-id:0.1.0 #3169
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9b36731
sheen-id:0.1.0
fepfitra 1fb9e25
Merge branch 'typst:main' into main
fepfitra 7fd1b6c
sheen-id: add readme
fepfitra 203a3b5
sheen-id: add license
fepfitra 8d80619
sheen-id: fix file-missing package-check
fepfitra 3f677c3
sheen-id: fix warning kebab-case
fepfitra 7758e2a
sheen-id: add thumbnail
fepfitra 7e9726e
sheen-id: add manifest category
fepfitra af42cde
sheen-id: bigger thumbnail
fepfitra d0b78a5
sheen-id: exclude chapter-colored.png
fepfitra 8fb4942
sheen-id: fix table fail override
fepfitra 7440949
sheen-id: fix table text size
fepfitra 9ca63ff
sheen-id: fix table inset
fepfitra 0dd6086
sheen-id: fix redundant
fepfitra f05f9e2
Merge branch 'typst:main' into main
fepfitra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
MIT License | ||
|
||
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
# Sheen ID - Typst Book Template | ||
|
||
A flexible and feature-rich Typst template designed for creating books. It provides a structured set of functions to handle covers, title pages, tables of contents, headers, footers, and chapter styling. | ||
|
||
## Features | ||
|
||
- **Customizable Configuration**: Easily change the theme color, page margins, and fonts. | ||
- **Automated Covers**: Generate full-page color and grayscale covers from an image. | ||
- **Structured Content**: Functions for creating a title page, table of contents, list of figures, and list of equations. | ||
- **Dynamic Headers & Footers**: Automatically populates with the book title and chapter titles. | ||
- **Styled Chapter Pages**: A dedicated function to create beautiful chapter introduction pages with an image and learning objectives. | ||
- **Pre-styled Elements**: Comes with clean, pre-defined styles for figures, tables, code blocks, math equations, and lists. | ||
- **Helper Utilities**: Includes a `noindent` function to easily manage paragraph indentation. | ||
|
||
----- | ||
|
||
## Quick Start | ||
|
||
To use this template, import the `sheen-id` package and use its functions to structure your document. | ||
|
||
**`main.typ`** | ||
|
||
```typst | ||
// 1. Import all functions from the sheen-id package | ||
#import "@preview/sheen-id:0.1.0": * | ||
|
||
// 2. Apply the main configuration | ||
#show: doc => conf( | ||
color: green, // Set the theme color | ||
doc | ||
) | ||
|
||
// 3. Set global images (optional) | ||
#set-chapter-image("path/to/chapter-default.png") | ||
#set-cover("path/to/cover-image.png") | ||
|
||
// 4. Create front matter | ||
#make-cover() // or #make-gray-cover() | ||
#make-title( | ||
title: [My Awesome Book], | ||
author: [Your Name], | ||
gap: 4.5in // Optional vertical space | ||
) | ||
|
||
// 5. Apply headers and footers to the rest of the document | ||
#show: doc => make-header-footer(doc) | ||
|
||
// 6. Generate tables of contents | ||
#make-toc() // Table of Contents | ||
#make-toi() // Table of Images (Figures) | ||
#make-toe() // Table of Equations | ||
|
||
// 7. Apply main paragraph styling for the body | ||
#show: doc => make-paragraph(doc) | ||
|
||
// 8. Write your content | ||
#include "chapters/chapter1.typ" | ||
#include "chapters/chapter2.typ" | ||
// ... and so on | ||
``` | ||
|
||
**`chapters/chapter1.typ`** | ||
|
||
```typst | ||
// Import all functions from the sheen-id package | ||
#import "@preview/sheen-id:0.1.0": * | ||
|
||
#chapter( | ||
title: [Introduction to Topic], | ||
objectives: [ | ||
- Understand the basics. | ||
- Learn key concepts. | ||
- Prepare for the next chapter. | ||
] | ||
) | ||
|
||
== My First Section | ||
|
||
Here is the main content of the chapter... | ||
``` | ||
|
||
----- | ||
|
||
## API Reference | ||
|
||
### Configuration | ||
|
||
`#conf(color: blue, doc)` | ||
The main show rule to apply document-wide settings. | ||
|
||
- `color`: Sets the primary theme color for elements like headings and boxes. | ||
- `doc`: The document body to apply the settings to. | ||
|
||
----- | ||
|
||
### Page Setup Functions | ||
|
||
`#set-cover(path)` | ||
Sets the image to be used by `make-cover()` and `make-gray-cover()`. | ||
|
||
- `path`: A string path to your cover image. | ||
|
||
`#set-chapter-image(path)` | ||
Sets the default image used on chapter introduction pages created with `chapter()`. | ||
|
||
- `path`: A string path to the chapter image. | ||
|
||
`#make-cover()` | ||
Creates a full-page, full-color cover using the image set by `set-cover()`. | ||
|
||
`#make-gray-cover()` | ||
Creates a full-page, grayscale version of the cover. | ||
|
||
`#make-title(title:, author:, gap: 5in)` | ||
Generates a text-based title page. | ||
|
||
- `title`: The title of the book. | ||
- `author`: The author's name. | ||
- `gap`: (Optional) The amount of vertical space between the title and author. | ||
|
||
`#make-header-footer(img-path: none, doc)` | ||
A show rule that applies headers and footers to the `doc`. | ||
|
||
- `img-path`: (Optional) A path to a small image to display in the footer. | ||
- `doc`: The document body. | ||
|
||
----- | ||
|
||
### Outline Functions | ||
|
||
`#make-toc()` | ||
Generates a "Table of Contents" page. | ||
|
||
`#make-toi()` | ||
Generates a "List of Figures" page. | ||
|
||
`#make-toe()` | ||
Generates a "List of Equations" page. | ||
|
||
----- | ||
|
||
### Content Functions | ||
|
||
`#make-paragraph(doc)` | ||
A show rule that applies the main body styling (justification, indentation, etc.) to the `doc`. | ||
|
||
`#chapter(title:, objectives:)` | ||
Creates a styled chapter introduction page. Best used at the start of an included chapter file. | ||
|
||
- `title`: The title for the chapter. | ||
- `objectives`: Content (usually a list) detailing the chapter's learning goals. | ||
|
||
`#noindent(content)` | ||
A helper function to wrap content that should not have a first-line indent. | ||
|
||
----- | ||
|
||
## Dependencies | ||
|
||
This template relies on the following external Typst packages, which will be fetched automatically when you compile your document: | ||
|
||
- `@preview/i-figured:0.2.4` | ||
- `@preview/grayness:0.3.0` | ||
- `@preview/hydra:0.6.2` | ||
- `@preview/showybox:2.0.4` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the paths here won't work properly (even with the use of
context
), because paths are package scoped. Instead a common approach is to accept the content here directly, so users would have to passimage("<path>")
instead. This also makes the template more flexible, since any kind of content can be used.