Skip to content

Add support for @Small directive #405

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

Conversation

dobromir-hristov
Copy link
Contributor

@dobromir-hristov dobromir-hristov commented Aug 9, 2022

Bug/issue #, if applicable: 97717135

Summary

Adds support for the new @Small directive from DocC.

image

Dependencies

DocC PR - swiftlang/swift-docc#380

Testing

Add the RenderJSON below to a content field of a renderJSON of your choice

        {
          "type": "small",
          "content": [{
            "type": "text",
            "text": "Text you want to render"
          }]
        }

Steps:

  1. Assert the small text is rendered in a smaller font than the rest of the content

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

@dobromir-hristov dobromir-hristov changed the title Add support for @Small directive Add support for @Small directive Aug 9, 2022
Copy link
Contributor

@mportiz08 mportiz08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. We may want to hold off on merging until the spec is complete for this just to make sure the API expectations are synced properly.

@dobromir-hristov
Copy link
Contributor Author

This PR is now synced with the latest changes on the DocC side. Each small tag is wrapped in a paragraph, so to keep semantics in order.

Copy link
Contributor

@mportiz08 mportiz08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. I found one minor inconsistency with the spec (Ethan fixed it already), and there's one tiny comment I had regarding the new font style.

Works and looks ready to go once you have a chance to look at that.

@dobromir-hristov
Copy link
Contributor Author

@swift-ci test

@dobromir-hristov
Copy link
Contributor Author

@swift-ci test

@dobromir-hristov
Copy link
Contributor Author

@swift-ci test

@dobromir-hristov dobromir-hristov merged commit 009f87b into swiftlang:main Sep 15, 2022
@dobromir-hristov dobromir-hristov deleted the dhristov/r97717135-add-support-for-small branch September 15, 2022 07:49
ethan-kusters added a commit to ethan-kusters/swift-docc that referenced this pull request Sep 15, 2022
Adds support for the `@Small` directive as described here:
https://forums.swift.org/t/supporting-more-dynamic-content-in-swift-docc-reference-documentation/59527#small-18

A new `@Small` directive based on HTML’s small tag.
This directive can be used to specify small print like legal,
license, or copyright text that should be rendered in a smaller
font size.

`@Small` accepts no parameters and accepts inline DocC markup body
content.

Example:

    You can create a sloth using the ``init(name:color:power:)``
    initializer, or create randomly generated sloth using a
    ``SlothGenerator``:

       let slothGenerator = MySlothGenerator(seed: randomSeed())
       let habitat = Habitat(isHumid: false, isWarm: true)

       // ...

    @Small {
        Licensed under Apache License v2.0 with Runtime Library Exception
    }

Dependencies:

- swiftlang/swift-docc-render#405

Resolves rdar://97744845
ethan-kusters added a commit to ethan-kusters/swift-docc that referenced this pull request Sep 15, 2022
Adds support for the `@Small` directive as described here:
https://forums.swift.org/t/supporting-more-dynamic-content-in-swift-docc-reference-documentation/59527#small-18

A new `@Small` directive based on HTML’s small tag.
This directive can be used to specify small print like legal,
license, or copyright text that should be rendered in a smaller
font size.

`@Small` accepts no parameters and accepts inline DocC markup body
content.

Example:

    You can create a sloth using the ``init(name:color:power:)``
    initializer, or create randomly generated sloth using a
    ``SlothGenerator``:

       let slothGenerator = MySlothGenerator(seed: randomSeed())
       let habitat = Habitat(isHumid: false, isWarm: true)

       // ...

    @Small {
        Licensed under Apache License v2.0 with Runtime Library Exception
    }

Dependencies:

- swiftlang/swift-docc-render#405

Resolves rdar://97744845
ethan-kusters added a commit to ethan-kusters/swift-docc that referenced this pull request Sep 16, 2022
Adds support for the `@Small` directive as described here:
https://forums.swift.org/t/supporting-more-dynamic-content-in-swift-docc-reference-documentation/59527#small-18

A new `@Small` directive based on HTML’s small tag.
This directive can be used to specify small print like legal,
license, or copyright text that should be rendered in a smaller
font size.

`@Small` accepts no parameters and accepts inline DocC markup body
content.

Example:

    You can create a sloth using the ``init(name:color:power:)``
    initializer, or create randomly generated sloth using a
    ``SlothGenerator``:

       let slothGenerator = MySlothGenerator(seed: randomSeed())
       let habitat = Habitat(isHumid: false, isWarm: true)

       // ...

    @Small {
        Licensed under Apache License v2.0 with Runtime Library Exception
    }

Dependencies:

- swiftlang/swift-docc-render#405

Resolves rdar://97744845
ethan-kusters added a commit to ethan-kusters/swift-docc that referenced this pull request Sep 16, 2022
Adds support for the `@Small` directive as described here:
https://forums.swift.org/t/supporting-more-dynamic-content-in-swift-docc-reference-documentation/59527#small-18

A new `@Small` directive based on HTML’s small tag.
This directive can be used to specify small print like legal,
license, or copyright text that should be rendered in a smaller
font size.

`@Small` accepts no parameters and accepts inline DocC markup body
content.

Example:

    You can create a sloth using the ``init(name:color:power:)``
    initializer, or create randomly generated sloth using a
    ``SlothGenerator``:

       let slothGenerator = MySlothGenerator(seed: randomSeed())
       let habitat = Habitat(isHumid: false, isWarm: true)

       // ...

    @Small {
        Licensed under Apache License v2.0 with Runtime Library Exception
    }

Dependencies:

- swiftlang/swift-docc-render#405

Resolves rdar://97744845
ethan-kusters added a commit to swiftlang/swift-docc that referenced this pull request Sep 16, 2022
Adds support for the `@Small` directive as described here:
https://forums.swift.org/t/supporting-more-dynamic-content-in-swift-docc-reference-documentation/59527#small-18

A new `@Small` directive based on HTML’s small tag.
This directive can be used to specify small print like legal,
license, or copyright text that should be rendered in a smaller
font size.

`@Small` accepts no parameters and accepts inline DocC markup body
content.

Example:

    You can create a sloth using the ``init(name:color:power:)``
    initializer, or create randomly generated sloth using a
    ``SlothGenerator``:

       let slothGenerator = MySlothGenerator(seed: randomSeed())
       let habitat = Habitat(isHumid: false, isWarm: true)

       // ...

    @Small {
        Licensed under Apache License v2.0 with Runtime Library Exception
    }

Dependencies:

- swiftlang/swift-docc-render#405

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

Successfully merging this pull request may close these issues.

4 participants