Re-implementation of Pāli Dictionary and Pāli Tipiṭaka in Go programming language.
Development Environment:
This directory contains implementation of Pāli Dictionary.
Update Ubuntu and install packages for development:
$ sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade $ sudo apt-get install wget make git gcc g++ gettext
git clone the pali repository and data repository:
# create a workspace in your home directory $ mkdir ~/dev # enter workspace $ cd ~/dev # git clone paligo repository $ git clone https://github.com/siongui/paligo.git --depth=1 # or clone with full depth #$ git clone https://github.com/siongui/paligo.git # git clone data repository $ cd ~/dev/paligo $ make clone_pali_data
Install necessary packages:
$ cd ~/dev/paligo/dictionary $ make download_go $ make install_gopherjs
Create localhost dictionary website:
# create only basic website (no symlinks for words and prefix) $ make make-local-basic # create complete website (this might take some time because of lots of symlinks) $ make make-local
Create basic localhost dictionary website and run development server at http://localhost:8000/
$ make devserver
Use Pāli Dictionary without internet connection. The technique used to create offline website is to embed all files of the website in Go code, and serve the offline website via local http server.
Use goef package to embed all website content in Go code, together with a simple http server to serve the website content on local machine/desktop/laptop. See offline dir, Makefile, and ref [11] for more information.
TODO: add descriptions here.
This repo is not deployed via Travis CI now.
See
The Pali dictionary has more than 200K+ words, and each words has its webpage. So totally there are 200K+ symlinks pointing to the root index.html. Symbolic links are created on Travis CI build, and Travis CI can deploy to GitHub Pages after build success without problem. But after I add sub-sites for en_US, zh_TW, vi_VN, and fr_FR, Travis CI cannot successfully deploy to GitHub Pages after build success. This is because each sub-sites also has 200K+ pages, totally we have 1M+ pages/symlinks in the repo. To handle so many symlinks, Travis CI output nothing in 10 minutes so the deployment fails because 10 min no output constraint.
I tried to deploy the website on my local Ubuntu machine, and after some investigation [9], I successfully deploy to GitHub Pages:
$ cd (website-directory)
$ git init
$ git add .
$ git commit -m "Initial commit"
$ git remote add origin <url>
$ git push --force --set-upstream origin master:gh-pages
Even if the website is deployed to GitHub, the GitHub Pages build may fail due to unknown timeout, so we can request a re-build as follows [10]:
$ curl -u $(USER) https://api.github.com/user \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/$(USER)/$(REPO)/pages/builds
You will be prompted for password.
After successfully deployment on local machine, I tried again to apply the procedure of local deployment via Travis CI custom deployment, and successfully deploy to GitHub Pages. See Makefile for more information.
See
GitLab CI always fail to deploy to GitLab Pages if there are lots of symlinks, even if Travis CI can deploy without problem without sub-sites. No solution for now.
Currently GitLab repo is used to build offline website for Pāli Dictionary.
TODO: Provide instructions for offline website data processing.
- How to create JSON format files from original CSV data.
- How to extract i18n string for translation
- How to convert PO to JSON format files
- Build succinct data structure trie for all Pali words. (For fast lookup without using too much space)
- Embed all JSON format files in Go code by using goef package.
# optional: parse dictionary books
$ make parsebooks
$ make parsewords
# optional: convert po files to json
$ make po2json
# optional: build succinct trie
$ make succinct_trie
# optional: create VFS (embed data in front-end Go code)
#TODO: doc to build all pali words package using goef
#TODO: doc to embed data except pali words
Released in public domain. See UNLICENSE.
[1] | GitHub - siongui/pali: Pāḷi Tipiṭaka and Pāḷi Dictionaries |
[2] | siongui/data: Data files for Pāḷi Tipiṭaka, Pāḷi Dictionaries, and external libraries |
[3] | old implementation of Pāli Dictionary |
[4] | Home Screen Icon on Android/iPhone & PWA support
|
[5] | Howto SPA on GitHub Pages
|
[6] |
[7] | Bulma: Free, open source, and modern CSS framework based on Flexbox |
[8] | One Travis CI build deploy to two repository
|
[9] |
[10] |
[11] |