postsvg 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +105 -0
  3. data/CLAUDE.md +173 -0
  4. data/Gemfile +2 -3
  5. data/README.adoc +456 -179
  6. data/Rakefile +100 -0
  7. data/TODO.roadmap/00-architecture.md +139 -0
  8. data/TODO.roadmap/01-autoload-migration.md +39 -0
  9. data/TODO.roadmap/02-isolate-dormant-code.md +51 -0
  10. data/TODO.roadmap/03-domain-model.md +66 -0
  11. data/TODO.roadmap/04-lexer.md +40 -0
  12. data/TODO.roadmap/05-parser.md +43 -0
  13. data/TODO.roadmap/06-graphics-state.md +45 -0
  14. data/TODO.roadmap/07-matrix-and-color.md +37 -0
  15. data/TODO.roadmap/08-svg-builder.md +51 -0
  16. data/TODO.roadmap/09-renderer.md +52 -0
  17. data/TODO.roadmap/10-visitor.md +58 -0
  18. data/TODO.roadmap/11-operator-coverage.md +103 -0
  19. data/TODO.roadmap/12-svg-domain.md +62 -0
  20. data/TODO.roadmap/13-translation-handlers.md +69 -0
  21. data/TODO.roadmap/14-ps-serializer.md +49 -0
  22. data/TODO.roadmap/15-cli-and-public-api.md +47 -0
  23. data/TODO.roadmap/16-specs.md +84 -0
  24. data/TODO.roadmap/17-docs-sync.md +47 -0
  25. data/TODO.roadmap/18-performance-and-determinism.md +47 -0
  26. data/TODO.roadmap/19-error-model.md +45 -0
  27. data/TODO.roadmap/20-font-and-text.md +46 -0
  28. data/TODO.roadmap/21-images.md +45 -0
  29. data/TODO.roadmap/22-forms-and-resources.md +25 -0
  30. data/TODO.roadmap/23-level2-level3.md +52 -0
  31. data/TODO.roadmap/24-ci-and-release.md +42 -0
  32. data/TODO.roadmap/README.md +77 -0
  33. data/docs/.gitignore +29 -0
  34. data/docs/CHANGELOG.md +114 -0
  35. data/docs/COMPLETE_DOCUMENTATION_STATUS.md +376 -0
  36. data/docs/DEPLOYMENT.md +456 -0
  37. data/docs/DEPLOYMENT_INSTRUCTIONS.md +229 -0
  38. data/docs/DOCUMENTATION_PLAN.md +425 -0
  39. data/docs/FINAL_SUMMARY.md +657 -0
  40. data/docs/Gemfile +15 -0
  41. data/docs/README.md +327 -0
  42. data/docs/_config.yml +99 -0
  43. data/docs/advanced-topics.adoc +370 -0
  44. data/docs/api-reference/colors.adoc +705 -0
  45. data/docs/api-reference/converter.adoc +699 -0
  46. data/docs/api-reference/execution-context.adoc +1210 -0
  47. data/docs/api-reference/graphics-state.adoc +1070 -0
  48. data/docs/api-reference/interpreter.adoc +810 -0
  49. data/docs/api-reference/matrix.adoc +1179 -0
  50. data/docs/api-reference/path-builder.adoc +1284 -0
  51. data/docs/api-reference/postsvg-module.adoc +388 -0
  52. data/docs/api-reference/svg-generator.adoc +891 -0
  53. data/docs/api-reference/tokenizer.adoc +925 -0
  54. data/docs/api-reference.adoc +221 -0
  55. data/docs/architecture/command-registry.adoc +1191 -0
  56. data/docs/architecture/conversion-pipeline.adoc +746 -0
  57. data/docs/architecture/design-decisions.adoc +999 -0
  58. data/docs/architecture/generator-stage.adoc +1115 -0
  59. data/docs/architecture/graphics-state-model.adoc +1089 -0
  60. data/docs/architecture/interpreter-stage.adoc +1125 -0
  61. data/docs/architecture/parser-stage.adoc +1051 -0
  62. data/docs/architecture.adoc +354 -0
  63. data/docs/cli-reference/batch-command.adoc +616 -0
  64. data/docs/cli-reference/check-command.adoc +677 -0
  65. data/docs/cli-reference/cli-options.adoc +802 -0
  66. data/docs/cli-reference/convert-command.adoc +462 -0
  67. data/docs/cli-reference/version-command.adoc +296 -0
  68. data/docs/cli-reference.adoc +317 -0
  69. data/docs/concepts/conversion-pipeline.adoc +903 -0
  70. data/docs/concepts/coordinate-systems.adoc +836 -0
  71. data/docs/concepts/graphics-state.adoc +861 -0
  72. data/docs/concepts/path-operations.adoc +1076 -0
  73. data/docs/concepts/postscript-language.adoc +859 -0
  74. data/docs/concepts/svg-generation.adoc +937 -0
  75. data/docs/concepts.adoc +198 -0
  76. data/docs/contributing.adoc +443 -0
  77. data/docs/development.adoc +420 -0
  78. data/docs/faq.adoc +493 -0
  79. data/docs/getting-started/basic-usage.adoc +538 -0
  80. data/docs/getting-started/common-workflows.adoc +577 -0
  81. data/docs/getting-started/first-conversion.adoc +492 -0
  82. data/docs/getting-started/installation.adoc +534 -0
  83. data/docs/getting-started.adoc +94 -0
  84. data/docs/index.adoc +248 -0
  85. data/docs/optimization.adoc +196 -0
  86. data/docs/ps2svg_compatibility.adoc +149 -0
  87. data/docs/quick-reference.adoc +453 -0
  88. data/docs/sitemap.adoc +337 -0
  89. data/docs/troubleshooting.adoc +486 -0
  90. data/docs/validation.adoc +772 -0
  91. data/exe/postsvg +1 -0
  92. data/lib/postsvg/cli.rb +104 -57
  93. data/lib/postsvg/color.rb +132 -0
  94. data/lib/postsvg/errors.rb +68 -3
  95. data/lib/postsvg/format_number.rb +22 -0
  96. data/lib/postsvg/graphics_context.rb +80 -0
  97. data/lib/postsvg/graphics_stack.rb +43 -0
  98. data/lib/postsvg/model/literals/array.rb +41 -0
  99. data/lib/postsvg/model/literals/dictionary.rb +34 -0
  100. data/lib/postsvg/model/literals/hex.rb +37 -0
  101. data/lib/postsvg/model/literals/name.rb +40 -0
  102. data/lib/postsvg/model/literals/number.rb +36 -0
  103. data/lib/postsvg/model/literals/procedure.rb +41 -0
  104. data/lib/postsvg/model/literals/string.rb +30 -0
  105. data/lib/postsvg/model/literals.rb +19 -0
  106. data/lib/postsvg/model/operator.rb +58 -0
  107. data/lib/postsvg/model/operators/arithmetic.rb +264 -0
  108. data/lib/postsvg/model/operators/boolean.rb +182 -0
  109. data/lib/postsvg/model/operators/color.rb +74 -0
  110. data/lib/postsvg/model/operators/container.rb +186 -0
  111. data/lib/postsvg/model/operators/control_flow.rb +119 -0
  112. data/lib/postsvg/model/operators/device.rb +21 -0
  113. data/lib/postsvg/model/operators/dictionary.rb +118 -0
  114. data/lib/postsvg/model/operators/font.rb +121 -0
  115. data/lib/postsvg/model/operators/graphics_state.rb +84 -0
  116. data/lib/postsvg/model/operators/painting.rb +29 -0
  117. data/lib/postsvg/model/operators/path.rb +169 -0
  118. data/lib/postsvg/model/operators/stack.rb +72 -0
  119. data/lib/postsvg/model/operators/transformations.rb +103 -0
  120. data/lib/postsvg/model/operators.rb +89 -0
  121. data/lib/postsvg/model/program.rb +68 -0
  122. data/lib/postsvg/model/token.rb +43 -0
  123. data/lib/postsvg/model.rb +17 -0
  124. data/lib/postsvg/options.rb +29 -0
  125. data/lib/postsvg/renderer.rb +85 -0
  126. data/lib/postsvg/serializer.rb +325 -0
  127. data/lib/postsvg/source/ast_builder.rb +308 -0
  128. data/lib/postsvg/source/lexer.rb +322 -0
  129. data/lib/postsvg/source/operand_stack.rb +55 -0
  130. data/lib/postsvg/source.rb +21 -0
  131. data/lib/postsvg/svg/attribute_parser.rb +45 -0
  132. data/lib/postsvg/svg/clip_path_registry.rb +44 -0
  133. data/lib/postsvg/svg/document.rb +22 -0
  134. data/lib/postsvg/svg/element.rb +84 -0
  135. data/lib/postsvg/svg/elements/circle.rb +36 -0
  136. data/lib/postsvg/svg/elements/clip_path.rb +26 -0
  137. data/lib/postsvg/svg/elements/defs.rb +24 -0
  138. data/lib/postsvg/svg/elements/ellipse.rb +38 -0
  139. data/lib/postsvg/svg/elements/group.rb +37 -0
  140. data/lib/postsvg/svg/elements/image.rb +35 -0
  141. data/lib/postsvg/svg/elements/line.rb +36 -0
  142. data/lib/postsvg/svg/elements/path.rb +32 -0
  143. data/lib/postsvg/svg/elements/polygon.rb +12 -0
  144. data/lib/postsvg/svg/elements/polyline.rb +32 -0
  145. data/lib/postsvg/svg/elements/rect.rb +44 -0
  146. data/lib/postsvg/svg/elements/svg.rb +39 -0
  147. data/lib/postsvg/svg/elements/text.rb +42 -0
  148. data/lib/postsvg/svg/elements.rb +31 -0
  149. data/lib/postsvg/svg/paint.rb +34 -0
  150. data/lib/postsvg/svg/parser.rb +39 -0
  151. data/lib/postsvg/svg/path_data/command.rb +27 -0
  152. data/lib/postsvg/svg/path_data/parser.rb +82 -0
  153. data/lib/postsvg/svg/path_data.rb +17 -0
  154. data/lib/postsvg/svg/stroke.rb +31 -0
  155. data/lib/postsvg/svg/transform_list.rb +59 -0
  156. data/lib/postsvg/svg.rb +22 -0
  157. data/lib/postsvg/svg_builder.rb +249 -0
  158. data/lib/postsvg/translation/arc_converter.rb +86 -0
  159. data/lib/postsvg/translation/bounding_box.rb +59 -0
  160. data/lib/postsvg/translation/context.rb +34 -0
  161. data/lib/postsvg/translation/handler_registry.rb +38 -0
  162. data/lib/postsvg/translation/handlers/circle_handler.rb +28 -0
  163. data/lib/postsvg/translation/handlers/clip_path_handler.rb +13 -0
  164. data/lib/postsvg/translation/handlers/defs_handler.rb +15 -0
  165. data/lib/postsvg/translation/handlers/ellipse_handler.rb +31 -0
  166. data/lib/postsvg/translation/handlers/group_handler.rb +21 -0
  167. data/lib/postsvg/translation/handlers/image_handler.rb +20 -0
  168. data/lib/postsvg/translation/handlers/line_handler.rb +23 -0
  169. data/lib/postsvg/translation/handlers/open_handler.rb +18 -0
  170. data/lib/postsvg/translation/handlers/path_handler.rb +356 -0
  171. data/lib/postsvg/translation/handlers/polygon_handler.rb +33 -0
  172. data/lib/postsvg/translation/handlers/polyline_handler.rb +31 -0
  173. data/lib/postsvg/translation/handlers/rect_handler.rb +27 -0
  174. data/lib/postsvg/translation/handlers/shared.rb +110 -0
  175. data/lib/postsvg/translation/handlers/svg_handler.rb +25 -0
  176. data/lib/postsvg/translation/handlers/text_handler.rb +56 -0
  177. data/lib/postsvg/translation/handlers.rb +25 -0
  178. data/lib/postsvg/translation/ps_renderer.rb +105 -0
  179. data/lib/postsvg/translation/record_emitter.rb +35 -0
  180. data/lib/postsvg/translation.rb +17 -0
  181. data/lib/postsvg/version.rb +1 -1
  182. data/lib/postsvg/visitors/ps_visitor/arithmetic.rb +125 -0
  183. data/lib/postsvg/visitors/ps_visitor/boolean.rb +105 -0
  184. data/lib/postsvg/visitors/ps_visitor/color.rb +53 -0
  185. data/lib/postsvg/visitors/ps_visitor/common.rb +66 -0
  186. data/lib/postsvg/visitors/ps_visitor/container.rb +164 -0
  187. data/lib/postsvg/visitors/ps_visitor/control_flow.rb +110 -0
  188. data/lib/postsvg/visitors/ps_visitor/device.rb +20 -0
  189. data/lib/postsvg/visitors/ps_visitor/dictionary.rb +89 -0
  190. data/lib/postsvg/visitors/ps_visitor/font.rb +93 -0
  191. data/lib/postsvg/visitors/ps_visitor/graphics_state.rb +55 -0
  192. data/lib/postsvg/visitors/ps_visitor/painting.rb +90 -0
  193. data/lib/postsvg/visitors/ps_visitor/path.rb +112 -0
  194. data/lib/postsvg/visitors/ps_visitor/stack.rb +47 -0
  195. data/lib/postsvg/visitors/ps_visitor/transformations.rb +101 -0
  196. data/lib/postsvg/visitors/ps_visitor.rb +208 -0
  197. data/lib/postsvg/visitors.rb +9 -0
  198. data/lib/postsvg.rb +93 -59
  199. data/lychee.toml +86 -0
  200. metadata +216 -11
  201. data/postsvg.gemspec +0 -38
@@ -0,0 +1,456 @@
1
+ # Deploying Postsvg Documentation
2
+
3
+ This guide explains how to deploy the Postsvg documentation site to various platforms.
4
+
5
+ ## Quick Deploy to GitHub Pages
6
+
7
+ The easiest deployment method is GitHub Pages (already configured).
8
+
9
+ ### Prerequisites
10
+
11
+ - Repository pushed to GitHub
12
+ - Documentation in `docs/` directory
13
+ - `_config.yml` properly configured
14
+
15
+ ### Steps
16
+
17
+ 1. **Enable GitHub Pages:**
18
+ ```
19
+ Repository Settings → Pages
20
+ Source: Deploy from a branch
21
+ Branch: main
22
+ Folder: /docs
23
+ ```
24
+
25
+ 2. **Wait for deployment:**
26
+ - GitHub Actions will automatically build the site
27
+ - Check the Actions tab for build status
28
+ - Site will be available at: `https://metanorma.github.io/postsvg`
29
+
30
+ 3. **Verify deployment:**
31
+ ```sh
32
+ # Check the site is live
33
+ curl -I https://metanorma.github.io/postsvg
34
+ ```
35
+
36
+ ### Troubleshooting GitHub Pages
37
+
38
+ **Problem:** Site not building
39
+
40
+ **Solution:**
41
+ ```sh
42
+ # Check _config.yml syntax
43
+ bundle exec jekyll build
44
+
45
+ # View build logs in GitHub Actions tab
46
+ ```
47
+
48
+ **Problem:** 404 errors on pages
49
+
50
+ **Solution:**
51
+ - Ensure baseurl in `_config.yml` matches repository name
52
+ - Check file extensions are `.adoc` not `.md`
53
+ - Verify `jekyll-asciidoc` plugin is in `_config.yml`
54
+
55
+ ## Local Testing
56
+
57
+ Always test locally before deploying:
58
+
59
+ ```sh
60
+ cd docs
61
+
62
+ # Install dependencies
63
+ bundle install
64
+
65
+ # Serve locally
66
+ bundle exec jekyll serve
67
+
68
+ # View at http://localhost:4000/postsvg
69
+
70
+ # Build static site
71
+ bundle exec jekyll build
72
+
73
+ # Output in _site/
74
+ ```
75
+
76
+ ### Local Testing Checklist
77
+
78
+ - [ ] All pages load without errors
79
+ - [ ] Navigation works correctly
80
+ - [ ] Search functions properly
81
+ - [ ] Links are not broken
82
+ - [ ] Code examples display correctly
83
+ - [ ] Images/diagrams load
84
+ - [ ] Mobile layout works
85
+
86
+ ## Deploy to Netlify
87
+
88
+ For continuous deployment with Netlify:
89
+
90
+ ### Setup
91
+
92
+ 1. **Create `netlify.toml` in repository root:**
93
+
94
+ ```toml
95
+ [build]
96
+ base = "docs"
97
+ publish = "_site"
98
+ command = "bundle exec jekyll build"
99
+
100
+ [build.environment]
101
+ RUBY_VERSION = "3.2"
102
+
103
+ [[redirects]]
104
+ from = "/*"
105
+ to = "/index.html"
106
+ status = 200
107
+ ```
108
+
109
+ 2. **Connect repository:**
110
+ - Go to Netlify dashboard
111
+ - "New site from Git"
112
+ - Select GitHub repository
113
+ - Configure build settings (auto-detected from netlify.toml)
114
+
115
+ 3. **Deploy:**
116
+ - Push to main branch
117
+ - Netlify automatically builds and deploys
118
+ - Site available at: `https://your-site.netlify.app`
119
+
120
+ ### Custom Domain on Netlify
121
+
122
+ 1. **Add domain:**
123
+ ```
124
+ Site Settings → Domain Management → Add custom domain
125
+ ```
126
+
127
+ 2. **Configure DNS:**
128
+ ```
129
+ Add CNAME record:
130
+ docs.postsvg.org → your-site.netlify.app
131
+ ```
132
+
133
+ 3. **Enable HTTPS:**
134
+ - Automatically enabled by Netlify
135
+ - Free Let's Encrypt certificate
136
+
137
+ ## Deploy to Vercel
138
+
139
+ For deployment with Vercel:
140
+
141
+ ### Setup
142
+
143
+ 1. **Install Vercel CLI:**
144
+ ```sh
145
+ npm install -g vercel
146
+ ```
147
+
148
+ 2. **Create `vercel.json` in docs directory:**
149
+
150
+ ```json
151
+ {
152
+ "buildCommand": "bundle exec jekyll build",
153
+ "outputDirectory": "_site",
154
+ "framework": "jekyll"
155
+ }
156
+ ```
157
+
158
+ 3. **Deploy:**
159
+ ```sh
160
+ cd docs
161
+ vercel
162
+ ```
163
+
164
+ 4. **Production deployment:**
165
+ ```sh
166
+ vercel --prod
167
+ ```
168
+
169
+ ## Deploy to Custom Server
170
+
171
+ For deployment to your own server:
172
+
173
+ ### Build Static Site
174
+
175
+ ```sh
176
+ cd docs
177
+ bundle install
178
+ bundle exec jekyll build
179
+
180
+ # Output is in _site/
181
+ ```
182
+
183
+ ### Upload to Server
184
+
185
+ ```sh
186
+ # Using rsync
187
+ rsync -avz _site/ user@server:/var/www/docs/
188
+
189
+ # Using scp
190
+ scp -r _site/* user@server:/var/www/docs/
191
+ ```
192
+
193
+ ### Nginx Configuration
194
+
195
+ ```nginx
196
+ server {
197
+ listen 80;
198
+ server_name docs.postsvg.org;
199
+
200
+ root /var/www/docs;
201
+ index index.html;
202
+
203
+ location / {
204
+ try_files $uri $uri/ =404;
205
+ }
206
+
207
+ # Enable gzip
208
+ gzip on;
209
+ gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
210
+ }
211
+ ```
212
+
213
+ ### Apache Configuration
214
+
215
+ ```apache
216
+ <VirtualHost *:80>
217
+ ServerName docs.postsvg.org
218
+ DocumentRoot /var/www/docs
219
+
220
+ <Directory /var/www/docs>
221
+ Options Indexes FollowSymLinks
222
+ AllowOverride All
223
+ Require all granted
224
+ </Directory>
225
+
226
+ # Enable compression
227
+ <IfModule mod_deflate.c>
228
+ AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
229
+ </IfModule>
230
+ </VirtualHost>
231
+ ```
232
+
233
+ ## Automated Deployment with GitHub Actions
234
+
235
+ Create `.github/workflows/deploy-docs.yml`:
236
+
237
+ ```yaml
238
+ name: Deploy Documentation
239
+
240
+ on:
241
+ push:
242
+ branches: [ main ]
243
+ paths:
244
+ - 'docs/**'
245
+
246
+ jobs:
247
+ deploy:
248
+ runs-on: ubuntu-latest
249
+ steps:
250
+ - uses: actions/checkout@v3
251
+
252
+ - name: Setup Ruby
253
+ uses: ruby/setup-ruby@v1
254
+ with:
255
+ ruby-version: '3.2'
256
+ bundler-cache: true
257
+ working-directory: docs
258
+
259
+ - name: Build site
260
+ run: |
261
+ cd docs
262
+ bundle exec jekyll build
263
+
264
+ - name: Deploy to GitHub Pages
265
+ uses: peaceiris/actions-gh-pages@v3
266
+ with:
267
+ github_token: ${{ secrets.GITHUB_TOKEN }}
268
+ publish_dir: ./docs/_site
269
+ ```
270
+
271
+ ## Custom Domain Setup
272
+
273
+ ### GitHub Pages Custom Domain
274
+
275
+ 1. **Add CNAME file:**
276
+ ```sh
277
+ echo "docs.postsvg.org" > docs/CNAME
278
+ ```
279
+
280
+ 2. **Configure DNS:**
281
+ ```
282
+ CNAME record:
283
+ docs.postsvg.org → metanorma.github.io
284
+
285
+ Or A records:
286
+ docs.postsvg.org → 185.199.108.153
287
+ docs.postsvg.org → 185.199.109.153
288
+ docs.postsvg.org → 185.199.110.153
289
+ docs.postsvg.org → 185.199.111.153
290
+ ```
291
+
292
+ 3. **Enable HTTPS:**
293
+ ```
294
+ Repository Settings → Pages → Enforce HTTPS
295
+ ```
296
+
297
+ ## Monitoring Deployment
298
+
299
+ ### Check Build Status
300
+
301
+ **GitHub Pages:**
302
+ ```sh
303
+ # Check Actions tab in repository
304
+ # Or use GitHub API:
305
+ curl https://api.github.com/repos/metanorma/postsvg/pages/builds/latest
306
+ ```
307
+
308
+ **Netlify:**
309
+ ```sh
310
+ # Check Netlify dashboard
311
+ # Or use Netlify CLI:
312
+ netlify status
313
+ ```
314
+
315
+ ### Monitor Site Health
316
+
317
+ ```sh
318
+ # Check site is accessible
319
+ curl -I https://docs.postsvg.org
320
+
321
+ # Check specific pages
322
+ curl -s https://docs.postsvg.org/getting-started/ | grep "<title>"
323
+
324
+ # Check for broken links (using linkchecker)
325
+ linkchecker https://docs.postsvg.org
326
+ ```
327
+
328
+ ## Rollback Deployment
329
+
330
+ ### GitHub Pages
331
+
332
+ ```sh
333
+ # Revert last commit
334
+ git revert HEAD
335
+ git push origin main
336
+
337
+ # Or deploy specific commit
338
+ git checkout <commit-hash> docs/
339
+ git commit -m "Rollback docs to <commit-hash>"
340
+ git push origin main
341
+ ```
342
+
343
+ ### Netlify
344
+
345
+ ```
346
+ Deploys → Select previous deployment → Publish deploy
347
+ ```
348
+
349
+ ## Performance Optimization
350
+
351
+ ### Enable Caching
352
+
353
+ Add to `_config.yml`:
354
+
355
+ ```yaml
356
+ # Minify HTML
357
+ compress_html:
358
+ clippings: all
359
+ comments: all
360
+ endings: all
361
+ ignore:
362
+ envs: [development]
363
+ ```
364
+
365
+ ### Optimize Images
366
+
367
+ ```sh
368
+ # Install image optimizer
369
+ gem install image_optim image_optim_pack
370
+
371
+ # Optimize images
372
+ image_optim -r docs/images/
373
+ ```
374
+
375
+ ### Enable CDN
376
+
377
+ **Using Cloudflare:**
378
+ 1. Add site to Cloudflare
379
+ 2. Point DNS to Cloudflare nameservers
380
+ 3. Enable caching and minification
381
+ 4. Configure SSL/TLS to Full
382
+
383
+ ## Post-Deployment Checklist
384
+
385
+ - [ ] Site loads at production URL
386
+ - [ ] All pages are accessible
387
+ - [ ] Navigation works correctly
388
+ - [ ] Search is functional
389
+ - [ ] HTTPS is enabled
390
+ - [ ] Custom domain resolves correctly
391
+ - [ ] Mobile layout renders properly
392
+ - [ ] No broken links
393
+ - [ ] Analytics tracking (if configured)
394
+ - [ ] Sitemap generated
395
+ - [ ] robots.txt is correct
396
+
397
+ ## Troubleshooting
398
+
399
+ ### Build Failures
400
+
401
+ **Missing dependencies:**
402
+ ```sh
403
+ cd docs
404
+ bundle install
405
+ bundle exec jekyll build
406
+ ```
407
+
408
+ **Plugin errors:**
409
+ ```sh
410
+ # Check plugin versions in Gemfile
411
+ # Update plugins:
412
+ bundle update
413
+ ```
414
+
415
+ ### Deployment Issues
416
+
417
+ **Site not updating:**
418
+ ```sh
419
+ # Clear GitHub Pages cache
420
+ # Push new commit:
421
+ git commit --allow-empty -m "Trigger rebuild"
422
+ git push origin main
423
+ ```
424
+
425
+ **404 errors:**
426
+ ```sh
427
+ # Check baseurl in _config.yml
428
+ # Verify file paths are correct
429
+ # Ensure jekyll-asciidoc is installed
430
+ ```
431
+
432
+ ## Support
433
+
434
+ For deployment issues:
435
+ - Check [GitHub Pages documentation](https://docs.github.com/en/pages)
436
+ - Review [Jekyll documentation](https://jekyllrb.com/docs/)
437
+ - See [just-the-docs theme docs](https://just-the-docs.com/)
438
+ - Create issue at https://github.com/metanorma/postsvg/issues
439
+
440
+ ## Quick Reference
441
+
442
+ ```sh
443
+ # Local development
444
+ cd docs && bundle exec jekyll serve
445
+
446
+ # Build static site
447
+ cd docs && bundle exec jekyll build
448
+
449
+ # Deploy to GitHub Pages
450
+ git push origin main
451
+
452
+ # Check build status
453
+ # Visit: https://github.com/metanorma/postsvg/actions
454
+
455
+ # Access deployed site
456
+ # Visit: https://metanorma.github.io/postsvg
@@ -0,0 +1,229 @@
1
+ # GitHub Pages Deployment Instructions
2
+
3
+ This guide provides step-by-step instructions for deploying the PostSVG documentation to GitHub Pages.
4
+
5
+ ## Prerequisites
6
+
7
+ - Repository must be public or have GitHub Pages enabled for private repositories
8
+ - Documentation is committed and pushed to the `main` branch
9
+ - All link validation checks have passed
10
+
11
+ ## Enabling GitHub Pages
12
+
13
+ ### Step 1: Navigate to Repository Settings
14
+
15
+ 1. Go to the PostSVG repository: https://github.com/metanorma/postsvg
16
+ 2. Click on the **Settings** tab (located in the top navigation bar)
17
+ 3. In the left sidebar, scroll down to the **Code and automation** section
18
+ 4. Click on **Pages**
19
+
20
+ ### Step 2: Configure GitHub Pages Source
21
+
22
+ 1. Under **Build and deployment**, find the **Source** section
23
+ 2. Click the dropdown menu under **Source** and select **Deploy from a branch**
24
+ 3. Under **Branch**, select:
25
+ - Branch: `main`
26
+ - Folder: `/docs`
27
+ 4. Click **Save**
28
+
29
+ ### Step 3: Wait for Deployment
30
+
31
+ GitHub Pages will automatically build and deploy your site. This typically takes 1-3 minutes.
32
+
33
+ ## Expected Deployment URL
34
+
35
+ Once deployed, your documentation will be available at:
36
+
37
+ ```
38
+ https://metanorma.github.io/postsvg/
39
+ ```
40
+
41
+ The main documentation page will be:
42
+
43
+ ```
44
+ https://metanorma.github.io/postsvg/index.html
45
+ ```
46
+
47
+ ## Verifying Deployment
48
+
49
+ ### Method 1: Check GitHub Actions
50
+
51
+ 1. Go to the **Actions** tab in your repository
52
+ 2. Look for a workflow named **pages build and deployment**
53
+ 3. Wait for the workflow to complete (green checkmark ✓)
54
+ 4. The workflow details will show the deployment URL
55
+
56
+ ### Method 2: Check Settings Page
57
+
58
+ 1. Return to **Settings** > **Pages**
59
+ 2. At the top of the page, you'll see a banner that says:
60
+ ```
61
+ Your site is live at https://metanorma.github.io/postsvg/
62
+ ```
63
+ 3. Click **Visit site** to view your documentation
64
+
65
+ ### Method 3: Manual Verification
66
+
67
+ 1. Open a browser and navigate to: https://metanorma.github.io/postsvg/
68
+ 2. Verify that the documentation loads correctly
69
+ 3. Check navigation between pages works
70
+ 4. Verify all internal links are functional
71
+
72
+ ## Monitoring GitHub Actions Workflows
73
+
74
+ ### Link Check Workflow
75
+
76
+ The repository includes a `link-check.yml` workflow that runs on:
77
+ - Every push to `main`
78
+ - Every pull request
79
+ - Weekly schedule (Mondays at 00:00 UTC)
80
+
81
+ To monitor this workflow:
82
+
83
+ 1. Go to **Actions** tab
84
+ 2. Click on **Check Documentation Links** workflow
85
+ 3. View recent runs and their status
86
+
87
+ ### Troubleshooting Link Check Failures
88
+
89
+ If the link check workflow fails:
90
+
91
+ 1. Click on the failed workflow run
92
+ 2. Click on the **check-links** job
93
+ 3. Review the output to identify broken links
94
+ 4. Fix the broken links in the documentation
95
+ 5. Commit and push the changes
96
+ 6. The workflow will run automatically
97
+
98
+ ## Common Issues and Solutions
99
+
100
+ ### Issue 1: Site Not Updating
101
+
102
+ **Symptom**: Changes to documentation don't appear on the live site
103
+
104
+ **Solutions**:
105
+ - Clear your browser cache (Ctrl+Shift+R or Cmd+Shift+R)
106
+ - Wait 5-10 minutes for GitHub's CDN to update
107
+ - Check that changes were actually pushed to the `main` branch
108
+ - Verify the workflow completed successfully in Actions tab
109
+
110
+ ### Issue 2: 404 Page Not Found
111
+
112
+ **Symptom**: GitHub Pages shows 404 error
113
+
114
+ **Solutions**:
115
+ - Ensure the `/docs` folder exists in the `main` branch
116
+ - Verify `index.html` exists in the `/docs` folder
117
+ - Check that GitHub Pages is configured to use `/docs` folder
118
+ - Ensure the repository is public (or Pages is enabled for private repos)
119
+
120
+ ### Issue 3: Broken Links
121
+
122
+ **Symptom**: Internal links don't work or show 404 errors
123
+
124
+ **Solutions**:
125
+ - Run `rake check:links` locally to identify broken links
126
+ - Ensure all file references use relative paths
127
+ - Verify file extensions match exactly (case-sensitive)
128
+ - Check that cross-references use correct paths
129
+
130
+ ### Issue 4: Workflow Failures
131
+
132
+ **Symptom**: GitHub Actions workflows fail
133
+
134
+ **Solutions**:
135
+ - Check the workflow logs in the Actions tab
136
+ - Ensure all required files are committed
137
+ - Verify that Ruby and dependencies are properly installed
138
+ - For link-check failures, review the specific broken links reported
139
+
140
+ ### Issue 5: Custom Domain Not Working
141
+
142
+ **Symptom**: Custom domain doesn't resolve to GitHub Pages
143
+
144
+ **Solutions**:
145
+ - Verify DNS records are correctly configured
146
+ - Allow 24-48 hours for DNS propagation
147
+ - Check that the CNAME file exists in `/docs`
148
+ - Ensure HTTPS is enabled in GitHub Pages settings
149
+
150
+ ## Maintenance
151
+
152
+ ### Regular Tasks
153
+
154
+ 1. **Weekly Link Checks**: Monitor the automated weekly link check workflow
155
+ 2. **Update Documentation**: Keep documentation in sync with code changes
156
+ 3. **Review Pull Requests**: Ensure documentation changes pass link validation
157
+ 4. **Monitor Issues**: Address documentation-related issues promptly
158
+
159
+ ### Best Practices
160
+
161
+ 1. Always run `rake check:links` before pushing documentation changes
162
+ 2. Use relative paths for all internal documentation links
163
+ 3. Test documentation locally before deploying
164
+ 4. Keep the documentation structure organized and MECE
165
+ 5. Update the documentation when adding new features or commands
166
+
167
+ ## Rollback Procedure
168
+
169
+ If you need to rollback to a previous version:
170
+
171
+ 1. Identify the commit hash of the working version
172
+ 2. Create a new branch from that commit:
173
+ ```bash
174
+ git checkout -b rollback-docs <commit-hash>
175
+ ```
176
+ 3. Force push to main (use with caution):
177
+ ```bash
178
+ git push origin rollback-docs:main --force
179
+ ```
180
+ 4. Wait for GitHub Pages to redeploy
181
+
182
+ ## Support
183
+
184
+ For issues specific to GitHub Pages deployment:
185
+ - GitHub Pages Documentation: https://docs.github.com/en/pages
186
+ - GitHub Actions Documentation: https://docs.github.com/en/actions
187
+
188
+ For PostSVG documentation issues:
189
+ - Open an issue at: https://github.com/metanorma/postsvg/issues
190
+ - Include the page URL and description of the problem
191
+ - Attach screenshots if relevant
192
+
193
+ ## Quick Reference Commands
194
+
195
+ ```bash
196
+ # Check links locally
197
+ rake check:links
198
+
199
+ # Push documentation to GitHub
200
+ git push origin main
201
+
202
+ # View git log
203
+ git log --oneline
204
+
205
+ # Check current branch
206
+ git branch
207
+
208
+ # View workflow status (requires GitHub CLI)
209
+ gh workflow list
210
+ gh run list --workflow=link-check.yml
211
+ ```
212
+
213
+ ## Deployment Checklist
214
+
215
+ Before deploying documentation updates:
216
+
217
+ - [ ] All new files created and committed
218
+ - [ ] Link validation passes (`rake check:links`)
219
+ - [ ] Changes pushed to `main` branch
220
+ - [ ] GitHub Actions workflows triggered
221
+ - [ ] Link check workflow passes
222
+ - [ ] Documentation accessible at GitHub Pages URL
223
+ - [ ] All navigation links work correctly
224
+ - [ ] Cross-references resolve properly
225
+ - [ ] No 404 errors on any pages
226
+
227
+ ---
228
+
229
+ Last Updated: 2025-10-25