What is Scraps?
Scraps is a static site generator based on Markdown files written with simple Wiki-link notation, designed for personal and team knowledge management.
More details in here.
Getting Started
You can refer to the Getting Started document to quickly begin using Scraps.
Sample page in Japanese is here.
Sort by - committed date
-
Getting StartedSetup Begin with Installation of Scraps, then Init a new project and customize the Configuration to match your preferences. Content Creation Write Markdown files in the /scraps directory using CommonMark specification and GitHub-flavored Markdown. Enhance your content with Mermaid diagrams, Autolink functionality, and Internal Link connections between documents. Build and Deploy Use Build to generate static site files, Serve for local preview and debugging, then deploy to platforms like GitHub Pages.
-
What is Scraps?
-
Feature/Templates#Templates Generate scrap files from predefined Markdown templates for efficient content creation. Basic Usage Create template files in /templates directory Run generate scrap on command-line Template Syntax Templates use Tera template engine with TOML metadata: +++ title = "{{ now() | date(timezone=timezone) }}" +++ # Content goes here Available Variables timezone - Access Config.toml timezone setting All Tera built-in functions Examples See Sample templates for ready-to-use templates. For CLI commands, see Template.
-
Sample templates#Templates This document provides practical template samples that you can use immediately. Each sample includes detailed explanations and complete workflow examples. Daily Note Creates a daily note with today’s date as the title. This template utilizes Tera’s standard now() function, date filter, and Scraps’ custom timezone variable. Template file: /templates/daily_note.md +++ title = "{{ now() | date(timezone=timezone) }}" +++ # Daily Notes ## Today's Tasks - [ ] Usage: scraps template generate daily_note This generates a scrap with the current date as title (e.g., “2024-01-15”). Arguments by Environment Variables Using the get_env() function, you can write templates that customize arguments at the time of CLI execution. Template file: /templates/book.md +++ title = "[Book] {{ get_env(name="TITLE", default="") }}" +++  }}) Usage: TITLE="Test-Driven Development By Example" COVER="https://m.media-amazon.com/images/I/71I1GcjT-IL._SY522_.jpg" scraps template generate book
-
CLI/Template#CLI #Templates ❯ scraps template This command generates scrap files from Markdown templates located in the /templates directory. Commands List Templates ❯ scraps template list Lists all available templates in the /templates directory. Example output: daily_note book meeting project Generate Scrap from Template ❯ scraps template generate <TEMPLATE_NAME> [OPTIONS] Generates a scrap file from the specified template. Options: -t, --title <TITLE>: Specify the scrap title (required if not specified in template metadata) Examples: With metadata-specified title: ❯ scraps template generate daily_note With command-line title: ❯ scraps template generate meeting -t "Weekly Standup" With environment variables: ❯ TITLE="My Book Review" scraps template generate book References Template features and syntax: Templates Template samples: Sample templates
-
README File ProcessingIn Scraps, the scraps/README.md file is automatically converted to HTML and included in the static site’s top page ( public/index.html ). For Markdown syntax, please refer to Markdown Syntax. Limitations When using autolink syntax in scraps/README.md, the OGP card described in Autolink will not be displayed. URLs will be displayed as normal links. In: <https://example.com> Out: https://example.com
-
Context link#Internal Link #Markdown Syntax In cases where the same term exists in different contexts and Scrap titles would overlap, you can use the context feature by separating them with folders. For example: ❯ tree scraps scraps ├── DDD │ └── Service.md └── Kubernetes └── Service.md Links to Scrap with different contexts can be specified like [[DDD/Service]], [[Kubernetes/Service]]. You can also combine them with Alias link such as [[Kubernetes/Service|Kubernetes Service]]. The context is also displayed on the Scrap detail page in the static site. Not Recommended Scraps aims for simple knowledge management, so overuse of folders should be avoided. Use folders (Context) only in cases such as: When duplicate Scrap titles occur across different contexts When a Scrap has a strong association with a specific context
-
Tag link#Internal Link #Markdown Syntax If there is no scrap with the specified title, such as #Markdown Syntax, it becomes a tag. Tags are displayed on the index page. Each tag links to a page that lists all scraps using that tag.
-
Normal link#Markdown Syntax #Internal Link Specifying the name of the markdown file with a notation such as [[Link]] will generate a wiki-like internal link. For example, if you have the following set of files. ❯ tree scraps scraps ├── Overview.md └── Usage.md Fill in the file name in the scraps directory in Overview.md as follows to generate the link. See [[Usage]] for detail.
-
Alias link#Internal Link #Markdown Syntax Internal links allow you to use different display text as aliases. Writing [[Markdown Syntax|here]] creates a link that displays as here but links to the “Markdown Syntax” page.