Query page's content based on heading and tags

Hi @CawlinTeffid ,

thank you for your answer !

Indeed I could reuse the task list items, and use the headings filter to extract the section I want.

However, my notes are not limited to task lists, they are more like logs or journals.

That’s why I want a more powerful way of querying a section with Obsidian native queries.

In the meantime I managed to build a solution based on @kepano 's suggestion with transclusion and dataviewJS:

const curdate = moment("{{date:YYYY-MM-DD}}");
const section = ' 📖Log'
// Journal/2023/Q3/08/W34
const weekpath = `Journal/${curdate.format('YYYY/MM/[W]ww')}`;
const daily_notes = dv.pagePaths(`"${weekpath}"`);
for (const day_path of daily_notes) {
    //const day_name = dv.page(`"${day_path}"`).file.title;
    // 2023-08-26
    const day_str = day_path.split('/')[4].split('.')[0];
    // Saturday
    const day_name = moment(day_str).format('dddd');
    // [[Journal/2023/08/W34/2023-08-26|Saturday]]![[Journal/2023/08/W34/2023-08-26# 📖Log]]
    const trans_daily = `[[${day_path}|${day_name}]]![[${day_path}#${section}]]`;
    dv.paragraph(trans_daily);
}

Which rends as:

So it works so far.

I would like to highlight this feature request:

Because I would also find it very useful to rename the ‘Log’ header in my transclusion to the day’s name.

No way to filter on tags here however.
And the dataview query is brittle and complex to maintain.

Would be happy to receive feedback !

PS: I have one bug to report, when the first report is generated with the transclusion, the transclusion works, and then switches back to “non transclusion” anymore, as if the files didn’t exist. (??)