Sort by - committed date
-
CLI/Serve#CLI ❯ scraps serve This command starts a local development server to preview your static site. The server automatically serves the files from the public directory at http://127.0.0.1:1112. Examples # Basic serve ❯ scraps serve # Serve from specific directory ❯ scraps serve --path /path/to/project Use this command to check how your site looks and functions before deployment.
-
CLI/Tag#CLI ❯ scraps tag This command lists all tags found in your Scraps content, helping you understand the tag distribution across your knowledge base. Examples # List all tags ❯ scraps tag # List tags from specific directory ❯ scraps tag --path /path/to/project
-
CLI/Search#CLI ❯ scraps search <QUERY> This command searches through your Scraps content using fuzzy matching to find relevant information across your knowledge base. Examples # Basic search ❯ scraps search "markdown" # Limit results to 10 ❯ scraps search "documentation" --num 10 The search uses fuzzy matching across file names, content, and Wiki-link references, displaying results ranked by relevance.
-
CLI/Init#CLI ❯ scraps init <PROJECT_NAME> This command initializes a new Scraps project. It creates the following structure: ❯ tree -a -L 1 . ├── .gitignore # Git ignore patterns for Scraps projects ├── Config.toml # Project configuration file └── scraps # Directory for your Markdown files Examples # Initialize new project ❯ scraps init my-knowledge-base ❯ cd my-knowledge-base # Initialize with specific path ❯ scraps init docs --path /path/to/workspace After initializing the project, proceed to Build to generate your static site.
-
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
-
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
-
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.
-
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
-
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.
-
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.