From 62bfe80fb6e0cd51cec6fc9df9e1768f7d37d299 Mon Sep 17 00:00:00 2001 From: Shadman <13149513+shadmansaleh@users.noreply.github.com> Date: Tue, 14 Sep 2021 12:58:46 +0600 Subject: [PATCH] chore/docgen update (#48) * Pin panvimdoc to v2.7.1 * Add helper script to easily generate vimdoc locally. * Update generated doc. --- .github/workflows/docs.yml | 2 +- .gitignore | 3 +++ Makefile | 3 +++ doc/lualine.txt | 32 ++++++++++++++++---------------- scripts/docgen.sh | 38 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 61 insertions(+), 17 deletions(-) create mode 100644 scripts/docgen.sh diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 236d027..bfd0884 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,7 +26,7 @@ jobs: - name: Checkout to vimdoc branch run: git checkout -b ${VIMDOC_BRANCH} - name: panvimdoc - uses: kdheepak/panvimdoc@main + uses: kdheepak/panvimdoc@v2.7.1 with: vimdoc: lualine description: fast and easy to configure statusline plugin for neovim diff --git a/.gitignore b/.gitignore index 1e1f76d..5f2dd47 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,6 @@ tags # helptags doc/tags + +# panvimdoc +/panvimdoc/ diff --git a/Makefile b/Makefile index 1b9cbaa..8332973 100644 --- a/Makefile +++ b/Makefile @@ -11,4 +11,7 @@ format: test: @nvim --headless -u lua/tests/minimal_init.lua -c "PlenaryBustedDirectory lua/tests/ { minimal_init = './lua/tests/minimal_init.lua' }" +docgen: + @bash ./scripts/docgen.sh + check: lint test diff --git a/doc/lualine.txt b/doc/lualine.txt index ae28420..2987e17 100644 --- a/doc/lualine.txt +++ b/doc/lualine.txt @@ -43,7 +43,7 @@ installed INSTALLATION *lualine-installation* -VIM-PLUG +VIM-PLUG ~ > Plug 'hoob3rt/lualine.nvim' @@ -53,7 +53,7 @@ VIM-PLUG < -PACKER.NVIM +PACKER.NVIM ~ > use { @@ -119,7 +119,7 @@ If you want to get your current lualine config. you can do so with ------------------------------------------------------------------------------ -STARTING LUALINE +STARTING LUALINE ~ > require('lualine').setup() @@ -128,7 +128,7 @@ STARTING LUALINE ------------------------------------------------------------------------------ -SETTING A THEME +SETTING A THEME ~ > options = {theme = 'gruvbox'} @@ -158,7 +158,7 @@ Theme structure is available here ------------------------------------------------------------------------------ -SEPARATORS +SEPARATORS ~ Lualine defines two kinds of separators: @@ -184,14 +184,14 @@ Disabling separators ------------------------------------------------------------------------------ -CHANGING COMPONENTS IN LUALINE SECTIONS +CHANGING COMPONENTS IN LUALINE SECTIONS ~ > sections = {lualine_a = {'mode'}} < -**Available components** +Available components ~ - `branch` (git branch) @@ -261,7 +261,7 @@ global variables * require statements ------------------------------------------------------------------------------ -COMPONENT OPTIONS +COMPONENT OPTIONS ~ Component options can change the way a component behave. There are two kinds of options: * global options affecting all components * local options affecting @@ -284,7 +284,7 @@ with `lower = true` *lualine-Available-options* -**Global options** +Global options ~ > options = { @@ -299,7 +299,7 @@ with `lower = true` < -**Local options** +Local options ~ > sections = { @@ -333,7 +333,7 @@ with `lower = true` < -**Component specific local options** +Component specific local options ~ *lualine-diagnostics-component-options* @@ -419,7 +419,7 @@ with `lower = true` ------------------------------------------------------------------------------ -TABLINE +TABLINE ~ You can use lualine to display components in tabline. The configuration for tabline sections is exactly the same as for statusline. @@ -464,7 +464,7 @@ list here ------------------------------------------------------------------------------ -EXTENSIONS +EXTENSIONS ~ Lualine extensions change statusline appearance for a window/buffer with specified filetypes. @@ -477,7 +477,7 @@ extensions with: < -**Available extensions** +Available extensions ~ - chadtree @@ -488,7 +488,7 @@ extensions with: - quickfix -**Custom extensions** +Custom extensions ~ You can define your own extensions. If you think an extension might be useful for others then please submit a pr. @@ -501,7 +501,7 @@ for others then please submit a pr. ------------------------------------------------------------------------------ -DISABLING LUALINE +DISABLING LUALINE ~ You can disable lualine for specific filetypes diff --git a/scripts/docgen.sh b/scripts/docgen.sh new file mode 100644 index 0000000..77eafcd --- /dev/null +++ b/scripts/docgen.sh @@ -0,0 +1,38 @@ +PANVIMDOC_TAG_VERSION="v2.7.1" # panvimdoc version + +# panvimdocs metadata +PANVIMDOC_VIMDOC="lualine" +PANVIMDOC_DESCRIPTION="fast and easy to configure statusline plugin for neovim" +PANVIMDOC_PANDOC="README.md" +PANVIMDOC_VERSION="NVIM v0.5.0" +PANVIMDOC_TOC=true +PANDOC_OUTPUT="doc/lualine.txt" + +PANVIMDOC_INSTALLED=false # Whther panvimdoc was installed by this script + +if [ ! -d "panvimdoc/" ];then + # Grab panvimdoc if not present + PANVIMDOC_INSTALLED=true + echo "Installing panvimdoc" + git clone --depth 1\ + --branch "${PANVIMDOC_TAG_VERSION}"\ + "https://github.com/kdheepak/panvimdoc" "panvimdoc" +fi + +echo "Genarating docs" +pandoc --metadata=project:"${PANVIMDOC_VIMDOC}"\ + --metadata=toc:${PANVIMDOC_TOC}\ + --metadata=vimversion:"${PANVIMDOC_VERSION}"\ + --metadata=description:"${PANVIMDOC_DESCRIPTION}"\ + --lua-filter ./panvimdoc/scripts/skip-blocks.lua\ + --lua-filter ./panvimdoc/scripts/include-files.lua\ + -t ./panvimdoc/scripts/panvimdoc.lua\ + -o "${PANDOC_OUTPUT}"\ + "${PANVIMDOC_PANDOC}" + +if $PANVIMDOC_INSTALLED ;then + # Remove panvimdoc if it was installed by this script + echo "Removing panvimdoc" + rm -rf panvimdoc +fi +