Scraps is a portable CLI knowledge hub for managing interconnected Markdown documentation with Wiki-link notation.
Learn more: What is Scraps?
Documentation
This documentation follows the Diátaxis framework:
- Tutorials - Learn Scraps: Getting Started
- How-to Guides - Solve problems: Deploy to GitHub Pages, Setup LSP, Use Templates
- Reference - Look up details: Build, Configuration, Normal Link
- Explanation - Understand concepts: What is Scraps?, Search Architecture
Browse by topic: #CLI #Wiki-Links #Markdown
Sort by - committed date
-
Reference/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. Examples # List available templates ❯ scraps template list # Generate from template with metadata-specified title ❯ scraps template generate daily_note # Generate with command-line title ❯ scraps template generate meeting -t "Weekly Standup" # Generate with environment variables ❯ TITLE="My Book Review" scraps template generate book References Template features and syntax: Template System Template samples: Use Templates
-
Reference/Color Scheme
-
Reference/Build#CLI ❯ scraps build This command processes Markdown files from the /scraps directory and generates a static website. Source Structure ❯ tree scraps scraps ├── Getting Started.md └── Documentation.md Generated Files The command generates the following files in the public directory: ❯ tree public public ├── index.html # Main page with scrap list ├── getting-started.html ├── documentation.html ├── main.css # Styling for the site └── search.json # Search index (if enabled) Each Markdown file is converted to a slugified HTML file. Additional files like index.html and main.css are generated to create a complete static website. Examples # Basic build ❯ scraps build # Build with verbose output ❯ scraps build --verbose # Build from specific directory ❯ scraps build --path /path/to/project After building, use Serve to preview your site locally.
-
Explanation/README Processing#Markdown In 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 CommonMark. 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
-
Reference/Mermaid#Markdown By specifying mermaid as the language for a code block, you can use Mermaid diagrams. Example In: ```mermaid graph LR A --- B B-->C[fa:fa-ban forbidden] B-->D(fa:fa-spinner); ``` Out: graph LR A --- B B-->C[fa:fa-ban forbidden] B-->D(fa:fa-spinner);
-
Reference/CommonMark#Markdown Scraps supports Markdown syntax according to the CommonMark specification. Please refer to the documentation of the pulldown-cmark library used internally for more details. CommonMark specification - pulldown-cmark guide Example In: # Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 Out: Heading 1 Heading 2 Heading 3 Heading 4
-
Reference/GitHub-flavored Markdown#Markdown As an extension, GitHub-flavored Markdown is also supported. This includes features such as strikethrough, tables, and task lists. Example Strikethrough In: ~~This text is strikethrough.~~ Out: This text is strikethrough. Task Lists In: - [x] Task 1 - [ ] Task 2 - [ ] Task 3 Out: Task 1 Task 2 Task 3
-
Reference/Autolink#Markdown In Scraps, when you write using Markdown’s autolink syntax, it automatically fetches OGP data and displays it as a card. Example In: <https://github.com/boykush/scraps> Out: https://github.com/boykush/scraps
-
Explanation/What is Scraps?
-
How-to/Use 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