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

[docs] Enable PulumiCodeChooser on nested docs descriptions #15506

Open
guineveresaenger opened this issue Feb 23, 2024 · 0 comments
Open

[docs] Enable PulumiCodeChooser on nested docs descriptions #15506

guineveresaenger opened this issue Feb 23, 2024 · 0 comments
Labels
area/docs Improvements or additions to documentation kind/enhancement Improvements or new features

Comments

@guineveresaenger
Copy link
Contributor

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

With #15475 and pulumi/pulumi-terraform-bridge#1689, incoming schema description: fields on TF based providers now wrap all code blocks with <!--Start PulumiCodeChooser -->
and <!--End PulumiCodeChooser --> HTML tags.

This includes nested type descriptions! 🎉

We currently do not provide any handling for code blocks found in nested type descriptions, with can result in a rendered page stretching out all code blocks without a chooser.

More details:

I looked around a generated page with the new HTML tag wrappers looks like this:

<!-- raw HTML omitted -->
<pre><code class="language-typescript">import * as pulumi from &quot;@pulumi/pulumi&quot;;
import * as aws from &quot;@pulumi/aws&quot;;

const ecsPolicy = new aws.appautoscaling.Policy(&quot;ecsPolicy&quot;, {stepScalingPolicyConfiguration: {
    stepAdjustments: [
        {
            metricIntervalLowerBound: &quot;1&quot;,
            metricIntervalUpperBound: &quot;2&quot;,
            scalingAdjustment: -1,
        },
        {
            metricIntervalLowerBound: &quot;2&quot;,
            metricIntervalUpperBound: &quot;3&quot;,
            scalingAdjustment: 1,
        },
    ],
}});
</code></pre>
<pre><code class="language-python">import pulumi
import pulumi_aws as aws

ecs_policy = aws.appautoscaling.Policy(&quot;ecsPolicy&quot;, step_scaling_policy_configuration=aws.appautoscaling.PolicyStepScalingPolicyConfigurationArgs(
    step_adjustments=[
        aws.appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs(
            metric_interval_lower_bound=&quot;1&quot;,
            metric_interval_upper_bound=&quot;2&quot;,
            scaling_adjustment=-1,
        ),
        aws.appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs(
            metric_interval_lower_bound=&quot;2&quot;,
            metric_interval_upper_bound=&quot;3&quot;,
            scaling_adjustment=1,
        ),
        ...

and the <!-- raw HTML omitted --> seems to be replaced by our Markdown parser/renderer here.

A solution here would ensure that <!--Start PulumiCodeChooser -->" is recognized and swapped out for a real code chooser div. The tricky bit is recognizing the language highlight andsetting the language-specific choosable.

Affected area/feature

Docsgen

@guineveresaenger guineveresaenger added area/docs Improvements or additions to documentation kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Feb 23, 2024
@justinvp justinvp removed the needs-triage Needs attention from the triage team label Mar 2, 2024
@sean1588 sean1588 added this to the 0.103 milestone Apr 8, 2024
@mikhailshilkov mikhailshilkov removed this from the 0.103 milestone Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Improvements or additions to documentation kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

4 participants