minecraft-datapack-language 17.0.10__py3-none-any.whl → 17.0.12__py3-none-any.whl

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 (43) hide show
  1. minecraft_datapack_language/_embedded/docs/404.html +42 -0
  2. minecraft_datapack_language/_embedded/docs/Gemfile +26 -0
  3. minecraft_datapack_language/_embedded/docs/README.md +84 -0
  4. minecraft_datapack_language/_embedded/docs/_config.yml +74 -0
  5. minecraft_datapack_language/_embedded/docs/_data/version.yml +3 -0
  6. minecraft_datapack_language/_embedded/docs/_docs/cli-reference.md +506 -0
  7. minecraft_datapack_language/_embedded/docs/_docs/contributing.md +352 -0
  8. minecraft_datapack_language/_embedded/docs/_docs/docs-hub.md +266 -0
  9. minecraft_datapack_language/_embedded/docs/_docs/documentation.md +135 -0
  10. minecraft_datapack_language/_embedded/docs/_docs/examples.md +194 -0
  11. minecraft_datapack_language/_embedded/docs/_docs/getting-started.md +230 -0
  12. minecraft_datapack_language/_embedded/docs/_docs/language-reference.md +1637 -0
  13. minecraft_datapack_language/_embedded/docs/_docs/multi-file-projects.md +221 -0
  14. minecraft_datapack_language/_embedded/docs/_docs/python-bindings.md +446 -0
  15. minecraft_datapack_language/_embedded/docs/_docs/vscode-extension.md +381 -0
  16. minecraft_datapack_language/_embedded/docs/_includes/head-custom.html +983 -0
  17. minecraft_datapack_language/_embedded/docs/_includes/navigation.html +362 -0
  18. minecraft_datapack_language/_embedded/docs/_layouts/default.html +27 -0
  19. minecraft_datapack_language/_embedded/docs/_layouts/page.html +281 -0
  20. minecraft_datapack_language/_embedded/docs/_plugins/test_version.rb +13 -0
  21. minecraft_datapack_language/_embedded/docs/_plugins/version_reader.rb +37 -0
  22. minecraft_datapack_language/_embedded/docs/assets/css/style.css +211 -0
  23. minecraft_datapack_language/_embedded/docs/docs.md +134 -0
  24. minecraft_datapack_language/_embedded/docs/downloads.md +444 -0
  25. minecraft_datapack_language/_embedded/docs/icons/favicon-16.png +0 -0
  26. minecraft_datapack_language/_embedded/docs/icons/favicon-32.png +0 -0
  27. minecraft_datapack_language/_embedded/docs/icons/favicon-48.png +0 -0
  28. minecraft_datapack_language/_embedded/docs/icons/favicon-64.png +0 -0
  29. minecraft_datapack_language/_embedded/docs/icons/icon-1024.png +0 -0
  30. minecraft_datapack_language/_embedded/docs/icons/icon-128.png +0 -0
  31. minecraft_datapack_language/_embedded/docs/icons/icon-256.png +0 -0
  32. minecraft_datapack_language/_embedded/docs/icons/icon-512.png +0 -0
  33. minecraft_datapack_language/_embedded/docs/icons/icon-64.png +0 -0
  34. minecraft_datapack_language/_embedded/docs/index.md +378 -0
  35. minecraft_datapack_language/_version.py +2 -2
  36. minecraft_datapack_language/cli.py +5 -1
  37. {minecraft_datapack_language-17.0.10.dist-info → minecraft_datapack_language-17.0.12.dist-info}/METADATA +1 -1
  38. minecraft_datapack_language-17.0.12.dist-info/RECORD +56 -0
  39. minecraft_datapack_language-17.0.10.dist-info/RECORD +0 -22
  40. {minecraft_datapack_language-17.0.10.dist-info → minecraft_datapack_language-17.0.12.dist-info}/WHEEL +0 -0
  41. {minecraft_datapack_language-17.0.10.dist-info → minecraft_datapack_language-17.0.12.dist-info}/entry_points.txt +0 -0
  42. {minecraft_datapack_language-17.0.10.dist-info → minecraft_datapack_language-17.0.12.dist-info}/licenses/LICENSE +0 -0
  43. {minecraft_datapack_language-17.0.10.dist-info → minecraft_datapack_language-17.0.12.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,352 @@
1
+ ---
2
+ layout: page
3
+ title: Contributing
4
+ permalink: /docs/contributing/
5
+ ---
6
+
7
+ # Contributing to MDL
8
+
9
+ Thank you for your interest in contributing to Minecraft Datapack Language (MDL)! This guide will help you get started.
10
+
11
+ ## Getting Started
12
+
13
+ ### Prerequisites
14
+
15
+ - Python 3.9 or higher
16
+ - Git
17
+ - Basic knowledge of Python and Minecraft datapacks
18
+
19
+ ### Development Setup
20
+
21
+ 1. **Fork the repository**:
22
+ ```bash
23
+ git clone https://github.com/aaron777collins/MinecraftDatapackLanguage.git
24
+ cd MinecraftDatapackLanguage
25
+ ```
26
+
27
+ 2. **Install in development mode**:
28
+ ```bash
29
+ python -m pip install -e .
30
+ ```
31
+
32
+ 3. **Install development dependencies**:
33
+ ```bash
34
+ pip install -r requirements-dev.txt # if available
35
+ ```
36
+
37
+ 4. **Verify installation**:
38
+ ```bash
39
+ mdl --version
40
+ mdl --help
41
+ ```
42
+
43
+ ## Project Structure
44
+
45
+ ```
46
+ MinecraftDatapackLanguage/
47
+ ├── minecraft_datapack_language/ # Main package
48
+ │ ├── __init__.py
49
+ │ ├── cli.py # Command-line interface
50
+ │ ├── mdl_parser_js.py # JavaScript-style MDL parser
51
+ │ ├── pack.py # Pack generation
52
+ │ └── utils.py # Utility functions
53
+ ├── vscode-extension/ # VS Code extension
54
+ ├── scripts/ # Build and release scripts
55
+ ├── tools/ # Development tools
56
+ ├── docs/ # Documentation
57
+ └── tests/ # Test files
58
+ ```
59
+
60
+ ## Areas to Contribute
61
+
62
+ ### 1. Core Language Features
63
+
64
+ - **Parser improvements**: Enhance the MDL parser
65
+ - **New syntax features**: Add new language constructs
66
+ - **Error handling**: Improve error messages and validation
67
+ - **Performance**: Optimize parsing and compilation
68
+
69
+ ### 2. CLI Tools
70
+
71
+ - **New commands**: Add useful CLI commands
72
+ - **Better output**: Improve user experience
73
+ - **Configuration**: Add configuration options
74
+ - **Integration**: Better integration with other tools
75
+
76
+ ### 3. Python Bindings
77
+
78
+ - **Bindings improvements**: Enhance the Python bindings
79
+ - **New features**: Add new capabilities
80
+ - **Documentation**: Improve API documentation
81
+ - **Examples**: Add more examples
82
+
83
+ ### 4. VS Code Extension
84
+
85
+ - **Syntax highlighting**: Improve language support
86
+ - **IntelliSense**: Add auto-completion
87
+ - **Debugging**: Add debugging support
88
+ - **Snippets**: Add code snippets
89
+
90
+ ### 5. Documentation
91
+
92
+ - **User guides**: Improve existing documentation
93
+ - **Examples**: Add more examples
94
+ - **Tutorials**: Create step-by-step tutorials
95
+ - **API docs**: Improve API documentation
96
+
97
+ ### 6. Testing
98
+
99
+ - **Unit tests**: Add comprehensive tests
100
+ - **Integration tests**: Test end-to-end functionality
101
+ - **Performance tests**: Ensure good performance
102
+ - **Regression tests**: Prevent bugs from returning
103
+
104
+ ## Development Workflow
105
+
106
+ ### 1. Choose an Issue
107
+
108
+ 1. Check the [Issues](https://github.com/aaron777collins/MinecraftDatapackLanguage/issues) page
109
+ 2. Look for issues labeled `good first issue` for beginners
110
+ 3. Comment on the issue to let others know you're working on it
111
+ 4. Fork the repository if you haven't already
112
+
113
+ ### 2. Create a Branch
114
+
115
+ ```bash
116
+ git checkout -b feature/your-feature-name
117
+ # or
118
+ git checkout -b fix/your-bug-fix
119
+ ```
120
+
121
+ ### 3. Make Changes
122
+
123
+ - Write your code following the coding standards
124
+ - Add tests for new functionality
125
+ - Update documentation as needed
126
+ - Test your changes thoroughly
127
+
128
+ ### 4. Test Your Changes
129
+
130
+ ```bash
131
+ # Run the test suite
132
+ python -m pytest
133
+
134
+ # Test the CLI
135
+ mdl --help
136
+ mdl build --mdl sample.mdl -o test_output
137
+
138
+ # Test the Python bindings
139
+ python -c "from minecraft_datapack_language import Pack; print('API works!')"
140
+ ```
141
+
142
+ ### 5. Commit Your Changes
143
+
144
+ ```bash
145
+ git add .
146
+ git commit -m "feat: add new feature description"
147
+ ```
148
+
149
+ Use conventional commit messages:
150
+ - `feat:` for new features
151
+ - `fix:` for bug fixes
152
+ - `docs:` for documentation changes
153
+ - `test:` for test changes
154
+ - `refactor:` for code refactoring
155
+
156
+ ### 6. Push and Create a Pull Request
157
+
158
+ ```bash
159
+ git push origin feature/your-feature-name
160
+ ```
161
+
162
+ Then create a pull request on GitHub with:
163
+ - Clear description of changes
164
+ - Reference to related issues
165
+ - Screenshots if applicable
166
+ - Test results
167
+
168
+ ## Coding Standards
169
+
170
+ ### Python Code
171
+
172
+ - **Style**: Follow PEP 8
173
+ - **Type hints**: Use type hints where appropriate
174
+ - **Docstrings**: Add docstrings to functions and classes
175
+ - **Comments**: Add comments for complex logic
176
+
177
+ ### MDL Language
178
+
179
+ - **Consistency**: Follow existing language patterns
180
+ - **Error messages**: Provide clear, helpful error messages
181
+ - **Performance**: Consider performance implications
182
+ - **Backward compatibility**: Maintain compatibility when possible
183
+
184
+ ### Documentation
185
+
186
+ - **Clarity**: Write clear, concise documentation
187
+ - **Examples**: Include practical examples
188
+ - **Structure**: Use consistent formatting
189
+ - **Links**: Link to related documentation
190
+
191
+ ## Testing Guidelines
192
+
193
+ ### Unit Tests
194
+
195
+ - **Coverage**: Aim for high test coverage
196
+ - **Isolation**: Tests should be independent
197
+ - **Naming**: Use descriptive test names
198
+ - **Assertions**: Use specific assertions
199
+
200
+ ### Integration Tests
201
+
202
+ - **End-to-end**: Test complete workflows
203
+ - **Real scenarios**: Test realistic use cases
204
+ - **Error cases**: Test error conditions
205
+ - **Performance**: Test performance characteristics
206
+
207
+ ### Example Test
208
+
209
+ ```python
210
+ def test_pack_creation():
211
+ """Test basic pack creation functionality."""
212
+ pack = Pack(name="Test Pack", pack_format=48)
213
+
214
+ # Test namespace creation
215
+ namespace = pack.namespace("test")
216
+ assert namespace is not None
217
+
218
+ # Test function addition
219
+ namespace.function("hello", 'say Hello!')
220
+
221
+ # Test build
222
+ pack.build("test_output")
223
+
224
+ # Verify output files exist
225
+ assert os.path.exists("test_output/test_pack/pack.mcmeta")
226
+ assert os.path.exists("test_output/test_pack/data/test/functions/hello.mcfunction")
227
+ ```
228
+
229
+ ## Documentation Guidelines
230
+
231
+ ### Writing Documentation
232
+
233
+ - **Audience**: Write for the target audience
234
+ - **Structure**: Use clear headings and sections
235
+ - **Examples**: Include working examples
236
+ - **Links**: Link to related topics
237
+
238
+ ### Code Examples
239
+
240
+ - **Complete**: Provide complete, runnable examples
241
+ - **Clear**: Use clear, descriptive variable names
242
+ - **Commented**: Add comments explaining key parts
243
+ - **Tested**: Ensure examples work correctly
244
+
245
+ ### API Documentation
246
+
247
+ - **Parameters**: Document all parameters
248
+ - **Return values**: Document return values
249
+ - **Exceptions**: Document exceptions that may be raised
250
+ - **Examples**: Include usage examples
251
+
252
+ ## Release Process
253
+
254
+ ### Version Management
255
+
256
+ MDL uses semantic versioning:
257
+ - **Major**: Breaking changes
258
+ - **Minor**: New features (backward compatible)
259
+ - **Patch**: Bug fixes (backward compatible)
260
+
261
+ ### Release Steps
262
+
263
+ 1. **Update version**: Update version in `pyproject.toml`
264
+ 2. **Update changelog**: Document changes in `CHANGELOG.md`
265
+ 3. **Test thoroughly**: Run all tests
266
+ 4. **Create release**: Use GitHub releases
267
+ 5. **Publish to PyPI**: Upload to Python Package Index
268
+
269
+ ### Release Scripts
270
+
271
+ Use the provided release scripts:
272
+
273
+ ```bash
274
+ # Create a patch release
275
+ ./scripts/release.sh patch "Bug fixes"
276
+
277
+ # Create a minor release
278
+ ./scripts/release.sh minor "New features"
279
+
280
+ # Create a major release
281
+ ./scripts/release.sh major "Breaking changes"
282
+ ```
283
+
284
+ ## Community Guidelines
285
+
286
+ ### Code of Conduct
287
+
288
+ - **Respect**: Be respectful to all contributors
289
+ - **Inclusive**: Welcome contributors from all backgrounds
290
+ - **Constructive**: Provide constructive feedback
291
+ - **Helpful**: Help others learn and grow
292
+
293
+ ### Communication
294
+
295
+ - **Issues**: Use GitHub issues for bug reports and feature requests
296
+ - **Discussions**: Use GitHub Discussions for questions and ideas
297
+ - **Pull requests**: Provide clear, constructive feedback
298
+ - **Documentation**: Help improve documentation
299
+
300
+ ### Recognition
301
+
302
+ - **Contributors**: All contributors are recognized in the project
303
+ - **Credits**: Credit contributors in release notes
304
+ - **Thanks**: Thank contributors for their work
305
+
306
+ ## Getting Help
307
+
308
+ ### Questions and Support
309
+
310
+ - **GitHub Issues**: For bug reports and feature requests
311
+ - **GitHub Discussions**: For questions and general discussion
312
+ - **Documentation**: Check the documentation first
313
+ - **Examples**: Look at existing examples
314
+
315
+ ### Mentorship
316
+
317
+ - **New contributors**: Experienced contributors can help newcomers
318
+ - **Code reviews**: Get feedback on your code
319
+ - **Pair programming**: Work together on features
320
+ - **Documentation**: Help improve documentation
321
+
322
+ ## Future Roadmap
323
+
324
+ ### Planned Features
325
+
326
+ - **Enhanced syntax**: More language features
327
+ - **Better tooling**: Improved development tools
328
+ - **Performance**: Better performance
329
+ - **Integration**: Better integration with other tools
330
+
331
+ ### Contributing to the Roadmap
332
+
333
+ - **Suggestions**: Suggest new features
334
+ - **Prioritization**: Help prioritize features
335
+ - **Implementation**: Implement planned features
336
+ - **Testing**: Test new features
337
+
338
+ ## Legal
339
+
340
+ ### License
341
+
342
+ MDL is licensed under the GPL-3.0 License. By contributing, you agree to license your contributions under the same license.
343
+
344
+ ### Copyright
345
+
346
+ Contributors retain copyright to their contributions, but grant the project a license to use and distribute them.
347
+
348
+ ## Thank You
349
+
350
+ Thank you for contributing to MDL! Your contributions help make the project better for everyone in the Minecraft community.
351
+
352
+ Whether you're fixing a bug, adding a feature, improving documentation, or just asking questions, your involvement is valuable and appreciated.
@@ -0,0 +1,266 @@
1
+ ---
2
+ layout: page
3
+ title: Documentation Hub
4
+ permalink: /docs/docs-hub/
5
+ description: Search and browse all MDL documentation
6
+ ---
7
+
8
+ Search and browse all available documentation for the Minecraft Datapack Language (MDL).
9
+
10
+ <div class="search-container">
11
+ <input type="text" id="docSearch" placeholder="Search documentation..." class="search-input">
12
+ <div class="search-icon">
13
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
14
+ <path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd"/>
15
+ </svg>
16
+ </div>
17
+ </div>
18
+
19
+ <div class="docs-grid" id="docsGrid">
20
+ <div class="doc-card" data-categories="getting-started beginner">
21
+ <h3>🚀 Getting Started</h3>
22
+ <p>Learn the basics of MDL and set up your development environment.</p>
23
+ <div class="doc-meta">
24
+ <span class="category">Beginner</span>
25
+ <span class="category">Setup</span>
26
+ </div>
27
+ <a href="{{ site.baseurl }}/docs/getting-started/" class="doc-link">Get Started →</a>
28
+ </div>
29
+
30
+ <div class="doc-card" data-categories="language reference syntax">
31
+ <h3>📚 Language Reference</h3>
32
+ <p>Complete syntax reference, data types, functions, and language features.</p>
33
+ <div class="doc-meta">
34
+ <span class="category">Reference</span>
35
+ <span class="category">Syntax</span>
36
+ </div>
37
+ <a href="{{ site.baseurl }}/docs/language-reference/" class="doc-link">View Reference →</a>
38
+ </div>
39
+
40
+ <div class="doc-card" data-categories="cli command-line tools">
41
+ <h3>🔧 CLI Reference</h3>
42
+ <p>Command-line interface for building, testing, and managing MDL projects.</p>
43
+ <div class="doc-meta">
44
+ <span class="category">Tools</span>
45
+ <span class="category">CLI</span>
46
+ </div>
47
+ <a href="{{ site.baseurl }}/docs/cli-reference/" class="doc-link">CLI Guide →</a>
48
+ </div>
49
+
50
+ <div class="doc-card" data-categories="multi-file projects structure">
51
+ <h3>📁 Multi-file Projects</h3>
52
+ <p>Learn how to organize and structure larger, more complex MDL projects.</p>
53
+ <div class="doc-meta">
54
+ <span class="category">Advanced</span>
55
+ <span class="category">Structure</span>
56
+ </div>
57
+ <a href="{{ site.baseurl }}/docs/multi-file-projects/" class="doc-link">Project Structure →</a>
58
+ </div>
59
+
60
+ <div class="doc-card" data-categories="python bindings programming">
61
+ <h3>🐍 Python Bindings</h3>
62
+ <p>Programmatic access to MDL for automation and integration.</p>
63
+ <div class="doc-meta">
64
+ <span class="category">Bindings</span>
65
+ <span class="category">Python</span>
66
+ </div>
67
+ <a href="{{ site.baseurl }}/docs/python-bindings/" class="doc-link">Bindings Guide →</a>
68
+ </div>
69
+
70
+ <div class="doc-card" data-categories="vscode extension ide">
71
+ <h3>💻 VS Code Extension</h3>
72
+ <p>Enhanced development experience with syntax highlighting and IntelliSense.</p>
73
+ <div class="doc-meta">
74
+ <span class="category">IDE</span>
75
+ <span class="category">VS Code</span>
76
+ </div>
77
+ <a href="{{ site.baseurl }}/docs/vscode-extension/" class="doc-link">Extension Guide →</a>
78
+ </div>
79
+
80
+ <div class="doc-card" data-categories="examples code samples">
81
+ <h3>🎯 Examples</h3>
82
+ <p>Complete working examples to learn from and use as templates.</p>
83
+ <div class="doc-meta">
84
+ <span class="category">Examples</span>
85
+ <span class="category">Code</span>
86
+ </div>
87
+ <a href="{{ site.baseurl }}/docs/examples/" class="doc-link">View Examples →</a>
88
+ </div>
89
+
90
+ <div class="doc-card" data-categories="contributing development">
91
+ <h3>🤝 Contributing</h3>
92
+ <p>How to contribute to the MDL project and development guidelines.</p>
93
+ <div class="doc-meta">
94
+ <span class="category">Community</span>
95
+ <span class="category">Development</span>
96
+ </div>
97
+ <a href="{{ site.baseurl }}/docs/contributing/" class="doc-link">Contribute →</a>
98
+ </div>
99
+ </div>
100
+
101
+ <div class="no-results" id="noResults" style="display: none;">
102
+ <h3>No documentation found</h3>
103
+ <p>Try searching with different keywords or browse all documentation above.</p>
104
+ </div>
105
+
106
+ <style>
107
+ .search-container {
108
+ position: relative;
109
+ margin: 2rem 0;
110
+ max-width: 600px;
111
+ }
112
+
113
+ .search-input {
114
+ width: 100%;
115
+ padding: 1rem 3rem 1rem 1rem;
116
+ border: 2px solid #e1e4e8;
117
+ border-radius: 8px;
118
+ font-size: 1rem;
119
+ transition: border-color 0.2s, box-shadow 0.2s;
120
+ }
121
+
122
+ .search-input:focus {
123
+ outline: none;
124
+ border-color: #0366d6;
125
+ box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
126
+ }
127
+
128
+ .search-icon {
129
+ position: absolute;
130
+ right: 1rem;
131
+ top: 50%;
132
+ transform: translateY(-50%);
133
+ color: #586069;
134
+ }
135
+
136
+ .docs-grid {
137
+ display: grid;
138
+ grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
139
+ gap: 1.5rem;
140
+ margin: 2rem 0;
141
+ }
142
+
143
+ .doc-card {
144
+ background: #ffffff;
145
+ border: 1px solid #e1e4e8;
146
+ border-radius: 8px;
147
+ padding: 1.5rem;
148
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15);
149
+ transition: transform 0.2s, box-shadow 0.2s;
150
+ }
151
+
152
+ .doc-card:hover {
153
+ transform: translateY(-2px);
154
+ box-shadow: 0 6px 20px rgba(0,0,0,0.2);
155
+ }
156
+
157
+ .doc-card.hidden {
158
+ display: none;
159
+ }
160
+
161
+ .doc-card h3 {
162
+ margin: 0 0 0.5rem 0;
163
+ color: #24292e;
164
+ font-size: 1.1rem;
165
+ }
166
+
167
+ .doc-card p {
168
+ margin: 0 0 1rem 0;
169
+ color: #586069;
170
+ line-height: 1.5;
171
+ }
172
+
173
+ .doc-meta {
174
+ margin-bottom: 1rem;
175
+ }
176
+
177
+ .category {
178
+ display: inline-block;
179
+ background: #f1f3f4;
180
+ color: #586069;
181
+ padding: 0.25rem 0.5rem;
182
+ border-radius: 4px;
183
+ font-size: 0.8rem;
184
+ margin-right: 0.5rem;
185
+ margin-bottom: 0.25rem;
186
+ }
187
+
188
+ .doc-link {
189
+ display: inline-block;
190
+ color: #0366d6;
191
+ text-decoration: none;
192
+ font-weight: 500;
193
+ padding: 0.5rem 1rem;
194
+ border: 1px solid #0366d6;
195
+ border-radius: 6px;
196
+ transition: background-color 0.2s, color 0.2s;
197
+ }
198
+
199
+ .doc-link:hover {
200
+ background: #0366d6;
201
+ color: #ffffff;
202
+ text-decoration: none;
203
+ }
204
+
205
+ .no-results {
206
+ text-align: center;
207
+ padding: 3rem;
208
+ color: #586069;
209
+ }
210
+
211
+ .no-results h3 {
212
+ margin-bottom: 0.5rem;
213
+ color: #24292e;
214
+ }
215
+
216
+ @media (max-width: 768px) {
217
+ .docs-grid {
218
+ grid-template-columns: 1fr;
219
+ }
220
+
221
+ .search-input {
222
+ font-size: 16px; /* Prevents zoom on iOS */
223
+ }
224
+ }
225
+ </style>
226
+
227
+ <script>
228
+ document.addEventListener('DOMContentLoaded', function() {
229
+ const searchInput = document.getElementById('docSearch');
230
+ const docsGrid = document.getElementById('docsGrid');
231
+ const docCards = docsGrid.querySelectorAll('.doc-card');
232
+ const noResults = document.getElementById('noResults');
233
+
234
+ searchInput.addEventListener('input', function() {
235
+ const searchTerm = this.value.toLowerCase().trim();
236
+ let visibleCount = 0;
237
+
238
+ docCards.forEach(card => {
239
+ const title = card.querySelector('h3').textContent.toLowerCase();
240
+ const description = card.querySelector('p').textContent.toLowerCase();
241
+ const categories = card.dataset.categories.toLowerCase();
242
+
243
+ const matches = title.includes(searchTerm) ||
244
+ description.includes(searchTerm) ||
245
+ categories.includes(searchTerm);
246
+
247
+ if (matches || searchTerm === '') {
248
+ card.classList.remove('hidden');
249
+ visibleCount++;
250
+ } else {
251
+ card.classList.add('hidden');
252
+ }
253
+ });
254
+
255
+ // Show/hide no results message
256
+ if (visibleCount === 0 && searchTerm !== '') {
257
+ noResults.style.display = 'block';
258
+ } else {
259
+ noResults.style.display = 'none';
260
+ }
261
+ });
262
+
263
+ // Focus search input on page load
264
+ searchInput.focus();
265
+ });
266
+ </script>