aboutsummaryrefslogtreecommitdiffhomepage
path: root/.envrc-local_
blob: 3cfc9b1863d62fccd5ff94f6f0ea70ee43e7ed6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos
#export NIX_PATH=/nixpkgs-ra/nixpkgs
## reload when these files change
#use flake
watch_file flake.nix
# watch_file flake.lock
## load the flake devShell
eval "$(nix print-dev-env)"
# echo $NIX_BUILD_TOP
export SpineVER=$(git describe --long --tags | sed 's/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g')
export SpineSRC=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform
export SpineBIN=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform/result/bin
export SpineDOC=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples
export SpineOUT=/srv/www/spine/$SpineVER
export SpineOUTstatic=/srv/www/spine/static

echo '-*- mode: org -*-

* nixpkgs path?

  eval "$(nix print-dev-env)"
' > nix_note_

echo "  <nixpkgs> == `nix-instantiate --find-file nixpkgs`" >> nix_note_

echo '
* nix build and show derivation

  nix-shell --pure

  nix-build
  nix build -f default.nix
  nix shell -f default.nix
  nix-instantiate | nix-build
  nix build `nix-instantiate`

  nix develop

  nix-instantiate | nix show-derivation | jq
  nix-instantiate | nix show-derivation --recursive | jq

  nix search --json 2>/dev/null |jq

* version and build info
' >> nix_note_

echo "  spine version (git) == $SpineVER" >> nix_note_
echo "  nix-instantiate == `nix-instantiate`" >> nix_note_

echo "
* initialised shell variables

  SpineSRC=$SpineSRC
  SpineDOC=$SpineDOC
  SpineOUT=$SpineOUT
  SpineOUTstatic=$SpineOUTstatic
" >> nix_note_

echo '* spine run instruction examples
** parallelized tasks

  - doc source
    $SpineBIN/spine --very-verbose --pod --source --output="$SpineOUT" $SpineDOC/markup/pod/*

  - html & epub output
    $SpineBIN/spine --very-verbose --html --epub --output="$SpineOUT" $SpineDOC/markup/pod/*

  - sqlite db for each document - populate each db
    $SpineBIN/spine --very-verbose --sqlite-discrete --output="$SpineOUT" $SpineDOC/markup/pod/*

  - doc source; html, epub; sqlite outputs
    $SpineBIN/spine --verbose --pod --html --epub --sqlite-discrete --output="$SpineOUT" $SpineDOC/markup/pod/*

  - harvest (authors topics)
    $SpineBIN/spine --very-verbose --harvest --output="$SpineOUT" $SpineDOC/markup/pod/*
  - html, harvest
    $SpineBIN/spine --verbose --dark --html --html-link-harvest --harvest --output="$SpineOUT" $SpineDOC/markup/pod/*
    $SpineBIN/spine --very-verbose --html --html-link-harvest --harvest --output="$SpineOUT" $SpineDOC/markup/pod/*

  - composite command: source pod, html, epub, harvest, sqlite
    $SpineBIN/spine --verbose --dark --pod --epub --html --html-link-harvest --harvest --sqlite-discrete --output="$SpineOUT" $SpineDOC/markup/pod/*

** sequential tasks

  - sqlite db (shared)  - create db
    $SpineBIN/spine --very-verbose --sqlite-db-create --output="$SpineOUT"
  - sqlite db (shared) - populate db
    $SpineBIN/spine --very-verbose --sqlite-update --output="$SpineOUT" $SpineDOC/spine-markup-samples/markup/pod/*
  - sqlite db (shared) - drop db
    $SpineBIN/spine --very-verbose --sqlite-db-drop --output="$SpineOUT"

  - sqlite db (shared) - create & populate db (single step)
    $SpineBIN/spine --very-verbose --sqlite-db-create --sqlite-update --output="$SpineOUT" $SpineDOC/markup/pod/*

  - composite command: source pod, html, epub, harvest, sqlite
    $SpineBIN/spine --verbose --no-parallel --dark --pod --epub --html --html-link-harvest --harvest --sqlite-discrete --output="$SpineOUT" $SpineDOC/markup/pod/*

** config [./pod/].dr/config_local_site

  cat $SpineDOC/markup/pod/.dr/config_local_site
  $SpineBIN/spine --show-config $SpineDOC/markup/pod
  $SpineBIN/spine --show-config --output="$SpineOUT" $SpineDOC/markup/pod

** cgi operations (output to $SpineOUTstatic /var/www)

    $SpineBIN/spine --very-verbose --sqlite-db-create --output="$SpineOUTstatic" $SpineDOC/markup/pod/*

    $SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUTstatic $SpineDOC/markup/pod/*

    $SpineBIN/spine -v --show-config --config=$SpineDOC/markup/pod/.dr

    $SpineBIN/spine --html $SpineDOC/markup/pod/*

    $SpineBIN/spine -v  --sqlite-db-create --sqlite-db-filename="spine.search.db" --output="$SpineOUTstatic" $SpineDOC/markup/pod/*

    $SpineBIN/spine -v  --sqlite-db-create --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine-search" --output=$SpineOUTstatic $SpineDOC/markup/pod/*
    $SpineBIN/spine -v  --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine-search" --output=$SpineOUTstatic $SpineDOC/markup/pod/*

    $SpineBIN/spine -v  --sqlite-update --sqlite-db-filename="spine.search.db"   --output=$SpineOUTstatic $SpineDOC/markup/pod/*

    $SpineBIN/spine -v --cgi-search-form-codegen --config=$SpineDOC/markup/pod/.dr/config_local_site

  - generate html linked to search form
    $SpineBIN/spine -v --html --html-link-search --html-link-harvest --harvest  --output=$SpineOUTstatic $SpineDOC/markup/pod/*

  - populate sqlite db
    $SpineBIN/spine -v  --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine-search" --sqlite-update --output=$SpineOUTstatic $SpineDOC/markup/pod/*

  - make search form
    $SpineBIN/spine -v --cgi-search-form-codegen --config=$SpineDOC/markup/pod/.dr/config_local_site --output=$SpineOUTstatic

' >> nix_note_
cat nix_note_
echo "cat nix_note_"