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

When I use attribute as a literal type, the doc generate error. #1426

Closed
LinYunling opened this issue Jun 20, 2024 · 2 comments
Closed

When I use attribute as a literal type, the doc generate error. #1426

LinYunling opened this issue Jun 20, 2024 · 2 comments
Labels
question Further information is requested

Comments

@LinYunling
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

schema ResourceModel:
    '''
        Resource Model Definition

        Attributes
        ----------
        name: str
            The name of resource.
        alias: str
            The alias name of resource.
        type: "PC" | "Notebook" | "IPad" | "SmartPhone" = "PC"
            The type of resource.
   
        Examples
        ----------------------
        res = ResourceModel {
            name = "ServerA"
            alias = "My Computer"
            type = "PC"
        }
    '''
    name: str
    alias?: str
    type: "PC" | "Notebook" | "IPad" | "SmartPhone" = "PC"

generate the doc

2. What did you expect to see? (Required)

image

3. What did you see instead (Required)

image

4. What is your KCL components version? (Required)

0.9.0-beta.1

@Peefy
Copy link
Contributor

Peefy commented Jun 20, 2024

Hello @LinYunling You can use the command kcl doc gen --escape-html to escape the | character in the string literal union types.

@Peefy Peefy added the question Further information is requested label Jun 20, 2024
@LinYunling
Copy link
Author

thanks

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

No branches or pull requests

2 participants