Skip to content

Commit ade8c17

Browse files
Fix grammar errors and clarify notes around gists
1 parent 8ef71e3 commit ade8c17

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

docs/embed-files.md

+20-18
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,13 @@ Embedding any type of source code file, you can specify the highlighted language
9595

9696
## Embed a gist
9797

98-
You can embed a gist as markdown content or as a code block - this is based on the approach in the [Embed files](#embed-files) but uses raw gist URL as the target.
98+
You can embed a gist as markdown content or as a code block - this is based on the approach at the start of [Embed Files](#embed-files) section, but uses a raw gist URL as the target.
9999

100-
?> No plugin or app config change is needed here. In fact, an "Embed" script tag that is copied from a gist will _not_ load even if you make plugin or config changes to allow the external script.
100+
?> **No** plugin or app config change is needed here to make this work. In fact, the "Embed" `script` tag that is copied from a gist will _not_ load even if you make plugin or config changes to allow an external script.
101101

102-
### Identify gist metadata
102+
### Identify the gist's metadata
103103

104-
Start by viewing a gist on `gist.github.com`.
105-
106-
For the purposes of this guide, we assume that is this is a valid gist URL:
104+
Start by viewing a gist on `gist.github.com`. For the purposes of this guide, we assume that is this is a valid gist URL:
107105

108106
- https://gist.github.com/docsify/c2bece08f27c4277001f123898d16a7c
109107

@@ -113,46 +111,50 @@ Identify the following from the gist:
113111
- **Gist ID** - e.g. `c2bece08f27c4277001f123898d16a7c`
114112
- **Filename** - choose any valid filename in the gist e.g. `instructions.md`
115113

116-
Now you can create the _raw gist URL_ for the file on the `gist.githubusercontent.com` domain.
114+
Now you have to build the _raw gist URL_ for the target file on the `gist.githubusercontent.com` domain.
117115

118116
For example:
119117

120118
- https://gist.githubusercontent.com/docsify/c2bece08f27c4277001f123898d16a7c/raw/instructions.md
121119

122-
Continue with one of the the sections below to actually embed the gist on a Docsify page.
120+
?> Alternatively, you can get a raw gist URL directly from a gist by clicking the _Raw_ button on a gist file. But if you use that value, just be sure to **remove** the revision number between `raw/` and the filename so that the URL matches the pattern above instead. Otherwise your embedded gist will **not** show the latest content when the gist is updated.
121+
122+
Continue with one of the sections below to embed the gist on a Docsify page.
123+
124+
### Render markdown content from a gist
123125

124-
### Render markdown content from gist
126+
This is a great way to embed content **seamlessly** in your docs, without sending someone to an external link. This approach is well-suited to reusing a gist of say installation instructions across doc sites of multiple repos.
125127

126-
Embed markdown content on your Docsify page. This is a great way to embed content seemlessly without an external link, whether the gist was created by yourself or another account.
128+
?> This approach works equally well with a gist owned by your account or by someone else.
127129

128130
Here is the format:
129131

130132
```markdown
131133
[LABEL](https://gist.githubusercontent.com/USERNAME/GIST_ID/raw/FILENAME ':include')
132134
```
133135

134-
Using the example case, the element on your page would be:
136+
Using the example case, the element on your Docsify page would be:
135137

136138
```markdown
137-
[instructions.md](https://gist.githubusercontent.com/docsify/c2bece08f27c4277001f123898d16a7c/raw/instructions.md ':include')
139+
[gist: instructions.md](https://gist.githubusercontent.com/docsify/c2bece08f27c4277001f123898d16a7c/raw/instructions.md ':include')
138140
```
139141

140-
?> The the `LABEL` will be the fallback text if the link is broken, so it is useful to repeat the filename in the label.
142+
?> The `LABEL` can be any text you want. It acts fallback text if the link is broken - so it is useful to repeat the filename here in case you need to fix the link.
141143

142-
### Render codeblock from gist
144+
### Render a codeblock from a gist
143145

144-
Embed a gist on your Docsify page as a code block. The format is the same as the previous section, but with `:type=code` added to the alt text.
146+
The format is the same as the previous section, but with `:type=code` added to the alt text at the end.
145147

146-
?> As with the [Embedded file type](#embedded-file-type) section, the syntax highlighting will be inferred from the extension (e.g. `.js` or `.py`) so you can leave the type as the generic value of `code`.
148+
?> As with the [Embedded file type](#embedded-file-type) section, the syntax highlighting will be inferred from the extension (e.g. `.js` or `.py`), so you can leave the `:type` as the generic value of `code`.
147149

148150
Here is the format:
149151

150152
```markdown
151153
[LABEL](https://gist.githubusercontent.com/USERNAME/GIST_ID/raw/FILENAME ':include :type=code')
152154
```
153155

154-
Using the example case, the element on your page would be:
156+
Using the example case, the element on your Docsify page would be:
155157

156158
```markdown
157-
[instructions.md](https://gist.githubusercontent.com/docsify/c2bece08f27c4277001f123898d16a7c/raw/instructions.md ':include :type=code')
159+
[gist: instructions.md](https://gist.githubusercontent.com/docsify/c2bece08f27c4277001f123898d16a7c/raw/instructions.md ':include :type=code')
158160
```

0 commit comments

Comments
 (0)