diff --git a/README.md b/README.md index 5c21418..b53d929 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,15 @@ +- [ ] checkboxs individuelles pour les sous-extensions de "extra" ? https://python-markdown.github.io/extensions/ +- [ ] help labels and links for pandoc too! +- [ ] CSS for admonitions +- [ ] cesser les zouaveries avec pandoc et les pre-strings/post-strings, il y a de vraies options +- [ ] compléter les descriptions des schémas +- [ ] se souvenir du splitter +- [ ] ajouter le réglage pour le splitter dans les préférences + +~ TODO --> This is a plugin for the Gedit text editor, previewing .md files in the side (`F9`) or the bottom (`Ctrl+F9`) panel. diff --git a/markdown_preview/export.py b/markdown_preview/export.py index 63321d2..729da02 100644 --- a/markdown_preview/export.py +++ b/markdown_preview/export.py @@ -262,21 +262,21 @@ def __init__(self, file_format, gedit_window, settings, **kwargs): self.file_format = file_format self.gedit_window = gedit_window self._settings = settings - self.add_button(_("Cancel"), Gtk.ResponseType.CANCEL) - self.add_button(_("Next"), Gtk.ResponseType.OK) + self.add_button(_("Cancel"), Gtk.ResponseType.CANCEL) self.get_content_area().set_margin_left(20) self.get_content_area().set_margin_right(20) self.get_content_area().set_margin_top(20) self.get_content_area().set_margin_bottom(20) self.get_content_area().set_spacing(20) - if not BACKEND_P3MD_AVAILABLE and not BACKEND_PANDOC_AVAILABLE: error_label = Gtk.Label(visible=True, \ label=_("Error: please install pandoc or python3-markdown")) self.get_content_area().add(error_label) return + self.add_button(_("Next"), Gtk.ResponseType.OK) + # Add the backend settings to the dialog self._backend = MdBackendSettings(_("Export file with:"), \ self._settings, False) self.get_content_area().add(self._backend.full_widget) @@ -356,6 +356,7 @@ def launch_file_chooser(self, output_extension): # retirer l'ancienne extension ? name = str(name + ' ' + _("(exported)") + output_extension) file_chooser.set_current_name(name) + file_chooser.set_do_overwrite_confirmation(True) response = file_chooser.run() if response == Gtk.ResponseType.ACCEPT: return file_chooser @@ -369,7 +370,7 @@ def export_p3md(self): return False md_extensions = [] - for plugin_id in P3MD_PLUGINS: + for plugin_id in self._backend.plugins: if self._backend.plugins[plugin_id].get_active(): md_extensions.append(plugin_id) @@ -400,7 +401,8 @@ def export_pandoc(self): output_format = self._backend.format_combobox.get_active_id() doc_path = self.gedit_window.get_active_document().get_location().get_path() - cmd = self._backend.pandoc_cli_entry.get_buffer().get_text() + buff = self._backend.pandoc_cli_entry.get_buffer() + cmd = buff.get_text(buff.get_start_iter(), buff.get_end_iter(), False) words = cmd.split() words[words.index('$INPUT_FILE')] = doc_path words[words.index('$OUTPUT_FILE')] = file_chooser.get_filename()