Skip to content

Dev-Docs Update #334

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 13 commits into
base: main
Choose a base branch
from
16 changes: 10 additions & 6 deletions Create user-facing docs from your codebase.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@


# How to Use and Customize the "Populate External Docs" Command in the VS Code Extension
# How to Use and Customize the "Populate External Docs" Command in the VS Code Extension

## Step 1: Access the Command

1. Open your VS Code workspace
2. Press `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux) to open the command palette
3. Type "Populate External Docs" and select the command


## Step 2: Customizing Generation with dev-docs.json

To customize the documentation generation, modify the `dev-docs.json` file in your project root:
Expand Down Expand Up @@ -48,6 +45,13 @@ After running the command:
2. Review and edit the generated content as needed
3. Commit changes to your repository

By following these steps and customizing the `dev-docs.json`, you can efficiently generate and manage external documentation for your project using the VS Code extension.
## Step 4: Refine and Iterate

To improve the quality of generated documentation:

1. Analyze the initial output and identify areas for improvement
2. Adjust the `externalDocPrompt` in `dev-docs.json` to provide more specific guidance
3. Re-run the "Populate External Docs" command to generate updated documentation
4. Repeat this process until you achieve the desired level of detail and accuracy

By following these steps and customizing the `dev-docs.json`, you can efficiently generate, manage, and refine external documentation for your project using the VS Code extension.
38 changes: 22 additions & 16 deletions blog/Static Generated Sites are You Need.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,61 @@
---
title: Why a Static Generated Site is the Best Choice for Developer Docs and Landing Pages
title: Why Static Generated Sites are What You Need for Developer Docs and Landing Pages
authors: andrew
header_image: /img/dev-docs-assets/ClippedHeroBg.png
text_color: white
tags: [markdown, docusaurus, developerdocs]
tags: [markdown, docusaurus, developerdocs, staticsite]
---

# Why a Static Generated Site is the Best Choice for Developer Docs and Landing Pages
# Why Static Generated Sites are What You Need for Developer Docs and Landing Pages

In the fast-paced world of software development, efficient documentation is crucial. Static generated sites, particularly those using Markdown and platforms like GitHub and Docusaurus, offer an optimal solution for developer docs and landing pages. Here's why:
In the ever-evolving landscape of software development, efficient and accessible documentation is paramount. Static generated sites, particularly those utilizing Markdown and platforms like GitHub and Docusaurus, offer an unparalleled solution for developer docs and landing pages. Here's why they're exactly what you need:

## 1. Simplicity and Speed with Markdown

Static site generators like Docusaurus leverage Markdown, allowing developers to create lightning-fast documentation. Pages load instantly, enhancing user experience and reducing bounce rates.
Static site generators like Docusaurus harness the power of Markdown, enabling developers to create blazing-fast documentation. Pages load in the blink of an eye, significantly enhancing user experience and reducing bounce rates.

## 2. Cost-Effective Hosting on GitHub or Vercel

Hosting developer docs on platforms like GitHub Pages is incredibly cost-effective, often free. This is perfect for open-source projects and startups looking to minimize expenses.
Hosting developer docs on platforms like GitHub Pages or Vercel is incredibly cost-effective, often completely free. This is ideal for open-source projects and startups aiming to minimize overhead costs.

## 3. Enhanced Security for Developer Docs

Static sites, including those built with Docusaurus, are inherently more secure. With no dynamic content or databases, there are fewer vulnerabilities for potential attackers to exploit.
Static sites, including those built with Docusaurus, are inherently more secure. With no dynamic content or databases to manage, there are significantly fewer vulnerabilities for potential attackers to exploit.

## 4. Version Control with GitHub

Integrating your developer docs with GitHub allows for seamless version control. This makes collaboration easier and provides a comprehensive history of documentation changes.
Integrating your developer docs with GitHub allows for seamless version control. This not only facilitates easier collaboration but also provides a comprehensive history of documentation changes.

## 5. Focus on Content with Markdown

Markdown, the preferred format for many static site generators, allows developers to focus on writing clear, concise documentation without worrying about complex formatting.
Markdown, the preferred format for many static site generators, allows developers to concentrate on writing clear, concise documentation without getting bogged down by complex formatting issues.

## 6. SEO-Friendly Developer Docs

Static sites built with tools like Docusaurus are easily crawlable by search engines. Their fast load times and structured content contribute to better SEO rankings for your developer docs.
Static sites built with tools like Docusaurus are easily crawlable by search engines. Their rapid load times and structured content contribute to better SEO rankings for your developer docs.

## 7. Easy Maintenance with Docusaurus

Once set up, maintaining developer docs on a static site is straightforward. Docusaurus makes it easy to update content without dealing with complex CMS systems.
Once set up, maintaining developer docs on a static site is straightforward. Docusaurus simplifies the process of updating content without the need to wrestle with complex CMS systems.

## 8. Scalability for Growing Projects

Static sites can handle high traffic volumes, making them ideal for popular open-source projects hosted on GitHub with extensive developer docs.
Static sites can effortlessly handle high traffic volumes, making them perfect for popular open-source projects hosted on GitHub with extensive developer docs.

## 9. Modern Development Workflow

Static site generators like Docusaurus integrate well with modern development tools and practices, facilitating continuous integration and deployment of your developer docs.
Static site generators like Docusaurus integrate seamlessly with modern development tools and practices, facilitating continuous integration and deployment of your developer docs.

## 10. Flexibility with Markdown and JavaScript

Despite being "static," these sites can incorporate dynamic elements through JavaScript and APIs, giving your developer docs the best of both worlds.
While "static" by nature, these sites can incorporate dynamic elements through JavaScript and APIs, providing your developer docs with the best of both worlds.

In conclusion, for developer docs and landing pages, a static generated site using Markdown and tools like Docusaurus provides an excellent balance of simplicity, performance, and functionality. It's a powerful approach that can help your project's documentation stand out on platforms like GitHub.
## 11. Customization and Theming


Static site generators often offer extensive customization options. With Docusaurus, you can easily apply themes and styles to match your brand identity, ensuring your developer docs look professional and cohesive.

## 12. Community Support and Plugins

The vibrant community around static site generators like Docusaurus provides a wealth of plugins and extensions. This ecosystem allows you to extend the functionality of your developer docs with features like search, analytics, and interactive components.

In conclusion, for developer docs and landing pages, static generated sites using Markdown and tools like Docusaurus provide an optimal balance of simplicity, performance, and functionality. They're not just a trend, but a robust solution that can elevate your project's documentation, making it stand out on platforms like GitHub and beyond.
11 changes: 6 additions & 5 deletions dev-docs/context-docs-editor-modify a draft.md.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@


---
---
# High Level Context
## context
This Markdown file provides step-by-step instructions on how to modify a previously published draft in a content management system or editor interface. The document outlines three main steps:
This Markdown file provides step-by-step instructions on how to Modify a Draft that was previously published in a content management system or editor interface. The document outlines three main steps:

1. Navigating to the "Published" section under "DRAFTS" in the sidebar and selecting the draft to modify.
2. Loading the selected draft's content in the main editing area for review.
3. Making modifications to the draft, which automatically saves changes and moves the draft back to the "DRAFTS" section for further editing or review before republishing.

The instructions are accompanied by images to illustrate each step visually, making it easier for users to follow the process. This guide is likely part of a larger user manual or documentation for a content management or editing platform.


## Additional Information
- The system may include a versioning feature that allows users to view and compare different versions of the draft.
- Users should be aware that modifying a published draft might affect its visibility or status on the live site.
- It's recommended to preview changes before moving the draft back to the published state to ensure all modifications appear as intended.
75 changes: 75 additions & 0 deletions docs/chat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# chat Documentation

## Brief Description
The `chat` method enables communication with an AI model, allowing for multi-turn conversations and the inclusion of images in messages.

## Usage
To use the `chat` method, you need to create an instance of the Ollama class and then call the `chat` method with the appropriate parameters.

```javascript
import { Ollama } from 'ollama-js';

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 the model can use.
- `options` (Partial<Options>, optional): Additional options for the chat request.

## Return Value
The `chat` method returns a Promise that resolves to either:
- `ChatResponse`: An object containing the model's response and metadata.
- `AbortableAsyncIterator<ChatResponse>`: An async iterator that yields response messages if streaming is enabled.

## Examples

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

### Chat with streaming
```javascript
const stream = await ollama.chat({
model: 'llama2',
messages: [{ role: 'user', content: 'Tell me a story' }],
stream: true
});

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

### Chat with image
```javascript
const response = await ollama.chat({
model: 'llava',
messages: [
{
role: 'user',
content: 'What's in this image?',
images: ['data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEA...']
}
]
});
console.log(response.message.content);
```

## Notes or Considerations
- Images in messages can be provided as base64 encoded strings or file paths.
- The `stream` option allows for real-time responses, which is useful for long-running conversations.
- When using tools, ensure they are properly defined in the `tools` array of the request.
- The `keep_alive` option can be used to optimize performance for multiple requests to the same model.
- Error handling should be implemented to manage potential issues with the AI model or network connectivity.
64 changes: 64 additions & 0 deletions docs/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# create Documentation

## Brief Description
The `create` method creates a new model from a stream of data or a modelfile.

## Usage
To use the `create` method, you need to import the Ollama class and instantiate it. Then you can call the `create` method on the instance.

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

const ollama = new Ollama()
```

## Parameters
The `create` method accepts a `CreateRequest` object with the following properties:

- `model` (string, required): The name of the model to create.
- `path` (string, optional): The path to the modelfile.
- `modelfile` (string, optional): The content of the modelfile.
- `stream` (boolean, optional): Whether to stream the response.
- `quantize` (string, optional): The quantization level for the model.

Note: You must provide either `path` or `modelfile`, but not both.

## Return Value
The `create` method returns a Promise that resolves to either:

- A `ProgressResponse` object if `stream` is false or not specified.
- An `AbortableAsyncIterator<ProgressResponse>` if `stream` is true.

## Examples

1. Creating a model from a modelfile path:

```javascript
const response = await ollama.create({
model: 'my-new-model',
path: '/path/to/modelfile'
})
console.log(response)
```

2. Creating a model with streaming progress:

```javascript
const stream = await ollama.create({
model: 'my-streaming-model',
modelfile: 'FROM llama2\n\nSYSTEM You are a helpful assistant.',
stream: true
})

for await (const chunk of stream) {
console.log(chunk.status)
}
```

## Notes or Considerations

- If you provide a `path`, the method will read the modelfile content and parse it before sending the request.
- The method supports automatic parsing of `FROM` and `ADAPTER` commands in the modelfile, replacing them with corresponding blob hashes if the files exist.
- When using `stream: true`, you can abort the operation by calling the `abort()` method on the returned `AbortableAsyncIterator`.
- The `create` method may throw an error if neither `path` nor `modelfile` is provided.
- Be cautious when using large modelfiles, as they may consume significant resources during the creation process.
57 changes: 57 additions & 0 deletions docs/dev-docs-vscode-extension-core-features-and-use-cases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@


# Dev-Docs VS Code Extension: Core Features and Use Cases

Dev-Docs is a powerful VS Code extension designed to streamline and enhance the documentation process for developers. Here's an overview of its core features and use cases for different developer roles:

## Core Features

1. AI-Powered Documentation Generation
2. Context-Aware Documentation
3. External and Internal Documentation Management
4. Version Control Integration
5. Customizable Documentation Workflows
6. API Documentation Generation
7. Missing Documentation Detection
8. Documentation Auditing
9. Interactive Q&A with Your Codebase

## Use Cases for Different Developer Roles

### For Individual Developers

1. **Rapid Documentation Creation**: Quickly generate documentation for your code using AI-assisted tools.
2. **Code Understanding**: Use the "Ask Dev-Docs A Question" feature to understand complex parts of the codebase.
3. **Personal Knowledge Base**: Create and maintain a personal documentation repository for your projects.

### For Team Leaders and Project Managers

1. **Onboarding Acceleration**: Generate comprehensive project overviews and architecture documentation to help new team members get up to speed quickly.
2. **Documentation Standardization**: Enforce consistent documentation practices across the team using customizable templates and AI-generated content.
3. **Project Health Monitoring**: Use the documentation auditing feature to identify areas of the codebase that need better documentation.

### For Open Source Maintainers

1. **Community Documentation**: Easily create and maintain user-facing documentation for your open-source projects.
2. **Contribution Guidelines**: Generate and keep updated contribution guidelines and project structure documentation.
3. **API References**: Automatically generate and update API documentation as your project evolves.

### For Technical Writers

1. **Content Generation Assistance**: Use AI-powered features to generate initial drafts of technical documentation.
2. **Documentation Gap Analysis**: Identify missing documentation and generate suggestions for new content.
3. **Integration with Existing Workflows**: Seamlessly integrate Dev-Docs into existing documentation processes and version control systems.

### For QA Engineers

1. **Test Documentation**: Generate documentation for test cases and testing procedures directly from the codebase.
2. **Feature Documentation Review**: Use the generated documentation to cross-reference with actual implemented features.

### For DevOps Engineers

1. **Infrastructure Documentation**: Generate and maintain documentation for deployment processes and infrastructure setup.
2. **Configuration Management**: Document configuration files and environment variables with context-aware features.

By leveraging these features, Dev-Docs empowers developers across different roles to create, maintain, and improve documentation efficiently, leading to better code understanding, improved collaboration, and streamlined development processes.


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

## Brief Description
The `encodeImage` method converts image data to a base64-encoded string, supporting both Uint8Array and string inputs.

## Usage
This method is used internally by the Ollama class to prepare image data for API requests. It's not typically called directly by users.

## Parameters
- `image` (Uint8Array | string): The image data to encode. Can be a Uint8Array of raw image data or a string (potentially already base64 encoded).

## Return Value
- `Promise<string>`: A Promise that resolves to the base64-encoded image string.

## Examples

```javascript
const ollama = new Ollama();

// Example with a Uint8Array
const imageData = new Uint8Array([/* ... */]); // Raw image data
const encodedImage = await ollama.encodeImage(imageData);

// Example with a string (potentially already base64 encoded)
const base64String = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBD...";
const encodedImage = await ollama.encodeImage(base64String);
```

## Notes or Considerations
- This method is primarily used internally by other Ollama methods that handle image inputs.
- If a string is provided, the method assumes it might already be base64 encoded and returns it as-is.
- For Uint8Array inputs, the method performs the base64 encoding.
- This method is asynchronous and returns a Promise, so remember to use `await` or `.then()` when calling it.
Loading