@iannacus/docs
v0.1.7
Published
Docsnnacus is a docs template. The idea is mantain 0 configuration adn get focus on docs.
Readme
Docsnnacus
Docsnnacus is a docs template. The idea is mantain 0 configuration adn get focus on docs.
Setup
First create a basic "minimal starter" astro template
npm create astro@latest my-project -- --template minimalEnter into project directory
cd my-projectInstall docsnnacus
npm i @iannacus/docsNow open a astro.config.mjs and add Docsnnacus itegration
import { defineConfig } from 'astro/config';
import docsnnacus from "@iannacus/docs"
export default defineConfig({
integrations: [
docsnnacus()
]
});Read collections
Into a src directory create
- A directory named "content"
- A file named content.config.ts
Into a content.config.ts write the following code
import { defineCollection } from "astro:content";
import { glob } from "astro/loaders";
const docs = defineCollection({
loader: glob({
pattern: "**/*.md",
base: "./src/content/",
}),
});
export const collections = { docs };Create documentation
Now you just need to add md files into content directory.
These files need the follow structure:
title: Page title description: A short description for page displayName: Overview
md content
Extra components
While Markdown offers a diverse range of styles, Docssnacus provides extra features to enhance your documentation process.
You should use mdx files for this components
Code block
Use this component to highlight code sintaxis on your documentation.
Usage
import { Code } from '@iannacus/docs/extra-components';
<Code lan="js" code="console.log('using iannacus code component')" /> Alerts
Use this component for advice something like, tips, alerts, info or caution into your explanation.
import { Alert } from '@iannacus/docs/extra-components';
<Alert type="tip">
Alert content
</Alert>type can be "tip" | "info" | "warning" | "error" | "alt"
You can use a title prop for override default alert title
TODO
- search bar
