Sort by - committed date
-
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
-
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
-
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.
-
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.
-
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
-
Autolink#Markdown Syntax 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
-
CommonMark specification#Markdown Syntax 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