Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto generate documentation #13

Merged
merged 8 commits into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ dist
.DS_Store
.fleet
.idea
*.story.md
7 changes: 7 additions & 0 deletions components/docgen.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require('path');

module.exports = {
componentsRoot: 'src',
outDir: 'src',
getDestFile: (file, config) => path.join(config.outDir, file).replace(/\.vue$/, '.story.md'),
};
3 changes: 3 additions & 0 deletions components/histoire.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ import { defineConfig } from 'histoire';
export default defineConfig({
plugins: [HstVue()],
setupFile: './histoire.setup.ts',
defaultStoryProps: {
autoPropsDisabled: true,
},
});
2 changes: 2 additions & 0 deletions components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"story:dev": "histoire dev",
"story:build": "histoire build",
"story:preview": "histoire preview",
"docs": " vue-docgen '**/*[!story].vue' -c docgen.config.cjs",
"typecheck": "vue-tsc --noEmit"
},
"devDependencies": {
Expand All @@ -43,6 +44,7 @@
"vite": "4.3.7",
"vite-plugin-dts": "2.3.0",
"vitest": "0.31.1",
"vue-docgen-cli": "4.67.0",
"vue-tsc": "1.8.0"
},
"dependencies": {
Expand Down
15 changes: 0 additions & 15 deletions components/src/base-icon/base-icon.story.md

This file was deleted.

2 changes: 1 addition & 1 deletion components/src/base-icon/base-icon.story.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const state = reactive({
</script>

<template>
<Story title="Base / Icon" auto-props-disabled>
<Story title="Base / Icon">
<template #controls>
<HstText v-model="state.name" title="Name" />
<HstSlider v-model="state.weight" :step="100" :min="100" :max="700" title="Weight" />
Expand Down
14 changes: 14 additions & 0 deletions components/src/base-icon/base-icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@
import { computed, unref } from 'vue';

export interface BaseIconProps {
/**
* Name of the Material Symbol to use.
paescuj marked this conversation as resolved.
Show resolved Hide resolved
* @see https://fonts.google.com/icons for all available icons
*/
name: string;

/**
* Size of the icon. Controls both font size and optical size
* @values small, medium, large
*/
size?: 'small' | 'medium' | 'large';

/**
* Weight of the icon. Similar to font-weight
* @values 100, 200, 300, 400, 500, 600, 700
*/
weight?: number;
}

Expand Down
Loading