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
In Markdown, use the `::: code-tree` container to display the code blocks of several files together with a file tree, so that the structure of a small template is clear at a glance.
- Add a title after the `::: code-tree` container to declare the title of the code tree.
44
+
- Add a `height` attribute after the `::: code-tree` container to declare the height of the code tree. A bare number is treated as pixels.
45
+
- Add an `entry` attribute after the `::: code-tree` container to declare the file opened by default.
46
+
- Add `:active` after a code block to declare the file opened by default, which has a higher priority than `entry`.
47
+
- When neither `entry` nor `:active` is declared, the first code block is opened by default.
48
+
49
+
Code blocks without a `title` attribute are not included in the file tree, and they are not displayed.
50
+
51
+
Files and folders are displayed with their icons. The icons come from <https://icon-sets.iconify.design/> and are rendered by `<VPIcon />` provided by `@vuepress/plugin-icon`. When that plugin is not enabled, a generic file or folder icon is used instead.
52
+
53
+
## Related
54
+
55
+
Only the container syntax is supported. The `@[code-tree](dir_path)` syntax of other themes is not supported.
56
+
57
+
::: warning
58
+
59
+
The code tree relies on the code block title feature of the highlighter, which is enabled by default in `@vuepress/plugin-shiki` and `@vuepress/plugin-prismjs`.
60
+
61
+
Do not disable `codeBlockTitle`, or replace it with a custom render function, otherwise the file tree is rendered without any code block.
0 commit comments