Skip to content

Dev-Docs Update #326

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

Open
wants to merge 89 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
52158dc
md file
dev-docs-github-app[bot] Jan 25, 2025
ea6fd33
Update web-editor-overview.md
avb-is-me Jan 25, 2025
1109b3e
md file
dev-docs-github-app[bot] Jan 25, 2025
e1778ab
Dev-Docs Renamed docs/web-editor-overview.md to docs/editor/web-edito…
dev-docs-github-app[bot] Jan 25, 2025
7a5a77c
Delete renamed docs/web-editor-overview.md after rename to docs/edito…
dev-docs-github-app[bot] Jan 25, 2025
69aeacd
Update file
dev-docs-github-app[bot] Jan 25, 2025
57ee0b1
Update file
dev-docs-github-app[bot] Jan 25, 2025
195bef0
Update file
dev-docs-github-app[bot] Jan 25, 2025
a2d2e77
Update file
dev-docs-github-app[bot] Jan 25, 2025
1a66dec
Update file
dev-docs-github-app[bot] Jan 25, 2025
26d7a6f
Update file
dev-docs-github-app[bot] Jan 25, 2025
a1e6999
Update file
dev-docs-github-app[bot] Jan 25, 2025
fbf588a
Update file
dev-docs-github-app[bot] Jan 25, 2025
98d42fc
Update file
dev-docs-github-app[bot] Jan 25, 2025
98df5df
Update file
dev-docs-github-app[bot] Jan 25, 2025
37868c5
Update file
dev-docs-github-app[bot] Jan 25, 2025
6a44525
Update file
dev-docs-github-app[bot] Jan 25, 2025
65efe76
Update file
dev-docs-github-app[bot] Jan 25, 2025
83d65c4
Update file
dev-docs-github-app[bot] Jan 25, 2025
d859484
Dev-Docs Renamed docs/connect-existing-docs-repo-to-editor.md to docs…
dev-docs-github-app[bot] Jan 25, 2025
aab5833
Delete renamed docs/connect-existing-docs-repo-to-editor.md after ren…
dev-docs-github-app[bot] Jan 25, 2025
f882ebb
md file
dev-docs-github-app[bot] Jan 27, 2025
c587539
Dev-Docs Renamed docs/customizing-dev-docs-json-for-generating-docume…
dev-docs-github-app[bot] Jan 27, 2025
7e5d747
Delete renamed docs/customizing-dev-docs-json-for-generating-document…
dev-docs-github-app[bot] Jan 27, 2025
a22f3d0
Deletef file
dev-docs-github-app[bot] Jan 27, 2025
e8d48ad
md file
dev-docs-github-app[bot] Jan 27, 2025
f544d8f
Update file
dev-docs-github-app[bot] Jan 27, 2025
6382d11
Update file
dev-docs-github-app[bot] Jan 27, 2025
e67075e
Update file
dev-docs-github-app[bot] Jan 27, 2025
3b3178c
md file
dev-docs-github-app[bot] Jan 27, 2025
5f1e7cc
Create file
dev-docs-github-app[bot] Jan 29, 2025
d6744d3
Update file
dev-docs-github-app[bot] Jan 29, 2025
8a294a3
Update file
dev-docs-github-app[bot] Jan 29, 2025
b19cac5
Update file
dev-docs-github-app[bot] Jan 29, 2025
0d4c084
Update file
dev-docs-github-app[bot] Jan 29, 2025
7a9fc16
Update file
dev-docs-github-app[bot] Jan 29, 2025
aa51742
Update file
dev-docs-github-app[bot] Jan 29, 2025
608ca0b
Update file
dev-docs-github-app[bot] Jan 29, 2025
e718aa1
Update file
dev-docs-github-app[bot] Jan 29, 2025
52652c5
Update file
dev-docs-github-app[bot] Jan 29, 2025
f891fe4
Update file
dev-docs-github-app[bot] Jan 29, 2025
b3408f3
Update file
dev-docs-github-app[bot] Jan 29, 2025
c287de3
Update file
dev-docs-github-app[bot] Jan 29, 2025
cd528bf
Update file
dev-docs-github-app[bot] Jan 29, 2025
4677cc1
Update file
dev-docs-github-app[bot] Jan 29, 2025
dc2589a
Update file
dev-docs-github-app[bot] Jan 29, 2025
ba02f6f
Update file
dev-docs-github-app[bot] Jan 29, 2025
794750a
Update file
dev-docs-github-app[bot] Jan 29, 2025
5dd822a
Update file
dev-docs-github-app[bot] Jan 29, 2025
d6c4406
Update file
dev-docs-github-app[bot] Jan 29, 2025
aba862e
Update file
dev-docs-github-app[bot] Jan 29, 2025
22eae42
Update file
dev-docs-github-app[bot] Jan 29, 2025
285fa5c
Update file
dev-docs-github-app[bot] Jan 29, 2025
798d1e5
Update file
dev-docs-github-app[bot] Jan 29, 2025
5bca806
md file
dev-docs-github-app[bot] Jan 30, 2025
83e0fb1
md file
dev-docs-github-app[bot] Jan 31, 2025
9d30e98
md file
dev-docs-github-app[bot] Jan 31, 2025
dc42961
md file
dev-docs-github-app[bot] Jan 31, 2025
e0e8dcb
Create file
dev-docs-github-app[bot] Feb 1, 2025
b1ff687
Update file
dev-docs-github-app[bot] Feb 1, 2025
42962db
Update file
dev-docs-github-app[bot] Feb 1, 2025
a2fdfe7
Update file
dev-docs-github-app[bot] Feb 1, 2025
10a1759
Update file
dev-docs-github-app[bot] Feb 1, 2025
3c51a3c
Update file
dev-docs-github-app[bot] Feb 1, 2025
758b770
Update file
dev-docs-github-app[bot] Feb 1, 2025
78582c3
Update file
dev-docs-github-app[bot] Feb 1, 2025
d78473a
Update file
dev-docs-github-app[bot] Feb 1, 2025
b3d1837
Update file
dev-docs-github-app[bot] Feb 1, 2025
958052c
Update file
dev-docs-github-app[bot] Feb 1, 2025
a99c541
Update file
dev-docs-github-app[bot] Feb 1, 2025
68ddda3
Update file
dev-docs-github-app[bot] Feb 1, 2025
4371ed3
Update file
dev-docs-github-app[bot] Feb 1, 2025
ee1b231
Update file
dev-docs-github-app[bot] Feb 1, 2025
90bf550
Update file
dev-docs-github-app[bot] Feb 3, 2025
ac3cdc7
Create file
dev-docs-github-app[bot] Feb 3, 2025
1c1fc3a
Update file
dev-docs-github-app[bot] Feb 3, 2025
fa8447a
Create file
dev-docs-github-app[bot] Feb 3, 2025
cc41d94
Create file
dev-docs-github-app[bot] Feb 3, 2025
11c2aa9
Create file
dev-docs-github-app[bot] Feb 3, 2025
ee317e8
md file
dev-docs-github-app[bot] Feb 4, 2025
30c7f96
Update file
dev-docs-github-app[bot] Feb 4, 2025
7e1d00e
Update file
dev-docs-github-app[bot] Feb 4, 2025
980b851
Update file
dev-docs-github-app[bot] Feb 4, 2025
01da820
Update file
dev-docs-github-app[bot] Feb 4, 2025
e7e2d2c
Create file
dev-docs-github-app[bot] Feb 4, 2025
de3d2c8
Create file
dev-docs-github-app[bot] Feb 4, 2025
bf04744
Create file
dev-docs-github-app[bot] Feb 4, 2025
6b55e2f
md file
dev-docs-github-app[bot] Feb 4, 2025
b5e95f5
md file
dev-docs-github-app[bot] Feb 4, 2025
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
31 changes: 31 additions & 0 deletions changelog/1.0.02.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## 1.0.02

## Features:

### Webapp/GitHub App

* For users doc usecase there is now a pull request comments flow that kicks off a ui to generate custom docs

### GitHub App:

* New docs on auto pilot workflow that listens for changes on code and creates relevant user-facing documentation

### Web App:

* In the editor we now support streaming interfaces on simple ai tasks

## Bug fixes:

## Web app

* In the web editor drafts with new tag had issues being deleted, we now fixed that

## Security enhancements/fixes:

## Backend

* Updated latest npm packages, specifically fastify as recommend by npm audit to deal with fastify multipart

### Open source User-facing Starter template

* Removed a test GitHub client id for a new test feature in the open source docusaurus template.  Important to note client ids are typically public and usually apparent in the client side code, versus client secrets, but decided to remove and delete the client id for extra measure
15 changes: 15 additions & 0 deletions changelog/1.0.03.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## 1.0.03

## Features

## Vs Code Extension

* Switched from Webpack to Vite for the vue webview, for faster loading and rendering and better coexistence with other npm packages

## Security enhancements/fixes:

## Vs Code Extension

* Updated latest npm packages for both the extension and vue web app including mermaid

* Updated security logic for the nonce in the webview
65 changes: 65 additions & 0 deletions docs/add-shatter-effect-to-sprite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@


# Shatter Effect

The `addShatterEffect` function allows you to create a dynamic shatter animation for your sprite. This effect simulates breaking or shattering the sprite into multiple pieces, which can be useful for destruction animations, transitions, or special effects in games.

## Usage

```javascript
const result = await sprite.addShatterEffect(description, shatterOptions, options);
```

### Parameters

1. `description` (string): A text description of the sprite you want to generate and apply the shatter effect to.
2. `shatterOptions` (object, optional): Customization options for the shatter effect.
3. `options` (object, optional): General options for sprite generation.

### Shatter Options

The `shatterOptions` object can include the following properties:

- `pieces` (number, default: 12): The number of pieces the sprite will shatter into.
- `spread` (number, default: 100): How far the shattered pieces will spread from the original position.
- `frames` (number, default: 15): The number of animation frames to generate for the shatter effect.
- `pattern` (string, default: 'radial'): The pattern for breaking the sprite. Options are 'radial' or 'grid'.

### Return Value

The function returns an object with the following properties:

- `original` (string): Base64-encoded string of the original sprite image.
- `shatterFrames` (array): An array of Base64-encoded strings representing each frame of the shatter animation.
- `settings` (object): The settings used to generate the effect, including pieces, spread, frames, and pattern.

## Example

```javascript
const shatterResult = await sprite.addShatterEffect('red crystal', {
pieces: 20,
spread: 150,
frames: 20,
pattern: 'grid'
});

console.log(shatterResult.original); // Base64 string of the original sprite
console.log(shatterResult.shatterFrames.length); // Number of animation frames
console.log(shatterResult.settings); // Applied shatter effect settings
```

## Tips for Using Shatter Effect

1. Adjust the `pieces` value to control the granularity of the shatter effect. More pieces create a more detailed break but may increase processing time.

2. Use a higher `spread` value for a more explosive effect, or a lower value for a subtle crumble.

3. Increase the `frames` count for a smoother animation, especially when using a large `spread` value.

4. Experiment with both 'radial' and 'grid' patterns to see which works best for your specific sprite and desired effect.

5. For best results, use sprites with clear, distinct shapes or objects that make sense to shatter (e.g., crystals, rocks, or solid objects).

6. Consider using the shatter effect in combination with other effects like particle systems or sound effects to enhance the overall impact of the animation in your game or application.


66 changes: 66 additions & 0 deletions docs/chat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# chat Documentation

## Brief Description
The `chat` method facilitates communication with an AI model, allowing for multi-turn conversations with support for images.

## Usage
To use the `chat` method, first import and initialize the Ollama class, then call the `chat` method with your request parameters.

```javascript
import { Ollama } from 'ollama'

const ollama = new Ollama()
const response = await ollama.chat(chatRequest)
```

## Parameters
- `request` (ChatRequest): An object containing the following properties:
- `model` (string, required): The name of the model to use for the chat.
- `messages` (Message[], optional): An array of message objects representing the conversation history.
- `stream` (boolean, optional): If true, the response will be streamed.
- `format` (string | object, optional): The desired format for the response.
- `keep_alive` (string | number, optional): Duration to keep the model loaded in memory.
- `tools` (Tool[], optional): An array of tool objects that can be used by the model.
- `options` (Partial<Options>, optional): Additional options for the chat request.

## Return Value
- If `stream` is false: Promise<ChatResponse>
- If `stream` is true: Promise<AbortableAsyncIterator<ChatResponse>>

The ChatResponse object includes properties such as the model name, creation timestamp, the generated message, and various performance metrics.

## Examples

1. Basic chat request:

```javascript
const response = await ollama.chat({
model: 'llama2',
messages: [{ role: 'user', content: 'Hello, how are you?' }]
})
console.log(response.message.content)
```

2. Streaming chat with image:

```javascript
const imageData = await fetch('https://example.com/image.jpg').then(res => res.arrayBuffer())
const stream = await ollama.chat({
model: 'llava',
messages: [
{ role: 'user', content: 'What's in this image?', images: [new Uint8Array(imageData)] }
],
stream: true
})

for await (const chunk of stream) {
process.stdout.write(chunk.message.content)
}
```

## Notes or Considerations
- The `chat` method supports multi-modal interactions, allowing you to include images in the conversation.
- When using images, they can be provided as either Uint8Arrays or base64 encoded strings. The method will handle the encoding internally.
- Streaming responses can be useful for real-time applications or when dealing with long responses.
- Be mindful of the model's context length limitations when sending large conversation histories.
- The method automatically handles base64 encoding of images, making it easier to work with various image formats.
146 changes: 146 additions & 0 deletions docs/configuring-dev-docs-json-for-generating-documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Advanced configuring dev-docs.json for Generating Documentation

The `dev-docs.json` file offers various configuration options to customize how Dev-Docs generates documentation for your code files. This guide focuses on the "ai" section of the configuration, which provides powerful features for tailoring the documentation process.

## AI Section Configuration

The "ai" section in `dev-docs.json` allows you to set up specific prompts and filters for different files or directories in your project. Here's an overview of the key configuration options:

### 1. File-Specific Prompts

You can define custom prompts for individual files using the following structure:

```json
"ai": {
"variablesAndFunctions": {
"path/to/your/file.js": {
"prompts": [
{
"title": "Function Purpose",
"question": "What is the main purpose of this function?",
"documentation": "Explain the function's primary role in the codebase."
},
{
"title": "Input Parameters",
"question": "What are the input parameters for this function?",
"documentation": ""
}
]
}
}
}
```

### 2. Directory-Specific Prompts

To apply prompts to all files within a specific directory:

```json
"ai": {
"variablesAndFunctions": {
"src/components": {
"prompts": [
{
"title": "Component Overview",
"question": "Provide a brief overview of this component.",
"documentation": ""
}
]
}
}
}
```

### 3. Global Filters

You can set global filters to control which symbols are documented:

```json
"ai": {
"internalTypeFilters": ["class", "method", "function"],
"codeFilters": ["async function", "export default"],
"nameFilters": ["handleSubmit", "render"]
}
```

### 4. Import Handling

Configure how imports are handled in documentation:

```json
"ai": {
"importFolders": ["src/utils", "src/helpers"],
"importFiles": ["src/constants.js", "src/types.ts"],
"importTypeFilters": ["class", "function"],
"importCodeFilters": ["export const"],
"importNameFilters": ["util", "helper"]
}
```

### 5. Documentation Output

Customize the output of generated documentation:

```json
"ai": {
"docPath": "docs/api-reference",
"docSubFolder": "components",
"populateDoc": "docs/template.md",
"branch": "documentation-updates"
}
```

### 6. Context Prompts

Add custom context prompts for more detailed documentation:

```json
"ai": {
"contextPrompt": "dev-docs/context-prompt-template.md",
"folderContextPrompt": "dev-docs/folder-context-template.md"
}
```

### 7. Code Summary

Customize the code summary generation:

```json
"ai": {
"codeSummaryPrompt": "Provide 3 bullet points summarizing the code's functionality",
"defaultLength": "3-5 Sentences"
}
```

### 8. File Mappings

Define custom mappings for documentation organization:

```json
"ai": {
"mappings": [
{
"files": ["src/main.ts"],
"cloudDir": "Getting Started"
},
{
"folder": ["src/components"],
"cloudDir": "Components"
}
]
}
```

## Best Practices

1. Start with global filters and gradually add file-specific or directory-specific prompts as needed.

2. Use context prompts to provide additional information about your project's structure or conventions.

3. Regularly review and update your `dev-docs.json` configuration as your project evolves.

4. Utilize the `mappings` feature to organize your documentation in a logical structure.

5. Leverage import handling to ensure comprehensive documentation of dependencies and utilities.

By carefully configuring these options in your `dev-docs.json` file, you can create highly tailored and comprehensive documentation for your codebase, enhancing its maintainability and accessibility for developers.
57 changes: 57 additions & 0 deletions docs/core-features-and-use-cases-for-developer-roles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@


# Core Features and Use Cases for Developer Roles

## Documentation Generation
- AI-powered content creation from existing codebase and docs
- Automatic internal documentation generation on code commits
- User-facing documentation creation from codebase

## Editor Capabilities
- Rich text and raw Markdown editing
- Image and table insertion
- Frontmatter editing
- Draft management (create, rename, delete, modify)

## Integration and Workflow
- GitHub App for automated documentation workflows
- Chrome Extension for capturing UI workflows
- Repository connection to AI editor

## Collaboration and Review
- Merge drafts to different branches
- Audit documentation for inconsistencies and gaps

## Use Cases by Role

### Developer
- Generate code documentation automatically
- Create and edit technical documentation
- Integrate documentation into development workflow

### Technical Writer
- Leverage AI to draft initial content
- Collaborate with developers using GitHub integration
- Maintain consistency across documentation

### Project Manager
- Ensure up-to-date project documentation
- Monitor documentation coverage and quality through audits
- Streamline onboarding with comprehensive docs

### DevOps Engineer
- Set up automated documentation generation pipelines
- Manage documentation as code alongside application code
- Implement version control for documentation

### UX Designer
- Document UI workflows using the Chrome Extension
- Collaborate on user guides and interface documentation
- Ensure consistency between design and documentation

### API Developer
- Generate API documentation from codebase
- Maintain changelogs automatically
- Create interactive API guides for external users


Loading