Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed headline in new daily note #4

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions packages/foam-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@
"**/.vscode/**/*",
"**/_layouts/**/*",
"**/_site/**/*",
"**/node_modules/**/*"
"**/node_modules/**/*",
"**/logseq/**/*"
],
"description": "Specifies the list of globs that will be ignored by Foam (e.g. they will not be considered when creating the graph). To ignore the all the content of a given folder, use `<folderName>/**/*`"
},
Expand Down Expand Up @@ -553,31 +554,23 @@
},
"foam.openDailyNote.onStartup": {
"type": "boolean",
"default": false
"default": true
},
"foam.openDailyNote.fileExtension": {
"type": "string",
"default": "md"
},
"foam.openDailyNote.filenameFormat": {
"type": "string",
"default": "isoDate",
"default": "yyyy_mm_dd",
"markdownDescription": "Specifies how the daily note filename is formatted. See the [dateformat docs](https://www.npmjs.com/package/dateformat) for valid formats"
},
"foam.openDailyNote.titleFormat": {
"type": [
"string",
"null"
],
"default": null,
"markdownDescription": "Specifies how the daily note title is formatted. Will default to the filename format if set to null. See the [dateformat docs](https://www.npmjs.com/package/dateformat) for valid formats"
},
"foam.openDailyNote.directory": {
"type": [
"string",
"null"
],
"default": null,
"default": "./journals",
"description": "The directory into which daily notes should be created. Defaults to the workspace root."
},
"foam.orphans.exclude": {
Expand Down Expand Up @@ -634,6 +627,9 @@
"type": "object",
"description": "Custom graph styling settings. An example is present in the documentation.",
"default": {}
},
"files.exclude": {
"logseq/*": true
}
}
},
Expand Down
5 changes: 1 addition & 4 deletions packages/foam-vscode/src/dated-notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,12 @@ export function getDailyNoteFileName(date: Date): string {
*/
export async function createDailyNoteIfNotExists(targetDate: Date) {
const pathFromLegacyConfiguration = getDailyNotePath(targetDate);
const titleFormat: string =
getFoamVsCodeConfig('openDailyNote.titleFormat') ??
getFoamVsCodeConfig('openDailyNote.filenameFormat');

const templateFallbackText = `---
foam_template:
filepath: "${pathFromLegacyConfiguration.toFsPath().replace(/\\/g, '\\\\')}"
---
# ${dateFormat(targetDate, titleFormat, false)}

`;

return await NoteFactory.createFromDailyNoteTemplate(
Expand Down
Loading