|
1 | | -# How do I include Readme Typing SVG in my Readme? |
| 1 | +# FAQ |
2 | 2 |
|
3 | | -Markdown files on GitHub support embedded images using Markdown or HTML. |
| 3 | +## How do I include Readme Typing SVG in my Readme? |
4 | 4 |
|
5 | | -Markdown: |
| 5 | +Markdown files on GitHub support embedded images using Markdown or HTML. You can customize your SVG on the [demo site](https://readme-typing-svg.herokuapp.com/demo/) and use the image source in either of the following ways: |
6 | 6 |
|
7 | | -```html |
| 7 | +### Markdown |
| 8 | + |
| 9 | +```md |
8 | 10 | [](https://git.io/typing-svg) |
9 | 11 | ``` |
10 | 12 |
|
11 | | -HTML: |
| 13 | +### HTML |
12 | 14 |
|
13 | 15 | ```html |
14 | 16 | <a href="https://git.io/typing-svg"><img src="https://readme-typing-svg.herokuapp.com/?lines=First+line+of+text;Second+line+of+text"></a> |
15 | 17 | ``` |
16 | 18 |
|
17 | | -# FAQs |
| 19 | +## The text is getting cut off at the end, how do I fix it? |
18 | 20 |
|
19 | | -## How do I center the image on the page? |
| 21 | +The text rendered within the SVG can be any variable width, therefore you must specify the width manually to ensure the text will fit. |
20 | 22 |
|
21 | | -We can do so by *using the HTML version*, and then wrapping it by the HTML attribute of `align="center"`. |
| 23 | +The `width` parameter in the URL should be increased such that the full width of the text is displayed properly. |
22 | 24 |
|
23 | | -You can do so by: |
| 25 | +```md |
| 26 | +https://readme-typing-svg.herokuapp.com/?lines=Your+Long+Message+With+A+Long+Width&width=460 |
| 27 | +``` |
| 28 | + |
| 29 | +## How do I center the image on the page? |
| 30 | + |
| 31 | +To center align images, you must use the HTML syntax and wrap it in an element with the HTML attribute `align="center"`. |
24 | 32 |
|
25 | 33 | ```html |
26 | 34 | <p align="center"> |
27 | | - <img src="https://readme-typing-svg.herokuapp.com/?lines=Type+messages+everywhere!;Add+a+bio+to+your+profile!;Add+a+description+to+your+repo!;Make+your+readme+stand+out!&font=Fira%20Code¢er=true&width=380&height=50"> |
| 35 | + <a href="https://git.io/typing-svg"><img src="https://readme-typing-svg.herokuapp.com/?lines=This+image+is+center-aligned&font=Fira%20Code¢er=true&width=380&height=50"></a> |
28 | 36 | </p> |
29 | | -``` |
| 37 | +``` |
| 38 | + |
| 39 | +## How do I add multiple spaces in the middle of a line? |
| 40 | + |
| 41 | +Similar to HTML, SVG/XML treats multiple consecutive spaces as a single space. |
| 42 | + |
| 43 | +A workaround for adding extra spaces can be to use other whitespace characters (for example, you can copy-paste the en-space or other unusual spaces from https://qwerty.dev/whitespace). The alternate whitespace characters don't get ignored. |
| 44 | + |
| 45 | +## How do I make different SVGs for dark mode and light mode? |
| 46 | + |
| 47 | +As of May 2022, you can now [specify theme context](https://github.blog/changelog/2022-05-19-specify-theme-context-for-images-in-markdown-beta/) using the `<picture>` and `<source>` elements as shown below. The dark mode version appears in the `srcset` of the `<source>` tag and the light mode version appears in the `src` of the `<img>` tag. |
| 48 | + |
| 49 | +```html |
| 50 | +<picture> |
| 51 | + <source media="(prefers-color-scheme: dark)" srcset="https://readme-typing-svg.herokuapp.com/?lines=You+are+using+dark+mode&color=FFFFFF"> |
| 52 | + <img src="https://readme-typing-svg.herokuapp.com/?lines=You+are+using+light+mode&color=000000"> |
| 53 | +</picture> |
| 54 | +``` |
| 55 | + |
| 56 | +## How do I create a Readme for my profile? |
| 57 | + |
| 58 | +A profile readme appears on your profile page when you create a repository with the same name as your username and add a `README.md` file to it. For example, the repository for the user [`DenverCoder1`](https://github.com/DenverCoder1) is located at [`DenverCoder1/DenverCoder1`](https://github.com/DenverCoder1/DenverCoder1). |
0 commit comments