You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i am trying to create a literature matrix markdown table from my existing notes. I want to create a template that:
select all items with tag "LR_Note🗒"
for each item, it reads the note named "LR"
each LR note has some content. basically it has a few heading and some content under each heading. around one paragraph each generally.
now to create a markdown table, each heading will be 1 column.
also includes the paper title as one column, and the paper citation key as another column
sample LR note:
# LR
## Significance
the paper focuses on 2 .....
## Research Question
This paper investigates .....
## Methodology
The authors conducted a .....
## Results
The survey .....
## Limitations
The paper acknowledges .....
## Future Works
Future work in .....
for reference, i previously had a dataview js script for obsidian, which can use to create a matrix for all zotero imported items. maybe it can be helpful:
const pages = dv.pages("#LR_Note🗒 or #LR_Note_old");
let rows = [];
let allSubheadings = new Set();
// First pass: collect all unique subheadings
for (let page of pages) {
const content = await dv.io.load(page.file.path);
// Extract content under the "# LR" heading
const notesMatch = content.match(/# LR\s+([\s\S]*?)(\n# |\n---|$)/);
if (notesMatch) {
const notesContent = notesMatch[1];
// Find all subheadings (## level) within the LR section
const subheadingMatches = notesContent.match(/^#{2}\s+(.+)$/gm);
if (subheadingMatches) {
subheadingMatches.forEach(match => {
const heading = match.replace(/^#{2}\s+/, '').trim();
allSubheadings.add(heading);
});
}
}
}
// Convert set to sorted array
const subheadingColumns = Array.from(allSubheadings).sort();
// Second pass: extract content for each subheading
for (let page of pages) {
const content = await dv.io.load(page.file.path);
// Extract content under the "# LR" heading
const notesMatch = content.match(/# LR\s+([\s\S]*?)(\n# |\n---|$)/);
const notesContent = notesMatch ? notesMatch[1] : "";
let row = [
page.title,
page.authors ? page.authors.join(", ") : "",
page.year
];
// For each subheading column, extract its content
subheadingColumns.forEach(subheading => {
const regex = new RegExp(`^#{2}\\s+${subheading.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*\\n([\\s\\S]*?)(?=\\n#{2}|$)`, 'm');
const match = notesContent.match(regex);
const content = match ? match[1].trim() : "";
row.push(content);
});
rows.push(row);
}
// Sort rows by title
rows.sort((a, b) => a[0].localeCompare(b[0]));
// Create dynamic headers
const headers = ["Title", "Authors", "Year", ...subheadingColumns];
dv.table(headers, rows);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i am trying to create a literature matrix markdown table from my existing notes. I want to create a template that:
sample LR note:
for reference, i previously had a dataview js script for obsidian, which can use to create a matrix for all zotero imported items. maybe it can be helpful:
Beta Was this translation helpful? Give feedback.
All reactions