From 7ebd32ee99bb20096439979f40572ef21a9ff99b Mon Sep 17 00:00:00 2001 From: Jacob Date: Tue, 16 Dec 2025 22:20:15 +0100 Subject: [PATCH 1/4] Improve docs embed files code fragment --- docs/embed-files.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/embed-files.md b/docs/embed-files.md index aba1bfaaf..f4e74565f 100644 --- a/docs/embed-files.md +++ b/docs/embed-files.md @@ -65,9 +65,11 @@ Sometimes you don't want to embed a whole file. Maybe because you need just a fe ``` In your code file you need to surround the fragment between `/// [demo]` lines (before and after the fragment). -Alternatively you can use `### [demo]`. By default, only identifiers are omitted. To omit the entire line containing the identifier in the fragment output, you can add the `:omitFragmentLine` option. +Alternatively you can use `### [demo]`. By default, only identifiers are omitted. To omit the entire line containing the identifier in the fragment output, add the `:omitFragmentLine` option. This is useful if your code fragment is e.g. HTML and you want to hide the Docsify fragment identifier from showing in your HTML source. `` in your source file and `:omitFragmentLine` will make the `-->` not show up in your Docsify code fragment section. -Example: +Example ([\_media/example.js](/_media/example.js ':ignore')): + +`[filename](_media/example.js ':include :type=code :fragment=demo')` [filename](_media/example.js ':include :type=code :fragment=demo') From 45be7c9dc9755dce1737e4f2043f97b9a6b30feb Mon Sep 17 00:00:00 2001 From: Jacob Date: Wed, 17 Dec 2025 21:50:44 +0100 Subject: [PATCH 2/4] Remove leading slash docs link --- docs/embed-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/embed-files.md b/docs/embed-files.md index f4e74565f..82b98d27d 100644 --- a/docs/embed-files.md +++ b/docs/embed-files.md @@ -67,7 +67,7 @@ Sometimes you don't want to embed a whole file. Maybe because you need just a fe In your code file you need to surround the fragment between `/// [demo]` lines (before and after the fragment). Alternatively you can use `### [demo]`. By default, only identifiers are omitted. To omit the entire line containing the identifier in the fragment output, add the `:omitFragmentLine` option. This is useful if your code fragment is e.g. HTML and you want to hide the Docsify fragment identifier from showing in your HTML source. `` in your source file and `:omitFragmentLine` will make the `-->` not show up in your Docsify code fragment section. -Example ([\_media/example.js](/_media/example.js ':ignore')): +Example ([\_media/example.js](_media/example.js ':ignore')): `[filename](_media/example.js ':include :type=code :fragment=demo')` From 8d8cfcf5f115216d3cc5e5ce8130d0c0439f24cb Mon Sep 17 00:00:00 2001 From: Jacob Date: Sat, 20 Dec 2025 11:22:57 +0100 Subject: [PATCH 3/4] Add code embed example files embedded in docs --- docs/embed-files.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/embed-files.md b/docs/embed-files.md index 82b98d27d..ad0e63f30 100644 --- a/docs/embed-files.md +++ b/docs/embed-files.md @@ -67,9 +67,19 @@ Sometimes you don't want to embed a whole file. Maybe because you need just a fe In your code file you need to surround the fragment between `/// [demo]` lines (before and after the fragment). Alternatively you can use `### [demo]`. By default, only identifiers are omitted. To omit the entire line containing the identifier in the fragment output, add the `:omitFragmentLine` option. This is useful if your code fragment is e.g. HTML and you want to hide the Docsify fragment identifier from showing in your HTML source. `` in your source file and `:omitFragmentLine` will make the `-->` not show up in your Docsify code fragment section. -Example ([\_media/example.js](_media/example.js ':ignore')): +Example: The file [\_media/example.js](_media/example.js ':ignore') contains `/// [demo]` identifiers: -`[filename](_media/example.js ':include :type=code :fragment=demo')` +```markdown +[filename](_media/example.js ':include :type=code') +``` + +[filename](_media/example.js ':include :type=code') + +Adding the `:fragment=demo` results in the following: + +```markdown +[filename](_media/example.js ':include :type=code :fragment=demo') +``` [filename](_media/example.js ':include :type=code :fragment=demo') From 984e28dcaaaa36b534320e531ac80183fb3661f0 Mon Sep 17 00:00:00 2001 From: Jacob Date: Sun, 21 Dec 2025 12:41:14 +0100 Subject: [PATCH 4/4] Improve docs wording --- docs/embed-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/embed-files.md b/docs/embed-files.md index ad0e63f30..e9241c478 100644 --- a/docs/embed-files.md +++ b/docs/embed-files.md @@ -67,7 +67,7 @@ Sometimes you don't want to embed a whole file. Maybe because you need just a fe In your code file you need to surround the fragment between `/// [demo]` lines (before and after the fragment). Alternatively you can use `### [demo]`. By default, only identifiers are omitted. To omit the entire line containing the identifier in the fragment output, add the `:omitFragmentLine` option. This is useful if your code fragment is e.g. HTML and you want to hide the Docsify fragment identifier from showing in your HTML source. `` in your source file and `:omitFragmentLine` will make the `-->` not show up in your Docsify code fragment section. -Example: The file [\_media/example.js](_media/example.js ':ignore') contains `/// [demo]` identifiers: +Example: In the source file \_media/example.js, `/// [demo]` identifiers have been included: ```markdown [filename](_media/example.js ':include :type=code')