Skip to content

Commit

Permalink
Merge pull request #27556 from michalvavrik/feature/doc-add-copy-butt…
Browse files Browse the repository at this point in the history
…on-to-env-var

Make it easy to copy environment variables in config tables - add button
  • Loading branch information
gsmet authored Sep 12, 2022
2 parents 6db6a38 + 7a1f0b8 commit 5b8eaa9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ public void format(Writer writer, ConfigDocKey configDocKey) throws IOException
String doc = configDocKey.getConfigDoc();

// Convert a property name to an environment variable name and show it in the config description
final var envVarExample = String.format("Environment variable: `+++%s+++`", toEnvVarName(configDocKey.getKey()));
final String envVarExample = String.format("ifdef::add-copy-button-to-env-var[]\n" +
"Environment variable: env_var_with_copy_button:+++%1$s+++[]\n" +
"endif::add-copy-button-to-env-var[]\n" +
"ifndef::add-copy-button-to-env-var[]\n" +
"Environment variable: `+++%1$s+++`\n" +
"endif::add-copy-button-to-env-var[]", toEnvVarName(configDocKey.getKey()));
if (configDocKey.getConfigDoc().isEmpty()) {
doc = envVarExample;
} else {
Expand Down

0 comments on commit 5b8eaa9

Please sign in to comment.