Skip to content

Commit

Permalink
adding panvimdoc workflow to generate vimdoc (#6)
Browse files Browse the repository at this point in the history
* testing docs ci

* removing if

* fix folder name

* auto-generate vimdoc

* split docs into new workflow

* fix workflow name

* removing unnecessary needs statement

* change docs workflow branch

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ellisonleao and github-actions[bot] committed Jul 26, 2023
1 parent 8f96449 commit 51ea54b
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
push:
branches:
- main
name: docs

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: panvimdoc
uses: kdheepak/panvimdoc@main
with:
vimdoc: carbon-now.nvim
version: "Neovim >= 0.8.0"
demojify: true
treesitter: true
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "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>"
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
on: [push, pull_request]
name: default
name: lint-test

jobs:
stylua:
lint:
name: stylua
runs-on: ubuntu-latest
steps:
Expand All @@ -15,11 +14,11 @@ jobs:
args: --color always --check lua

test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
nvim-versions: ['stable', 'nightly']
name: test
steps:
- name: checkout
uses: actions/checkout@v3
Expand All @@ -30,4 +29,4 @@ jobs:
version: ${{ matrix.nvim-versions }}

- name: run tests
run: make test
run: make test
118 changes: 118 additions & 0 deletions doc/carbon-now.nvim.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
*carbon-now.nvim.txt* For Neovim >= 0.8.0 Last change: 2023 July 26

==============================================================================
Table of Contents *carbon-now.nvim-table-of-contents*

- Requirements |carbon-now.nvim-requirements|
- Installing |carbon-now.nvim-installing|
- Configuration and customization|carbon-now.nvim-configuration-and-customization|
- Generating snippets from visual selection|carbon-now.nvim-generating-snippets-from-visual-selection|
- Generating snippets from github gists|carbon-now.nvim-generating-snippets-from-github-gists|
- Changing default open in browser command|carbon-now.nvim-changing-default-open-in-browser-command|


REQUIREMENTS *carbon-now.nvim-requirements*

Neovim 0.8+


INSTALLING *carbon-now.nvim-installing*

Using your preferred plugin manager, add:

>
'ellisonleao/carbon-now.nvim'
<

Example with packer:

>lua
use {"ellisonleao/carbon-now.nvim", config = function() require('carbon-now').setup() end}
<

Example with lazy.nvim:

>lua
{
"ellisonleao/carbon-now.nvim",
lazy = true,
cmd = "CarbonNow",
---@param opts cn.ConfigSchema
opts = { [[ your custom config here ]] }
}
<


CONFIGURATION AND CUSTOMIZATION*carbon-now.nvim-configuration-and-customization*

The plugin comes with the following default configs:

>lua
{
base_url = "https://carbon.now.sh/",
open_cmd = "xdg-open",
options = {
bg = "gray",
drop_shadow_blur = "68px",
drop_shadow = false,
drop_shadow_offset_y = "20px",
font_family = "Hack",
font_size = "18px",
line_height = "133%",
line_numbers = true,
theme = "monokai",
titlebar = "Made with carbon-now.nvim",
watermark = false,
width = "680",
window_theme = "sharp",
},
}
<

You can override it in `setup()` function. Example:

>lua
local carbon = require('carbon-now')
carbon.setup({
options = {
theme = "solarized",
font_family = "Monoid",
}
})
<


GENERATING SNIPPETS FROM VISUAL SELECTION*carbon-now.nvim-generating-snippets-from-visual-selection*

Adding a custom mapping for generating a new snippet is really easy

>lua
vim.keymap.set("v", "<leader>cn", ":CarbonNow<CR>", { silent = true })
<

But if you preferer a command, visual select the code you want to share and
call:

>
:CarbonNow
<


GENERATING SNIPPETS FROM GITHUB GISTS*carbon-now.nvim-generating-snippets-from-github-gists*

>
:CarbonNow GIST_ID
<


CHANGING DEFAULT OPEN IN BROWSER COMMAND*carbon-now.nvim-changing-default-open-in-browser-command*

Example: Opening snippet in google-chrome

>lua
require('carbon-now').setup({open_cmd = "google-chrome"})
<

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

vim:tw=78:ts=8:noet:ft=help:norl:

0 comments on commit 51ea54b

Please sign in to comment.