form.css000644 0000000557 14031411561007364 0ustar00000000 000000 .dialog { padding: 0; margin: 0; } .dialog-header { border-bottom: 1px solid black; text-align: center; } form { padding: 0.5rem; } .labels { font-weight: 700; font-size: 0.8rem; } input, textarea { padding: 0.5rem; } .block-element { display: block; } span { color: red; } .field { margin: 0.5rem 0; } index.js000644 0000016152 14031411561007352 0ustar00000000 000000 !function(t){var e={};function o(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=0)}([function(t,e,o){"use strict";var n=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))((function(i,r){function l(t){try{d(n.next(t))}catch(t){r(t)}}function a(t){try{d(n.throw(t))}catch(t){r(t)}}function d(t){var e;t.done?i(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(l,a)}d((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=o(1),r=o(2),l=i.default.require("fs-extra"),a=o(3);function d(t){let e=new Date;return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()+"-"+t.split(" ").join("-")}function s(t,e,o,r){return n(this,void 0,void 0,(function*(){const{items:n}=yield i.default.data.get(["notes",t.id,"resources"],{fields:["id","title","file_extension"]});for(var d=0;d\n\t\t\t
\n\t\t\t\t

Exporting Configuration

\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n \t
\n\t\t\t\t\t\t

Choose your SSG (*required)

\n\t\t\t\t\t\t\n \t\t\t\t\t\t
\n \t\t\t\t\t\t\n \t\t\t\t\t\t
\n \t\t\t\t\t\t\n \t\t\t\t\t\t
\n \t
\n \t
\n \t \n\t\t\t\t\t \n \t
\n \t
\n\t\t\t\t\t \n\t\t\t\t\t \n \t
\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t'),yield e.addScript(o,"./form.css"),yield e.setButtons(o,[{id:"submit",title:"Export"},{id:"cancel",title:"Cancel"}]),yield i.default.commands.register({name:"exportingProcedure",execute:(...e)=>n(this,void 0,void 0,(function*(){let o=e[1].basic_info.ssg,r=e[1].basic_info.dest_Path,u=e[1].basic_info.frontMatter;const c=yield i.default.data.get(["folders",e[0]],{fields:["id","title","body"]}),{items:f}=yield i.default.data.get(["notes"],{fields:["id","title","body","parent_id"]}),p=f.filter(t=>t.parent_id===e[0]);if("hugo"===o){const e=c.title+"-"+c.id;yield l.mkdirp(a.join(r,"content",e)),yield l.mkdirp(a.join(r,"static","resources"));const n=a.join(r,"static","resources");for(var y=0;yn(this,void 0,void 0,(function*(){e&&(yield l.mkdirp(a.join(r,"static")));const n=a.join(r,"static");for(var i=0;in(this,void 0,void 0,(function*(){e&&(yield l.mkdirp(a.join(r,"_posts"))),yield l.mkdirp(a.join(r,"resources"));const n=a.join(r,"resources");for(var i=0;in(this,void 0,void 0,(function*(){const{id:n,formData:r}=yield e.open(o);if("submit"==n){if(!r.basic_info.ssg)return void alert("Please choose one static site generator.");if(!a.isAbsolute(r.basic_info.dest_Path))return void alert("Provided path is not valid.");yield i.default.commands.execute("exportingProcedure",t,r)}}))}),yield i.default.views.menuItems.create("Export to SSG","staticSiteExporterDialog",r.MenuItemLocation.FolderContextMenu)}))}})},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=joplin},function(t,e,o){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ContentScriptType=e.SettingItemType=e.ToolbarButtonLocation=e.isContextMenuItemLocation=e.MenuItemLocation=e.ImportModuleOutputFormat=e.FileSystemItem=void 0,function(t){t.File="file",t.Directory="directory"}(e.FileSystemItem||(e.FileSystemItem={})),function(t){t.Markdown="md",t.Html="html"}(e.ImportModuleOutputFormat||(e.ImportModuleOutputFormat={})),function(t){t.File="file",t.Edit="edit",t.View="view",t.Note="note",t.Tools="tools",t.Help="help",t.Context="context",t.NoteListContextMenu="noteListContextMenu",t.EditorContextMenu="editorContextMenu",t.FolderContextMenu="folderContextMenu",t.TagContextMenu="tagContextMenu"}(n=e.MenuItemLocation||(e.MenuItemLocation={})),e.isContextMenuItemLocation=function(t){return[n.Context,n.NoteListContextMenu,n.EditorContextMenu,n.FolderContextMenu,n.TagContextMenu].includes(t)},function(t){t.NoteToolbar="noteToolbar",t.EditorToolbar="editorToolbar"}(e.ToolbarButtonLocation||(e.ToolbarButtonLocation={})),function(t){t[t.Int=1]="Int",t[t.String=2]="String",t[t.Bool=3]="Bool",t[t.Array=4]="Array",t[t.Object=5]="Object",t[t.Button=6]="Button"}(e.SettingItemType||(e.SettingItemType={})),function(t){t.MarkdownItPlugin="markdownItPlugin",t.CodeMirrorPlugin="codeMirrorPlugin"}(e.ContentScriptType||(e.ContentScriptType={}))},function(t,e){t.exports=require("path")}]);manifest.json000644 0000000670 14031411561010404 0ustar00000000 000000 { "manifest_version": 1, "id": "com.export-to-ssg.aman-d-1-n-only", "app_min_version": "1.7", "version": "1.0.3", "name": "Export To SSG", "description": "Export a collection of notes to static site generator project.", "author": "aman-d-1-n-only", "homepage_url": "https://github.com/aman-d-1-n-only/joplin-exports-to-ssg#readme", "repository_url": "https://github.com/aman-d-1-n-only/joplin-exports-to-ssg.git", "keywords": [] }