gsantner / markor

Text editor - Notes & ToDo (for Android) - Markdown, todo.txt, plaintext, math, ..
https://github.com/gsantner/markor/discussions/2269
Other
3.86k stars 370 forks source link

Documentation: How to use Markor together with Sync apps #358

Closed gsantner closed 4 years ago

gsantner commented 6 years ago

General information

Description

Currently the howto use Markor with X sync app is partially in the app and partly in Matrix discussion. It would be good to have a (markdown) document that describes howto setup file sync with NextCloud, Dropbox, Syncthing, FolderSync... . If you use something of those give some insights how it works, best with screenshots.
As one person very likely will not have all sync apps and services, yes multiple people can work on this :).

The resulting document will be be shown in the Markor GitHub Wiki and may be either integrated in the app itself (not decided yet).

( issue ref #197 )

tengucrow commented 6 years ago

I use Syncthing - both on my desktop (Linux Debian) and on Android phone (Xiaomi Redmi 4x). Open source, privacy (my data doesn't get to the third party), etc.

I use both with local networks settings (syncing by local home wifi) since in the recent past I didn't have mobile internet, so I connect desktop (firefly at 192.168.1.4) and phone (redmi 4x new at 192.168.1.6).

I prefer keep separate folder for texts (~/text at desktop, and ~/text aka /storage/emulated/0/text at phone), because syncthing sync little text files lightning fast - without having to wait for all other (big) files to be synchronized.

For desktop linux I install syncthing by default repo (sudo apt install syncthing), start it and set it up via browser interface (http://127.0.0.1:8384/). I use "homebrew" selftuned Openbox install, so syncthing run at start via ~/.config/openbox/autostart.sh (added there (syncthing -no-browser) &).

For android phone I get syncthing from f-droid.org and connect it with desktop.

Rarely I may get version conflict, but syncthing keep both version of files (see at screenshot) and I just use vimdiff.

2018-10-04_1708-1538662113_1920x1080_scrot

So far - 143 files inside ~/text :)

gsantner commented 6 years ago

@tengucrow Thanks for writing up syncthing! May I ask to rewrite it to the "you/user" perspective? So like "For android you have to install Syncthing from..."

tengucrow commented 6 years ago

Will try to do it. But I can't get rid of the feeling that most of these information are already described in the syncthing manuals :(

gsantner commented 6 years ago

You can refer to that docs! whats important is only how to setup folders on android and howto open those files/change folder :). In case of Syncthing this is very easy and short described. For NextCloud its lots more for example

theTaikun commented 6 years ago

@tengucrow

I actually just set up Syncthing and Markor for the first time today on my phone and Raspberry Pi, also integrating subversion for version control. I wish I would have seen your post earlier, and it might have saved me some time.

But I had a question, I saw your address was "tcp://192.168.1.6? dynamic" What does the [?] do? How is it different than using a [,] comma?

gsantner commented 6 years ago

when the correct sync target is available at 192.168.1.6 it is taken first, if not your device makes a request to relay (dynamic) to find it. Just dynamic is fine too.

theTaikun commented 6 years ago

And a comma does what? Tries both and sticks with whichever connects first?

gsantner commented 6 years ago

seperator^^

wmww commented 6 years ago

I found the setup for Syncthing quite easy. Below is my (very short) how-to in case its useful, but first I have a question: My one pain point is that I am unable to have multiple root notebook folders. That is, I would like to have multiple (non-nested) synced folders (and maybe an unsynced folder), and be able to easily open, edit and save documents from any of them. Is this a feature that has been considered? Or am I missing something?


Syncthing is a protocol to sync files between your devices, with implementations for various platforms. Unlike other (even open source) sync and backup solutions, it does not require complex server setup or dependence on 3rd parties. According to their website:

Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet.

To start off, install Syncthing and set up a shared folder. More info on how to do that here.

Then, all you need to do is tell Marker where to look for and save files:


And markdown, for easy copy-paste:

Syncthing is a protocol to sync files between your devices, with implementations for various platforms. Unlike other (even open source) sync and backup solutions, it does not require complex server setup or dependence on 3rd parties. According to their [website](https://syncthing.net/):

> Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet.

To start off, install Syncthing and set up a shared folder. More info on how to do that [here](https://docs.syncthing.net/intro/getting-started.html).

Then, all you need to do is tell Marker where to look for and save files:
* Go to your Notebook (close any open note and swipe to the left)
* Open the overflow menu (tap the three dots in the upper right)
* Go to `Settings` -> `App-wide` -> `Notebook`
* Navigate to and select your synced folder (The Syncthing app will tell you the path under the folder's name)
theTaikun commented 6 years ago

@wmww

My one pain point is that I am unable to have multiple root notebook folders. That is, I would like to have multiple (non-nested) synced folders (and maybe an unsynced folder), and be able to easily open, edit and save documents from any of them. Is this a feature that has been considered? Or am I missing something?

Can't you just make a main Notebook folder on your device, and point Markor to it, then within it have your multiple synced (or unsynced) notebook folders?

wmww commented 6 years ago

I suppose I could, but it's a bit inflexible. For example, I currently sync the DCIM directory the camera uses. What if I wanted to have markdown notes in the same place?

Perhaps a better way to do it would be to keep the root notebook directory the way it is, but allow files outside the notebook to be opened. Right now (AFAIK), when you "import" a file with Marker, it copies the file into your notebook and allows you to edit that. What if instead it continued to save to the original location? The notebook system works really nicely, but it would be good to not be locked down to a specific file structure.

Or maybe I should just make my notebook my root file system. That might work.

gsantner commented 6 years ago

Please have discussion on Matrix channel or other issue. This one is about writing a document for the user.

goldmanm commented 6 years ago

I wrote a description of how to sync markor with NextCloud. Let me know if you have any questions, comments. It works with NextCloud 3.3.2 and Markor 1.4

To sync your markor files using NextCloud, you will need an app to sync with your NextCloud account. One app you can use is simply called NextCloud and is available on F-droid or Google play. Once you have the NextCloud app installed, you will need to log in with your NextCloud account, which will create the directory necessary to store your NextCloud files.

The next step is to determine which directory your NextCloud files are synced to. In the NextCloud app menu, click on Settings.

nextcloud_menu_screenshot

Find and remember the path listed next to 'Storage Path', since this is the directory where Markor needs to save your files. The path will likely look something like this \storage\emulated\0\Android\media\com.nextcloud.client.

Now, you may want to transfer your current Markor files to this directory, so you can keep using these files. Your Markor files are stored by the directories described in the Markor menu -> Settings -> App-wide -> Save location. You can use a file manager app to move them from the specified directory in Markor to the directory which NextCloud syncs.

Now, we must change where Markor checks for your files. In the Markor menu, click on Settings and then App-wide. The app shows four directories and/or files under Save location. Click on whichever files you want to be synced to NextCloud. A window should pop-up where you can choose the new directory. Choose the path which you found in the NextCloud app followed by the folder of your NextCloud account.

To get NextCloud app to automatically sync, you will need to specify the files for offline use. Log into the NextCloud app, click on All files in the left menu, which should bring up the files stored in NextCloud. For Markor files you want to be automatically synced, click on the three dots to the right of the file name, and click 'Set as available online'. NextCloud should now sync the files automatically.

nextcloud_app_screenshot

gsantner commented 6 years ago

@goldmanm Thanks! Can you add 2-4 screenshots of where to find the options in NextCloud? You can of course mask private stuff or use a dummy account :). Btw, I would go for first signing in at NC app, because usually then an subfolder like myaccount.default gets added (as far I remember), which is better to use as Notebook directory then. I copied the current state to Markor Wiki: https://github.com/gsantner/markor/wiki/Sync-with-NextCloud-(or-OwnCloud),-work-with-Markor

gsantner commented 6 years ago

@tengucrow @wmww Posted your writing at https://github.com/gsantner/markor/wiki/Sync-with-Syncthing,-work-with-Markor. If you want to make improvements, just edit your comment and tell me when I should update wiki post.

tengucrow commented 6 years ago

All OK. Sorry for delay - was bogged down in work :(

bbkane commented 5 years ago

https://github.com/gsantner/markor/issues/126#issuecomment-374063663 - How to sync with Dropbox.

gsantner commented 5 years ago

@bbkane I tried this back then and it worked fine.

bbkane commented 5 years ago

@gsantner Edited my comment to relate it to this issue.

goldmanm commented 5 years ago

@gsantner, Finally added the screenshots to this post and updated some of the wording.

Terrox commented 5 years ago

How about using Document Provider to notify Nextcloud app of changes so the syncs are seamless. Some info here https://github.com/nextcloud/android/issues/3534#issuecomment-459669504 (I'm just passing info on, I know very little about this and am trying to set up a synced note workflow)

Backfighter commented 5 years ago

I have opened a new issue (#547) in regards to this. Using this system could potentially solve a lot of problems people have with cloud storage.

ceylanb commented 4 years ago

It would be nice to have a git feature of the app to sync notes over github.

gsantner commented 4 years ago

You can do that with MGit

ceylanb commented 4 years ago

@gsantner Thanks a lot.

macdonaldster commented 4 years ago

@ceylanb I like to use PocketGit for this but am giving MGit a try as a result of @gsantner comment, above. I have a pretty good workflow going using Git. It seemed inconvenient to do the synching manually but I have had far less trouble doing this than I have with various sync apps and, after I settled into a rhythm, I only really sync a couple times a day, if that.

xu4wang commented 4 years ago

@ceylanb I like to use PocketGit for this but am giving MGit a try as a result of @gsantner comment, above. I have a pretty good workflow going using Git. It seemed inconvenient to do the synching manually but I have had far less trouble doing this than I have with various sync apps and, after I settled into a rhythm, I only really sync a couple times a day, if that.

I'd like to use git too, I am thinking to use one file name dairy.md to keep my diary, git will save the history. @macdonaldster would you please share your workflow using mgit? It will help me to get started..

macdonaldster commented 4 years ago

@xu4wang - the workflow is pretty simple:

  1. I tend to use Markor when not at my desk so each morning when I sit down to work I stage all changes on my phone, commit, and push (s/c/p)
  2. On my workstation I then pull those changes in.
  3. At the end of the day (or, say, before I go get groceries if I was working on a grocery list) I s/c/p from my workstation
  4. On my phone I pull those changes in

Now, I am using a private Github repo for my files but you can use any Git repo solution (self-hosted, Bitbucket, etc).

I use Git at my job so this seems like a pretty natural way of doing things. If I haven't answered your question in enough detail, please let me know and I'll try to answer any specific questions you have.

xu4wang commented 4 years ago

@xu4wang - the workflow is pretty simple:

Thanks @macdonaldster for the detailed flow introduction. I understand it's a typical workflow for two git clients work together. One on the mobile, another on the workstation.

I did some test today, and finally end up with below hybrid way: 1) using syncthing on both workstation and mobile to sync all the .md files. 2) using git to s/c/p files to github, for backup purpose, on the workstation only.

gsantner commented 4 years ago

@wmww @tengucrow I have copied the tutorials for markor+syncthing to Markor's/my blog -- > markor-how-to-use-syncthing-for-sync.html

The wiki was a first idea how to get the info to the users, but I feel like dust not much people looking into it. Fits better there. It was not much work to copy over as blog also uses Markdown :smiley: .

aw-bib commented 4 years ago

A probably simple(?) question wrt cloud storage syncs. The description from the WIKI that originated from this discussion relies on selecting the storage folder of the cloud app. This is simple enough and the general idea is not depending on a specific cloud storage, of course (same procedure works ds cloud from synology btw, not that I would recommend this sync solution).

First off: this does work for me, but only as long as said folder lives in the internal storage, like described between the lines as /storage/emulated/0/.... For most, this may be a non-issue as it is just the default and quite some cloud tools (to my limited experience) don't allow to place their sync folder to the external storage, anyway.

However, at least recent editions e.g. of nextcloud do allow it.

Having limited internal, but quite a bit of sd card storage, I actually told the the cloud app (nextcloud, but I think this does not matter) to use the sd card, so it is something like /storage/1234-5678/....

Here, it seems, I am out of luck. First, all all those dirs get a strike through highlighting in Markors browser. I understand from #909 I should follow the FAQ to give Markor access to the SD card (BTW: it's a good idea to add the link to the issue). I followed the procedure outlined, but to no avail. Something changed (as I guess from not being able to end up in this setup dialogue again) but all folders still get the strike through.

If, accidentally, before reading up all this, I just simple mindedly set the storage folder right from Markor to the external storage dir close the app it will crash and never come up again. "This app keeps crashing". I think this is like #816 The only solution I found was to de-install Markor entirely, and re-install it so it seems to forget my mistake (and my settings and the home screen shortcuts but at least the documents still exist.)

Making this long detour short: is the gist of all this, that I could sync against a cloud storage provider if and only if it's sync app places the files in the internal storage? (Would be sad news comparing Markor e.g. with nextcloud notes.) If so, I think it would require some note in the docs.

(BTW: using Markor 2.2.10 from F-Droid with a Sony XPeria G8441 and it's latest edition of Android 9.)

gsantner commented 4 years ago

cloud storage, work for me, but only as long as said folder lives in the internal storage

only real storage on the phone is there, i.e. SD Cards. No cloud storage or cloud mounting. When you sync a folder structure to some local folder, point Markor to it. "Virtual cloud" is not suppoted.

aw-bib commented 4 years ago

only real storage on the phone is there, i.e. SD Cards.

Understood. For nextcloud I'd just use something like /storage/1234-5678/Android/media/nextcloud/cloud.org/Markor, which I understand is your mentioned real storage, right? (This one is set to sync, so files are there.)

However, I am not able to get Markor to write to any SD card folder :( That is I end up in step 2 of https://gsantner.net/assets/blog/img/markor/markor-v1-8-showcase-2.jpg but step 3 does not happen:

Here, it seems, I am out of luck. First, all all those dirs get a strike through highlighting in Markors browser. [...] I followed the procedure outlined, but to no avail. Something changed (as I guess from not being able to end up in this setup dialogue again) but all folders still get the strike through.

Any hints on this?

gsantner commented 4 years ago

So you are inside the 1234-5678 sd directory, press the plus button and nothing happens?

aw-bib commented 4 years ago

So you are inside the 1234-5678 sd directory, press the plus button and nothing happens?

First time I got the dialogue, can select the folder, I come back and get them all with strike through again. Same on any level of the tree. :S

But, silly me. I did not realize that the selection dialogue does not send me to the folder I were just were in but to some funny place elsewhere that looks like it, so I have to explicitly select the SD card first from the left hand burger menu first. Doing this, and only then [Select], tada. :) All is fine now. (Yes, I did try it about 10 times with drop markor, reinstall from f-droid etc. before writing to this issue.)

Yes, it is marked with a red border in your screenshot.

So one can amend the documentation wrt nextcloud and friends:


Note: If your nextcloud app is configured to sync to a sd card make sure to follow the instructions for from the FAQ How do I save files to SD Cards? first. Once you can write a file to your sd card you may move your notebook structure to the nextcloud storage path. To do so just follow the instructions as for internal storage.


I would suggest to (if this is possible) to add the mini-screenshots (1,2,3,4 in step 2 of https://gsantner.net/assets/blog/img/markor/markor-v1-8-showcase-2.jpg) explicitly to the FAQ in say "full size" like the other screenshots for silly people like me.

BTW: still, if I don't give permissions properly, and select the sd card as Notebook storage space, Markor will crash without recovery options. (At least, I only found delete and reinstall.) This sounds like #816. Maybe a "I can write to the space specified -> I go to a safe harbour" would be a good idea, but this is nothing for this documentation issue.

abubelinha commented 1 year ago

the [MGit] workflow is pretty simple:

  1. I tend to use Markor when not at my desk so each morning when I sit down to work I stage all changes on my phone, commit, and push (s/c/p)
  2. On my workstation I then pull those changes in.
  3. At the end of the day (or, say, before I go get groceries if I was working on a grocery list) I s/c/p from my workstation
  4. On my phone I pull those changes in

Now, I am using a private Github repo for my files but you can use any Git repo solution (self-hosted, Bitbucket, etc).

I use Git at my job so this seems like a pretty natural way of doing things. If I haven't answered your question in enough detail, please let me know and I'll try to answer any specific questions you have.

@macdonaldster thanks for sharing your workflow above: does it permit you to rename & resync files from your phone? Haven't tried yet markor / MGit, but found this MGit renaming issue I guess that would not affect as long as you rename files with markor. Can anyone confirm that?

Thanks @abubelinha