Skip to content

Conversation

@cgoetze11
Copy link

Summary

Updates the API documentation infrastructure from the unmaintained 10-year-old ringcentral/slate fork to the official slatedocs/slate v2.13.1
release. This brings 150+ commits of improvements including updated dependencies, bug fixes, and better Middleman integration.

Key Changes

Infrastructure Updates

  • Middleman: 4.2.1 → 4.4.3 (latest stable)
  • Ruby: Updated to support Ruby 2.6-3.1 (tested with 3.1.6)
  • Redcarpet: 3.4.0 → 3.6.0
  • Rouge: Updated to 3.30.0
  • Nokogiri: Updated to 1.13.9
  • Added webrick: Required for Ruby 3.x compatibility

Guidebook Customizations Preserved

  • Maintained deploy.sh --current VERSION flag for copying versioned index.html to root
  • Kept custom unique header ID generation in lib/unique_head.rb
  • Preserved existing markdown configuration and syntax highlighting

Compatibility Fixes

Redcarpet Renderer (Middleman 4.6)

Fixed undefined method 'link_to' for nil:NilClass error by switching from custom renderer class to monkey-patching approach in config.rb.
This ensures Middleman properly sets up the scope variable that the renderer needs.

Before (broken with Middleman 4.6):

set :markdown, renderer: UniqueHeadCounter

After (working):
ready do
  Middleman::Renderers::MiddlemanRedcarpetHTML.class_eval do
    def header(text, header_level)
      # Custom header ID logic
    end
  end
end

Build Optimizations

Temporarily disabled three build optimizations due to compatibility issues:

1. Autoprefixer: Disabled due to SCSS comments in compiled CSS
  - Sass :compressed output leaves // comments that autoprefixer can't parse
  - Future fix: Migrate to Dart Sass which properly strips all comments
2. CSS Minification: Disabled due to import resolution issues
  - Minifier attempts to recompile already-compiled CSS
  - Sass already outputs compressed CSS via style: :compressed
3. JS Minification: Disabled due to ES6 syntax
  - Uglifier doesn't support const, arrow functions, etc.
  - Future fix: Replace with terser for ES6+ support

Testing

-  bundle install succeeds with Ruby 3.1.6
-  bundle exec middleman build --clean completes successfully
-  Generated HTML files (v1 and v1.1) are properly formatted
-  All assets (CSS, JS, fonts, images) build correctly
-  Custom header ID generation works as expected

Migration Notes

- Requires Ruby >= 2.6 (recommend 3.1.6 via rbenv)
- Run bundle install to update dependencies
- .ruby-version file added for rbenv users
- No changes to documentation source files required

Future Improvements

- Re-enable autoprefixer after Dart Sass migration
- Re-enable JS minification with terser
- Consider using slatedocs' nested header ID approach
- Evaluate middleman-syntax 3.3.0 upgrade (currently 3.2.0 for Haml compatibility)

Related Issues

Fixes compatibility with modern Ruby versions (2.7-3.1) and brings infrastructure up to date with actively maintained upstream.

Abdullah Hashim and others added 30 commits July 20, 2017 10:28
I think the use of the word retrieves in the DELETE request is used mistakenly.
The `--source-only` already works to only build and not deploy. But
sometimes we want to just push and not build. An example of that is
when you want to use Docker to build the project, avoiding the
installation of the whole Ruby environment in your computer.

This commit adds `--push-only` to add the ability to execute only the
actions related to `git` and avoid the project build.

No API was broken by this commit, it's a minor change.
on line 101 missing a semicolon
Add possibility to have the ´code´ tag inside the content tables
I believe the data-title attribute for H2 elements was mistakenly using the parent H1 content as its value, rather than its own content.

* Move nesting generator to separate class

* Major bug fix, code simplification

* Get rid of global value, use class variable instead.
MasterOdin and others added 28 commits April 22, 2022 21:28
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthew Peveler <matt.peveler@gmail.com>
- Updated to Middleman 4.4 from unmaintained fork
- Merged deploy.sh changes from slatedocs/slate v2.13.1
- Preserved Guidebook's -c/--current flag for versioned deployments
- Added slate's --source-only and --push-only flags
- Updated all gem dependencies to latest compatible versions
- Added Ruby 3.1 support via .ruby-version
- Fixed Redcarpet renderer to work with Middleman 4.6 scope handling
- Modified config.rb to use monkey-patching instead of custom renderer class
- Added cattr_accessor to custom renderer classes for scope support
- Disabled CSS minification (conflicts with Sass compressed output)
- Disabled JS minification (conflicts with ES6 syntax)
- Disabled autoprefixer (conflicts with SCSS comments in compiled CSS)
- All assets now building successfully (CSS, JS, HTML, fonts, images)
- Build generates 675KB HTML files for both v1 and v1.1
@cgoetze11 cgoetze11 merged commit a5b045e into master Nov 25, 2025
cgoetze11 pushed a commit that referenced this pull request Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.