Skip to content

Add utility method to skip code blocks in migrations

Sarah German requested to merge 73-migrations-skip-codeblocks into main

What does this MR do and why?

Adds a utility method to skip code blocks in migrations.

In content migrations, we only want to modify actual content, not examples of how to use different elements. Examples are are shown in code blocks and have different markup to print them literally rather than as their rendered elements.

We should just skip these because:

  1. Examples of the literal markup for Hugo shortcodes have slightly different markup in order for them to not render literally. Including handling for these cases would add significant complexity to our migration scripts.
  2. These examples will need to be manually updated regardless in order to ensure the surrounding context is still accurate. There is not a real benefit of programmatically updating these.

Screenshots, screen recordings, or links to review app

Alerts:

Before After
image image

Version history:

Before After
image image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md.
  2. Run a compile and view the site with updated content: REMOVE_BEFORE_CLONE=true make clone-docs-projects && make view
  3. Verify the style guide no longer contains invalid markup/unclosed tags: http://localhost:1313/development/documentation/styleguide/#alert-boxes
  4. Verify alerts and version history still migrate by viewing pages with these, such as:

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #73 (closed)

Edited by Sarah German

Merge request reports