Sort by - committed date
-
Serve
#CLI ❯ scraps serve You can debug the build outputs by visiting http://127.0.0.1:1112
-
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.
-
Build
#CLI ❯ scraps build This command builds the Markdown files under the /scraps directory and generates static site files. Markdown files ❯ tree scraps scraps ├── Overview.md └── Markdown Syntax.md Generated files The output will be a slugged html file as follows. ❯ tree public public ├── overview.html ├── markdown-syntax.html ├── index.html └── main.css The next step is Serve.
-
Init
#CLI ❯ scraps init your-scraps-project ❯ cd your-scraps-project This command initializes a new Scraps project. The output result will look like this. ❯ tree -a -L 1 . ├── .gitignore ├── Config.toml └── scraps The next step is Build.
-
Getting Started
-
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.
-
Configuration
Configuration is managed by Config.toml in the Scraps project. Only the base_url and title variables are required. Everything else is optional. All configuration variables used by Scraps and their default values are listed below. # The site base url base_url = "https://username.github.io/repository-name/" # The site title title = "" # The site language (compliant with iso639-1, default=en) lang_code = "en" # The site description (optional) description = "" # The site favicon in the form of png file URL (optional) favicon = "" # The site timezone (optional, default=UTC) timezone = "UTC" # The site color scheme (optional, default=os_setting, choices=os_setting or only_light or only_dark) color_scheme = "os_setting" # Build a search index with the Fuse JSON and display search UI (optional, default=true, choices=true or false) build_search_index = true # Scraps sort key choice on index page (optional, default=committed_date, choices=committed_date or linked_count) sort_key = "committed_date" # Scraps pagination on index page(optional, default=no paginsation) paginate_by = 20
-
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
-
Installation
You can find the latest version on GitHub Releases. Requires git command is required for features. cargo ❯ cargo install scraps mac OS ❯ brew install boykush/tap/scraps
-
Color Scheme