Skip to content

Commit

Permalink
minor docs fixups (consistency) (#1480)
Browse files Browse the repository at this point in the history
  • Loading branch information
sawka authored Dec 11, 2024
1 parent 7c76a43 commit 4fccd71
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 28 deletions.
81 changes: 81 additions & 0 deletions cmd/packfiles/main-packfiles.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package main

import (
"bufio"
"fmt"
"io"
"os"
"path/filepath"
)

func main() {
// Ensure at least one argument is provided
if len(os.Args) < 2 {
fmt.Fprintln(os.Stderr, "Usage: go run main.go <file1> <file2> ...")
os.Exit(1)
}

// Get the current working directory
cwd, err := os.Getwd()
if err != nil {
fmt.Fprintf(os.Stderr, "Error getting current working directory: %v\n", err)
os.Exit(1)
}

for _, filePath := range os.Args[1:] {
if filePath == "" || filePath == "--" {
continue
}
// Convert file path to an absolute path
absPath, err := filepath.Abs(filePath)
if err != nil {
fmt.Fprintf(os.Stderr, "Error resolving absolute path for %q: %v\n", filePath, err)
continue
}

finfo, err := os.Stat(absPath)
if err != nil {
fmt.Fprintf(os.Stderr, "Error getting file info for %q: %v\n", absPath, err)
continue
}
if finfo.IsDir() {
fmt.Fprintf(os.Stderr, "%q is a directory, skipping\n", absPath)
continue
}

// Get the path relative to the current working directory
relPath, err := filepath.Rel(cwd, absPath)
if err != nil {
fmt.Fprintf(os.Stderr, "Error resolving relative path for %q: %v\n", absPath, err)
continue
}

// Open the file
file, err := os.Open(absPath)
if err != nil {
fmt.Fprintf(os.Stderr, "Error opening file %q: %v\n", absPath, err)
continue
}
defer file.Close()

// Print start delimiter with quoted relative path
fmt.Printf("@@@start file %q\n", relPath)

// Copy file contents to stdout
reader := bufio.NewReader(file)
for {
line, err := reader.ReadString('\n')
fmt.Print(line) // Print each line
if err == io.EOF {
break
}
if err != nil {
fmt.Fprintf(os.Stderr, "Error reading file %q: %v\n", relPath, err)
break
}
}

// Print end delimiter with quoted relative path
fmt.Printf("@@@end file %q\n", relPath)
}
}
5 changes: 3 additions & 2 deletions docs/docs/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ wsh editconfig
| ai:preset | string | the default AI preset to use |
| ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) |
| ai:apitoken | string | your AI api token |
| ai:apitype | string | defaults to "open_ai", but can also set to "azure" (forspecial Azure AI handling) or "anthropic" |
| ai:apitype | string | defaults to "open_ai", but can also set to "azure" (forspecial Azure AI handling), "anthropic", or "perplexity" |
| ai:name | string | string to display in the Wave AI block header |
| ai:model | string | model name to pass to API |
| ai:apiversion | string | for Azure AI only (when apitype is "azure", this will default to "2023-05-15") |
Expand All @@ -44,7 +44,7 @@ wsh editconfig
| term:copyonselect | bool | set to false to disable terminal copy-on-select |
| term:scrollback | int | size of terminal scrollback buffer, max is 10000 |
| editor:minimapenabled | bool | set to false to disable editor minimap |
| editor:stickscrollenabled | bool | |
| editor:stickyscrollenabled | bool | enables monaco editor's stickyScroll feature (pinning headers of current context, e.g. class names, method names, etc.), defaults to false |
| editor:wordwrap | bool | set to true to enable word wrapping in the editor (defaults to false) |
| web:openlinksinternally | bool | set to false to open web links in external browser |
| web:defaulturl | string | default web page to open in the web widget when no url is provided (homepage) |
Expand All @@ -66,6 +66,7 @@ wsh editconfig
| window:magnifiedblocksize | float64 | change the size of a magnified block as a percentage of the dimensions of its parent layout (must be between 0 and 1, defaults to 0.9) |
| window:magnifiedblockblurprimarypx | int | change the blur in CSS pixels that is applied directly behind a magnified block (see [backdrop-filter](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter) for more info on how this gets applied) |
| window:magnifiedblockblursecondarypx | int | change the blur in CSS pixels that is applied to the visible portions of non-magnified blocks when a block is magnified (see [backdrop-filter](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter) for more info on how this gets applied) |
| window:maxtabcachesize | int | number of tabs to cache. when tabs are cached, switching between them is very fast. (defaults to 10) |
| window:showmenubar | bool | set to use the OS-native menu bar (Windows and Linux only, requires app restart) |
| window:nativetitlebar | bool | set to use the OS-native title bar, rather than the overlay (Windows and Linux only, requires app restart) |
| window:disablehardwareacceleration | bool | set to disable Chromium hardware acceleration to resolve graphical bugs (requires app restart) |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/customwidgets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ This `WidgetConfigType` is shared between all types of widgets. That is to say,

**Font Awesome Icons**

[Font Awesome](https://fontawesome.com/search) provides a ton of useful icons that you can use as a widget icon in your app. At it's simplest, you can just provide the icon name and it will be used. For example, the string `"house"`, will provide an icon containing a house. We also allow you to apply a few different styles to your icon by modifying the name as follows:
[Font Awesome](https://fontawesome.com/search) provides a ton of useful icons that you can use as a widget icon in your app. At its simplest, you can just provide the icon name and it will be used. For example, the string `"house"`, will provide an icon containing a house. We also allow you to apply a few different styles to your icon by modifying the name as follows:

| format | description |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
8 changes: 0 additions & 8 deletions docs/docs/features/_category_.json

This file was deleted.

3 changes: 0 additions & 3 deletions docs/docs/features/ai.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions docs/docs/features/browser.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions docs/docs/features/charts.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions docs/docs/features/preview.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions docs/docs/features/remotes.mdx

This file was deleted.

4 changes: 2 additions & 2 deletions frontend/app/tab/tabbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from "@/app/element/button";
import { modalsModel } from "@/app/store/modalmodel";
import { WindowDrag } from "@/element/windowdrag";
import { deleteLayoutModelForTab } from "@/layout/index";
import { atoms, createTab, getApi, globalStore, PLATFORM, setActiveTab } from "@/store/global";
import { atoms, createTab, getApi, globalStore, isDev, PLATFORM, setActiveTab } from "@/store/global";
import { fireAndForget } from "@/util/util";
import { useAtomValue } from "jotai";
import { OverlayScrollbars } from "overlayscrollbars";
Expand Down Expand Up @@ -637,7 +637,7 @@ const TabBar = memo(({ workspace }: TabBarProps) => {
}

const tabsWrapperWidth = tabIds.length * tabWidthRef.current;
const devLabel = false ? (
const devLabel = isDev() ? (
<div ref={devLabelRef} className="dev-label">
<i className="fa fa-brands fa-dev fa-fw" />
</div>
Expand Down

0 comments on commit 4fccd71

Please sign in to comment.