Skip to content

Commit

Permalink
[datopian#1233 extend feature][xs] Adding markdown-transclusion.
Browse files Browse the repository at this point in the history
  • Loading branch information
gradedSystem committed Aug 22, 2024
1 parent 1baebc3 commit 969a7c6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/remark-wiki-link/src/lib/fromMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ function fromMarkdown(opts: FromMarkdownOptions = {}) {
width: '100%',
src: `${hrefTemplate(link)}#toolbar=0`,
};
} else if (format === 'csv') {
// CSV support
wikiLink.data.hName = 'FlatUiTable';
wikiLink.data.hProperties = {
data: { url: hrefTemplate(link) },
};
} else {
const hasDimensions = alias && /^\d+(x\d+)?$/.test(alias);
// Take the target as alt text except if alt name was provided [[target|alt text]]
Expand Down
5 changes: 5 additions & 0 deletions packages/remark-wiki-link/src/lib/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ function html(opts: HtmlOptions = {}) {
link
)}#toolbar=0" class="${classNames}" />`
);
} else if (format === 'csv') {
// CSV support
this.tag(
`<FlatUiTable data={{ url: "${hrefTemplate(link)}" }} />`
);
} else {
const hasDimensions = alias && /^\d+(x\d+)?$/.test(alias);
// Take the target as alt text except if alt name was provided [[target|alt text]]
Expand Down
1 change: 1 addition & 0 deletions packages/remark-wiki-link/src/lib/isSupportedFileFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const supportedFileFormats = [
"avif",
"ico",
"pdf",
"csv",
];

export const isSupportedFileFormat = (filePath: string): [boolean, string] => {
Expand Down

0 comments on commit 969a7c6

Please sign in to comment.