Skip to content

Commit

Permalink
🐛 replace dataview queries in transcluded text content
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-dot-earth committed Aug 23, 2024
1 parent 0bc3338 commit 954d1ba
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/compiler/GardenPageCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ export class GardenPageCompiler {
const transclusionMatches = text.match(transcludedRegex);
let numberOfExcaliDraws = 0;

if (file.getPath().includes("test content")) {
console.log("hi mom");
}

for (const transclusionMatch of transclusionMatches ?? []) {
try {
const [transclusionFileName, headerName] = transclusionMatch
Expand Down Expand Up @@ -462,6 +466,30 @@ export class GardenPageCompiler {
)(publishLinkedFile)(fileText);
}

// if (file.getPath().includes("test content")) {
// const publishLinkedFile = new PublishFile({
// file: linkedFile,
// compiler: this,
// metadataCache: this.metadataCache,
// vault: this.vault,
// settings: this.settings,
// });

// compile dataview in transcluded text
const withDvCompiledText = await this.runCompilerSteps(
publishLinkedFile,
[this.convertDataViews],
)(fileText);
fileText = withDvCompiledText;

// console.log({
// filePath: file.getPath(),
// linkedFileName: linkedFile.name,
// fileText,
// withDvCompiledText,
// });
// }

//This should be recursive up to a certain depth
transcludedText = transcludedText.replace(
transclusionMatch,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
dg-publish: true
---
let's see if the whole part 1 transcludes -
![[test content for digital garden]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
foo: bar
url: https://kagi.com
dg-publish: true
---
testing if `foo` in frontmatter can be embedded:
`=this.foo`

testing if url in properties works in link:
[kagi](`=this.url`)

continued: [[test content for digital garden PART 2]]

0 comments on commit 954d1ba

Please sign in to comment.