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

Implementation of reference mode #371

Closed
ECOWOOD opened this issue Jan 22, 2019 · 9 comments
Closed

Implementation of reference mode #371

ECOWOOD opened this issue Jan 22, 2019 · 9 comments

Comments

@ECOWOOD
Copy link

ECOWOOD commented Jan 22, 2019

In order not to update it accidentally, I would like to implement the reference mode for the completed document.

@zadam
Copy link
Owner

zadam commented Jan 22, 2019

Is "reference mode" essentially some kind of read-only protection?

@ECOWOOD
Copy link
Author

ECOWOOD commented Jan 23, 2019

Yes. It is a read-only mode designation by note.

@SugoiDev
Copy link

This is interesting! I had a few broke Evernote notes due to the lack of a read-only toggle.

@zadam
Copy link
Owner

zadam commented Jan 24, 2019

Not dismissing this, but I think the importance is smaller in Trilium since changes in text notes are automatically versioned so if you accidentally change/remove content, you can get the original back ...

@SugoiDev
Copy link

There's versioning in Evernote (premium at least) as well. But the cases where it was an issue for me were silent: I did not know I had modified the note. My most recent example was an inline pdf attachment that was accidentally deleted and I never noticed.

@ECOWOOD
Copy link
Author

ECOWOOD commented Jan 24, 2019

It is very thankful to be able to return. However, I think it is important to prevent errors.

@jkurei
Copy link

jkurei commented Jan 27, 2019

I was actually planing to do something similar in a plugin.

I recently discovered Draftin and liked its ability to freeze a version of a document in its history, kind of like creating a git label.

I was thinking I could add a button to Trilium's toolbar to copy a note's content into a new child, and rename it. I would also probably have to clone (some of?) its children for images and such to work...

Important Essay
|__ [2018-11-15] Important Essay
|__ [2018-11-29] Important Essay

i'm already using children in a similar manner, with the last version of a doc being the parent and particular drafts or derivative versions being children, and I love it.

May be this is enough to prevent accidental edits, since you are not generally going to open that child, and you can use it for reference. I could also investigate if there is some way to prevent edits (may be making a Render note with the contents of the draft in another note.

@jkurei
Copy link

jkurei commented Jan 27, 2019

Easy way to prevent acidental edits to some text you want to store in trilium through a Render note:

capture2

Go to the original, normal, editable note and copy it's source (Note actions > Note source). Create a new Note with the type "Render HTML note". Give it a child of type HTML and copy the previous note's source.

Then go to the Render HTML note and give it a relation named "renderNote" and select its child in the next field. Hide the children overview to hide the trick for maximum coolness.

capture3

Now you have the content of the original note in a way that you can see but not edit easily (you'd have to go to its content child). If the original note has images and such you will have to clone them.

@zadam
Copy link
Owner

zadam commented Jan 27, 2019

@jkurei interestingly it would be even simpler in the old implementation of "Render HTML note" since that used to render the note's own content so in this case it would be enough to switch text note and render HTML note and that would be it.

But anyway, I just pushed to master change which switches the text editor to read only mode if the note has readOnly label. I guess this might still be pretty manual for some people, but some kind of UI can be implemented on top of this as a plugin.

One possible way of using this would be having e.g. "Finished essays" note which would have inheritable readOnly label. So whenever you clone an essay into this note it automatically becomes read only (because it inherits it from "Finished essays" ancestor note).

If the original note has images and such you will have to clone them.

Images (and files) are immutable and cannot be changed - if you want to upload a new image you will effectively create new (image) note. But cloning might be a form of protection against deleting it.

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

No branches or pull requests

4 participants