scriptorium 0.0.2 → 0.6.1
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.
- checksums.yaml +4 -4
- data/README.lt3 +324 -0
- data/README.md +3155 -1
- data/assets/.DS_Store +0 -0
- data/assets/README.md +44 -0
- data/assets/back-icon.png +0 -0
- data/assets/icons/facebook.svg +1 -0
- data/assets/icons/github.svg +1 -0
- data/assets/icons/instagram.svg +1 -0
- data/assets/icons/reddit.svg +1 -0
- data/assets/icons/ui/.DS_Store +0 -0
- data/assets/icons/ui/back.png +0 -0
- data/assets/icons/ui/copy.png +0 -0
- data/assets/icons/ui/down.png +0 -0
- data/assets/icons/ui/end.png +0 -0
- data/assets/icons/ui/exit.png +0 -0
- data/assets/icons/ui/foo +10 -0
- data/assets/icons/ui/home.png +0 -0
- data/assets/icons/ui/left.png +0 -0
- data/assets/icons/ui/next.png +0 -0
- data/assets/icons/ui/right.png +0 -0
- data/assets/icons/ui/start.png +0 -0
- data/assets/icons/ui/up.png +0 -0
- data/assets/icons/x.svg +1 -0
- data/assets/icons/youtube.svg +1 -0
- data/assets/samples/placeholder.svg +9 -0
- data/assets/themes/standard/favicon.svg +6 -0
- data/bin/scriptorium +1511 -0
- data/doc/README.txt +6 -0
- data/doc/anti-amnesia/20250727-054000-scriptorium-overview.md +95 -0
- data/doc/anti-amnesia/20250727-060000-api-design-tui-planning.md +34 -0
- data/doc/anti-amnesia/20250727-061000-runeblog-tui-analysis.md +50 -0
- data/doc/anti-amnesia/20250727-123000-anti-amnesia-conventions.md +31 -0
- data/doc/anti-amnesia/20250727-154000-livetext-plugin-file-stats.md +73 -0
- data/doc/anti-amnesia/20250727-172600-cursor-rbenv-ruby-version-mystery.md +64 -0
- data/doc/anti-amnesia/20250727-172600-unified-minitest-framework.md +70 -0
- data/doc/anti-amnesia/20250727-172900-ai-cognitive-assessment-capabilities.md +40 -0
- data/doc/anti-amnesia/20250727-173000-widget-testing-achievement.md +110 -0
- data/doc/anti-amnesia/20250727-180000-post-id-num-refactoring.md +73 -0
- data/doc/anti-amnesia/20250728-124243-aaa-syntax-clarification.md +46 -0
- data/doc/anti-amnesia/20250728-124421-conversation-summary-concise.md +124 -0
- data/doc/anti-amnesia/20250729-190000-scriptorium-tui-testing-complete.md +46 -0
- data/doc/anti-amnesia/20250729-200000-scriptorium-tui-testing-edit-file-workflow.md +97 -0
- data/doc/anti-amnesia/20250729-210000-reddit-autopost-integration-complete.md +158 -0
- data/doc/anti-amnesia/20250729-211500-dependency-management-system.md +211 -0
- data/doc/anti-amnesia/20250729-213000-python-virtual-environment-setup.md +141 -0
- data/doc/anti-amnesia/20250729-214500-theme-management-commands.md +211 -0
- data/doc/anti-amnesia/20250729-215000-version-update-to-0.6.0.md +134 -0
- data/doc/anti-amnesia/20250729-220000-user-guide-complete.md +41 -0
- data/doc/anti-amnesia/20250804-190500-cognitive-loop-bug.md +45 -0
- data/doc/anti-amnesia/20250804-190700-anti-amnesia-timestamping-fix.md +30 -0
- data/doc/anti-amnesia/20250804-213700-publishing-test-fix.md +49 -0
- data/doc/anti-amnesia/20250804-214400-additional-test-fixes.md +46 -0
- data/doc/anti-amnesia/20250804-220000-asset-function-logic-clarification.md +41 -0
- data/doc/anti-amnesia/20250806-202032-asset-function-logic-clarification.md +41 -0
- data/doc/anti-amnesia/20250807-213025.md +116 -0
- data/doc/anti-amnesia/20250813-082428-syntax-highlighting-and-navigation-improvements.md +256 -0
- data/doc/banner_svg_config.md +114 -0
- data/doc/contrib.lt3 +8 -0
- data/doc/dependencies.md +281 -0
- data/doc/hacker.lt3 +5 -0
- data/doc/reddit_credentials_template.json +8 -0
- data/doc/reddit_integration.md +207 -0
- data/doc/user.lt3 +38 -0
- data/doc/user_guide_section_1.md +137 -0
- data/doc/user_guide_section_10.md +515 -0
- data/doc/user_guide_section_11.md +708 -0
- data/doc/user_guide_section_2.md +233 -0
- data/doc/user_guide_section_3.md +5 -0
- data/doc/user_guide_section_4.md +221 -0
- data/doc/user_guide_section_5.md +243 -0
- data/doc/user_guide_section_6.md +147 -0
- data/doc/user_guide_section_7.md +311 -0
- data/doc/user_guide_section_8.md +224 -0
- data/doc/user_guide_section_9.md +375 -0
- data/doc/userdoc-toc.txt +88 -0
- data/lib/rouge/lexers/livetext.rb +74 -0
- data/lib/scriptorium/api.rb +640 -0
- data/lib/scriptorium/banner_svg.rb +742 -0
- data/lib/scriptorium/contract.rb +33 -0
- data/lib/scriptorium/exceptions.rb +174 -0
- data/lib/scriptorium/helpers.rb +475 -0
- data/lib/scriptorium/post.rb +195 -0
- data/lib/scriptorium/reddit.rb +83 -0
- data/lib/scriptorium/repo.rb +624 -0
- data/lib/scriptorium/standard_files.rb +515 -0
- data/lib/scriptorium/syntax_highlighter.rb +234 -0
- data/lib/scriptorium/theme.rb +179 -0
- data/lib/scriptorium/version.rb +2 -2
- data/lib/scriptorium/view.rb +976 -0
- data/lib/scriptorium/widgets/featured_posts.rb +149 -0
- data/lib/scriptorium/widgets/links.rb +112 -0
- data/lib/scriptorium/widgets/pages.rb +133 -0
- data/lib/scriptorium/widgets/widget.rb +133 -0
- data/lib/scriptorium.rb +22 -9
- data/lib/skeleton.rb +11 -2
- data/scriptorium.gemspec +15 -4
- data/test/README.md +69 -0
- data/test/all +43 -0
- data/test/api_demo.rb +99 -0
- data/test/assets/imagenotfound.jpg +0 -0
- data/test/assets/images/.DS_Store +0 -0
- data/test/assets/images/README.md +27 -0
- data/test/assets/images/odd_aspect.png +0 -0
- data/test/assets/images/perfect.png +0 -0
- data/test/assets/images/small.png +0 -0
- data/test/assets/images/tall.png +0 -0
- data/test/assets/images/very_tall.png +0 -0
- data/test/assets/images/very_wide.png +0 -0
- data/test/assets/images/wide.png +0 -0
- data/test/assets/testbanner.jpg +0 -0
- data/test/banner_svg/simple_helpers.rb +13 -0
- data/test/banner_svg/unit.rb +768 -0
- data/test/ed_test.rb +204 -0
- data/test/integration/cursor_banner_combinations.rb +193 -0
- data/test/integration/cursor_banner_features.rb +374 -0
- data/test/integration/integration_test.rb +326 -0
- data/test/livetext_plugin_test.rb +229 -0
- data/test/manual/asset_mgmt.rb +67 -0
- data/test/manual/banner-tests/config.txt +3 -0
- data/test/manual/banner-tests/index.html +45 -0
- data/test/manual/banner-tests/test01.html +58 -0
- data/test/manual/banner-tests/test02.html +58 -0
- data/test/manual/banner-tests/test03.html +58 -0
- data/test/manual/banner-tests/test04.html +65 -0
- data/test/manual/banner-tests/test05.html +65 -0
- data/test/manual/banner-tests/test06.html +65 -0
- data/test/manual/banner-tests/test07.html +65 -0
- data/test/manual/banner-tests/test08.html +59 -0
- data/test/manual/banner-tests/test09.html +59 -0
- data/test/manual/banner-tests/test10.html +59 -0
- data/test/manual/banner-tests/test11.html +59 -0
- data/test/manual/banner-tests/test12.html +59 -0
- data/test/manual/banner-tests/test13.html +59 -0
- data/test/manual/banner-tests/test14.html +59 -0
- data/test/manual/banner-tests/test15.html +58 -0
- data/test/manual/banner-tests/test16.html +58 -0
- data/test/manual/banner-tests/test17.html +58 -0
- data/test/manual/banner-tests/test18.html +68 -0
- data/test/manual/banner-tests/test19.html +68 -0
- data/test/manual/banner-tests/test20.html +68 -0
- data/test/manual/banner-tests/test21.html +68 -0
- data/test/manual/banner-tests/test22.html +68 -0
- data/test/manual/banner-tests/test23.html +68 -0
- data/test/manual/banner-tests/test24.html +68 -0
- data/test/manual/banner-tests/test25.html +67 -0
- data/test/manual/banner_environment.rb +192 -0
- data/test/manual/deploy_symlink_demo.rb +142 -0
- data/test/manual/environment.rb +67 -0
- data/test/manual/make_banner.rb +153 -0
- data/test/manual/sample_banner_config.txt +12 -0
- data/test/manual/symlink_demo.rb +117 -0
- data/test/manual/test1.rb +47 -0
- data/test/manual/test2.rb +12 -0
- data/test/manual/test3.rb +38 -0
- data/test/manual/test4.rb +40 -0
- data/test/manual/test5.rb +24 -0
- data/test/manual/test6.rb +73 -0
- data/test/manual/test_banner_combinations.rb +120 -0
- data/test/manual/test_banner_features.rb +306 -0
- data/test/manual/test_banner_from_file.rb +150 -0
- data/test/manual/test_banner_in_header.rb +35 -0
- data/test/manual/test_code_highlighting.rb +68 -0
- data/test/manual/test_complex_header.rb +74 -0
- data/test/manual/test_empty_header.rb +32 -0
- data/test/manual/test_radial_custom.rb +58 -0
- data/test/manual/test_radial_large_radius.rb +52 -0
- data/test/manual/test_svg_debug.rb +47 -0
- data/test/manual/test_syntax_highlighting.rb +147 -0
- data/test/pages-demo/config/currentview.txt +1 -0
- data/test/pages-demo/views/demo/config/bootstrap_css.txt +5 -0
- data/test/pages-demo/views/demo/config/bootstrap_js.txt +4 -0
- data/test/pages-demo/views/demo/config/common.js +57 -0
- data/test/pages-demo/views/demo/config/footer.txt +1 -0
- data/test/pages-demo/views/demo/config/global-head.txt +8 -0
- data/test/pages-demo/views/demo/config/header.txt +1 -0
- data/test/pages-demo/views/demo/config/layout.txt +1 -0
- data/test/pages-demo/views/demo/config/left.txt +1 -0
- data/test/pages-demo/views/demo/config/main.txt +1 -0
- data/test/pages-demo/views/demo/config/right.txt +1 -0
- data/test/pages-demo/views/demo/config.txt +3 -0
- data/test/pages-demo/views/demo/output/panes/footer.html +1 -0
- data/test/pages-demo/views/demo/output/panes/header.html +1 -0
- data/test/pages-demo/views/demo/output/panes/left.html +1 -0
- data/test/pages-demo/views/demo/output/panes/main.html +1 -0
- data/test/pages-demo/views/demo/output/panes/right.html +1 -0
- data/test/rubytext/rubytext_comprehensive_test.rb +307 -0
- data/test/rubytext/rubytext_demo_test.rb +42 -0
- data/test/rubytext/rubytext_testing_guide.md +277 -0
- data/test/run_automated_tests.rb +45 -0
- data/test/scriptorium-TEST-1754622690-146/config/bootstrap_css.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/config/bootstrap_js.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/config/common.js +57 -0
- data/test/scriptorium-TEST-1754622690-146/config/currentview.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/config/global-head.txt +9 -0
- data/test/scriptorium-TEST-1754622690-146/config/last_post_num.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/config/os_helpers.rb +4 -0
- data/test/scriptorium-TEST-1754622690-146/config/widgets.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/posts/0001/meta.txt +8 -0
- data/test/scriptorium-TEST-1754622690-146/posts/0001/source.lt3 +6 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/README.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/config.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/initial/post.lt3 +12 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/footer.txt +2 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/header.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/left.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/main.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/right.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/gen/text.css +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/layout.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/index.lt3 +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/index_entry.lt3 +14 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/post.lt3 +13 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/widget.lt3 +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/bootstrap_css.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/bootstrap_js.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/common.js +57 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/deploy.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/footer.txt +2 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/global-head.txt +9 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/header.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/layout.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/left.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/main.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/reddit.txt +10 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/right.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/social.txt +7 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/status.txt +7 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/footer.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/header.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/left.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/main.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/right.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/footer.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/header.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/left.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/main.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/right.html +1 -0
- data/test/staging/.DS_Store +0 -0
- data/test/syntax_highlighting_test.lt3 +124 -0
- data/test/test_helpers.rb +230 -0
- data/test/tui_editor_integration_test.rb +296 -0
- data/test/tui_integration_test.rb +637 -0
- data/test/unit/api.rb +1056 -0
- data/test/unit/asset_management.rb +245 -0
- data/test/unit/clipboard_test.rb +60 -0
- data/test/unit/contract_test.rb +91 -0
- data/test/unit/core.rb +857 -0
- data/test/unit/deploy_test.rb +187 -0
- data/test/unit/gem_asset_management.rb +189 -0
- data/test/unit/livetext_basic.rb +69 -0
- data/test/unit/livetext_compatibility.rb +89 -0
- data/test/unit/post.rb +244 -0
- data/test/unit/read_commented_file_test.rb +276 -0
- data/test/unit/reddit_test.rb +235 -0
- data/test/unit/repo.rb +548 -0
- data/test/unit/social_test.rb +369 -0
- data/test/unit/symlink_test.rb +213 -0
- data/test/unit/view.rb +431 -0
- data/test/unit/widgets.rb +669 -0
- data/test/wizard_test.rb +123 -0
- data/ui/README.md +67 -0
- data/ui/common/lib/ui_common.rb +8 -0
- data/ui/rubytext/README.md +191 -0
- data/ui/rubytext/bin/scriptorium-rubytext +402 -0
- data/ui/rubytext/lib/rubytext_ui.rb +300 -0
- data/ui/tui/bin/scriptorium +1420 -0
- data/ui/tui/test/tui_test.rb +23 -0
- data/ui/web/app/app.rb +1378 -0
- data/ui/web/app/error_helpers.rb +150 -0
- data/ui/web/app/views/advanced_config.erb +190 -0
- data/ui/web/app/views/asset_management.erb +589 -0
- data/ui/web/app/views/banner_config.erb +200 -0
- data/ui/web/app/views/configure_view.erb +401 -0
- data/ui/web/app/views/dashboard.erb +162 -0
- data/ui/web/app/views/deploy_config.erb +146 -0
- data/ui/web/app/views/edit_pages.erb +195 -0
- data/ui/web/app/views/edit_post.erb +54 -0
- data/ui/web/app/views/error_page.erb +29 -0
- data/ui/web/app/views/header_config.erb +155 -0
- data/ui/web/app/views/layout_config.erb +147 -0
- data/ui/web/app/views/navbar_config.erb +411 -0
- data/ui/web/app/views/view_dashboard.erb +138 -0
- data/ui/web/bin/scriptorium-web +153 -0
- data/ui/web/test/web_basic_test.rb +38 -0
- data/ui/web/test_navbar.txt +7 -0
- data/ui/web/tmp/web_server.log +5 -0
- data/ui/web/tmp/web_server.pid +1 -0
- metadata +360 -5
@@ -0,0 +1,375 @@
|
|
1
|
+
# 9. Deployment & Hosting
|
2
|
+
|
3
|
+
Once you've created your Scriptorium site, you'll want to deploy it to make it accessible on the web. This section covers various deployment options, from local development to production hosting.
|
4
|
+
|
5
|
+
## Local Development
|
6
|
+
|
7
|
+
Before deploying to a server, you'll typically want to test your site locally to ensure everything works correctly.
|
8
|
+
|
9
|
+
### Local development server
|
10
|
+
|
11
|
+
Scriptorium generates static files that can be served by any web server. For local development:
|
12
|
+
|
13
|
+
1. **Generate your site**:
|
14
|
+
```bash
|
15
|
+
scriptorium generate
|
16
|
+
```
|
17
|
+
|
18
|
+
2. **Start a local web server**:
|
19
|
+
```bash
|
20
|
+
# Using Python (if available)
|
21
|
+
cd output
|
22
|
+
python -m http.server 8000
|
23
|
+
|
24
|
+
# Using Ruby (if available)
|
25
|
+
cd output
|
26
|
+
ruby -run -e httpd . -p 8000
|
27
|
+
|
28
|
+
# Using Node.js (if available)
|
29
|
+
cd output
|
30
|
+
npx serve -p 8000
|
31
|
+
```
|
32
|
+
|
33
|
+
3. **Access your site** at `http://localhost:8000`
|
34
|
+
|
35
|
+
### Live reload development
|
36
|
+
|
37
|
+
For a better development experience with automatic reloading:
|
38
|
+
|
39
|
+
1. **Install a live reload server**:
|
40
|
+
```bash
|
41
|
+
# Using Node.js
|
42
|
+
npm install -g live-server
|
43
|
+
|
44
|
+
# Or using Python
|
45
|
+
pip install livereload
|
46
|
+
```
|
47
|
+
|
48
|
+
2. **Start the development server**:
|
49
|
+
```bash
|
50
|
+
cd output
|
51
|
+
live-server --port=8000
|
52
|
+
```
|
53
|
+
|
54
|
+
3. **Your browser will automatically refresh** when you make changes to your site
|
55
|
+
|
56
|
+
### Testing different views
|
57
|
+
|
58
|
+
During development, you may want to test different views:
|
59
|
+
|
60
|
+
1. **Switch between views**:
|
61
|
+
```bash
|
62
|
+
scriptorium view view-name
|
63
|
+
```
|
64
|
+
|
65
|
+
2. **Generate the specific view**:
|
66
|
+
```bash
|
67
|
+
scriptorium generate
|
68
|
+
```
|
69
|
+
|
70
|
+
3. **Test the view** in your local development server
|
71
|
+
|
72
|
+
### Debugging local issues
|
73
|
+
|
74
|
+
Common local development issues and solutions:
|
75
|
+
|
76
|
+
- **Files not updating**: Ensure you're running `scriptorium generate` after changes
|
77
|
+
- **CSS not loading**: Check file paths and ensure CSS files are in the correct location
|
78
|
+
- **Images not displaying**: Verify image paths and file permissions
|
79
|
+
- **JavaScript errors**: Check browser console for errors and verify script paths
|
80
|
+
|
81
|
+
## Server Deployment
|
82
|
+
|
83
|
+
When you're ready to deploy your site to production, you have several hosting options available.
|
84
|
+
|
85
|
+
### Static hosting services
|
86
|
+
|
87
|
+
Static hosting services are ideal for Scriptorium sites since they generate static HTML files:
|
88
|
+
|
89
|
+
#### GitHub Pages
|
90
|
+
|
91
|
+
1. **Create a GitHub repository** for your site
|
92
|
+
2. **Push your Scriptorium repository** to GitHub:
|
93
|
+
```bash
|
94
|
+
git init
|
95
|
+
git add .
|
96
|
+
git commit -m "Initial commit"
|
97
|
+
git remote add origin https://github.com/username/repository-name.git
|
98
|
+
git push -u origin main
|
99
|
+
```
|
100
|
+
|
101
|
+
3. **Enable GitHub Pages** in your repository settings
|
102
|
+
4. **Configure GitHub Actions** for automatic deployment (optional)
|
103
|
+
|
104
|
+
#### Netlify
|
105
|
+
|
106
|
+
1. **Sign up for Netlify** and connect your Git repository
|
107
|
+
2. **Configure build settings**:
|
108
|
+
- Build command: `scriptorium generate`
|
109
|
+
- Publish directory: `output`
|
110
|
+
3. **Deploy automatically** on every push to your repository
|
111
|
+
|
112
|
+
#### Vercel
|
113
|
+
|
114
|
+
1. **Sign up for Vercel** and import your Git repository
|
115
|
+
2. **Configure build settings**:
|
116
|
+
- Build command: `scriptorium generate`
|
117
|
+
- Output directory: `output`
|
118
|
+
3. **Deploy with automatic updates**
|
119
|
+
|
120
|
+
### Traditional web hosting
|
121
|
+
|
122
|
+
For traditional web hosting providers:
|
123
|
+
|
124
|
+
1. **Generate your site**:
|
125
|
+
```bash
|
126
|
+
scriptorium generate
|
127
|
+
```
|
128
|
+
|
129
|
+
2. **Upload files** to your web server:
|
130
|
+
```bash
|
131
|
+
# Using rsync (recommended)
|
132
|
+
rsync -avz output/ user@your-server.com:/path/to/web/root/
|
133
|
+
|
134
|
+
# Using scp
|
135
|
+
scp -r output/* user@your-server.com:/path/to/web/root/
|
136
|
+
|
137
|
+
# Using FTP/SFTP client
|
138
|
+
# Upload all files from the output directory
|
139
|
+
```
|
140
|
+
|
141
|
+
3. **Set proper permissions**:
|
142
|
+
```bash
|
143
|
+
chmod 644 output/*.html
|
144
|
+
chmod 644 output/*.css
|
145
|
+
chmod 644 output/*.js
|
146
|
+
chmod 755 output/
|
147
|
+
```
|
148
|
+
|
149
|
+
### VPS deployment
|
150
|
+
|
151
|
+
For more control, deploy to a Virtual Private Server:
|
152
|
+
|
153
|
+
1. **Set up your VPS** with a web server (Apache, Nginx, etc.)
|
154
|
+
2. **Install required dependencies**:
|
155
|
+
```bash
|
156
|
+
# Ubuntu/Debian
|
157
|
+
sudo apt update
|
158
|
+
sudo apt install nginx ruby ruby-dev
|
159
|
+
|
160
|
+
# CentOS/RHEL
|
161
|
+
sudo yum install nginx ruby ruby-devel
|
162
|
+
```
|
163
|
+
|
164
|
+
3. **Configure your web server** to serve static files
|
165
|
+
4. **Set up automatic deployment** with Git hooks or CI/CD
|
166
|
+
|
167
|
+
### Deployment automation
|
168
|
+
|
169
|
+
Automate your deployment process:
|
170
|
+
|
171
|
+
1. **Create a deployment script**:
|
172
|
+
```bash
|
173
|
+
#!/bin/bash
|
174
|
+
# deploy.sh
|
175
|
+
|
176
|
+
# Generate the site
|
177
|
+
scriptorium generate
|
178
|
+
|
179
|
+
# Upload to server
|
180
|
+
rsync -avz --delete output/ user@your-server.com:/path/to/web/root/
|
181
|
+
|
182
|
+
# Clear cache (if using a CDN)
|
183
|
+
# curl -X POST https://api.cloudflare.com/client/v4/zones/zone-id/purge_cache
|
184
|
+
```
|
185
|
+
|
186
|
+
2. **Make it executable**:
|
187
|
+
```bash
|
188
|
+
chmod +x deploy.sh
|
189
|
+
```
|
190
|
+
|
191
|
+
3. **Run deployment**:
|
192
|
+
```bash
|
193
|
+
./deploy.sh
|
194
|
+
```
|
195
|
+
|
196
|
+
## Domain Configuration
|
197
|
+
|
198
|
+
Configure your domain name to point to your hosted site.
|
199
|
+
|
200
|
+
### DNS configuration
|
201
|
+
|
202
|
+
1. **Add DNS records** in your domain registrar's control panel:
|
203
|
+
- **A record**: Point your domain to your server's IP address
|
204
|
+
- **CNAME record**: Point `www` subdomain to your main domain
|
205
|
+
- **MX records**: Configure email (if needed)
|
206
|
+
|
207
|
+
2. **Example DNS configuration**:
|
208
|
+
```
|
209
|
+
Type Name Value
|
210
|
+
A @ 192.168.1.100
|
211
|
+
CNAME www yourdomain.com
|
212
|
+
```
|
213
|
+
|
214
|
+
### Subdomain setup
|
215
|
+
|
216
|
+
Set up subdomains for different sections of your site:
|
217
|
+
|
218
|
+
1. **Add subdomain DNS records**:
|
219
|
+
```
|
220
|
+
Type Name Value
|
221
|
+
A blog 192.168.1.100
|
222
|
+
A docs 192.168.1.100
|
223
|
+
```
|
224
|
+
|
225
|
+
2. **Configure web server** to handle subdomains
|
226
|
+
3. **Set up separate Scriptorium repositories** for each subdomain (if needed)
|
227
|
+
|
228
|
+
### Domain verification
|
229
|
+
|
230
|
+
Verify your domain is properly configured:
|
231
|
+
|
232
|
+
1. **Check DNS propagation**:
|
233
|
+
```bash
|
234
|
+
nslookup yourdomain.com
|
235
|
+
dig yourdomain.com
|
236
|
+
```
|
237
|
+
|
238
|
+
2. **Test website accessibility**:
|
239
|
+
```bash
|
240
|
+
curl -I http://yourdomain.com
|
241
|
+
```
|
242
|
+
|
243
|
+
3. **Check for redirects** and ensure they're working correctly
|
244
|
+
|
245
|
+
## SSL Setup
|
246
|
+
|
247
|
+
Secure your site with HTTPS using SSL certificates.
|
248
|
+
|
249
|
+
### Let's Encrypt (free SSL)
|
250
|
+
|
251
|
+
1. **Install Certbot**:
|
252
|
+
```bash
|
253
|
+
# Ubuntu/Debian
|
254
|
+
sudo apt install certbot python3-certbot-nginx
|
255
|
+
|
256
|
+
# CentOS/RHEL
|
257
|
+
sudo yum install certbot python3-certbot-nginx
|
258
|
+
```
|
259
|
+
|
260
|
+
2. **Obtain SSL certificate**:
|
261
|
+
```bash
|
262
|
+
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
|
263
|
+
```
|
264
|
+
|
265
|
+
3. **Auto-renewal setup**:
|
266
|
+
```bash
|
267
|
+
sudo crontab -e
|
268
|
+
# Add: 0 12 * * * /usr/bin/certbot renew --quiet
|
269
|
+
```
|
270
|
+
|
271
|
+
### Manual SSL certificate
|
272
|
+
|
273
|
+
For paid SSL certificates:
|
274
|
+
|
275
|
+
1. **Generate CSR (Certificate Signing Request)**:
|
276
|
+
```bash
|
277
|
+
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
|
278
|
+
```
|
279
|
+
|
280
|
+
2. **Submit CSR** to your certificate provider
|
281
|
+
3. **Install the certificate** on your web server
|
282
|
+
4. **Configure web server** to use SSL
|
283
|
+
|
284
|
+
### Web server SSL configuration
|
285
|
+
|
286
|
+
#### Nginx SSL configuration
|
287
|
+
|
288
|
+
```nginx
|
289
|
+
server {
|
290
|
+
listen 443 ssl http2;
|
291
|
+
server_name yourdomain.com www.yourdomain.com;
|
292
|
+
|
293
|
+
ssl_certificate /path/to/certificate.crt;
|
294
|
+
ssl_certificate_key /path/to/private.key;
|
295
|
+
|
296
|
+
ssl_protocols TLSv1.2 TLSv1.3;
|
297
|
+
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512;
|
298
|
+
ssl_prefer_server_ciphers off;
|
299
|
+
|
300
|
+
location / {
|
301
|
+
root /path/to/your/site;
|
302
|
+
index index.html;
|
303
|
+
try_files $uri $uri/ =404;
|
304
|
+
}
|
305
|
+
}
|
306
|
+
|
307
|
+
# Redirect HTTP to HTTPS
|
308
|
+
server {
|
309
|
+
listen 80;
|
310
|
+
server_name yourdomain.com www.yourdomain.com;
|
311
|
+
return 301 https://$server_name$request_uri;
|
312
|
+
}
|
313
|
+
```
|
314
|
+
|
315
|
+
#### Apache SSL configuration
|
316
|
+
|
317
|
+
```apache
|
318
|
+
<VirtualHost *:443>
|
319
|
+
ServerName yourdomain.com
|
320
|
+
ServerAlias www.yourdomain.com
|
321
|
+
|
322
|
+
SSLEngine on
|
323
|
+
SSLCertificateFile /path/to/certificate.crt
|
324
|
+
SSLCertificateKeyFile /path/to/private.key
|
325
|
+
|
326
|
+
DocumentRoot /path/to/your/site
|
327
|
+
|
328
|
+
<Directory /path/to/your/site>
|
329
|
+
AllowOverride All
|
330
|
+
Require all granted
|
331
|
+
</Directory>
|
332
|
+
</VirtualHost>
|
333
|
+
|
334
|
+
# Redirect HTTP to HTTPS
|
335
|
+
<VirtualHost *:80>
|
336
|
+
ServerName yourdomain.com
|
337
|
+
ServerAlias www.yourdomain.com
|
338
|
+
Redirect permanent / https://yourdomain.com/
|
339
|
+
</VirtualHost>
|
340
|
+
```
|
341
|
+
|
342
|
+
### SSL best practices
|
343
|
+
|
344
|
+
- **Use strong encryption**: Configure modern SSL protocols and ciphers
|
345
|
+
- **Enable HSTS**: Add HTTP Strict Transport Security headers
|
346
|
+
- **Regular renewal**: Set up automatic certificate renewal
|
347
|
+
- **Monitor certificate expiration**: Use monitoring tools to track certificate status
|
348
|
+
- **Backup certificates**: Keep secure backups of your SSL certificates and private keys
|
349
|
+
|
350
|
+
### Content Delivery Networks (CDN)
|
351
|
+
|
352
|
+
Improve site performance with a CDN:
|
353
|
+
|
354
|
+
1. **Choose a CDN provider** (Cloudflare, AWS CloudFront, etc.)
|
355
|
+
2. **Configure DNS** to point to CDN
|
356
|
+
3. **Set up caching rules** for static assets
|
357
|
+
4. **Configure SSL** through the CDN provider
|
358
|
+
5. **Monitor performance** and adjust settings as needed
|
359
|
+
|
360
|
+
### Deployment checklist
|
361
|
+
|
362
|
+
Before going live:
|
363
|
+
|
364
|
+
- [ ] Site generates without errors
|
365
|
+
- [ ] All links work correctly
|
366
|
+
- [ ] Images and assets load properly
|
367
|
+
- [ ] SSL certificate is installed and working
|
368
|
+
- [ ] Domain DNS is configured correctly
|
369
|
+
- [ ] Web server is configured properly
|
370
|
+
- [ ] Backup and recovery procedures are in place
|
371
|
+
- [ ] Monitoring and analytics are set up
|
372
|
+
- [ ] Error pages (404, 500) are configured
|
373
|
+
- [ ] Site is tested across different browsers and devices
|
374
|
+
|
375
|
+
Deploying your Scriptorium site can be as simple as uploading static files or as complex as setting up a full CI/CD pipeline. Choose the approach that best fits your needs, technical expertise, and budget.
|
data/doc/userdoc-toc.txt
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
1. Core Concepts
|
2
|
+
What is Scriptorium?
|
3
|
+
- Static files
|
4
|
+
- What are views? and why?
|
5
|
+
- What is a repository?
|
6
|
+
- How does deployment work?
|
7
|
+
What is Livetext?
|
8
|
+
- Why Livetext?
|
9
|
+
- Syntax in brief (1-2 paragraphs)
|
10
|
+
|
11
|
+
2. Getting Started
|
12
|
+
Quick installation (gem install)
|
13
|
+
Interactive setup
|
14
|
+
- create repo
|
15
|
+
- create first view
|
16
|
+
- other commands
|
17
|
+
- the sample view
|
18
|
+
- first blog post
|
19
|
+
Basic Configuration
|
20
|
+
Checking dependencies
|
21
|
+
The "standard" theme (only one for now)
|
22
|
+
|
23
|
+
3. LiveText Basics
|
24
|
+
What is LiveText?
|
25
|
+
Basic Syntax
|
26
|
+
- inline formatting: boldface, italics, etc.
|
27
|
+
- simple dot commands (with/without parameters)
|
28
|
+
- comments
|
29
|
+
- dot commands taking a body and .end
|
30
|
+
- predefined variables
|
31
|
+
- predefined functions
|
32
|
+
- user variables
|
33
|
+
- writing your own dot commands and functions in Ruby
|
34
|
+
The Plugin for Scriptorium
|
35
|
+
Writing Posts
|
36
|
+
|
37
|
+
4. The Front Page
|
38
|
+
- containers and their uses
|
39
|
+
- configuring header
|
40
|
+
- banner
|
41
|
+
- navbar
|
42
|
+
- configuring a sidebar
|
43
|
+
- the main container: post index
|
44
|
+
Widgets
|
45
|
+
- Links
|
46
|
+
- Pages
|
47
|
+
- Featured Posts
|
48
|
+
|
49
|
+
5. Managing posts
|
50
|
+
- create
|
51
|
+
- delete
|
52
|
+
- link
|
53
|
+
- unlink
|
54
|
+
- featured
|
55
|
+
|
56
|
+
6. Managing Pages
|
57
|
+
- Used in navbar
|
58
|
+
- Used in Pages widget
|
59
|
+
- Internal links
|
60
|
+
- Subdirectories under pages/
|
61
|
+
|
62
|
+
7. Customization
|
63
|
+
- Themes and Styling (cloning)
|
64
|
+
- Templates
|
65
|
+
- Widgets and Features
|
66
|
+
|
67
|
+
8. Advanced Features
|
68
|
+
Reddit Integration
|
69
|
+
Social Media Features
|
70
|
+
|
71
|
+
9. Deployment & Hosting
|
72
|
+
Local Development
|
73
|
+
Server Deployment
|
74
|
+
Domain Configuration
|
75
|
+
SSL Setup
|
76
|
+
|
77
|
+
10. Troubleshooting
|
78
|
+
Common Issues
|
79
|
+
Dependency Management
|
80
|
+
Error Messages
|
81
|
+
Getting Help
|
82
|
+
|
83
|
+
11. Reference
|
84
|
+
Command Reference
|
85
|
+
Configuration Files
|
86
|
+
LiveText Reference
|
87
|
+
API Reference
|
88
|
+
View Tree Structure
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Rouge
|
5
|
+
module Lexers
|
6
|
+
class LiveText < RegexLexer
|
7
|
+
title "LiveText"
|
8
|
+
desc "LiveText markup language (.lt3 files)"
|
9
|
+
tag 'livetext'
|
10
|
+
aliases 'lt3'
|
11
|
+
filenames '*.lt3', '*.livetext'
|
12
|
+
mimetypes 'text/x-livetext'
|
13
|
+
|
14
|
+
# Define token types
|
15
|
+
state :root do
|
16
|
+
# Comments (## lines) - must come first
|
17
|
+
rule %r/##.*$/, Comment::Single
|
18
|
+
|
19
|
+
# Dot commands (start with .) - must come before general text
|
20
|
+
rule %r/\.([a-zA-Z_][a-zA-Z0-9_]*)\b/, Name::Function
|
21
|
+
|
22
|
+
# Code block markers
|
23
|
+
rule %r/\.end\b/, Keyword::Reserved
|
24
|
+
|
25
|
+
# Variables ($VAR, @blog.view, Livetext::Vars)
|
26
|
+
rule %r/\$([A-Z][A-Z0-9_]*)\b/, Name::Variable::Global
|
27
|
+
rule %r/@([a-zA-Z_][a-zA-Z0-9_.]*)\b/, Name::Variable::Instance
|
28
|
+
rule %r/Livetext::Vars\[:([a-zA-Z_][a-zA-Z0-9_]*)\]/, Name::Variable::Global
|
29
|
+
|
30
|
+
# Functions ($$funcname[param])
|
31
|
+
rule %r/\$\$([a-zA-Z_][a-zA-Z0-9_]*)\[/, Name::Function, :function_param
|
32
|
+
|
33
|
+
# Special syntax (:views, :posts, etc.)
|
34
|
+
rule %r/:([a-zA-Z_][a-zA-Z0-9_]*)\b/, Name::Constant
|
35
|
+
|
36
|
+
# Path separators (custom PathSep operator)
|
37
|
+
rule %r/([a-zA-Z0-9_\/]+)\/([a-zA-Z0-9_\/]+)/, Literal::String::Other
|
38
|
+
|
39
|
+
# Strings (quoted text)
|
40
|
+
rule %r/"([^"]*)"/, Literal::String::Double
|
41
|
+
rule %r/'([^']*)'/, Literal::String::Single
|
42
|
+
|
43
|
+
# Numbers
|
44
|
+
rule %r/\b(\d+)\b/, Literal::Number::Integer
|
45
|
+
rule %r/\b(\d+\.\d+)\b/, Literal::Number::Float
|
46
|
+
|
47
|
+
# HTML-like tags in strings
|
48
|
+
rule %r/</, Literal::String::Other
|
49
|
+
rule %r/>/, Literal::String::Other
|
50
|
+
|
51
|
+
# Operators
|
52
|
+
rule %r/[=+\-*\/<>!&|]/, Operator
|
53
|
+
|
54
|
+
# Punctuation
|
55
|
+
rule %r/[\[\]{}();,.]/, Punctuation
|
56
|
+
|
57
|
+
# Whitespace
|
58
|
+
rule %r/\s+/, Text::Whitespace
|
59
|
+
|
60
|
+
# Everything else as text - must come last
|
61
|
+
rule %r/.+/, Text
|
62
|
+
end
|
63
|
+
|
64
|
+
# Function parameter state
|
65
|
+
state :function_param do
|
66
|
+
rule %r/\]/, Name::Function, :pop!
|
67
|
+
rule %r/\[/, Punctuation
|
68
|
+
rule %r/"([^"]*)"/, Literal::String::Double
|
69
|
+
rule %r/'([^']*)'/, Literal::String::Single
|
70
|
+
rule %r/[^\]]+/, Text
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|