Skip to content

Commit e2c005c

Browse files
authored
docs: Add more questions and answers to the FAQ (#112)
1 parent 9f57b88 commit e2c005c

File tree

1 file changed

+40
-11
lines changed

1 file changed

+40
-11
lines changed

docs/faq.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,58 @@
1-
# How do I include Readme Typing SVG in my Readme?
1+
# FAQ
22

3-
Markdown files on GitHub support embedded images using Markdown or HTML.
3+
## How do I include Readme Typing SVG in my Readme?
44

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:
66

7-
```html
7+
### Markdown
8+
9+
```md
810
[![Typing SVG](https://readme-typing-svg.herokuapp.com/?lines=First+line+of+text;Second+line+of+text)](https://git.io/typing-svg)
911
```
1012

11-
HTML:
13+
### HTML
1214

1315
```html
1416
<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>
1517
```
1618

17-
# FAQs
19+
## The text is getting cut off at the end, how do I fix it?
1820

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.
2022

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.
2224

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"`.
2432

2533
```html
2634
<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&center=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&center=true&width=380&height=50"></a>
2836
</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

Comments
 (0)