Skip to content

Commit 1fde078

Browse files
authored
Initial commit
0 parents  commit 1fde078

25 files changed

+624
-0
lines changed
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Foam Note Templates
2+
3+
Foam includes note templates!
4+
This allows you to easily create notes that have similar structure without having to use copy/paste :)
5+
6+
Templates support the [VS Code's Snippet Syntax](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax), which means you can:
7+
- add variables to the newly created note
8+
- add tabstop to automatically navigate to the key parts of the note, just like a form
9+
Below you can see an example showing a todo list and a timestamp.
10+
11+
## Todo List
12+
13+
1. ${1:First tabstop}
14+
2. ${2:A second tabstop}
15+
3. ${3:A third tabstop}
16+
17+
Note Created: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}
18+
19+
---
20+
21+
Try out the above example by running the `Foam: Create New Note From Template` command and selecting the `your-first-template` template. Notice what happens when your new note is created!
22+
23+
To remove this template, simply delete the `.foam/templates/your-first-template.md` file.
24+
25+
Enjoy!

.vscode/extensions.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
// Foam's own extension
6+
"foam.foam-vscode",
7+
8+
// Tons of markdown goodies (lists, tables of content, so much more)
9+
"yzhang.markdown-all-in-one",
10+
11+
// Image-pasting for markdown
12+
"mushan.vscode-paste-image"
13+
]
14+
}

.vscode/foam.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"purpose": "this file exists to tell the foam-vscode plugin that it's currently in a foam workspace",
3+
"future": "we may use this for custom configuration"
4+
}

.vscode/settings.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"editor.minimap.enabled": false,
3+
"editor.wrappingIndent": "indent",
4+
"editor.overviewRulerBorder": false,
5+
"editor.lineHeight": 24,
6+
"[markdown]": {
7+
"editor.quickSuggestions": {
8+
"comments": "on",
9+
"strings": "on",
10+
"other": "on"
11+
}
12+
},
13+
"files.defaultLanguage": "markdown",
14+
"files.exclude": {
15+
"**/node_modules": true
16+
},
17+
"files.watcherExclude": {
18+
"**/node_modules": true
19+
},
20+
"foam.edit.linkReferenceDefinitions": "off",
21+
"foam.openDailyNote.directory": "journal",
22+
"foam.openDailyNote.titleFormat": "fullDate",
23+
"git.enableSmartCommit": true,
24+
"git.postCommitCommand": "sync",
25+
"markdown.preview.breaks": true,
26+
"pasteImage.path": "${projectRoot}/attachments",
27+
"pasteImage.showFilePathConfirmInputBox": true,
28+
"prettier.singleQuote": false,
29+
}

_layouts/home.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: default
3+
---
4+
5+
{{ content }}
6+
7+
<script type="text/javascript">
8+
// Hack: Replace page-link with "Page Title"
9+
document.querySelectorAll(".markdown-body a[title]").forEach((a) => {
10+
a.innerText = a.title;
11+
});
12+
// Hack: Remove .md extension from wikilinks to get the html in jekyll
13+
document.querySelectorAll("a").forEach(l => {
14+
if (l.href.endsWith('.md')) {
15+
l.href = l.href.substring(0, l.href.length-3)
16+
}
17+
})
18+
</script>

_layouts/page.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: default
3+
---
4+
5+
{{ content }}
6+
7+
<script type="text/javascript">
8+
// Hack: Replace page-link with "Page Title"
9+
document.querySelectorAll(".markdown-body a[title]").forEach((a) => {
10+
a.innerText = a.title;
11+
});
12+
// Hack: Remove .md extension from wikilinks to get the html in jekyll
13+
document.querySelectorAll("a").forEach(l => {
14+
if (l.href.endsWith('.md')) {
15+
l.href = l.href.substring(0, l.href.length-3)
16+
}
17+
})
18+
</script>

assets/css/style.scss

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
---
3+
4+
@import "{{ site.theme }}";
5+
6+
.markdown-body {
7+
max-width: 800px;
8+
font-size: 16px;
9+
}
10+
11+
.markdown-body p {
12+
font-size: 16px;
13+
line-height: 1.9em;
14+
margin-bottom: 1.2em;
15+
}
16+
17+
.markdown-body li {
18+
line-height: 1.9em;
19+
}
20+
21+
input.task-list-item-checkbox {
22+
margin-right: 4px;
23+
}
24+
25+
h1,
26+
h2,
27+
h3,
28+
h4,
29+
h5,
30+
blockquote {
31+
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida,
32+
"DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
33+
}

attachments/foam-icon.png

16.3 KB
Loading

docs/features/daily-notes.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Daily Notes
2+
3+
Daily notes allow you to quickly create and access notes for today.
4+
5+
Try it out, run the `Foam: Open Daily Note` command.
6+
7+
## Shortcuts and Snippets
8+
9+
You can quickly open today's daily note by pressing `alt+d`.
10+
You can also automatically open today's note via the `Foam › Open Daily Note: On Startup` setting.
11+
12+
You can also quickly create link to your daily notes, in the configured format, using [snippets](https://code.visualstudio.com/docs/editor/userdefinedsnippets).
13+
14+
Type `/today` and press `enter` to link to today's note.
15+
You can also write:
16+
17+
| Snippet | Date |
18+
| ------------ | ------------- |
19+
| `/tomorrow` | tomorrow |
20+
| `/yesterday` | yesterday |
21+
| `/monday` | next Monday |
22+
| `/+1d` | tomorrow |
23+
| `/-3d` | 3 days ago |
24+
| `/+1w` | in a week |
25+
| `/-1m` | one month ago |
26+
| `/+1y` | in one year |
27+
28+
You get the idea ;)
29+
30+
## Configuration
31+
32+
It's possible to customize path and heading of your daily notes, by following the [dateformat masking syntax](https://github.com/felixge/node-dateformat#mask-options).
33+
The following properties can be used:
34+
35+
```json
36+
"foam.openDailyNote.directory": "journal",
37+
"foam.openDailyNote.filenameFormat": "'daily-note'-yyyy-mm-dd",
38+
"foam.openDailyNote.fileExtension": "mdx",
39+
"foam.openDailyNote.titleFormat": "'Journal Entry, ' dddd, mmmm d",
40+
```
41+
42+
The above configuration would create a file `journal/daily-note-2020-07-25.mdx`, with the heading `Journal Entry, Sunday, July 25`.

docs/features/graph-visualization.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Graph Visualization
2+
3+
Foam comes with a graph visualization of your notes.
4+
To see the graph execute the `Foam: Show Graph` command.
5+
6+
## Graph Navigation
7+
8+
With the graph you can:
9+
10+
- highlight a node by hovering on it, to quickly see how it's connected to the rest of your notes
11+
- select one or more (by keeping `shift` pressed while selecting) nodes by clicking on them, to better understand the structure of your notes
12+
- navigate to a note by clicking on it while pressing `ctrl` or `cmd`
13+
- automatically center the graph on the currently edited note, to immediately see its connections
14+
15+
## Custom Graph Styles
16+
17+
By default, the Foam graph will use the VS Code theme, but it's possible to customize it with the `foam.graph.style` setting.
18+
19+
A sample configuration object is provided below, you can provide as many or as little configuration as you wish:
20+
21+
```json
22+
"foam.graph.style": {
23+
"background": "#202020",
24+
"fontSize": 12,
25+
"highlightedForeground": "#f9c74f",
26+
"node": {
27+
"note": "#277da1",
28+
"placeholder": "#545454",
29+
"feature": "green",
30+
}
31+
}
32+
```
33+
34+
- `note` defines the color for regular nodes
35+
- `placeholder` defines the color for links that don't match any existing note. This is a [[placeholder]] because no file with such name exists (see [[wikilinks]] for more info).
36+
- `feature` shows an example of how you can use note types to customize the graph. It defines the color for the notes of type `feature`
37+
- see [[note-properties]] for details
38+
- you can have as many types as you want
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Link Reference Definitions
2+
3+
When you use `[[wikilinks]]`, the [foam-vscode](https://github.com/foambubble/foam/tree/master/packages/foam-vscode) extension can generate [Markdown Link Reference Definitions](https://spec.commonmark.org/0.29/#link-reference-definitions) at the bottom of the file.
4+
5+
This is done to make the content of the file compatible with various Markdown tools (e.g. parsers, static site generators, VS code plugins etc), which don't support `[[wikilinks]]` directly.
6+
7+
This feature can be disabled by default (as it's done in the foam-template) because you don't need it to navigate your workspace, it is useful for publishing and compatibility of your notes.
8+
9+
## Example
10+
11+
The following example:
12+
13+
```md
14+
- [[graph-visualization]]
15+
```
16+
17+
...generates the following link reference definitions to the bottom of the file:
18+
19+
```md
20+
[graph-visualization]: graph-visualization "Graph Visualization"
21+
```
22+
23+
## Configuration
24+
25+
You can use the `foam.edit.linkReferenceDefinitions` to configure the definitions (see [[get-started-with-vscode]]):
26+
27+
- `withoutExtensions` (default): this works better with certain web publishing tools (e.g. GitHub pages)
28+
- `withExtensions`: this works better with standard markdown-based tools (e.g GitHub web UI)
29+
- `off`: this disables the generation of definitions
30+
31+
After changing the setting in your workspace, you can run the `Foam: Run Janitor (Experimental)` command to convert all existing definitions.

docs/features/note-properties.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
type: feature
3+
keywords: hello world
4+
---
5+
6+
# Note Properties
7+
8+
At the top of the file you can have a section where you define your properties.
9+
10+
> Be aware that this section needs to be at the very top of the file to be valid
11+
12+
For example, for this file, we have:
13+
14+
```text
15+
---
16+
type: feature
17+
keywords: hello world
18+
---
19+
```
20+
21+
Those are properties.
22+
Properties can be used to organize your notes.
23+
24+
## Special Properties
25+
26+
Some properties have special meaning for Foam:
27+
28+
- the `title` property will assign the name to the note that you will see in the graph, regardless of the filename or the first heading (also see how to [[write-notes-in-foam]])
29+
- the `type` property can be used to style notes differently in the graph (also see [[graph-visualization]])
30+
- the `tags` property can be used to add tags to a note (see [[tags-and-tag-explorer]])

docs/features/note-templates.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Note Templates
2+
3+
You can create notes from templates by running the `Foam: Create New Note from Template` command and follow the instructions.
4+
5+
To create a template, just add regular `.md` files in `.foam/templates` (create the directory if necessary).
6+
7+
Templates can use all the variables available in [VS Code Snippets](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_variables).

docs/features/spell-checking.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Spell Checking
2+
3+
There are many spell checking extensions for VS Code.
4+
5+
The most popular spell checker for VS Code is [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker).
6+
7+
Another one of our favorites is [LTeX](https://marketplace.visualstudio.com/items?itemName=valentjn.vscode-ltex&ssr=false#overview), which is a bit heavier but offers some extra functionality.
8+
9+
Another popular one is [Spellright](https://marketplace.visualstudio.com/items?itemName=ban.spellright), but be mindful that there have been reports of incompatibility with the `vscode-markdown` extension (see https://github.com/foambubble/foam/issues/1068).
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
tags: my-tag1 my-tag2
3+
---
4+
5+
# Tags and Tag Explorer
6+
7+
## Tags
8+
9+
You can add tags to your notes to categorize them, or in any way you want.
10+
11+
There are two ways to add tags:
12+
13+
- you can add #tags just by writing them in the note
14+
- another way is through [[note-properties]], as you can see at the top of this file
15+
16+
## Tag Explorer
17+
18+
In the sidebar to the left, you will see a panel called `Tag Explorer`.
19+
20+
You can use this panel to see the tags in your notes, and navigate them.
21+
22+
Notice `my-tag1` and `my-tag2`, which were added via [[note-properties]].

docs/features/wikilinks.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Wikilinks
2+
3+
Wikilinks are the internal links that connect the files in your knowledge base.
4+
5+
To create a wikilink use `[[` and type the name of another file in your repo, for example [[graph-visualization]]
6+
7+
You can also create a [[placeholder]].
8+
A placeholder is a wikilink that doesn't have a target file and a link to a placeholder is styled differently so you can easily tell them apart.
9+
They can still be helpful to highlight connections.
10+
11+
Open the graph with `Foam: Show Graph` command, and look at the placeholder node.
12+
13+
Remember, with `CTRL/CMD+click` on a wikilink you can navigate to the note, or create it (if the link is a placeholder).
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Getting started with VS Code
2+
3+
VS Code is a powerful text editor, hidden behind a simple interface.
4+
5+
VS Code supports various **keyboard shortcuts**, the most important for us are:
6+
7+
| Shortcut | Action |
8+
| ------------- | ---------------------------- |
9+
| `cmd+N` | create a new file |
10+
| `cmd+S` | save the current file |
11+
| `cmd+O` | open a file |
12+
| `cmd+P` | use quickpick to open a file |
13+
| `cmd+shift+P` | invoke a command (see below) |
14+
15+
For more information, see the [VS Code keyboard cheat sheets](https://code.visualstudio.com/docs/getstarted/keybindings#_keyboard-shortcuts-reference), where you can also see how to customize your keybindings.
16+
17+
## Commands
18+
19+
Commands make VS Code extremely powerful.
20+
21+
To invoke a command, press `cmd+shift+P` and select the command you want to execute.
22+
For example, to see the Foam graph:
23+
24+
- press `cmd+shift+P`
25+
- start typing `show graph`
26+
- select the `Foam: Show Graph` command
27+
28+
And watch the magic unfold.
29+
30+
For more information on commands, see [commands on the VS Code site](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).
31+
32+
If you want to learn more about VS Code, check out their [website](https://code.visualstudio.com/docs#first-steps).
33+
34+
## Panels
35+
36+
You can see a few panels on the left, including:
37+
38+
- `Outline`: this panel shows you the structure of the file based on the headings
39+
- `Tag Explorer`: This shows you the tags in your workspace, see [[tags-and-tag-explorer]] for more information on tags
40+
41+
## Settings
42+
43+
To view or change the settings in VS Code, press `cmd+,`

0 commit comments

Comments
 (0)