sdocs 0.0.30 → 0.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.0.31] - 2026-07-03
11
+
12
+ ### Added
13
+
14
+ - **`icon` config option** — the sidebar header icon is now configurable:
15
+ `'sdocs'` shows the built-in mascot (the default), any other string is
16
+ used as an image URL, and `false` hides it.
17
+
10
18
  ## [0.0.30] - 2026-07-03
11
19
 
12
20
  ### Fixed
@@ -15,6 +15,7 @@
15
15
  interface Props {
16
16
  docs: DocEntry[];
17
17
  logo?: string;
18
+ icon?: string | false;
18
19
  cssNames?: string[];
19
20
  sidebarConfig?: {
20
21
  order?: Record<string, string[]>;
@@ -22,7 +23,7 @@
22
23
  };
23
24
  }
24
25
 
25
- let { docs, logo = 'sdocs', cssNames = [], sidebarConfig }: Props = $props();
26
+ let { docs, logo = 'sdocs', icon = 'sdocs', cssNames = [], sidebarConfig }: Props = $props();
26
27
 
27
28
  let sidebarHidden = $state(false);
28
29
  let activeStylesheet = $state<string | undefined>(undefined);
@@ -62,6 +63,7 @@
62
63
  {tree}
63
64
  {currentPath}
64
65
  {logo}
66
+ {icon}
65
67
  {cssNames}
66
68
  {activeStylesheet}
67
69
  {theme}
@@ -11,6 +11,7 @@
11
11
  tree: TreeNode[];
12
12
  currentPath: string[];
13
13
  logo: string;
14
+ icon?: string | false;
14
15
  cssNames?: string[];
15
16
  activeStylesheet?: string;
16
17
  theme?: ThemeMode;
@@ -19,7 +20,7 @@
19
20
  onThemeChange?: (theme: ThemeMode) => void;
20
21
  }
21
22
 
22
- let { tree, currentPath, logo, cssNames = [], activeStylesheet, theme = 'light', onToggleFullscreen, onStylesheetChange, onThemeChange }: Props = $props();
23
+ let { tree, currentPath, logo, icon = 'sdocs', cssNames = [], activeStylesheet, theme = 'light', onToggleFullscreen, onStylesheetChange, onThemeChange }: Props = $props();
23
24
 
24
25
  const themeIcons: Record<ThemeMode, string> = { light: '\u2600', dark: '\u263D' };
25
26
  const themeLabels: Record<ThemeMode, string> = { light: 'Light', dark: 'Dark' };
@@ -185,7 +186,11 @@
185
186
  <aside class="sdocs-sidebar">
186
187
  <div class="sdocs-sidebar-header">
187
188
  <a href="#/" class="sdocs-logo">
188
- <Icon name="sdocs" --w="22px" --h="22px" --fill="#FC1D29" />
189
+ {#if icon === 'sdocs'}
190
+ <Icon name="sdocs" --w="22px" --h="22px" --fill="#FC1D29" />
191
+ {:else if icon}
192
+ <img class="sdocs-logo-img" src={icon} alt="" />
193
+ {/if}
189
194
  {logo}
190
195
  </a>
191
196
  <div class="sdocs-header-actions">
@@ -304,6 +309,11 @@
304
309
  color: var(--color-base-900);
305
310
  text-decoration: none;
306
311
  }
312
+ .sdocs-logo-img {
313
+ width: 22px;
314
+ height: 22px;
315
+ object-fit: contain;
316
+ }
307
317
  .sdocs-header-actions {
308
318
  display: flex;
309
319
  align-items: center;
@@ -21,6 +21,9 @@ export default {
21
21
  // Sidebar logo text (default: 'sdocs')
22
22
  // logo: 'sdocs',
23
23
 
24
+ // Sidebar logo icon: 'sdocs' for the mascot, an image URL, or false to hide (default: 'sdocs')
25
+ // icon: 'sdocs',
26
+
24
27
  // Sidebar configuration
25
28
  // sidebar: {
26
29
  // order: { root: ['Components', '*', 'Documentation'] },
@@ -90,6 +90,7 @@ mount(App, {
90
90
  docs,
91
91
  cssNames,
92
92
  logo: ${JSON.stringify(config.logo)},
93
+ icon: ${JSON.stringify(config.icon)},
93
94
  sidebarConfig: ${JSON.stringify(config.sidebar)},
94
95
  }
95
96
  });`;
@@ -8,6 +8,7 @@ const DEFAULTS = {
8
8
  open: false,
9
9
  css: null,
10
10
  logo: 'sdocs',
11
+ icon: 'sdocs',
11
12
  sidebar: {
12
13
  order: {},
13
14
  open: [],
@@ -77,6 +78,7 @@ export function resolveConfig(userConfig) {
77
78
  open: userConfig.open ?? DEFAULTS.open,
78
79
  css: userConfig.css ?? DEFAULTS.css,
79
80
  logo: userConfig.logo ?? DEFAULTS.logo,
81
+ icon: userConfig.icon ?? DEFAULTS.icon,
80
82
  sidebar: {
81
83
  order: userConfig.sidebar?.order ?? DEFAULTS.sidebar.order,
82
84
  open: userConfig.sidebar?.open ?? DEFAULTS.sidebar.open,
package/dist/types.d.ts CHANGED
@@ -10,6 +10,8 @@ export interface SdocsConfig {
10
10
  css?: string | Record<string, string>;
11
11
  /** Sidebar logo text. Default: 'sdocs' */
12
12
  logo?: string;
13
+ /** Sidebar logo icon: 'sdocs' for the built-in mascot, an image URL, or false to hide. Default: 'sdocs' */
14
+ icon?: string | false;
13
15
  /** Sidebar configuration */
14
16
  sidebar?: {
15
17
  /** Per-folder sort overrides. Keys are folder paths, 'root' for top level. '*' = unlisted items. */
@@ -25,6 +27,7 @@ export interface ResolvedSdocsConfig {
25
27
  open: boolean;
26
28
  css: string | Record<string, string> | null;
27
29
  logo: string;
30
+ icon: string | false;
28
31
  sidebar: {
29
32
  order: Record<string, string[]>;
30
33
  open: string[];
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "sdocs",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "A lightweight documentation tool for Svelte 5 components",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/gabilungu/sdocs.git",
10
+ "directory": "packages/sdocs"
11
+ },
7
12
  "bin": {
8
13
  "sdocs": "./bin/sdocs.js"
9
14
  },