### Install Material for MkDocs Source: https://github.com/foambubble/foam/blob/main/docs/user/recipes/generate-material-for-mkdocs-site.md Installs the Material for MkDocs theme and necessary plugins using pip. Ensure your virtual environment is activated. ```bash pip install mkdocs-material ``` ```bash pip install mkdocs-roamlinks-plugin ``` ```bash pip install mkdocs-exclude ``` -------------------------------- ### Full Clean, Install, and Build with Yarn Source: https://github.com/foambubble/foam/blob/main/CLAUDE.md Performs a comprehensive cleanup, reinstalls dependencies, and builds all packages. Useful for resolving complex dependency issues or starting fresh. ```bash yarn reset ``` -------------------------------- ### Install Dependencies Source: https://github.com/foambubble/foam/blob/main/docs/dev/contribution-guide.md Install the necessary project dependencies using Yarn. Run this command from the root of the cloned repository. ```bash yarn install ``` -------------------------------- ### Foam CLI: Install and Basic Usage Source: https://context7.com/foambubble/foam/llms.txt Install the `foam-cli` globally using npm or run it directly with `npx`. All commands support `--format json` for scripting and `--workspace` or `FOAM_WORKSPACE` to specify the target workspace. ```bash # Install globally npm install -g foam-cli # or run without installing: npx foam-cli ``` -------------------------------- ### Foam CLI Quick Start Commands Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Navigate to your notes directory and use these commands to interact with your Foam workspace. ```bash cd /path/to/your/notes ``` ```bash # See available commands foam ``` ```bash # List all notes foam list notes ``` ```bash # Run lint foam lint ``` -------------------------------- ### List All Notes Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli/list.md Use this command to retrieve a list of all notes in your workspace. No specific setup is required beyond having Foam installed. ```bash foam list notes ``` -------------------------------- ### Initialize Jekyll Site Source: https://github.com/foambubble/foam/blob/main/docs/user/publishing/publish-to-github-pages.md Use this command to create a new Jekyll site in the current directory. Ensure you have Jekyll installed and have run `bundle`. ```bash bundle exec jekyll 3.9.0 new . ``` -------------------------------- ### Install Foam CLI Source: https://github.com/foambubble/foam/blob/main/docs/user/getting-started/installation.md Install the Foam Command Line Interface globally using npm. This allows you to manage your workspace from the terminal. ```bash npm install -g foam-cli ``` -------------------------------- ### Markdown Forward Links Example Source: https://github.com/foambubble/foam/blob/main/docs/user/features/backlinking.md Demonstrates how to create forward links to other notes using the `[[wikilink]]` syntax in Markdown. ```markdown # Machine Learning Note I'm studying [[Neural Networks]] and [[Deep Learning]] concepts. ``` -------------------------------- ### Quick Open Search Patterns Source: https://github.com/foambubble/foam/blob/main/docs/user/getting-started/get-started-with-vscode.md Examples of search patterns to use with the Quick Open command (Ctrl+P) for finding files. ```plaintext # Go to File (Ctrl+P) machine # Finds "machine-learning.md" proj alpha # Finds "project-alpha.md" daily/2025 # Finds files in daily/2025 folder ``` -------------------------------- ### Serve MkDocs Site Locally Source: https://github.com/foambubble/foam/blob/main/docs/user/recipes/generate-material-for-mkdocs-site.md Run this command in the root directory of your Foam workspace to start a local preview server for your Material for MkDocs site. The server automatically rebuilds your site as you make changes. ```bash mkdocs serve ``` -------------------------------- ### Search Notes with Foam CLI Source: https://context7.com/foambubble/foam/llms.txt Use 'foam search' to find notes containing specific text or matching tags and properties. No special setup is required beyond having the Foam CLI installed. ```bash foam search "meeting notes" ``` ```bash foam search --tag project --property status=draft ``` -------------------------------- ### Enable Automatic Daily Notes on Startup Source: https://github.com/foambubble/foam/blob/main/docs/user/features/daily-notes.md Configure VS Code to automatically open your daily note when the application starts. ```json { "foam.openDailyNote.onStartup": true } ``` -------------------------------- ### Basic Front-Matter Example Source: https://github.com/foambubble/foam/blob/main/docs/user/features/note-properties.md Define document type and keywords using YAML Front-Matter at the top of the file. Spaces and commas act as separators for keywords. ```markdown --- type: feature keywords: hello world, bonjour --- ``` -------------------------------- ### Install and Run Foam Janitor CLI Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/workspace-janitor.md Install the Foam CLI globally and then run the janitor command on your workspace. This is useful for command-line users or for integration into scripts. ```sh npm install -g foam-cli foam janitor path/to/workspace ``` -------------------------------- ### Foam CLI Note Command Examples Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Manage individual notes using the `note` command. This includes showing, creating, moving, and deleting notes, with options to include links, content, and properties. ```bash foam note show my-note ``` ```bash foam note show my-note --links # include incoming/outgoing links ``` ```bash foam note show my-note --content # print raw file content ``` ```bash foam note id my-note # print Foam identifier ``` ```bash foam note create --title "My Note" ``` ```bash foam note create --title "My Note" --dir subdir --property status=draft ``` ```bash foam note move my-note --to new-name.md ``` ```bash foam note delete my-note # moves to .foam/trash/ (prompts for confirmation) ``` ```bash foam note delete my-note --force # skip confirmation ``` ```bash foam note delete my-note --permanent # delete permanently ``` -------------------------------- ### Create and Open Daily Note with Scripting Source: https://context7.com/foambubble/foam/llms.txt This scripting example demonstrates how to create a daily note using the 'foam daily' command and then open it in the VS Code editor. The '--path-only' flag ensures only the path is returned, which is then piped to 'code'. ```bash PATH=$(foam daily --create --path-only) code "$PATH" ``` -------------------------------- ### Serve Jekyll Site Locally Source: https://github.com/foambubble/foam/blob/main/docs/user/publishing/publish-to-github-pages.md This command serves your Jekyll site locally, allowing you to preview it before publishing. It requires Jekyll to be installed and bundled. ```bash bundle exec jekyll serve ``` -------------------------------- ### Complex Resource Filter Example Source: https://github.com/foambubble/foam/blob/main/docs/user/features/resource-filters.md This example demonstrates a complex filter configuration for the Foam graph, combining multiple conditions using logical operators. ```json { "key": "alt+f", "command": "foam-vscode.show-graph", "args": { "filter": { "and": [ { "or": [ { "type": 'daily-note' }, { "type": 'weekly-note' }, { "path": '/projects/*' }, ], "not": { { "tag": '#b' }, }, }, ], } } } ``` -------------------------------- ### Test Setup and Teardown Best Practice Source: https://github.com/foambubble/foam/blob/main/CLAUDE.md Recommends setting up and tearing down tests within the test case itself for improved readability, unless using functions like `beforeEach` offers a significantly better approach. ```javascript To improve readability of the tests, set up the test and tear it down within the test case (as opposed to use other functions like `beforeEach` unless it's much better to do it that way) ``` -------------------------------- ### Bootstrap Foam Workspace with Node.js fs Source: https://context7.com/foambubble/foam/llms.txt Initializes a Foam workspace using a minimal IDataStore backed by Node.js's fs module. This example demonstrates setting up resource providers and the core Foam instance for a static load. ```typescript import { bootstrap, URI, createMarkdownParser, MarkdownResourceProvider, AttachmentResourceProvider, GenericDataStore, AlwaysIncludeMatcher, } from '@foam/core'; import { readFile, writeFile, readdir, unlink, rename, stat } from 'fs/promises'; import { join } from 'path'; // Minimal IDataStore backed by Node's fs const rootPath = '/path/to/my-notes'; const rootUri = URI.file(rootPath); const dataStore = { list: async () => { const walk = async (dir: string): Promise => { const entries = await readdir(dir, { withFileTypes: true }); const uris: URI[] = []; for (const e of entries) { const full = join(dir, e.name); if (e.isDirectory()) uris.push(...(await walk(full))); else uris.push(URI.file(full)); } return uris; }; return walk(rootPath); }, read: async (uri: URI) => { try { return await readFile(uri.toFsPath(), 'utf8'); } catch { return null; } }, write: async (uri: URI, content: string) => { await writeFile(uri.toFsPath(), content, 'utf8'); }, delete: async (uri: URI) => { await unlink(uri.toFsPath()); }, move: async (from: URI, to: URI) => { await rename(from.toFsPath(), to.toFsPath()); }, exists: async (uri: URI) => { try { await stat(uri.toFsPath()); return true; } catch { return false; } }, }; const parser = createMarkdownParser([]); const matcher = new AlwaysIncludeMatcher(); const mdProvider = new MarkdownResourceProvider(matcher, dataStore, parser); const attachProvider = new AttachmentResourceProvider(matcher, dataStore); const foam = await bootstrap( [rootUri], matcher, undefined, // no watcher — static load dataStore, parser, [mdProvider, attachProvider], '.md', 'info' ); console.log(`Loaded ${foam.workspace.list().length} resources`); console.log(`Graph has ${foam.graph.getAllConnections().length} connections`); foam.dispose(); ``` -------------------------------- ### Foam CLI Outline Command Examples Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Display the heading structure of a note using the `outline` command. You can specify the note by its identifier or path. ```bash foam outline my-note ``` ```bash foam outline --path path/to/note.md ``` -------------------------------- ### Foam CLI Already Up to Date Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli/update.md This output indicates that your installed `foam-cli` version is the latest available. No update is necessary. ```bash foam update # Current version: 0.42.0 # You are already on the latest version. ``` -------------------------------- ### Foam CLI List Command Examples Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md List various elements of your Foam workspace, including notes, tags, orphans, placeholders, dead-ends, and templates. Use filters like `--type`, `--tag`, and `--sort` for more specific results. ```bash foam list notes ``` ```bash foam list notes --type daily-note ``` ```bash foam list notes --tag project --tag active ``` ```bash foam list tags ``` ```bash foam list tags --sort count ``` ```bash foam list orphans ``` ```bash foam list deadends ``` ```bash foam list placeholders ``` ```bash foam list templates ``` -------------------------------- ### Foam CLI Daily Note Command Examples Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Access or create daily notes using the `daily` command. You can specify a date, create a note if it doesn't exist, or just print the resolved path. ```bash foam daily # today's note ``` ```bash foam daily --date 2025-01-15 ``` ```bash foam daily --create # create if it doesn't exist ``` ```bash foam daily --path-only # print resolved path only (for scripting) ``` -------------------------------- ### Open Named Graph View via Keybinding Source: https://github.com/foambubble/foam/blob/main/docs/user/features/graph-view.md Open a named view using a keybinding in `keybindings.json`. This example shows how to open the 'Journal' view. ```json { "key": "ctrl+shift+j", "command": "foam-vscode.show-graph", "args": { "view": "Journal" } } ``` -------------------------------- ### Foam CLI Links Command Examples Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md View the links associated with a note using the `links` command (alias `connections`). You can filter to show only outgoing or incoming links. ```bash foam links my-note ``` ```bash foam links my-note --outgoing ``` ```bash foam links my-note --incoming ``` -------------------------------- ### Daily Note Template with Dynamic Filepath Source: https://github.com/foambubble/foam/blob/main/docs/user/features/templates.md Use FOAM_DATE variables to organize daily notes by year and month. This example creates notes under 'journal/YEAR/MONTH-MONTH_NAME/'. ```markdown --- type: daily-note foam_template: description: Daily Note filepath: '/journal/$FOAM_DATE_YEAR/$FOAM_DATE_MONTH-$FOAM_DATE_MONTH_NAME_SHORT/$FOAM_DATE_YEAR-$FOAM_DATE_MONTH-$FOAM_DATE_DATE-daily-note.md' --- # $FOAM_DATE_YEAR-$FOAM_DATE_MONTH-$FOAM_DATE_DATE Daily Notes ``` -------------------------------- ### Foam CLI Search Command Examples Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Find notes based on various criteria like title, alias, tag, or frontmatter properties using the `search` command. Supports AND filtering for multiple tags. ```bash foam search "meeting notes" ``` ```bash foam search --tag project ``` ```bash foam search --tag project --tag active # AND filter ``` ```bash foam search --property status=draft ``` ```bash foam search --property status # has the property (any value) ``` ```bash foam search --type daily-note ``` -------------------------------- ### Foam CLI Grep Command Examples Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Search note content using regular expressions with the `grep` command. Options include adding context lines, limiting results, and disabling line numbers. ```bash foam grep "TODO" ``` ```bash foam grep "TODO" --context 2 ``` ```bash foam grep "TODO" --limit 50 ``` ```bash foam grep "TODO" --no-line-number ``` -------------------------------- ### Daily Note Template Example Source: https://github.com/foambubble/foam/blob/main/docs/user/features/templates.md This daily note template demonstrates how `FOAM_DATE_` variables correctly populate with relative dates (e.g., tomorrow's date) when using snippets like `/tomorrow`. ```markdown # $FOAM_DATE_YEAR-$FOAM_DATE_MONTH-$FOAM_DATE_DATE ## Here's what I'm going to do today - Thing 1 - Thing 2 ``` -------------------------------- ### Clone Foam Template Repository Source: https://github.com/foambubble/foam/blob/main/docs/user/getting-started/first-workspace.md Clone the Foam template repository to your local machine to start with a pre-configured workspace. Ensure you replace placeholders with your actual GitHub username and repository name. ```bash git clone https://github.com/yourusername/your-repo-name.git cd your-repo-name ``` -------------------------------- ### Foam CLI Tag Command Examples Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Manage tags within your Foam workspace using the `tag` command. You can list, search, and rename tags, with an option to force merge during renaming. ```bash foam tag list ``` ```bash foam tag search project ``` ```bash foam tag rename old-name new-name ``` ```bash foam tag rename old-name new-name --force # skip merge confirmation ``` -------------------------------- ### Foam CLI Lint Command Examples Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Check your workspace notes for issues using the `lint` command. Use `--fix` to automatically resolve issues or `--rule` to specify a particular rule. ```bash foam lint ``` ```bash foam lint --fix ``` ```bash foam lint --rule missing-heading ``` ```bash foam lint --rule stale-definitions ``` -------------------------------- ### Open Today's Daily Note in Editor Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli/daily.md This command opens today's daily note directly in your default editor. It first gets the path to the note (creating it if necessary) and then passes that path to the `$EDITOR` environment variable. ```bash $EDITOR $(foam daily --create --path-only) ``` -------------------------------- ### Count All Notes with Foam Query Source: https://github.com/foambubble/foam/blob/main/docs/user/features/foam-queries.md If no filter is specified, Foam searches all notes. This example shows how to get a count of all notes. ```foam-query format: count ``` -------------------------------- ### Build Project Source: https://github.com/foambubble/foam/blob/main/docs/dev/contribution-guide.md Build the entire project from the repository root. This command compiles the code and prepares it for development. ```bash yarn build ``` -------------------------------- ### Run Foam CLI without installing Source: https://github.com/foambubble/foam/blob/main/packages/foam-vscode/WHATS_NEW.md Use npx to run Foam CLI commands directly from your terminal without a global installation. ```bash # Run without installing npx foam-cli [options] ``` -------------------------------- ### Running foam-cli from source Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Build the foam-cli package from source and run commands directly using Node.js. This is useful for development and testing. ```bash # From the foam-cli package directory cd packages/foam-cli yarn build node out/index.js ``` -------------------------------- ### Markdown with Wikilinks Source: https://github.com/foambubble/foam/blob/main/docs/user/features/link-reference-definitions.md Example of a Markdown note containing wikilinks. ```markdown # Machine Learning Related to [[Data Science]] and [[Statistics]]. ``` -------------------------------- ### Atomic Note Example Source: https://github.com/foambubble/foam/blob/main/docs/user/getting-started/note-taking-in-foam.md Illustrates the principle of keeping notes focused on a single concept or idea. ```markdown # The Feynman Technique A learning method where you explain a concept in simple terms as if teaching it to someone else. ## Steps 1. Choose a topic to learn 2. Explain it in simple terms 3. Identify gaps in understanding 4. Simplify and use analogies ## Why It Works - Forces active engagement with material - Reveals knowledge gaps quickly - Improves retention through teaching Related: [[Active Learning]] [[Study Methods]] ``` -------------------------------- ### Get Foam Lint Results as JSON Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli/lint.md Outputs the linting results in JSON format, suitable for programmatic processing. ```bash foam lint --format json ``` -------------------------------- ### Foam CLI Usage and Global Options Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Understand the general syntax for Foam CLI commands and available global options like workspace and format. ```bash foam [options] Global options: --workspace Workspace root (default: FOAM_WORKSPACE env var, then cwd) --format Output format: text (default) or json --help Show help ``` -------------------------------- ### Create a note using a template and open if it exists Source: https://github.com/foambubble/foam/blob/main/docs/user/features/commands.md This configuration creates a note using a specified template. If the note already exists, it will be opened directly. The `templatePath` is resolved against the workspace root. ```json { "key": "alt+g", "command": "foam-vscode.create-note", "args": { "templatePath": ".foam/templates/weekly-note.md", "onFileExists": "open" } } ``` -------------------------------- ### Count Notes in a Specific Path Source: https://github.com/foambubble/foam/blob/main/docs/user/features/foam-queries.md Use `format: count` to get only the number of notes that match a given path filter. ```foam-query filter: path: "^/projects/" format: count ``` -------------------------------- ### Create New Note Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli/note.md Creates a new note, optionally specifying a title, directory, and frontmatter properties. Uses a template if available. ```bash foam note create [options] ``` ```bash foam note create --title "Meeting Notes" --dir meetings # Created: meetings/meeting-notes.md (id: meeting-notes) ``` -------------------------------- ### Open a resource with a title filter Source: https://github.com/foambubble/foam/blob/main/docs/user/features/commands.md This command opens a resource. It can accept a filter to find resources by title. If multiple matches are found, a quick pick menu will appear. ```json { "key": "alt+f", "command": "foam-vscode.open-resource", "args": { "filter": { "title": "Weekly Note*" } } } ``` -------------------------------- ### Watch Mode for Development with Yarn Source: https://github.com/foambubble/foam/blob/main/CLAUDE.md This command starts a watch process that automatically rebuilds packages when changes are detected. Ideal for active development. ```bash yarn watch ``` -------------------------------- ### Get Note Identifier Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli/note.md Prints the Foam identifier for a note, useful for resolving ambiguities. Target notes by identifier or exact file path. ```bash foam note id ( | --path ) ``` ```bash foam note id my-note # my-note ``` -------------------------------- ### Create a note with custom text and file existence handling Source: https://github.com/foambubble/foam/blob/main/docs/user/features/commands.md Use this to create a note with specific text and choose how to handle existing files. The `notePath` is resolved against the workspace root. The `onFileExists` option determines the behavior when the file already exists. ```json { "key": "alt+f", "command": "foam-vscode.create-note", "args": { "text": "test note ${FOAM_DATE_YEAR}", "notePath": "test note.md", "onFileExists": "ask" } } ``` -------------------------------- ### Build @foam/graph-view Workspace Source: https://github.com/foambubble/foam/blob/main/docs/dev/contribution-guide.md Build the graph visualization web component package. This command is specific to the '@foam/graph-view' workspace. ```bash yarn workspace @foam/graph-view build ``` -------------------------------- ### Get links as JSON Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli/links.md Formats the output as JSON, which is suitable for programmatic use in scripts or other applications. This allows for easier parsing of link data. ```bash foam links my-note --format json ``` -------------------------------- ### Alias foam CLI for convenience Source: https://github.com/foambubble/foam/blob/main/packages/foam-cli/README.md Create a shell alias to easily run the foam-cli from its source directory without needing to navigate or install it globally. ```bash alias foam="node /path/to/foam/packages/foam-cli/out/index.js" ``` -------------------------------- ### Build Gatsby Site Locally Source: https://github.com/foambubble/foam/blob/main/docs/user/publishing/generate-gatsby-site.md Run this command to build your Gatsby site locally before deployment. Ensure you are in the correct directory. ```bash cd _layouts npm run build ``` -------------------------------- ### List Available Templates Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli/list.md Display all note templates located in the `.foam/templates/` directory. This command is useful for quickly seeing available templates for new notes. ```bash foam list templates ``` -------------------------------- ### Foam CLI Output Formatting Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli.md Use the `--format json` option to get machine-readable output, which is particularly useful for scripting and automation tasks. ```bash foam --format json ``` -------------------------------- ### Define Wiki Home Page Source: https://github.com/foambubble/foam/blob/main/docs/user/publishing/publish-to-azure-devops-wiki.md Create a `.order` file in the root of your Foam workspace. The first line of this file, containing a document filename without the .md extension, specifies the wiki's home page. ```plaintext readme ``` -------------------------------- ### Get Note Outline as JSON Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli/outline.md Retrieves the outline of a note in JSON format, which includes line numbers. This is useful for programmatic processing of the note structure. ```bash foam outline my-note --format json ``` -------------------------------- ### Reset and Test Project Source: https://github.com/foambubble/foam/blob/main/docs/dev/releasing-foam.md Perform sanity checks by resetting the project and running tests. ```bash yarn reset yarn test ``` -------------------------------- ### Conditional Test Execution Guidance Source: https://github.com/foambubble/foam/blob/main/CLAUDE.md Provides instructions on how to run specific types of tests based on file naming conventions and the presence of the `/* @unit-ready */` marker. Unit tests are typically run with `yarn test:unit`. ```bash /* @unit-ready */ // If you are interested in a test inside a `*.test.ts` file, run `yarn test:unit` or inside a `*.spec.ts` file that starts with `/* @unit-ready */` run `yarn test:unit` // If you are interested in a test inside a `*.spec.ts` file that does not include `/* @unit-ready */` run `yarn test` ``` -------------------------------- ### Template Metadata Example Source: https://github.com/foambubble/foam/blob/main/docs/user/features/templates.md Markdown templates can include YAML Frontmatter for metadata like `filepath`, `name`, and `description`. Foam-specific variables like `$FOAM_TITLE` can be used here. ```yaml --- filepath: "${FOAM_TITLE}.md" name: "My New Note" description: "A template for creating new notes." --- Content goes here. ``` -------------------------------- ### Mermaid Diagram Syntax Source: https://github.com/foambubble/foam/blob/main/docs/user/getting-started/get-started-with-vscode.md Example of using Mermaid syntax within a markdown code block to create diagrams. This requires the Mermaid extension for VS Code. ```markdown ```mermaid graph TD A[Foam Workspace] --> B[Notes] A --> C[Templates] A --> D[Assets] B --> E[Wikilinks] B --> F[Tags] E --> G[Graph View] ``` ``` -------------------------------- ### Foam CLI Usage Source: https://github.com/foambubble/foam/blob/main/docs/user/tools/cli.md Basic syntax for using the Foam CLI. Replace `` with a specific Foam command and `[options]` with any relevant flags. ```bash foam [options] ``` -------------------------------- ### List and Filter GitHub Pull Requests Source: https://github.com/foambubble/foam/blob/main/CLAUDE.md Use `gh pr list` to view pull requests, with options to filter them similarly to issues, for example, by milestone. ```bash # List all PRs gh pr list # Filter PRs the same way as for filters (for example, here is by milestone) gh pr list --milestone "v1.0.0" ``` -------------------------------- ### Test Pandoc PDF Generation Source: https://github.com/foambubble/foam/blob/main/docs/user/recipes/export-to-pdf.md Verify that Pandoc is installed and can successfully generate a PDF from a Markdown file using LaTeX. This command creates a temporary file and then converts it. ```bash echo It is working > test.md pandoc test.md -o test.pdf ``` -------------------------------- ### Bulk WikiLink Creation in VS Code Source: https://github.com/foambubble/foam/blob/main/docs/user/getting-started/get-started-with-vscode.md A step-by-step process to select all occurrences of a word and wrap them in wiki links. ```shell Ctrl+Shift+L / Cmd+Shift+L ``` -------------------------------- ### Build Library and VS Code Bundle Source: https://github.com/foambubble/foam/blob/main/packages/foam-graph/README.md Build the library and the VS Code bundle for the @foam/graph-view workspace. ```shell yarn workspace @foam/graph-view build # build lib + VS Code bundle ``` -------------------------------- ### Import Core Components Source: https://github.com/foambubble/foam/blob/main/packages/foam-core/README.md Import core components like bootstrap, FoamWorkspace, and FoamGraph from the @foam/core package. This is a common starting point for integrating Foam's core functionality. ```typescript import { bootstrap, FoamWorkspace, FoamGraph } from '@foam/core'; ``` -------------------------------- ### Basic Wikilink Syntax Source: https://github.com/foambubble/foam/blob/main/docs/user/getting-started/navigation.md Use double square brackets to create links to other notes. If a note doesn't exist, Foam creates a placeholder. ```markdown I'm learning about [[Machine Learning]] and its applications in [[Data Science]]. This reminds me of my notes on [[Python Programming]] from yesterday. ``` -------------------------------- ### Publish Foam CLI Source: https://github.com/foambubble/foam/blob/main/docs/dev/releasing-foam.md This command packages and publishes the `@foam/cli` package to npm under the name `foam-cli`. ```bash yarn publish-cli ``` -------------------------------- ### Define Named Graph Views Source: https://github.com/foambubble/foam/blob/main/docs/user/features/graph-view.md Configure pre-configured graph views in `foam.graph.views`. The 'Default' view is applied automatically on graph open. Use this to set your preferred starting configuration. ```json "foam.graph.views": [ { "name": "Default", "colorBy": "directory", "show": { "tag": { "enabled": false }, "placeholder": { "enabled": false } } }, { "name": "Journal", "colorBy": "directory", "show": { "tag": { "enabled": false }, "placeholder": { "enabled": false } }, "groups": [ { "id": "journal", "label": "path=journal", "color": "#6bcb77", "enabled": true, "match": { "property": "path", "value": "journal" } } ] } ] ``` -------------------------------- ### Configure mkdocs.yml for Foam Source: https://github.com/foambubble/foam/blob/main/docs/user/recipes/generate-material-for-mkdocs-site.md Use this YAML configuration in your `mkdocs.yml` file to set up Material for MkDocs. Remember to change `site_name` and `site_url` to match your workspace. This configuration includes common features like navigation expansion, tabs, and various Markdown extensions. ```yaml site_name: My site # Change this to your site name site_url: https://mydomain.org/mysite # change this theme: name: material features: - navigation.expand - tabs markdown_extensions: - attr_list - pymdownx.tabbed - nl2br - toc: permalink: '#' slugify: !!python/name:pymdownx.slugs.uslugify - admonition - codehilite: guess_lang: false linenums: false - footnotes - meta - def_list - pymdownx.arithmatex - pymdownx.betterem: smart_enable: all - pymdownx.caret - pymdownx.critic - pymdownx.details - pymdownx.inlinehilite - pymdownx.magiclink - pymdownx.mark - pymdownx.smartsymbols - pymdownx.superfences - pymdownx.tasklist - pymdownx.tilde plugins: - search - roamlinks - exclude: glob: - '*.tmp' - '*.pdf' - '*.gz' regex: - '.*\.(tmp|bin|tar)$' ```