|
| 1 | +# Diplodoc v6.0: New Level of Performance |
| 2 | + |
| 3 | +## Major Improvements |
| 4 | + |
| 5 | +### Performance Optimization |
| 6 | +- Significant CLI tools performance improvement (2x base speedup) |
| 7 | +- Parallel document processing with up to 10x speedup on multi-core systems |
| 8 | +- Improved TOC (Table of Contents) processing |
| 9 | +- Resource loading optimization and caching |
| 10 | +- Optimized handling of large projects |
| 11 | + |
| 12 | +We have been making gradual performance improvements since version 4.50.0 and are now ready to announce the results. We have achieved a base speedup of 2x thanks to optimized document processing algorithms, improved caching, and more efficient resource utilization. Additionally, we have added parallel document processing, which further accelerates the build depending on the number of cores in the system. In some cases, especially when working with large projects on multi-core servers, we observed a 10x speedup. This significant improvement allows developers to get build results faster and work more efficiently with documentation. |
| 13 | + |
| 14 | +Our system now efficiently processes documentation with over 50,000 articles, including individual articles containing more than 10 MB of text and markup. This enables the use of Diplodoc for creating and maintaining large-scale documentation projects without performance degradation. |
| 15 | + |
| 16 | +### Extended Features |
| 17 | +- Page Constructor support for modern landing pages |
| 18 | +- Built-in search system with Algolia support |
| 19 | +- Enhanced RTL (Right-to-Left) support for Arabic and Hebrew |
| 20 | +- Version Control Systems integration (GitHub) |
| 21 | + |
| 22 | +### Enhanced Table of Contents (TOC) System |
| 23 | +- Extended variable templating support for `href` and `label` fields |
| 24 | +- Automatic extraction of headings from referenced files for the `name` field |
| 25 | +- Improved handling of includes in TOC with more careful file system operations |
| 26 | +- More flexible documentation structure configuration through frontmatter |
| 27 | + |
| 28 | +We have significantly improved the Table of Contents (TOC) system, making it more flexible and user-friendly. Now more fields support variable templating, allowing for dynamic link and label generation. The `name` field can now automatically extract headings from the file it references, simplifying documentation maintenance and keeping it up-to-date. We have also improved the handling of includes in TOC, making it more careful when working with the file system, which is especially important for large projects with many nested directories. |
| 29 | + |
| 30 | +### Redirect System |
| 31 | +- Built-in support for simple file-to-file redirects based on browser redirects |
| 32 | +- Set of hooks for generating configurations for nginx and other proxy servers |
| 33 | +- Flexible configuration of redirect rules |
| 34 | +- Support for complex redirect scenarios for large projects |
| 35 | + |
| 36 | +While developing the Extension API, we recognized the need to introduce a new functionality in the system - handling redirects. By default, we implemented a simple file-to-file redirect system that works based on browser redirects. For more complex scenarios, when generating configurations for nginx or other proxy servers is required, the system includes a set of hooks for convenient work with redirects. This allows flexible configuration of redirection rules depending on project requirements and infrastructure. |
| 37 | + |
| 38 | +### Enhanced Configuration System |
| 39 | +- New configuration format with environment variables support |
| 40 | +- Extended settings validation capabilities |
| 41 | +- Improved presets and variables handling |
| 42 | +- More flexible settings override system |
| 43 | +- Systematized command-line parameters with unified naming style |
| 44 | +- Complete synchronization of settings between configuration file and command-line parameters |
| 45 | + |
| 46 | +We have systematized command-line parameters for more intuitive use. Previously, we had several "disabling" parameters that were difficult to remember: `--disableLiquid`, `--lintDisabled`, `--buildDisabled`, `--needToSanitizeHtml`. We removed unnecessary parameters and standardized the remaining ones to follow a unified naming convention: |
| 47 | + |
| 48 | +- `--disableLiquid` → `--no-template` |
| 49 | +- `--lintDisabled` → `--no-lint` |
| 50 | +- `--needToSanitizeHtml false` → `--no-sanitize-html` |
| 51 | + |
| 52 | +This systematization makes the command-line interface more understandable and predictable for users. |
| 53 | + |
| 54 | +We have also synchronized project build settings between command-line parameters and the configuration file. Now, for all main parameters in the configuration file, there is a corresponding command-line parameter. This has allowed us to add new parameters: |
| 55 | + |
| 56 | +- `--langs` - manage documentation languages |
| 57 | +- `--search` - configure search parameters |
| 58 | +- `--changelogs` - manage changelog list |
| 59 | +- `--mtimes` - configure timestamps |
| 60 | + |
| 61 | +### Extension API and Hook System |
| 62 | +- New extension system for developers with full TypeScript support |
| 63 | +- Built-in hook system for extending functionality at various stages |
| 64 | +- Modular design for creating independent, reusable extensions |
| 65 | +- Documented API for creating plugins and integrations |
| 66 | +- Integration examples with popular tools |
| 67 | +- Flexible extension lifecycle management |
| 68 | + |
| 69 | +We have already developed several extensions using the new system, which can be used as examples for creating your own extensions: |
| 70 | + |
| 71 | +- **GenericIncluder** - extension for automatic Table of Contents (TOC) generation. Analyzes the file system, finds Markdown files, and automatically creates a TOC structure based on their location and content. When generating the TOC, it takes into account the file title and its weight specified in the frontmatter, allowing for flexible customization of the documentation structure. This significantly simplifies the organization of large documentation projects. |
| 72 | + |
| 73 | +- **GithubVcsConnector** - extension for collecting information about contributors and article authors from GitHub. Gathers metadata about commits, authors, and contributors, which can then be displayed in the documentation interface. This allows users to see who and when made changes to the documentation, increasing transparency in the development process and acknowledging community contributions. |
| 74 | + |
| 75 | +- **AlgoliaSearch** - integration with Algolia for full-text search capabilities. Automatically indexes documentation content in Algolia, configures search suggestions and filters, and provides fast and relevant search across the entire documentation with multi-language support. |
| 76 | + |
| 77 | +- **LocalSearch** - extension for local documentation search using the lunr.js library. Creates a search index on the client side, enabling fast search without connecting to external services. Supports fuzzy search, phrase search, and relevance-based result ranking. Particularly useful for projects requiring offline operation or with data confidentiality restrictions. |
| 78 | + |
| 79 | +These extensions demonstrate various capabilities of the new extension system and can serve as a starting point for developing your own plugins. Each of them implements its own set of hooks and utilizes different aspects of the extension API. |
| 80 | + |
| 81 | +## Technical Details |
| 82 | + |
| 83 | +### New Configuration Options |
| 84 | +```yaml |
| 85 | +sanitizeHtml: true |
| 86 | +allowHtml: true |
| 87 | +addMapFile: false |
| 88 | +removeHiddenTocItems: false |
| 89 | +mergeIncludes: false |
| 90 | +staticContent: false |
| 91 | +``` |
| 92 | +
|
| 93 | +### Enhanced Extension System |
| 94 | +- Base Program class for all CLI commands |
| 95 | +- Hook system for functionality extension |
| 96 | +- Configuration and logging management |
| 97 | +- Extension registration interface |
| 98 | +
|
| 99 | +## Getting Started |
| 100 | +
|
| 101 | +1. Update dependencies to the latest version |
| 102 | +2. Check compatibility of existing configurations |
| 103 | +3. Review new documentation |
| 104 | +4. Configure parameters according to your needs |
| 105 | +
|
| 106 | +### Minor Technical Improvements |
| 107 | +
|
| 108 | +- Landing pages now fully support frontmatter, allowing customization of their metadata and behavior |
| 109 | +- Using Latex and Mermaid syntax no longer requires the `--allow-custom-resources` flag, these features are now available by default |
| 110 | +- More secure file system operations - fixed a number of vulnerabilities that allowed access to files outside the project |
| 111 | + |
| 112 | +## Additional Information |
| 113 | + |
| 114 | +- [Full Documentation](https://diplodoc.com/docs) |
| 115 | +- [Migration Guide](https://diplodoc.com/docs/migration) |
| 116 | +- [Usage Examples](https://diplodoc.com/docs/examples) |
0 commit comments