Skip to content

Simplify the CodeSnippet component #29

@igotinfected

Description

@igotinfected

The current CodeSnippet component was expected to render out its ChildContent as well as the textual/code representation of that content. Since this seems to be impossible without having the content in a separate file and parsing that file this was scrapped.

The wrapping logic still remains though, e.g.:

<CodeSnippet Code="@Code">
    <Component>
        <CodeSnippet Code="@_content"
                     CodeFormat="CodeFormat.Html"
                     Summary="Show HTML">
            <Component>
                <RichTextEditor @bind-Content="@_content"
                                IsTouchedChanged="(value => _isTouched = value)" />

                <div class="container items-center border-2 border-dashed border-stone-500 p-4 mt-2">
                    @((MarkupString)_isTouchedContent)
                </div>
            </Component>
        </CodeSnippet>
    </Component>
</CodeSnippet>

This should however just be:

<RichTextEditor ... />
<CodeSnippet Code="@_content" ... />
<CodeSnippet Code="@Code" />

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions