giblish 0.8.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/unit_tests.yml +30 -0
  3. data/.gitignore +7 -3
  4. data/.ruby-version +1 -1
  5. data/Changelog.adoc +59 -0
  6. data/README.adoc +261 -0
  7. data/docs/concepts/text_search.adoc +213 -0
  8. data/docs/concepts/text_search_im/cgi-search_request.puml +35 -0
  9. data/docs/concepts/text_search_im/cgi-search_request.svg +397 -0
  10. data/docs/concepts/text_search_im/search_request.puml +40 -0
  11. data/docs/concepts/text_search_im/search_request.svg +408 -0
  12. data/docs/howtos/trigger_generation.adoc +180 -0
  13. data/docs/{setup_server_assets → howtos/trigger_generation_im}/Render Documents.png +0 -0
  14. data/docs/{setup_server_assets → howtos/trigger_generation_im}/View Documents.png +0 -0
  15. data/docs/{setup_server_assets → howtos/trigger_generation_im}/deploy_with_hooks.graphml +0 -0
  16. data/docs/{setup_server_assets → howtos/trigger_generation_im}/deploy_with_hooks.svg +0 -0
  17. data/docs/{setup_server_assets → howtos/trigger_generation_im}/deploy_with_jenkins.graphml +0 -0
  18. data/docs/{setup_server_assets → howtos/trigger_generation_im}/deploy_with_jenkins.svg +0 -0
  19. data/docs/howtos/trigger_generation_im/docgen_github.puml +51 -0
  20. data/docs/{setup_server_assets → howtos/trigger_generation_im}/giblish_deployment.graphml +0 -0
  21. data/docs/howtos/trigger_generation_im/post-receive-example.sh +50 -0
  22. data/docs/reference/box_flow_spec.adoc +22 -0
  23. data/docs/reference/search_spec.adoc +185 -0
  24. data/giblish.gemspec +50 -29
  25. data/lib/giblish/adocsrc_providers.rb +23 -0
  26. data/lib/giblish/application.rb +214 -41
  27. data/lib/giblish/cmdline.rb +273 -259
  28. data/lib/giblish/config_utils.rb +41 -0
  29. data/lib/giblish/configurator.rb +163 -0
  30. data/lib/giblish/conversion_info.rb +120 -0
  31. data/lib/giblish/docattr_providers.rb +125 -0
  32. data/lib/giblish/docid/docid.rb +181 -0
  33. data/lib/giblish/github_trigger/webhook_manager.rb +64 -0
  34. data/lib/giblish/gitrepos/checkoutmanager.rb +124 -0
  35. data/lib/giblish/{gititf.rb → gitrepos/gititf.rb} +30 -4
  36. data/lib/giblish/gitrepos/gitsummary.erb +61 -0
  37. data/lib/giblish/gitrepos/gitsummaryprovider.rb +78 -0
  38. data/lib/giblish/gitrepos/history_pb.rb +41 -0
  39. data/lib/giblish/indexbuilders/d3treegraph.rb +88 -0
  40. data/lib/giblish/indexbuilders/depgraphbuilder.rb +109 -0
  41. data/lib/giblish/indexbuilders/dotdigraphadoc.rb +174 -0
  42. data/lib/giblish/indexbuilders/standard_index.erb +10 -0
  43. data/lib/giblish/indexbuilders/subtree_indices.rb +132 -0
  44. data/lib/giblish/indexbuilders/templates/circles.html.erb +111 -0
  45. data/lib/giblish/indexbuilders/templates/flame.html.erb +61 -0
  46. data/lib/giblish/indexbuilders/templates/tree.html.erb +366 -0
  47. data/lib/giblish/indexbuilders/templates/treemap.html.erb +127 -0
  48. data/lib/giblish/indexbuilders/verbatimtree.rb +94 -0
  49. data/lib/giblish/pathtree.rb +473 -74
  50. data/lib/giblish/resourcepaths.rb +150 -0
  51. data/lib/giblish/search/expand_adoc.rb +55 -0
  52. data/lib/giblish/search/headingindexer.rb +312 -0
  53. data/lib/giblish/search/request_manager.rb +110 -0
  54. data/lib/giblish/search/searchquery.rb +68 -0
  55. data/lib/giblish/search/textsearcher.rb +349 -0
  56. data/lib/giblish/subtreeinfobuilder.rb +77 -0
  57. data/lib/giblish/treeconverter.rb +272 -0
  58. data/lib/giblish/utils.rb +142 -294
  59. data/lib/giblish/version.rb +1 -1
  60. data/lib/giblish.rb +10 -7
  61. data/scripts/hooks/post-receive.example +66 -0
  62. data/{docgen/scripts/githook_examples → scripts/hooks}/post-update.example +0 -0
  63. data/{docgen → scripts}/resources/css/adoc-colony.css +0 -0
  64. data/scripts/resources/css/giblish-serif.css +419 -0
  65. data/scripts/resources/css/giblish.css +1979 -419
  66. data/{docgen → scripts}/resources/fonts/Ubuntu-B.ttf +0 -0
  67. data/{docgen → scripts}/resources/fonts/Ubuntu-BI.ttf +0 -0
  68. data/{docgen → scripts}/resources/fonts/Ubuntu-R.ttf +0 -0
  69. data/{docgen → scripts}/resources/fonts/Ubuntu-RI.ttf +0 -0
  70. data/{docgen → scripts}/resources/fonts/mplus1p-regular-fallback.ttf +0 -0
  71. data/{docgen → scripts}/resources/images/giblish_logo.png +0 -0
  72. data/{docgen → scripts}/resources/images/giblish_logo.svg +0 -0
  73. data/{docgen → scripts}/resources/themes/giblish.yml +0 -0
  74. data/scripts/wserv_development.rb +32 -0
  75. data/web_apps/cgi_search/gibsearch.rb +43 -0
  76. data/web_apps/gh_webhook_trigger/config.ru +2 -0
  77. data/web_apps/gh_webhook_trigger/gh_webhook_trigger.rb +73 -0
  78. data/web_apps/gh_webhook_trigger/public/dummy.txt +3 -0
  79. data/web_apps/sinatra_search/config.ru +2 -0
  80. data/web_apps/sinatra_search/public/dummy.txt +3 -0
  81. data/web_apps/sinatra_search/sinatra_search.rb +34 -0
  82. data/web_apps/sinatra_search/tmp/restart.txt +0 -0
  83. metadata +180 -71
  84. data/.rubocop.yml +0 -7
  85. data/.travis.yml +0 -3
  86. data/Changelog +0 -16
  87. data/Gemfile +0 -4
  88. data/README.adoc +0 -1
  89. data/Rakefile +0 -41
  90. data/bin/console +0 -14
  91. data/bin/setup +0 -8
  92. data/data/testdocs/malformed/no_header.adoc +0 -5
  93. data/data/testdocs/toplevel.adoc +0 -19
  94. data/data/testdocs/wellformed/adorned_purpose.adoc +0 -17
  95. data/data/testdocs/wellformed/docidtest/docid_1.adoc +0 -24
  96. data/data/testdocs/wellformed/docidtest/docid_2.adoc +0 -8
  97. data/data/testdocs/wellformed/simple.adoc +0 -14
  98. data/data/testdocs/wellformed/source_highlighting/highlight_source.adoc +0 -38
  99. data/docgen/resources/css/giblish.css +0 -1979
  100. data/docgen/scripts/Jenkinsfile +0 -18
  101. data/docgen/scripts/gen_adoc_org.sh +0 -58
  102. data/docs/README.adoc +0 -387
  103. data/docs/setup_server.adoc +0 -202
  104. data/lib/giblish/buildgraph.rb +0 -216
  105. data/lib/giblish/buildindex.rb +0 -459
  106. data/lib/giblish/core.rb +0 -451
  107. data/lib/giblish/docconverter.rb +0 -308
  108. data/lib/giblish/docid.rb +0 -180
  109. data/lib/giblish/docinfo.rb +0 -75
  110. data/lib/giblish/indexheadings.rb +0 -251
  111. data/lib/giblish-search.cgi +0 -459
  112. data/scripts/hooks/post-receive +0 -57
  113. data/scripts/publish_html.sh +0 -99
@@ -1,57 +0,0 @@
1
- #!/bin/bash
2
- #
3
- # this hook runs the publish_html.sh script which, in turn,
4
- # publishes html versions of adoc files to the desired
5
- # destination.
6
- #
7
- #
8
- # Adjust the WORKING_TREE_ROOT, DST_DIR and SRC_DIR below to
9
- # locations suitable for your setup
10
-
11
- ### config section
12
- # set this to the repo root where the working tree exists
13
- WORKING_TREE_ROOT="/the/path/to/the/stage/repo"
14
-
15
- # set this to the publish root dir served by a web server
16
- DST_DIR="/the/path/to/webserver/directory/root"
17
-
18
- # set this to "true" if you want to force an 'rm -rf'of
19
- # the destination dir before generating new htmls
20
- CLEAR_DST=""
21
-
22
- # set this to the top dir to look for docs under in the
23
- # staging repo. This shall be given as a relative path
24
- # from the top dir of the git repo.
25
- SRC_DIR="."
26
-
27
- # Make config available in subshell
28
- export WORKING_TREE_ROOT
29
- export DST_DIR
30
- export SRC_DIR
31
- export CLEAR_DST
32
-
33
- # read the input from git...not currently used.
34
- # it could for example be used to filter on git branches
35
- #
36
- # while read line
37
- # do
38
- # echo "git ref: $line"
39
- # done < /dev/stdin
40
-
41
- echo "Post update hook running..."
42
- (
43
- cd "${WORKING_TREE_ROOT}"
44
-
45
- # need to unset the GIT_DIR env set by the invoking hook...
46
- unset GIT_DIR
47
-
48
- # Run the publish script
49
- PUBLISH_SCRIPT="scripts/publish_html.sh"
50
- echo "invoking publish script at ${WORKING_TREE_ROOT}/${PUBLISH_SCRIPT}"
51
- if [[ -z "${CLEAR_DST}" ]]; then
52
- "${PUBLISH_SCRIPT}" "${DST_DIR}" "${SRC_DIR}"
53
- else
54
- "${PUBLISH_SCRIPT}" -f "${DST_DIR}" "${SRC_DIR}"
55
- fi
56
-
57
- )
@@ -1,99 +0,0 @@
1
- #!/bin/bash
2
- #
3
- # pulls the master branch from origin and then runs giblish
4
- # on the working tree emitting the result to the given destination
5
- # folder
6
- #
7
- # NOTE: This script assumes that all assets referenced from adoc files
8
- # are located in corresponding .../<file>_assets directories
9
- # Ex:
10
- # adoc file .../repo_root/docs/myfile.adoc
11
- # is expected to have an imagesdir directive in its header pointing to:
12
- # .../repo_root/docs/myfile_assets
13
- #
14
- # all ..._assets directories found under SRC_TOP will be copied in full to
15
- # DST_DIR
16
-
17
- SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
18
-
19
- ### config section
20
- # set this to the 'resource' folder as expected by the giblish -r flag
21
- RESOURCE_DIR="${SCRIPT_DIR}/resources"
22
-
23
- # set this to the publish dir as expected by the giblish -w flag
24
- WEB_ROOT="/giblish"
25
-
26
- # display usage message
27
- function usage {
28
- echo "Usage:"
29
- echo " publish_html.sh <dst_dir> [src_top]"
30
- echo ""
31
- echo "where"
32
- echo " dst_dir the top dir to where the html will be generated"
33
- }
34
-
35
- # abort with non zero exit code
36
- # @param msg the message to output to user
37
- function die {
38
- echo "Error! $1"
39
- exit 1
40
- }
41
-
42
- ### useful variables
43
- GIT_ROOT=$(git rev-parse --show-toplevel)
44
- [ $? -ne 0 ] && die "You must invoke this from within a git working tree."
45
- SRC_ROOT="${GIT_ROOT}"
46
-
47
- # handle user flags
48
- force_remove=''
49
- while getopts 'f' flag; do
50
- case "${flag}" in
51
- f) force_remove='true'
52
- shift;;
53
- *) print_usage
54
- exit 1 ;;
55
- esac
56
- done
57
-
58
- # handle user args
59
- if [[ $# < 1 || $# > 2 ]]; then
60
- usage
61
- die "Wrong number of input arguments."
62
- fi
63
- DST_HTML=$1
64
- if [[ $# == 2 ]]; then
65
- SRC_ROOT=$2
66
- fi
67
-
68
- # Make the paths absolute
69
- DST_HTML=$(realpath "$1")
70
- [ $? -ne 0 ] && die "Unknown path: ${DST_HTML}"
71
- SRC_ROOT=$(realpath "${SRC_ROOT}")
72
- [ $? -ne 0 ] && die "Unknown path: ${SRC_ROOT}"
73
-
74
- # update working tree with latest master
75
- echo "Cleaning git repo at..."
76
- git clean -fdx
77
- [ $? -ne 0 ] && die "Could not clean repo"
78
- echo "Pulling updates from origin..."
79
- git pull
80
- [ $? -ne 0 ] && die "Could not pull from origin"
81
-
82
- # generate the html from adoc files in repo
83
- echo "Will generate html to: ${DST_HTML} from adoc files found under ${SRC_ROOT}"
84
- if [[ "${force_remove}" ]]; then
85
- echo "force flag enabled, remove everything under ${DST_HTML}/"
86
- rm -rf ${DST_HTML}/*
87
- fi
88
-
89
- giblish -a icons=font -c -r "${RESOURCE_DIR}" -s giblish -w "${WEB_ROOT}" "${SRC_ROOT}" "${DST_HTML}"
90
- [ $? -ne 0 ] && die
91
-
92
- # copy assets folders
93
- # do this within subshell so we can use find with '.' notation,
94
- # giving relative paths back
95
- echo "Copying asset folders to destination..."
96
- (
97
- cd "${SRC_ROOT}"
98
- find . -name '*_assets' -type d -exec cp -r {} ${DST_HTML}/{} \;
99
- )