Skip to content

Commit

Permalink
Copy local remarkjs to resource folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lemedege committed Jun 25, 2023
1 parent 44e3cf8 commit 00a737d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 40 deletions.
11 changes: 4 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ const path = require('path');

//---------collecting and transfering the static file
async function resourceFetcher(note, resourceDir: string, destPath: string ) {

const installDir = await joplin.plugins.installationDir();
await fs.copy(path.join(installDir,'/remark/remark.js'), path.join(destPath,'resources','remark.js'));

const should_copy_pictures = await joplin.settings.value('copy_pictures');
//await fs.copy("/remark/remark.js", path.join(destPath,'resources','remark.js'));
const { items } = await joplin.data.get(['notes', note.id, 'resources'] , { fields: ['id', 'title', 'file_extension']} );
for( var i = 0; i < items.length; i++ ) {
const resource = items[i];
Expand Down Expand Up @@ -60,10 +63,6 @@ function renderSlides(note): string {
return html
};





joplin.plugins.register({
onStart: async function () {

Expand Down Expand Up @@ -123,10 +122,8 @@ joplin.plugins.register({

await resourceFetcher(note, resourceDir, folderPath);


let html = renderSlides(note);


await fs.mkdirp(path.join(dest_Path, 'slides', folderName));//markdown

fs.writeFile(path.join(dest_Path, 'slides', folderName, `${note.title}.html`), html);
Expand Down
6 changes: 3 additions & 3 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"manifest_version": 1,
"id": "joplin.remark.slides",
"app_min_version": "2.8",
"version": "1.0.1",
"version": "1.0.2",
"name": "Joplin remark slides",
"description": "export note to slides using remarkjs",
"author": "lemedege",
"homepage_url": "",
"repository_url": "https://github.com/lemedege/joplin-remark-slides",
"homepage_url": "https://github.com/lemedege/joplin-remark-slides",
"repository_url": "https://github.com/lemedege/joplin-remark-slides.git",
"keywords": [],
"categories": []
}
30 changes: 0 additions & 30 deletions src/remark/remark.css

This file was deleted.

0 comments on commit 00a737d

Please sign in to comment.