offline.org
#924
- Author
- Anonymous
- Created
- Oct. 26, 2023, 12:14 a.m.
- Expires
- Never
- Size
- 2.2Â KB
- Hits
- 93
- Syntax
- org-mode
- Private
- â No
You are viewing the source code of this paste. Click "Render" to see the formatted version.
#+title: Ensuring resources are available without internet
* GitHub Wikis
Example: https://github.com/nesbox/TIC-80/wiki
** httrack
Didn't work well. I used the following command:
#+begin_src bash
httrack -*/nesbox/TIC-80/* +*/nesbox/TIC-80/wiki/* -*/_history*
#+end_src
The issue is it still pulls in a lot of js css from GitHub directly.
** wget -r
Could work, likely has same issues as httrack with pulling in assets from GitHub.
** pandoc/busybox httpd
Using the following script, I was able to produce a rudimentary website:
#+begin_src bash
#!/usr/bin/env bash
set -eu -o pipefail
shopt -s dotglob # Some of the wiki files may start with "."
rm -rf public
mkdir -p public
for f in *.md; do
if [[ $f = _* ]]; then
continue
fi
cat _Sidebar.md <(echo) "$f" <(echo) _Footer.md |
pandoc - --from gfm --to html --standalone --output public/"${f%%.md}.html"
done
cd public
ln -sf Home.html index.html
for f in *.html; do
if [[ $f = index.html ]]; then
continue
fi
base="${f%%.html}"
mkdir -p "$base"
ln -sf "../$f" "$base/index.html"
done
#+end_src
The issue is this doesn't address wiki links. While links from the index page
works, =busybox httpd -h public/ -p 8181 -f -vv= doesn't produce hyperlinks
between pages that works.
** Gollum
This is the most promising option. It's a wiki webapp that can be used to
preview, edit, and publish GitHub wikis.
https://github.com/gollum/gollum
The downside is it appears to require 3+ seconds to load a page. It also
doesn't have a flag to generate a static website based off the wiki, so it
might not meet my expectations of fast page loads without any processing.
** Creating a docset
In theory. See https://kapeli.com/docsets#dashDocset and
https://github.com/godbout/dash-docset-builder for tools that streamline docset
generation. https://github.com/technosophos/dashing#readme
** Markdown renderers
- Use whatever gollum uses. It seems pretty good.
- Pandoc doesn't seem to implement mermaid and many GFM features.
- https://stackoverflow.com/questions/7694887/is-there-a-command-line-utility-for-rendering-github-flavored-markdown