Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cca9d5e

Browse files
Update README.md
1 parent 3f14679 commit cca9d5e

File tree

1 file changed

+35
-24
lines changed

1 file changed

+35
-24
lines changed

docs/README.md

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -738,41 +738,52 @@ To make the most of Docsify, update your content using the next section.
738738
739739
740740
## Write content
741-
> How to update and add to the content of your doc files so that they work well in Docsify.
741+
> How to update and add to the content of your doc files so that they work well in Docsify
742742
743743
744744
### Embed
745745
746-
You can embed content such as video, audio, iframes (`.html`), code blocks or even Markdown files.
746+
You can embed content such as
747+
748+
- Media - video, audio, iframes (`.html`)
749+
- Code that appears as a code block
750+
- Markdown or HTML that gets rendered on the page seamlessly.
747751
748752
#### Embed format
749753
750754
Add the `":include"` parameter in a markdown URL reference. Here is the format:
751755
752756
```markdown
753-
[filename](url ":include")
757+
[LABEL](PATH ":include")
754758
```
755759
756-
The URL could be a local file (e.g. `_media/foo.js`) or a remote URL `https://...`.
760+
If you want to embed as a **code block**, you can use the automatic formatting. But markdown and HTML files need to be marked as a code using `type` parameter if you want them as code rather than HTML.
757761
758-
The remote file could be anywhere:
762+
```
763+
":include :type=code"
764+
```
759765
760-
- On a server
761-
- e.g. `assets/js/main.js`
762-
- Repo reference
763-
- Use the **raw** URL so you only reference plain text.
764-
- Protocol of `//` is recommended, since `https://` is needed for a remote and `http://` for localhost, to avoid a CORS error.
765-
- e.g. `https://raw.githubusercontent.com/MichaelCurrin/docsify-js-tutorial/master/nested-example/_sidebar.md`
766-
- A gist reference
767-
- See instructions in this [guide](https://gist.github.com/MichaelCurrin/c2bece08f27c4277001f123898d16a7c).
766+
The path could be:
768767
769-
If you want to embed a code block, you can use the automatic formatting. But markdown and HTML files need to be marked as a code using `type` parameter if you want them as code rather than HTML.
768+
- On the static server.
769+
e.g. `foo/hello.md`
770770
771-
```
772-
':include :type=code'
773-
```
771+
```markdown
772+
[hello.js](/path/to/hello.md ":include")
773+
```
774+
- URL for a file on a public GitHub repo.
775+
- e.g.
776+
```markdown
777+
[hello.md](//raw.githubusercontent.com/UserName/repo-name/main/hello.md ":include")
774778
775-
See the _Docsify_ [Embed](https://docsify.js.org/#/embed-files) help for forcing types and using fragments.
779+
[\_sidebar.md](//raw.githubusercontent.com/MichaelCurrin/docsify-js-tutorial/master/nested-example/_sidebar.md ":include :type=code")
780+
```
781+
- Make sure to use the **raw** URL so you only reference plain text andbnot the entire GitHub UI HTML.
782+
- A protocol of `//` is recommended, since `https://` is needed for a remote and `http://` for localhost, to avoid a CORS error.
783+
- A gist reference.
784+
- See instructions in this [guide](https://gist.github.com/MichaelCurrin/c2bece08f27c4277001f123898d16a7c).
785+
786+
See the _Docsify_ [Embed Files](https://docsify.js.org/#/embed-files) help for forcing types and using fragments.
776787
777788
778789
#### Embed examples
@@ -791,6 +802,7 @@ Result:
791802
792803
[example.js](_media/example.js ':include' )
793804
805+
If you have a site on GitHub Pages subpath, make sure to avoid leading forward slash.
794806
795807
##### Markdown as code snippet
796808
@@ -806,24 +818,23 @@ Result:
806818
807819
[\_sidebar.md](_coverpage.md ':include :type=code')
808820
809-
810821
##### Markdown as rendered HTML
811822
812-
Render target markdown file as HTML. Leave out the `type` parameter.
823+
Render target Markdown file as HTML. Leave out the `type` parameter.
813824
814825
Code:
815826
816827
```markdown
817-
[example.md](https://docsify.js.org/_media/example.md ':include')
828+
[example.md](https://docsify.js.org/_media/example.md ":include")
818829
```
819830
820831
Result:
821832
822-
[example.md](https://docsify.js.org/_media/example.md ':include')
833+
[example.md](https://docsify.js.org/_media/example.md ":include")
823834
824-
Raw markdown:
835+
Raw Markdown at that URL:
825836
826-
[example.md](https://docsify.js.org/_media/example.md ':include :type=code')
837+
[example.md](https://docsify.js.org/_media/example.md ":include :type=code")
827838
828839
829840
#### Warnings

0 commit comments

Comments
 (0)