1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

add YAML front matter when exporting

This commit is contained in:
Baptiste Augrain
2018-11-15 22:48:14 +01:00
parent 168fe212f5
commit c796b3b30e
18 changed files with 639 additions and 382 deletions

View File

@@ -386,6 +386,17 @@ function removeStorageAndNoteReferences (input, noteKey) {
return input.replace(new RegExp(mdurl.encode(path.sep), 'g'), path.sep).replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER + '(' + escapeStringRegexp(path.sep) + noteKey + ')?', 'g'), DESTINATION_FOLDER)
}
/**
* @description replace all :storage references with given destination folder.
* @param input Input in which the references should be deleted
* @param noteKey Key of the current note
* @param destinationFolder Destination folder of the attachements
* @returns {String} Input without the references
*/
function replaceStorageReferences (input, noteKey, destinationFolder) {
return input.replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER + '(' + escapeStringRegexp(path.sep) + noteKey + ')?', 'g'), destinationFolder || DESTINATION_FOLDER)
}
/**
* @description Deletes the attachment folder specified by the given storageKey and noteKey
* @param storageKey Key of the storage of the note to be deleted
@@ -542,6 +553,7 @@ module.exports = {
getAttachmentsInMarkdownContent,
getAbsolutePathsOfAttachmentsInContent,
removeStorageAndNoteReferences,
replaceStorageReferences,
deleteAttachmentFolder,
deleteAttachmentsNotPresentInNote,
moveAttachments,