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

add fun to sign up for Sentry account #10970

Closed
wants to merge 12 commits into from
15 changes: 15 additions & 0 deletions docs/contributing/pages/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,18 @@ Example:
</OnboardingOption>
```
</OnboardingOption>

## Inline images

You can use the `|inline` modifier within an image alt text to render it inline with the text.
lizokm marked this conversation as resolved.
Show resolved Hide resolved

The `|inline` modifier is a hack, and gets stripped out by the markdown parser.
lizokm marked this conversation as resolved.
Show resolved Hide resolved


Example:

```markdown {2}
<span style={{display: 'inline-block', width: '24px'}}>
![sentry thumbs up |inline](./img/sentry-thumbs-up.gif)
</span>.
```
lizokm marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/platforms/javascript/common/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ Check out the other SDKs we support in the left-hand dropdown.

</PlatformSection>

Don't already have an account and Sentry project established? Head over to [sentry.io](https://sentry.io/signup/), then return to this page.
Try [**Sentry for free**](https://sentry.io/signup/)
lizokm marked this conversation as resolved.
Show resolved Hide resolved
<span style={{display: 'inline-block', width: '24px'}}>![sentry thumbs up |inline](./img/sentry-thumbs-up.gif)</span>.
Then come back here. We'll be waiting.

<PlatformSection noGuides>

Expand Down
24 changes: 24 additions & 0 deletions src/components/docImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,32 @@ export default function DocImage({
.split('x')
.map(s => parseInt(s, 10));

// handle inline images (with |inline at the end of the alt text)
if (props.alt?.endsWith('|inline')) {
return (
// eslint-disable-next-line @next/next/no-img-element
<img
src={imgPath}
style={{
display: 'inline',
maxWidth: '100%',
height: 'auto',
border: 'none',
boxShadow: 'none',
}}
{...props}
alt={props.alt.replace('|inline', '')}
/>
);
}

return (
<div style={{textAlign: 'center'}}>
<pre>
src: {src}
<br />
props: {JSON.stringify(props, null, 2)}
</pre>
<a href={imgPath} target="_blank" rel="noreferrer">
<Image
{...props}
Expand Down
1 change: 1 addition & 0 deletions src/mdxComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export function mdxComponents(
VimeoEmbed,
a: SmartLink,
img: DocImage,
DocImage,
...dynamicComponents,
wrapper,
};
Expand Down
Loading