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

docs: updating doc builder #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
50 changes: 48 additions & 2 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
# Sample workflow for building and deploying a Hugo site to Pages
name: Deploy Hugo site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
paths:
- 'docs/**' # Only trigger on changes to docs directory
- '.github/workflows/hugo.yml' # And on workflow file changes

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -16,7 +19,6 @@
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
Expand All @@ -33,21 +35,42 @@
env:
HUGO_VERSION: 0.128.0
steps:
# Add cache for Hugo modules and builds
- name: Cache Hugo resources
uses: actions/cache@v3
with:
path: |
${{ runner.temp }}/hugo_cache
./docs/resources
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}

Check warning on line 45 in .github/workflows/hugo.yaml

View workflow job for this annotation

GitHub Actions / Check Spelling

Unknown word (hugomod)
restore-keys: |
${{ runner.os }}-hugomod-

Check warning on line 47 in .github/workflows/hugo.yaml

View workflow job for this annotation

GitHub Actions / Check Spelling

Unknown word (hugomod)

- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb

- name: Install Dart Sass
run: sudo snap install dart-sass

- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

Check warning on line 61 in .github/workflows/hugo.yaml

View workflow job for this annotation

GitHub Actions / Check Spelling

Unknown word (Lastmod)

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"

# Add HTML validation
- name: Setup HTML validation
run: npm install -g html-validator-cli

- name: Build with Hugo
env:
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
Expand All @@ -57,6 +80,23 @@
--minify \
--source docs \
--baseURL "${{ steps.pages.outputs.base_url }}/"

# Add error checking
- name: Check for Hugo errors
run: |
if [ -d "./docs/public" ]; then
echo "Build succeeded"
else
echo "Build failed"
exit 1
fi

# Validate HTML output
- name: Validate HTML
run: |
find ./docs/public -name '*.html' -exec html-validator {} \;
continue-on-error: true # Optional: set to false if you want validation errors to fail the build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand All @@ -73,3 +113,9 @@
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

# Add deployment verification
- name: Verify deployment
run: |
curl -s --head --request GET ${{ steps.deployment.outputs.page_url }} | grep "200\|301"
shell: bash
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,18 @@ go.work.sum
# env file
.env
bin/

# Generated files by hugo
docs/themes/
docs/public/
/resources/_gen/
/assets/jsconfig.json
hugo_stats.json

# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux

# Temporary lock file while building
/.hugo_build.lock
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/themes/hugo-book"]
path = docs/themes/hugo-book
url = https://github.com/alex-shpak/hugo-book
40 changes: 33 additions & 7 deletions docs/config.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
baseURL = 'https://grimoire.cc/'
baseURL = 'https://gphorvath.github.io/grimoire/'
languageCode = 'en-us'
title = 'Grimoire - AI Prompt Management CLI'
title = 'Grimoire - Prompt Engineering Assistant'
theme = 'hugo-book'

# Show all pages in left sidebar
[params]
description = "A prompt engineer's Grimoire to assist with getting the best results from Generative AI prompts"
# Book theme parameters
BookTheme = 'dark'
BookToC = true
# Remove or comment out BookSection to show all content
# BookSection = 'docs'
BookRepo = 'https://github.com/gphorvath/grimoire'
BookEditPath = 'edit/main/docs'

# Show all files in the menu
BookMenuBundle = '/menu'
# Set to true to show all hidden pages
BookShowHidden = true

[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
# Configure the menu
[menu]
# This will show all pages in the sidebar
[[menu.before]]
name = "GitHub"
url = "https://github.com/gphorvath/grimoire"
weight = 10

# Enable all files to be included in menu
[markup.tableOfContents]
startLevel = 1
endLevel = 4

# Configure content browsing
[taxonomies]
category = "categories"
tag = "tags"
23 changes: 23 additions & 0 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "Command Reference"
description: "Complete reference for Grimoire CLI commands"
weight: 1
date: 2024-11-09
draft: false
---

# Command Reference

This section contains the complete reference for all Grimoire CLI commands.

## Available Commands

* [completion](grimoire/completion/) - Generate the autocompletion script for the specified shell
* [copy](grimoire/copy/) - Copy the prompt to the clipboard
* [delete](grimoire/delete/) - Delete the prompt
* [docs](grimoire/docs/) - Generate documentation for grimoire
* [edit](grimoire/edit/) - Edit the prompt in the chosen editor
* [generate](grimoire/generate/) - Get generation from Ollama
* [help](grimoire/help/) - Help about any command
* [list](grimoire/list/) - List files in the target directory
* [say](grimoire/say/) - Print Grimoire logo
37 changes: 21 additions & 16 deletions docs/content/grimoire.md → docs/content/grimoire/_index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## grimoire
---
title: "grimoire"
description: "Grimoire - A CLI tool for managing and using GenAI prompts"
weight: 1
date: 2024-11-09
draft: false
---

Grimoire - A CLI tool for managing and using GenAI prompts

### Synopsis
# grimoire


┌─────────────────────────────┐
Expand All @@ -22,20 +26,21 @@ Grimoire - A CLI tool for managing and using GenAI prompts

Grimoire is your magical companion to manage and quickly access a collection of GenAI prompts.

### Options
## Usage

```
-h, --help help for grimoire
```bash
grimoire
```

### SEE ALSO
## Subcommands

* [grimoire completion](grimoire_completion.md) - Generate the autocompletion script for the specified shell
* [grimoire copy](grimoire_copy.md) - Copy the prompt to the clipboard
* [grimoire delete](grimoire_delete.md) - Delete the prompt
* [grimoire edit](grimoire_edit.md) - Edit the prompt in the chosen editor
* [grimoire generate](grimoire_generate.md) - Get generation from Ollama
* [grimoire list](grimoire_list.md) - List files in the target directory
* [grimoire say](grimoire_say.md) - Print Grimoire logo
* [completion](./completion/) - Generate the autocompletion script for the specified shell
* [copy](./copy/) - Copy the prompt to the clipboard
* [delete](./delete/) - Delete the prompt
* [docs](./docs/) - Generate documentation for grimoire
* [edit](./edit/) - Edit the prompt in the chosen editor
* [generate](./generate/) - Get generation from Ollama
* [help](./help/) - Help about any command
* [list](./list/) - List files in the target directory
* [say](./say/) - Print Grimoire logo

###### Auto generated by spf13/cobra on 9-Nov-2024
27 changes: 27 additions & 0 deletions docs/content/grimoire/completion/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: "completion"
description: "Generate the autocompletion script for the specified shell"
weight: 2
date: 2024-11-09
draft: false
---

# grimoire completion

Generate the autocompletion script for grimoire for the specified shell.
See each sub-command's help for details on how to use the generated script.


## Usage

```bash
grimoire completion
```

## Subcommands

* [bash](./bash/) - Generate the autocompletion script for bash
* [fish](./fish/) - Generate the autocompletion script for fish
* [powershell](./powershell/) - Generate the autocompletion script for powershell
* [zsh](./zsh/) - Generate the autocompletion script for zsh

Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## grimoire completion bash
---
title: "bash"
description: "Generate the autocompletion script for bash"
weight: 3
date: 2024-11-09
draft: false
---

Generate the autocompletion script for bash

### Synopsis
# grimoire completion bash

Generate the autocompletion script for the bash shell.

Expand All @@ -26,19 +30,15 @@ To load completions for every new session, execute once:
You will need to start a new shell for this setup to take effect.


```
grimoire completion bash
```
## Usage

### Options

```
-h, --help help for bash
--no-descriptions disable completion descriptions
```bash
grimoire completion bash
```

### SEE ALSO
## Flags

* [grimoire completion](grimoire_completion.md) - Generate the autocompletion script for the specified shell
| Flag | Description | Default |
|------|-------------|----------|
| `--no-descriptions` | disable completion descriptions | `false` |

###### Auto generated by spf13/cobra on 9-Nov-2024
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## grimoire completion fish
---
title: "fish"
description: "Generate the autocompletion script for fish"
weight: 4
date: 2024-11-09
draft: false
---

Generate the autocompletion script for fish

### Synopsis
# grimoire completion fish

Generate the autocompletion script for the fish shell.

Expand All @@ -17,19 +21,15 @@ To load completions for every new session, execute once:
You will need to start a new shell for this setup to take effect.


```
grimoire completion fish [flags]
```
## Usage

### Options

```
-h, --help help for fish
--no-descriptions disable completion descriptions
```bash
grimoire completion fish [flags]
```

### SEE ALSO
## Flags

* [grimoire completion](grimoire_completion.md) - Generate the autocompletion script for the specified shell
| Flag | Description | Default |
|------|-------------|----------|
| `--no-descriptions` | disable completion descriptions | `false` |

###### Auto generated by spf13/cobra on 9-Nov-2024
32 changes: 32 additions & 0 deletions docs/content/grimoire/completion/powershell/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: "powershell"
description: "Generate the autocompletion script for powershell"
weight: 5
date: 2024-11-09
draft: false
---

# grimoire completion powershell

Generate the autocompletion script for powershell.

To load completions in your current shell session:

grimoire completion powershell | Out-String | Invoke-Expression

To load completions for every new session, add the output of the above command
to your powershell profile.


## Usage

```bash
grimoire completion powershell [flags]
```

## Flags

| Flag | Description | Default |
|------|-------------|----------|
| `--no-descriptions` | disable completion descriptions | `false` |

Loading
Loading