Skip to content

Commit 948e6cd

Browse files
committed
update_package_json_and_get_snapshot_js_for_dependency_management
- Add "smart-sources" as a dependency in package.json to enhance functionality. - Remove "smart-sources" from devDependencies in package.json to streamline development dependencies. - Modify get_snapshot.js to include logging and conditional reading of content, improving handling of 'dataview' content and extracting markdown links. - Maintain existing comments and methods unrelated to the changes.
1 parent da4e6b9 commit 948e6cd

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

smart-contexts/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
"dependencies": {
2828
"smart-blocks": "file:../smart-blocks",
2929
"smart-collections": "file:../smart-collections",
30-
"smart-file-system": "file:../smart-fs"
30+
"smart-file-system": "file:../smart-fs",
31+
"smart-sources": "file:../smart-sources"
3132
},
3233
"devDependencies": {
3334
"ava": "^5.3.1",
34-
"smart-environment": "file:../smart-environment",
35-
"smart-sources": "file:../smart-sources"
35+
"smart-environment": "file:../smart-environment"
3636
},
3737
"ava": {
3838
"files": [

smart-contexts/utils/get_snapshot.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { strip_excluded_headings } from './respect_exclusions.js';
2+
import { get_markdown_links } from 'smart-sources/utils/get_markdown_links.js';
23
export async function get_snapshot(context_item, opts) {
34
const snapshot = {
45
items: {},
@@ -73,7 +74,12 @@ async function process_depth(snapshot, curr_depth_keys, context_item, opts) {
7374
if (is_already_in_snapshot(item.key, snapshot)) {
7475
continue;
7576
}
76-
const content = await item.read();
77+
let content = await item.read();
78+
console.log('read context');
79+
if(!opts.calculating && content.includes('dataview')) {
80+
content = await item.read({render_output: true});
81+
item.data.outlinks = get_markdown_links(content);
82+
}
7783
const excluded_headings = opts.excluded_headings || [];
7884
const [new_content, exclusions, removed_char_count] = strip_excluded_headings(content, excluded_headings);
7985
curr_depth[item.path] = {

0 commit comments

Comments
 (0)