Skip to content

Commit

Permalink
Add code tabs to the guide (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Mar 17, 2024
1 parent 5d5138c commit b1ec4ec
Show file tree
Hide file tree
Showing 8 changed files with 363 additions and 43 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,26 @@ Ideally you don't add stub pages, but sometimes it's better to just add a page a
This page is just a stub that needs to be completed. You can `open a PR on the repo <https://github.com/Eeems-Org/remarkable.guide>`_ to add more content to the page.
:raw-html:`</div>`
```

### How do I add grouped tabs with examples of commands for different shells?

```rst
.. tabs::
.. code-tab:: bash Linux
ssh root@10.11.99.1
.. code-tab:: bash macOS
ssh root@10.11.99.1
.. code-tab:: bat Windows (CMD)
ssh root@10.11.99.1
.. code-tab:: pwsh Windows (PowerShell)
ssh root@10.11.99.1
```
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-spelling==8.0.0
sphinxext-opengraph==0.9.1
sphinx-tabs==3.4.4
4 changes: 3 additions & 1 deletion src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"sphinxcontrib.spelling",
"sphinxext.opengraph",
"sphinx.ext.doctest",
"sphinx_tabs.tabs",
]

rst_prolog = """
Expand All @@ -89,5 +90,6 @@
r"https://support\.remarkable\.com": "https://support.remarkable.com/s/",
r"https://discord\.gg/ATqQGfu": "https://discord.com/invite/ATqQGfu",
}

linkcheck_retries = 5

sphinx_tabs_valid_builders = ["linkcheck"]
62 changes: 56 additions & 6 deletions src/guide/access/backup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,71 @@ Backing Up Your Documents

Documents managed by the built in software (xochitl) are stored in ``/home/root/.local/share/remarkable/xochitl/`` and you can use the following to back them up to your computer:

.. code-block:: shell
.. tabs::

mkdir -p remarkable-backup/files
scp -r root@remarkable:/home/root/.local/share/remarkable/xochitl/ remarkable-backup/files/
.. code-tab:: bash Linux

mkdir -p remarkable-backup/files
scp -r \
root@remarkable:/home/root/.local/share/remarkable/xochitl/ \
remarkable-backup/files/

.. code-tab:: bash macOS

mkdir -p remarkable-backup/files
scp -r \
root@remarkable:/home/root/.local/share/remarkable/xochitl/ \
remarkable-backup/files/

.. code-tab:: bat Windows (CMD)

if not exist remarkable-backup\files mkdir remarkable-backup\files
scp -r ^
root@remarkable:/home/root/.local/share/remarkable/xochitl/ ^
remarkable-backup/files/

.. code-tab:: pwsh Windows (PowerShell)

New-Item -ItemType Directory -Force -Path remarkable-backup/files
scp -r `
root@remarkable:/home/root/.local/share/remarkable/xochitl/ `
remarkable-backup/files/


Backing Up Your Configuration
=============================

Xochitl's configuration is stored in ``/home/root/.config/remarkable/xochitl.conf``. This contains the root password in plain text, assuming you haven't changed it on the device.

.. code-block:: shell
.. tabs::

.. code-tab:: bash Linux

mkdir -p remarkable-backup
scp -r \
root@remarkable:/home/root/.config/remarkable/xochitl.conf \
remarkable-backup/

.. code-tab:: bash macOS

mkdir -p remarkable-backup
scp -r \
root@remarkable:/home/root/.config/remarkable/xochitl.conf \
remarkable-backup/

.. code-tab:: bat Windows (CMD)

if not exist remarkable-backup mkdir remarkable-backup
scp -r ^
root@remarkable:/home/root/.config/remarkable/xochitl.conf ^
remarkable-backup/

.. code-tab:: pwsh Windows (PowerShell)

mkdir -p remarkable-backup
scp -r root@remarkable:/home/root/.config/remarkable/xochitl.conf remarkable-backup/
New-Item -ItemType Directory -Force -Path remarkable-backup
scp -r `
root@remarkable:/home/root/.config/remarkable/xochitl.conf `
remarkable-backup/

Backing Up Other Data
=====================
Expand Down
71 changes: 65 additions & 6 deletions src/guide/access/file-transfer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,76 @@ OpenSSH

If you have OpenSSH installed, you can use `scp <https://www.man7.org/linux/man-pages/man1/scp.1.html>`_ from the command line to copy files to and from the device:

.. code-block:: shell

scp ./file.txt root@10.11.99.1:/home/root/file.txt
scp root@10.11.99.1:/home/root/file.txt ./file.txt
.. tabs::

.. code-tab:: bash Linux

scp \
./file.txt \
root@10.11.99.1:/home/root/file.txt
scp \
root@10.11.99.1:/home/root/file.txt \
./file.txt

.. code-tab:: bash macOS

scp \
./file.txt \
root@10.11.99.1:/home/root/file.txt
scp \
root@10.11.99.1:/home/root/file.txt \
./file.txt

.. code-tab:: bat Windows (CMD)

scp ^
./file.txt ^
root@10.11.99.1:/home/root/file.txt
scp ^
root@10.11.99.1:/home/root/file.txt ^
./file.txt

.. code-tab:: pwsh Windows (PowerShell)

scp `
./file.txt `
root@10.11.99.1:/home/root/file.txt
scp `
root@10.11.99.1:/home/root/file.txt `
./file.txt

You can also use `sftp <https://www.man7.org/linux/man-pages/man1/sftp.1.html>`_ from the command line to copy files to and from the device:

.. code-block:: shell
.. tabs::

.. code-tab:: bash Linux

echo put file.txt \
| sftp root@10.11.99.1
echo get file.txt \
| sftp root@10.11.99.1
.. code-tab:: bash macOS

echo put file.txt \
| sftp root@10.11.99.1
echo get file.txt \
| sftp root@10.11.99.1
.. code-tab:: bat Windows (CMD)

echo put file.txt ^
| sftp root@10.11.99.1
echo get file.txt ^
| sftp root@10.11.99.1
.. code-tab:: pwsh Windows (PowerShell)

echo put file.txt | sftp root@10.11.99.1
echo get file.txt | sftp root@10.11.99.1
echo "put file.txt" `
| sftp root@10.11.99.1
echo "get file.txt" `
| sftp root@10.11.99.1
PuTTY
-----
Expand Down
Loading

0 comments on commit b1ec4ec

Please sign in to comment.