Skip to content

Commit

Permalink
feat(docs): modify docs workflow (#4)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
AlejandroSuero and github-actions[bot] authored May 14, 2024
1 parent 137e4c6 commit ff919cd
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 22 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ name: docs

on:
push:
branches-ignore:
- main
pull_request:
branches:
- main
paths:
- "README.md"

permissions:
actions: write
contents: write

jobs:
docs:
Expand All @@ -23,14 +20,19 @@ jobs:
uses: kdheepak/panvimdoc@main
with:
vimdoc: freeze-code.nvim
version: "Neovim >= 0.8.0"
version: "Neovim >= 0.9.0"
demojify: true
treesitter: true
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "docs: auto-generate vimdoc"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author:
"github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
- name: Update documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_MSG: |
docs: update `doc/freeze-code.nvim.txt`
skip-checks: true
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git add doc/
# Only commit and push if we have changes
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF})
2 changes: 1 addition & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ rules:
present: false
line-length:
level: warning
max: 80
max: 200
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]

# Freeze NeoVim Plugin
# Freeze Neovim Plugin

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

</div>

> [!warning]
>
> This plugin requires Neovim v0.9.0 or higher
## Installation

Using your plugin manager at your disposal, in the example
Expand Down
13 changes: 9 additions & 4 deletions doc/freeze-code.nvim.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*freeze-code.nvim.txt* For Neovim >= 0.8.0 Last change: 2024 May 14
*freeze-code.nvim.txt* For Neovim >= 0.9.0 Last change: 2024 May 14

==============================================================================
Table of Contents *freeze-code.nvim-table-of-contents*
Expand All @@ -9,6 +9,9 @@ Table of Contents *freeze-code.nvim-table-of-contents*



[!warning]
This plugin requires Neovim v0.9.0 or higher

INSTALLATION *freeze-code.nvim-installation*

Using your plugin manager at your disposal, in the example lazy
Expand Down Expand Up @@ -53,7 +56,8 @@ Using your plugin manager at your disposal, in the example lazy
<


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


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

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


Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
Expand Down
9 changes: 8 additions & 1 deletion plugin/freeze-code.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
if vim.fn.has("nvim-0.9.0") ~= 1 then
vim.api.nvim_err_writeln("[freeze-code] plugin requires at least NeoVim 0.9.0.")
local current_version = vim.version()
local err_msg = string.format(
"[freeze-code] plugin requires at least NeoVim v0.9.0, current version: v%s.%s.%s",
current_version.major,
current_version.minor,
current_version.patch
)
vim.api.nvim_err_writeln(err_msg)
return
end

Expand Down

0 comments on commit ff919cd

Please sign in to comment.