Sort by - committed date
-
Language Server Protocol#Text Editor Currently, the most recommended LSP for editing Scraps is markdown-oxide. markdown-oxide supports the following editing environments: Neovim VSCode Zed Helix To match the current features provided by Scraps, place the following configuration file .moxide.toml under the scraps/ directory and open the scraps/ directory directly for a comfortable editing experience. heading_completions = false title_headings = false tags_in_codeblocks = false references_in_codeblocks = false We are considering a feature to generate the LSP configuration file during the init command.
-
Feature/Templates#Templates The template feature can be used by preparing Markdown files as templates under the templates/ directory, and it is implemented based on Tera, a template engine written in Rust. In templare feature of Scraps, you can mainly use Tera syntax and built-in functions. For more details, please refer to the Tera documentation. Scraps extension In addition to Tera’s syntax and built-ins, custom extensions can be implemented. Here are the custom extensions currently available in Scraps. Variables timezone You can use the timezone specified in Config.toml. {{ timezone }} As an example, use it as the timezone argument in the date filter. {{ now() | date(timezone=timezone) }} Please submit your extension requests to the Issue. Others For samples of templates using Tera, please refer to Scraps templates.
-
Feature/Search#Search Search index format Scraps can build a search index using the Fuse JSON schema as shown below. [ { "title": "Search", "url": "http://127.0.0.1:1112/scraps/search.html" }, { "title": "Overview", "url": "http://127.0.0.1:1112/scraps/overview.html" }, ... ] Search libraries Scraps content perform searches with fuse.js using an index. We are considering WASM solutions like tinysearch for future performance improvements in our deployment environment. Configuration If you are not using the search function, please modify your Config.toml as follows. See here for Configuration page. # Build a search index with the Fuse JSON and display search UI (optional, default=true, choices=true or false) build_search_index = false
-
GitHub-flavored Markdown#Markdown Syntax As an extension, GitHub-flavored Markdown is also supported. This includes features such as strikethrough, tables, and task lists. Strikethrough: Markdown ~~This text is strikethrough.~~ Result This text is strikethrough. Task Lists: Markdown - [x] Task 1 - [ ] Task 2 - [ ] Task 3 Result Task 1 Task 2 Task 3
-
Mermaid#Markdown Syntax By specifying mermaid as the language for a code block, you can use Mermaid diagrams. Markdown ```mermaid graph LR A --- B B-->C[fa:fa-ban forbidden] B-->D(fa:fa-spinner); ``` Result graph LR A --- B B-->C[fa:fa-ban forbidden] B-->D(fa:fa-spinner);
-
Internal link#Markdown Syntax 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.
-
CLI/Template#CLI #Templates ❯ scraps template This command generates the scrap file from the template of the Markdown files under the /templates directory. Step1. Prepare a template First, prepare a template file written in Markdown. The title of the template file will be the template name. The simplest example is a template that generates a daily note for today’s date. The title of the generated scrap can be specified with TOML metadata. +++ title = "{{ now() | date(timezone=timezone) }}" +++ For the features available in the template, please refer to Templates. Sample templates is here. You can check the templates added under /templates with the following command: ❯ scraps template list daily_note Step2. Generate a Scrap from the Template Specify the template name to generate a scrap. If the scrap title is not specified in the template metadata, the title option -t is required when executing the generate command. scraps template generate <TEMPLATE_NAME> -t <SCRAP_TITLE> Example: If metadata is specified in the template ❯ scraps template generate daily_note The metadata will be ignored from the generated scrap.
-
CLI/Tag#CLI ❯ scraps tag You can debug tag lists.
-
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
-
Scraps templates#Templates Daily note Utilizes Tera’s standard now() function, date filter, and Scraps’ custom timezone variable. +++ title = "{{ now() | date(timezone=timezone) }}" +++ Arguments by environment variables Using the get_env() function, you can write templates that customize arguments at the time of CLI execution. +++ title = "[Book] {{ get_env(name="TITLE", default="") }}" +++  }}) When execute generate TITLE="Test-Driven Development By Example" COVER="https://m.media-amazon.com/images/I/71I1GcjT-IL._SY522_.jpg" scraps template generate book