Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancements for offline use #227

Closed
wants to merge 10 commits into from
Closed

enhancements for offline use #227

wants to merge 10 commits into from

Conversation

jkall
Copy link

@jkall jkall commented Jun 18, 2022

Additions:

  1. an option in the config file to set file suffix for locally saved text files (by default .txt but user may want to use .md or .mkdn instead)
  2. a feature (File-menu and Ctrl+Shift+M) to open the locally saved text file, for the selected note, in default application
  3. simplenote module is only needed if user wants to sync with simplenote (and not for those only working offline)

@jkall jkall changed the title Jkall dev enhancements for offline use Jun 18, 2022
@yuuki0xff yuuki0xff self-assigned this Jun 26, 2022
@yuuki0xff yuuki0xff added this to the v2.3.0 milestone Jun 26, 2022
def observer_view_markdown(self, view, evt_type, evt):
fn = self.helper_markdown_to_html()
# turn filename into URI (mac wants this)
fn_uri = 'file://' + os.path.abspath(fn)
webbrowser.open(fn_uri)

def observer_view_markdown_raw(self, view, evt_type, evt):
fn = self.helper_render_markdown_raw()
subprocess.Popen([os.path.abspath(fn)],shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • If no note is selected or the notes_as_txt feature is disabled, abspath() raises TypeError because fn is None.
  • On UNIX-like platforms, Popen() should fail because *.txt or *.mkdn files are generally not executable.

if note_markdown(note):
fn += '.mkdn'
else:
fn += '.txt'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Degraded. systemtags are updated by Simplenote. It is an array that contains "pinned" or "markdown". nvPY changes the file extension based on it.
The internal data model of nvpy takes a lot of work to grasp. I plan to improve it in v2.4.0 or later.

@@ -300,6 +268,46 @@ def __init__(self, config):

self.config = config

# simplenote only imported if simplenote_sync activated in config-file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoting from the README.rst:

nvpy is a simplenote-syncing note-taking tool

I developed and tested assuming that the nvPY user uses simplenote synchronization feature. I don't want to complicate source code just to decouple simplenote library dependencies.

@yuuki0xff
Copy link
Collaborator

@jkall
Is your request enhancement to notes_as_txt feature?

@yuuki0xff yuuki0xff modified the milestones: v2.3.0, v2.4.0 Sep 24, 2023
@jkall jkall closed this by deleting the head repository Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants