Commit 51d9df74 authored by Siong-Ui Te's avatar Siong-Ui Te

trim tree text

parent d2adabfa
......@@ -13,44 +13,16 @@ addons:
- make
- git
- gettext
# https://docs.travis-ci.com/user/build-matrix/
jobs:
include:
# for dictionary.online-dhamma.net
- env: TARGET_WEBSITE=dhamma
install:
- cd dictionary/
- make install
script:
- make make-dhamma
after_success:
- make custom_dhamma_deploy
# for dictionary.sutta.org
- env: TARGET_WEBSITE=sutta
install:
- cd dictionary/
- make install
script:
- make make-sutta
after_success:
- make custom_sutta_deploy
# dpl v2 (not working for lots of symlinks)
#deploy:
# - provider: pages:git
# repo: siongui/dictionary.sutta.org
# keep_history: false
# token: $GITHUB_TOKEN
# local_dir: website
# on:
# branch: master
# edge: true
# verbose: true
# dpl v1 (not working for lots of symlinks)
#deploy:
# - provider: pages
# repo: siongui/dictionary.sutta.org
# skip_cleanup: true
# github_token: $GITHUB_TOKEN
# local_dir: website
# on:
# branch: master
install:
- cd tipitaka/
- make install
script:
- make make-sutta
deploy:
- provider: pages
repo: siongui/tipitaka.sutta.org
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: tipitaka/website
on:
branch: master
......@@ -102,6 +102,7 @@ lib_pali:
@echo "\033[92mInstalling common lib used in this project ...\033[0m"
go get -u github.com/siongui/gopalilib/dicutil
go get -u github.com/siongui/gopalilib/lib/jsgettext
go get -u github.com/siongui/gopalilib/lib/tipitaka
go get -u github.com/siongui/gopalilib/libfrontend
go get -u github.com/siongui/gopalilib/libfrontend/everyword
go get -u github.com/siongui/gopalilib/libfrontend/treeview
......
......@@ -65,6 +65,7 @@ func main() {
tree := lib.Tree{}
json.Unmarshal(b, &tree)
treeview.NewTreeview("treeview", tree, xmlAction)
SetupTipitakaUrl(tree)
xslt.SetupXSLTProcessor(libfrontend.GetXslUrl())
SetupModal()
......
package main
import (
"strings"
"github.com/siongui/gopalilib/lib"
"github.com/siongui/gopalilib/lib/tipitaka"
)
func traverse(tree lib.Tree, indent int) {
println(strings.Repeat(" ", indent) + tipitaka.TrimTreeText2(tree.Text))
for _, subtree := range tree.SubTrees {
traverse(subtree, indent+2)
}
}
func SetupTipitakaUrl(tree lib.Tree) {
traverse(tree, 0)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment