Skip to content

Commit

Permalink
Fixed review issues and bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
Developer-Mike committed Jan 30, 2024
1 parent 3333e40 commit d79fa29
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 240 deletions.
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "docxer",
"name": "Docxer",
"version": "1.0.0",
"version": "1.0.1",
"minAppVersion": "0.15.0",
"description": "Import Word files into obsidian. Adds a preview mode for .docx files and the ability to convert them to markdown (.md) files.",
"description": "Import Word files easily. Adds a preview mode for .docx files and the ability to convert them to markdown (.md) files.",
"author": "Developer-Mike",
"authorUrl": "https://github.com/Developer-Mike",
"isDesktopOnly": false
Expand Down
225 changes: 1 addition & 224 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
},
"dependencies": {
"docx-preview": "^0.3.0",
"mammoth": "^1.6.0",
"node-html-markdown": "^1.3.0"
"mammoth": "^1.6.0"
}
}
8 changes: 3 additions & 5 deletions src/filetypes/docx.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ConvertableFileView from "./convertable-file-view";
import * as mammoth from "mammoth";
import { NodeHtmlMarkdown } from 'node-html-markdown'
import { renderAsync } from 'docx-preview'
import { renderAsync } from 'docx-preview';
import * as path from "path";
import { createMissingFolders, toObsidianPath, toValidFilename } from "src/utils";
import { htmlToMarkdown } from "obsidian";

export default class DocxFileView extends ConvertableFileView {
static readonly VIEW_TYPE = "docx-view";
Expand Down Expand Up @@ -39,9 +39,7 @@ export default class DocxFileView extends ConvertableFileView {
})
})

const markdownService = new NodeHtmlMarkdown();
const markdown = markdownService.translate(html.value);

const markdown = htmlToMarkdown(html.value);
return markdown;
}
}
8 changes: 4 additions & 4 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class DocxerSettingTab extends PluginSettingTab {
containerEl.empty();

new Setting(containerEl)
.setName("Delete file after conversion")
.setDesc("Delete file after pressing the conversion button.")
.setName("Delete source file after conversion")
.setDesc("Delete source file after pressing the conversion button.")
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.deleteFileAfterConversion)
Expand All @@ -38,7 +38,7 @@ export class DocxerSettingTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName("Attachments Folder")
.setName("Attachments folder")
.setDesc("Specify the destination for attachments extracted during file conversion.")
.addDropdown((dropdown) =>
dropdown
Expand All @@ -56,7 +56,7 @@ export class DocxerSettingTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName("Custom Attachments Folder")
.setName("Custom attachments folder")
.setDesc("Specify the name of the folder where attachments will be extracted.")
.addText((text) =>
text
Expand Down
Loading

0 comments on commit d79fa29

Please sign in to comment.