Skip to content

Commit ff919cd

Browse files
feat(docs): modify docs workflow (#4)
* feat: modified `.yml` files max length * docs: updated to inform about Neovim min version allowed * ci(docs): modified to `skip-checks` and for better commits * docs: update `doc/freeze-code.nvim.txt` skip-checks: true --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 137e4c6 commit ff919cd

File tree

5 files changed

+40
-22
lines changed

5 files changed

+40
-22
lines changed

.github/workflows/docs.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ name: docs
22

33
on:
44
push:
5+
branches-ignore:
6+
- main
7+
pull_request:
58
branches:
69
- main
7-
paths:
8-
- "README.md"
9-
10-
permissions:
11-
actions: write
12-
contents: write
1310

1411
jobs:
1512
docs:
@@ -23,14 +20,19 @@ jobs:
2320
uses: kdheepak/panvimdoc@main
2421
with:
2522
vimdoc: freeze-code.nvim
26-
version: "Neovim >= 0.8.0"
23+
version: "Neovim >= 0.9.0"
2724
demojify: true
2825
treesitter: true
29-
- name: Push changes
30-
uses: stefanzweifel/git-auto-commit-action@v4
31-
with:
32-
commit_message: "docs: auto-generate vimdoc"
33-
commit_user_name: "github-actions[bot]"
34-
commit_user_email: "github-actions[bot]@users.noreply.github.com"
35-
commit_author:
36-
"github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
26+
- name: Update documentation
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
COMMIT_MSG: |
30+
docs: update `doc/freeze-code.nvim.txt`
31+
skip-checks: true
32+
run: |
33+
git config user.email "github-actions[bot]@users.noreply.github.com"
34+
git config user.name "github-actions[bot]"
35+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
36+
git add doc/
37+
# Only commit and push if we have changes
38+
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF})

.yamllint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ rules:
55
present: false
66
line-length:
77
level: warning
8-
max: 80
8+
max: 200
99
allow-non-breakable-words: true
1010
allow-non-breakable-inline-mappings: true

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Stargazers][stars-shield]][stars-url]
66
[![Issues][issues-shield]][issues-url]
77

8-
# Freeze NeoVim Plugin
8+
# Freeze Neovim Plugin
99

1010
Take a "screenshot" of your code by turning it into an image, thanks to
1111
[freeze](https://github.com/charmbracelet/freeze) by [charm](https://charm.sh/).
@@ -17,6 +17,10 @@ Take a "screenshot" of your code by turning it into an image, thanks to
1717

1818
</div>
1919

20+
> [!warning]
21+
>
22+
> This plugin requires Neovim v0.9.0 or higher
23+
2024
## Installation
2125

2226
Using your plugin manager at your disposal, in the example

doc/freeze-code.nvim.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*freeze-code.nvim.txt* For Neovim >= 0.8.0 Last change: 2024 May 14
1+
*freeze-code.nvim.txt* For Neovim >= 0.9.0 Last change: 2024 May 14
22

33
==============================================================================
44
Table of Contents *freeze-code.nvim-table-of-contents*
@@ -9,6 +9,9 @@ Table of Contents *freeze-code.nvim-table-of-contents*
99

1010

1111

12+
[!warning]
13+
This plugin requires Neovim v0.9.0 or higher
14+
1215
INSTALLATION *freeze-code.nvim-installation*
1316

1417
Using your plugin manager at your disposal, in the example lazy
@@ -53,7 +56,8 @@ Using your plugin manager at your disposal, in the example lazy
5356
<
5457

5558

56-
[!note] See default configuration below.
59+
[!note]
60+
See default configuration below.
5761
>lua
5862
local opts = {
5963
freeze_path = vim.fn.exepath("freeze"), -- where is freeze installed
@@ -70,7 +74,8 @@ Using your plugin manager at your disposal, in the example lazy
7074
<
7175

7276

73-
[!note] The commands to copy, as defaults per OS will be in the bin-directory
77+
[!note]
78+
The commands to copy, as defaults per OS will be in the bin-directory
7479
<https://github.com/AlejandroSuero/freeze-code.nvim/blob/main/bin>
7580
Once you have it installed, you can use `:checkhealt freeze-code` to see if
7681
there are any problems with the installation or you need to install aditional
@@ -96,7 +101,7 @@ project.
96101
7. Open a PR <https://github.com/AlejandroSuero/freeze-code.nvim/pulls>.
97102

98103
For more information, check CONTRIBUTING.md
99-
<https://github.com/AlejandroSuero/freeze-code.nvim/blob/main/contrib/CONTRIBUTING.md>.
104+
<https://github.com/AlejandroSuero/freeze-code.nvim/blob/main/CONTRIBUTING.md>.
100105

101106

102107
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>

plugin/freeze-code.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
if vim.fn.has("nvim-0.9.0") ~= 1 then
2-
vim.api.nvim_err_writeln("[freeze-code] plugin requires at least NeoVim 0.9.0.")
2+
local current_version = vim.version()
3+
local err_msg = string.format(
4+
"[freeze-code] plugin requires at least NeoVim v0.9.0, current version: v%s.%s.%s",
5+
current_version.major,
6+
current_version.minor,
7+
current_version.patch
8+
)
9+
vim.api.nvim_err_writeln(err_msg)
310
return
411
end
512

0 commit comments

Comments
 (0)