You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/embed-files.md
+55
Original file line number
Diff line number
Diff line change
@@ -92,3 +92,58 @@ Embedding any type of source code file, you can specify the highlighted language
92
92
[](_media/example.html':include :type=code text')
93
93
94
94
?> How to set highlight? You can see [here](language-highlight.md).
95
+
96
+
## Embed a gist
97
+
98
+
You can embed a gist as markdown content or as a code block. No plugin or app config change is needed - just an element which follows the formatting covered in [Embed files](#embed-files) and uses a raw gist URL.
99
+
100
+
Start by viewing a gist on `gist.github.com`.
101
+
102
+
For the purposes of the examples below, we assume is this is a valid gist URL.
-**Gist ID** - e.g. `c2bece08f27c4277001f123898d16a7c`
110
+
-**Filename** - choose any valid filename in the gist e.g. `instructions.md`
111
+
112
+
Next, you can create the full URL for the file on the `gist.githubusercontent.com` domain. See below for markdown or codeblock approaches.
113
+
114
+
### Render markdown content from gist
115
+
116
+
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.
Embed a gist on your Docsify page as a code block. The format is the same as the previous section except it just has `:type=code` added on in the alt text.
135
+
136
+
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 `code`.
0 commit comments