hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
14.98k stars 3.33k forks source link

Please fix documentation pages to remember code sample choice selected by user and use HCL2 as the default format #13078

Open sabuncumurat opened 6 days ago

sabuncumurat commented 6 days ago

Example page exhibiting the problem: https://developer.hashicorp.com/packer/docs/provisioners/breakpoint

When the user chooses HCL2 (vs JSON) as the format to display the template code samples on a page, the choice does not stick and switches back to the JSON format (which seems to be the default) when the same page is displayed again (e.g. after desktop focus is lost and regained). I tested with both FF and Chrome on Windows 10.

Better yet, make HCL2 the default for such code samples, as HCL2 is the preferred template format while JSON is the legacy format. By default, code samples should display in the HCL2 format, with the JSON version only displayed if the user clicks on it.

2024-06-27 091355 - firefox

Community Note

When filing a bug, please include the following headings if possible. Any example text in this template can be deleted.

Overview of the Issue

A paragraph or two about the issue you're experiencing.

Reproduction Steps

Steps to reproduce this issue

Packer version

From packer version

Simplified Packer Template

If the file is longer than a few dozen lines, please include the URL to the gist of the log or use the Github detailed format instead of posting it directly in the issue.

Operating system and Environment details

OS, Architecture, and any other information you can provide about the environment.

Log Fragments and crash.log files

Include appropriate log fragments. If the log is longer than a few dozen lines, please include the URL to the gist of the log or use the Github detailed format instead of posting it directly in the issue.

Set the env var PACKER_LOG=1 for maximum log detail.