diff options
author | nodiscc <nodiscc@gmail.com> | 2017-01-26 18:52:54 +0100 |
---|---|---|
committer | nodiscc <nodiscc@gmail.com> | 2017-06-18 00:19:49 +0200 |
commit | 53ed6d7d1e678d7486337ce67a2f17b30bac21ac (patch) | |
tree | f8bef0164a70bd03d2b9781951c01bdd018f1842 /doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md | |
parent | d5d22a6d07917865c44148ad76f43c65a929a890 (diff) | |
download | Shaarli-53ed6d7d1e678d7486337ce67a2f17b30bac21ac.tar.gz Shaarli-53ed6d7d1e678d7486337ce67a2f17b30bac21ac.tar.zst Shaarli-53ed6d7d1e678d7486337ce67a2f17b30bac21ac.zip |
Generate HTML documentation using MkDocs (WIP)
MkDocs is a static site generator geared towards building project documentation.
Documentation source files are written in Markdown, and configured with a single YAML file.
* http://www.mkdocs.org/
* http://www.mkdocs.org/user-guide/configuration/
Ref. #312
* remove pandoc-generated HTML documentation
* move markdown doc to doc/md/,
* mkdocs.yml:
* generate HTML doc in doc/html
* add pages TOC/ordering
* use index.md as index page
* Makefile: remove execute permissions from generated files
* Makefile: rewrite htmlpages GFM to markdown conversion using sed:
awk expression aslo matched '][' which causes invalid output on complex links with images or code blocks
* Add mkdocs.yml to .gitattributes, exclude this file from release archives
* Makefile: rename: htmldoc -> doc_html target
* run make doc: pull latest markdown documentation from wiki
* run make htmlpages: update html documentation
Diffstat (limited to 'doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md')
-rw-r--r-- | doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md b/doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md deleted file mode 100644 index 88d191da..00000000 --- a/doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | #Copy an existing installation over SSH and serve it locally | ||
2 | Example bash script: | ||
3 | |||
4 | ```bash | ||
5 | #!/bin/bash | ||
6 | #Description: Copy a Shaarli installation over SSH/SCP, serve it locally with php-cli | ||
7 | #Will create a local-shaarli/ directory when you run it, backup your Shaarli there, and serve it locally. | ||
8 | #Will NOT download linked pages. It's just a directly usable backup/copy/mirror of your Shaarli | ||
9 | #Requires: ssh, scp and a working SSH access to the server where your Shaarli is installed | ||
10 | #Usage: ./local-shaarli.sh | ||
11 | #Author: nodiscc (nodiscc@gmail.com) | ||
12 | #License: MIT (http://opensource.org/licenses/MIT) | ||
13 | set -o errexit | ||
14 | set -o nounset | ||
15 | |||
16 | ##### CONFIG ################# | ||
17 | #The port used by php's local server | ||
18 | php_local_port=7431 | ||
19 | |||
20 | #Name of the SSH server and path where Shaarli is installed | ||
21 | #TODO: pass these as command-line arguments | ||
22 | remotehost="my.ssh.server" | ||
23 | remote_shaarli_dir="/var/www/shaarli" | ||
24 | |||
25 | |||
26 | ###### FUNCTIONS ############# | ||
27 | _main() { | ||
28 | _CBSyncShaarli | ||
29 | _CBServeShaarli | ||
30 | } | ||
31 | |||
32 | _CBSyncShaarli() { | ||
33 | remote_temp_dir=$(ssh $remotehost mktemp -d) | ||
34 | remote_ssh_user=$(ssh $remotehost whoami) | ||
35 | ssh -t "$remotehost" sudo cp -r "$remote_shaarli_dir" "$remote_temp_dir" | ||
36 | ssh -t "$remotehost" sudo chown -R "$remote_ssh_user":"$remote_ssh_user" "$remote_temp_dir" | ||
37 | scp -rq "$remotehost":"$remote_temp_dir" local-shaarli | ||
38 | ssh "$remotehost" rm -r "$remote_temp_dir" | ||
39 | } | ||
40 | |||
41 | _CBServeShaarli() { | ||
42 | #TODO: allow serving a previously downloaded Shaarli | ||
43 | #TODO: ask before overwriting local copy, if it exists | ||
44 | cd local-shaarli/ | ||
45 | php -S localhost:${php_local_port} | ||
46 | echo "Please go to http://localhost:${php_local_port}" | ||
47 | } | ||
48 | |||
49 | |||
50 | ##### MAIN ################# | ||
51 | |||
52 | _main | ||
53 | ``` | ||
54 | |||
55 | This outputs: | ||
56 | |||
57 | ```bash | ||
58 | $ ./local-shaarli.sh | ||
59 | PHP 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014 | ||
60 | Listening on http://localhost:7431 | ||
61 | Document root is /home/user/local-shaarli/shaarli | ||
62 | Press Ctrl-C to quit. | ||
63 | |||
64 | [Mon Sep 1 21:56:27 2014] ::1:57868 [200]: /[](.html) | ||
65 | [Mon Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html[](.html) | ||
66 | [Mon Sep 1 21:56:37 2014] ::1:57881 [200]: /...[](.html) | ||
67 | ``` | ||