Compare commits

...

11 Commits

Author SHA1 Message Date
Riccardo Ferretti
a004e61b2a v0.26.11 2025-04-19 19:23:40 +02:00
Riccardo Ferretti
1a7e633edc Prepare for next release 2025-04-19 19:22:44 +02:00
Riccardo Ferretti
fb78e2baff Updated minimum VS Code version 2025-04-19 19:11:27 +02:00
Riccardo Ferretti
9d143394dc Updated test version and added flag to remove console warnings 2025-04-19 19:11:27 +02:00
Riccardo Ferretti
249e3dd924 Added return type to function 2025-04-19 19:11:27 +02:00
allcontributors[bot]
3398ab08ac add Tenormis as a contributor for code (#1458)
* update docs/index.md [skip ci]

* update readme.md [skip ci]

* update .all-contributorsrc [skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2025-04-19 19:10:59 +02:00
Tenormis
2a197cfee5 Support custom fonts (#1457)
Co-authored-by: tenormis <tenormis@mars.com>
2025-04-19 19:09:39 +02:00
Riccardo Ferretti
e95aa05059 removing new force-graph library from spell check 2025-03-29 19:01:49 +01:00
Riccardo Ferretti
dc8df6fd1e v0.26.10 2025-03-29 17:05:42 +01:00
Riccardo Ferretti
babcbb1ec1 Preparation for next release 2025-03-29 17:05:18 +01:00
Riccardo Ferretti
82e46b22ff Improved rendering of embedded notes. Fixes #1443 2025-03-29 17:03:29 +01:00
12 changed files with 55 additions and 22 deletions

View File

@@ -1139,6 +1139,15 @@
"contributions": [
"doc"
]
},
{
"login": "Tenormis",
"name": "Tenormis",
"avatar_url": "https://avatars.githubusercontent.com/u/61572102?v=4",
"profile": "https://github.com/Tenormis",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,

View File

@@ -266,6 +266,7 @@ If that sounds like something you're interested in, I'd love to have you along o
<td align="center" valign="top" width="14.28%"><a href="http://schaver.com/"><img src="https://avatars.githubusercontent.com/u/7584?v=4?s=60" width="60px;" alt="Mark Schaver"/><br /><sub><b>Mark Schaver</b></sub></a><br /><a href="https://github.com/foambubble/foam/commits?author=markschaver" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n8layman"><img src="https://avatars.githubusercontent.com/u/25353944?v=4?s=60" width="60px;" alt="Nathan Layman"/><br /><sub><b>Nathan Layman</b></sub></a><br /><a href="https://github.com/foambubble/foam/commits?author=n8layman" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/emmanuel-ferdman"><img src="https://avatars.githubusercontent.com/u/35470921?v=4?s=60" width="60px;" alt="Emmanuel Ferdman"/><br /><sub><b>Emmanuel Ferdman</b></sub></a><br /><a href="https://github.com/foambubble/foam/commits?author=emmanuel-ferdman" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Tenormis"><img src="https://avatars.githubusercontent.com/u/61572102?v=4?s=60" width="60px;" alt="Tenormis"/><br /><sub><b>Tenormis</b></sub></a><br /><a href="https://github.com/foambubble/foam/commits?author=Tenormis" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -38,6 +38,7 @@ A sample configuration object is provided below, you can provide as many or as l
"foam.graph.style": {
"background": "#202020",
"fontSize": 12,
"fontFamily": "Sans-Serif",
"lineColor": "#277da1",
"lineWidth": 0.2,
"particleWidth": 1.0,
@@ -50,6 +51,7 @@ A sample configuration object is provided below, you can provide as many or as l
- `background` background color of the graph, adjust to increase contrast
- `fontSize` size of the title font for each node
- `fontFamily` font of the title font for each node
- `lineColor` color of the edges between nodes in the graph
- `lineWidth` thickness of the edges between nodes
- `particleWidth` size of the particle animation showing link direction when highlighting a node

View File

@@ -4,5 +4,5 @@
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.26.9"
"version": "0.26.11"
}

View File

@@ -4,6 +4,18 @@ All notable changes to the "foam-vscode" extension will be documented in this fi
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [0.26.11] - 2025-04-19
Fixes and Improvements:
- Support for custom fonts in graph view (#1457 - thanks @Tenormis)
## [0.26.10] - 2025-03-29
Fixes and Improvements:
- General improvment of wiki embeds (#1443)
## [0.26.9] - 2025-03-29
Fixes and Improvements:

View File

@@ -8,11 +8,11 @@
"type": "git"
},
"homepage": "https://github.com/foambubble/foam",
"version": "0.26.9",
"version": "0.26.11",
"license": "MIT",
"publisher": "foam",
"engines": {
"vscode": "^1.70.0"
"vscode": "^1.96.0"
},
"icon": "assets/icon/FOAM_ICON_256.png",
"categories": [

View File

@@ -1,4 +1,5 @@
import { ResourceLink } from '../model/note';
import { TextEdit } from './text-edit';
export abstract class MarkdownLink {
private static wikilinkRegex = new RegExp(
@@ -45,7 +46,7 @@ export abstract class MarkdownLink {
type?: 'wikilink' | 'link';
isEmbed?: boolean;
}
) {
): TextEdit {
const { target, section, alias } = MarkdownLink.analyzeLink(link);
const newTarget = delta.target ?? target;
const newSection = delta.section ?? section ?? '';

View File

@@ -85,7 +85,7 @@ export const markdownItWikilinkEmbed = (
md
);
refsStack.pop();
return content;
return refsStack.length === 0 ? md.render(content) : content;
} catch (e) {
Logger.error(
`Error while including ${wikilinkItem} into the current document of the Preview panel`,
@@ -105,7 +105,7 @@ function getNoteContent(
md: markdownit
): string {
let content = `Embed for [[${includedNote.uri.path}]]`;
let html: string;
let toRender: string;
switch (includedNote.type) {
case 'note': {
@@ -126,7 +126,7 @@ function getNoteContent(
: cardFormatter;
content = extractor(includedNote, parser, workspace);
html = formatter(content, md);
toRender = formatter(content, md);
break;
}
case 'attachment':
@@ -135,19 +135,19 @@ function getNoteContent(
${md.renderInline('[[' + includedNote.uri.path + ']]')}<br/>
Embed for attachments is not supported
</div>`;
html = md.render(content);
toRender = md.render(content);
break;
case 'image':
content = `<div class="embed-container-image">${md.render(
`![](${md.normalizeLink(includedNote.uri.path)})`
)}</div>`;
html = md.render(content);
toRender = md.render(content);
break;
default:
html = content;
toRender = content;
}
return html;
return toRender;
}
function withLinksRelativeToWorkspaceRoot(
@@ -271,13 +271,11 @@ function contentExtractor(
export type EmbedNoteFormatter = (content: string, md: markdownit) => string;
function cardFormatter(content: string, md: markdownit): string {
return md.render(
`<div class="embed-container-note">${md.render(content)}</div>`
);
return `<div class="embed-container-note">\n\n${content}\n\n</div>`;
}
function inlineFormatter(content: string, md: markdownit): string {
return md.render(content);
return content;
}
export default markdownItWikilinkEmbed;

View File

@@ -45,10 +45,11 @@ async function main() {
extensionTestsPath,
launchArgs: [
testWorkspace,
'--disable-gpu',
'--disable-extensions',
'--disable-workspace-trust',
],
version: '1.70.0',
version: '1.96.0',
});
} catch (err) {
console.log('Error occurred while running Foam e2e tests:', err);

View File

@@ -47,6 +47,7 @@ function getStyle(name) {
const defaultStyle = {
background: getStyle(`--vscode-panel-background`) ?? '#202020',
fontSize: parseInt(getStyle(`--vscode-font-size`) ?? 12) - 2,
fontFamily: 'Sans-Serif',
lineColor: getStyle('--vscode-editor-foreground') ?? '#277da1',
lineWidth: 0.2,
particleWidth: 1.0,
@@ -229,7 +230,14 @@ function initDataviz(channel) {
painter
.circle(node.x, node.y, size, fill, border)
.text(label, node.x, node.y + size + 1, fontSize, textColor);
.text(
label,
node.x,
node.y + size + 1,
fontSize,
model.style.fontFamily,
textColor
);
})
.onRenderFramePost(ctx => {
painter.paint(ctx);
@@ -462,9 +470,9 @@ class Painter {
return this;
}
text(text, x, y, size, color) {
text(text, x, y, size, family, color) {
if (color.opacity > 0) {
this.texts.push({ x, y, text, size, color });
this.texts.push({ x, y, text, size, family, color });
}
return this;
}
@@ -489,7 +497,7 @@ class Painter {
ctx.textAlign = 'center';
ctx.textBaseline = 'top';
for (const text of this.texts) {
ctx.font = `${text.size}px Sans-Serif`;
ctx.font = `${text.size}px ${text.family}`;
ctx.fillStyle = text.color;
ctx.fillText(text.text, text.x, text.y);
}

View File

@@ -5,7 +5,7 @@
👀*This is an early stage project under rapid development. For updates join the [Foam community Discord](https://foambubble.github.io/join-discord/g)! 💬*
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-124-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-125-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
[![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/foam.foam-vscode?label=VS%20Code%20Installs)](https://marketplace.visualstudio.com/items?itemName=foam.foam-vscode)
@@ -366,6 +366,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="http://schaver.com/"><img src="https://avatars.githubusercontent.com/u/7584?v=4?s=60" width="60px;" alt="Mark Schaver"/><br /><sub><b>Mark Schaver</b></sub></a><br /><a href="https://github.com/foambubble/foam/commits?author=markschaver" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n8layman"><img src="https://avatars.githubusercontent.com/u/25353944?v=4?s=60" width="60px;" alt="Nathan Layman"/><br /><sub><b>Nathan Layman</b></sub></a><br /><a href="https://github.com/foambubble/foam/commits?author=n8layman" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/emmanuel-ferdman"><img src="https://avatars.githubusercontent.com/u/35470921?v=4?s=60" width="60px;" alt="Emmanuel Ferdman"/><br /><sub><b>Emmanuel Ferdman</b></sub></a><br /><a href="https://github.com/foambubble/foam/commits?author=emmanuel-ferdman" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Tenormis"><img src="https://avatars.githubusercontent.com/u/61572102?v=4?s=60" width="60px;" alt="Tenormis"/><br /><sub><b>Tenormis</b></sub></a><br /><a href="https://github.com/foambubble/foam/commits?author=Tenormis" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -3,4 +3,4 @@
ons = "ons" # add-ons
pallette = "pallette"
[files]
extend-exclude = ["CHANGELOG.md", "d3.v6.min.js", "force-graph.1.40.5.min.js", "dat.gui.min.js"]
extend-exclude = ["CHANGELOG.md", "d3.v6.min.js", "force-graph.1.49.5.min.js", "dat.gui.min.js"]