Sort by - committed date
-
What is Scraps?
-
Getting StartedInstallation of Scraps. Init project. Edit the Configuration. Write Markdown files under the /scraps directory: Basic Markdown: CommonMark specification Extended features: GitHub-flavored Markdown Linking: Internal link, Context link, Tag link Build static site files. Serve the site for debugging. Deploy the site, for example using GitHub Pages.
-
ConfigurationConfiguration 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 pagination) paginate_by = 20
-
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.
-
InstallationYou can find the latest version on GitHub Releases. Requirements The git command is required for features. Cargo ❯ cargo install scraps macOS ❯ brew install boykush/tap/scraps
-
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. Use this command to check how your site looks and functions before deployment.
-
CLI/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 └── What is Scraps?.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 ├── what-is-scraps.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. After building, use Serve to preview your site locally.
-
CLI/Init#CLI ❯ scraps init your-scraps-project ❯ cd your-scraps-project 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 After initializing the project, proceed to Build to generate your static site.
-
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
-
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.