Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sabuncumurat opened this issue Jun 27, 2024 · 2 comments
Labels

Comments

@sabuncumurat
Copy link

sabuncumurat commented Jun 27, 2024

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.

Please fix documentation pages to remember code sample choice made by the user. 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

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

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.

@sabuncumurat sabuncumurat changed the title Please fix documentation pages to remember template choice selected by user for examples Please fix documentation pages to remember template format choice selected by user for examples Jun 27, 2024
@sabuncumurat sabuncumurat changed the title Please fix documentation pages to remember template format choice selected by user for examples Please fix documentation pages to remember code sample choice selected by user for examples and use HCL2 as the default format Jun 27, 2024
@sabuncumurat sabuncumurat changed the title Please fix documentation pages to remember code sample choice selected by user for examples and use HCL2 as the default format Please fix documentation pages to remember code sample choice selected by user and use HCL2 as the default format Jun 27, 2024
@tenthirtyam
Copy link
Contributor

Recommend that this be labeled as an enhancement and documentation.

@lbajolet-hashicorp
Copy link
Contributor

Agreed on the labelling there @tenthirtyam, thanks!

You are correct @sabuncumurat, HCL2 should be the new normal these days, we should do a pass on the docs to change that behaviour.
We'll see to it ASAP, thanks for the report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants