Skip to content

Commit 8b05eb0

Browse files
committed
docs: Update README.md 📚
1 parent 25fe55a commit 8b05eb0

File tree

1 file changed

+91
-60
lines changed

1 file changed

+91
-60
lines changed

README.md

Lines changed: 91 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,28 @@
33
[![Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://kdheepak.com/panvimdoc/)
44
[![Build](https://github.com/kdheepak/panvimdoc/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/kdheepak/panvimdoc/actions/workflows/test.yml?query=branch%3Amain)
55

6-
Write documentation in [pandoc markdown](https://pandoc.org/MANUAL.html).
7-
Generate documentation in vimdoc.
6+
Write documentation in [pandoc markdown](https://pandoc.org/MANUAL.html). Generate documentation in
7+
vimdoc.
88

99
<img width="1512" alt="image" src="https://github.com/kdheepak/panvimdoc/assets/1813121/dfaed08d-fb9b-4cac-aad0-da71b605265d">
1010

11-
::: center
12-
This software is released under a MIT License.
13-
:::
11+
::: center This software is released under a MIT License. :::
12+
13+
# Support This Project
14+
15+
If you've found this project helpful, please consider supporting its ongoing development and
16+
maintenance. You can sponsor me on GitHub Sponsors or Donate via Strip:
17+
18+
[![Sponsor @kdheepak](https://img.shields.io/badge/GitHub_Sponsor-%E2%9D%A4-blue)](https://github.com/sponsors/kdheepak)
19+
[![Donate](https://img.shields.io/badge/Donate_Via_Stripe-%E2%9D%A4-blue)](https://donate.stripe.com/8wM9E7bBO9ZsbGUdQR)
20+
21+
Every bit of sponsorship helps, whether it's to buy me a coffee or to enable me to dedicate more
22+
time to maintaining and improving this project. I sincerely appreciate your generosity and support!
1423

1524
# TLDR
1625

17-
1. Choose a name for your project, i.e. `${VIMDOC_PROJECT_NAME}`. See [.github/workflows/panvimdoc.yml](./.github/workflows/panvimdoc.yml) as an example.
26+
1. Choose a name for your project, i.e. `${VIMDOC_PROJECT_NAME}`. See
27+
[.github/workflows/panvimdoc.yml](./.github/workflows/panvimdoc.yml) as an example.
1828
2. Add the following to `./.github/workflows/panvimdoc.yml`:
1929

2030
```yaml
@@ -85,8 +95,9 @@ jobs:
8595
incrementheadinglevelby: 0 # Increment heading levels by specified number
8696
```
8797

88-
The only required thing for you to do is to choose a `VIMDOC_PROJECT_NAME` appropriately.
89-
This is usually the name of the plugin or the documentation file without the `.txt` extension. For example, the following:
98+
The only required thing for you to do is to choose a `VIMDOC_PROJECT_NAME` appropriately. This is
99+
usually the name of the plugin or the documentation file without the `.txt` extension. For example,
100+
the following:
90101

91102
```yaml
92103
- name: panvimdoc
@@ -95,12 +106,13 @@ This is usually the name of the plugin or the documentation file without the `.t
95106
vimdoc: panvimdoc
96107
```
97108

98-
will output a file `doc/panvimdoc.txt` and the vim help tag for it will be `panvimdoc` using the `main` branch of the repository.
109+
will output a file `doc/panvimdoc.txt` and the vim help tag for it will be `panvimdoc` using the
110+
`main` branch of the repository.
99111

100112
All the other options are optional.
101113

102-
It is recommended to pin to an exact version so you can be confident that no surprises occur for you or your users.
103-
See <https://github.com/kdheepak/panvimdoc/releases/latest> for which version to use.
114+
It is recommended to pin to an exact version so you can be confident that no surprises occur for you
115+
or your users. See <https://github.com/kdheepak/panvimdoc/releases/latest> for which version to use.
104116
Once you pick a version, you can pin it like so:
105117

106118
```yaml
@@ -111,13 +123,16 @@ Once you pick a version, you can pin it like so:
111123
For an example of how this is used, see one of the following workflows:
112124

113125
- [kdheepak/panvimdoc](./.github/workflows/panvimdoc.yml): [doc/panvimdoc.txt](./doc/panvimdoc.txt)
114-
- [kdheepak/tabline.nvim](https://github.com/kdheepak/tabline.nvim/blob/main/.github/workflows/ci.yml): [doc/tabline.txt](https://github.com/kdheepak/tabline.nvim/blob/main/doc/tabline.txt)
126+
- [kdheepak/tabline.nvim](https://github.com/kdheepak/tabline.nvim/blob/main/.github/workflows/ci.yml):
127+
[doc/tabline.txt](https://github.com/kdheepak/tabline.nvim/blob/main/doc/tabline.txt)
115128

116-
Or see any of the packages here that depend on this action: <https://github.com/kdheepak/panvimdoc/network/dependents>
129+
Or see any of the packages here that depend on this action:
130+
<https://github.com/kdheepak/panvimdoc/network/dependents>
117131

118132
<summary>
119133

120-
If you are interested in making your vim plugin documentation available as a HTML page, check out [.github/workflows/docs.yml](./.github/workflows/docs.yml) file.
134+
If you are interested in making your vim plugin documentation available as a HTML page, check out
135+
[.github/workflows/docs.yml](./.github/workflows/docs.yml) file.
121136

122137
<details>
123138

@@ -141,20 +156,11 @@ jobs:
141156
uses: docker://pandoc/latex:3.1
142157
with:
143158
args: >-
144-
--katex
145-
--from markdown+tex_math_single_backslash
146-
--to html5+smart
147-
--template="./scripts/template.html5"
148-
--css="/panvimdoc/css/theme.css"
149-
--css="/panvimdoc/css/skylighting-solarized-theme.css"
150-
--toc
151-
--wrap=none
152-
--metadata title="panvimdoc"
153-
doc/panvimdoc.md
154-
--lua-filter=scripts/include-files.lua
155-
--lua-filter=scripts/skip-blocks.lua
156-
-t html
157-
-o public/index.html
159+
--katex --from markdown+tex_math_single_backslash --to html5+smart
160+
--template="./scripts/template.html5" --css="/panvimdoc/css/theme.css"
161+
--css="/panvimdoc/css/skylighting-solarized-theme.css" --toc --wrap=none --metadata
162+
title="panvimdoc" doc/panvimdoc.md --lua-filter=scripts/include-files.lua
163+
--lua-filter=scripts/skip-blocks.lua -t html -o public/index.html
158164
- name: deploy to GitHub pages
159165
uses: JamesIves/github-pages-deploy-action@v4
160166
with:
@@ -192,73 +198,98 @@ You will need `pandoc v3.0.0` or greater for this script to work.
192198

193199
# Motivation
194200

195-
Writing user-friendly documentation is important for every successful software project.
196-
This is particularly true when writing documentation for users in the world of vim plugins.
201+
Writing user-friendly documentation is important for every successful software project. This is
202+
particularly true when writing documentation for users in the world of vim plugins.
197203

198-
The process of writing and maintaining this documentation can often be a cumbersome, time-consuming task.
199-
This project is aims to make that process a little bit easier by allowing anyone to write documentation in markdown (or any format Pandoc supports) and converting it to vimdoc automatically.
200-
This way, plugin authors will have to write documentation just once (for example, as part of the README of the project), and the vim documentation can be autogenerated.
204+
The process of writing and maintaining this documentation can often be a cumbersome, time-consuming
205+
task. This project is aims to make that process a little bit easier by allowing anyone to write
206+
documentation in markdown (or any format Pandoc supports) and converting it to vimdoc automatically.
207+
This way, plugin authors will have to write documentation just once (for example, as part of the
208+
README of the project), and the vim documentation can be autogenerated.
201209

202210
## Rationale
203211

204-
1. **Simplicity**: Writing in Markdown is often more intuitive for developers. By converting from Markdown to vimdoc, authors can maintain the simplicity of Markdown while adhering to the vimdoc standards.
205-
2. **Unified Documentation**: Plugin authors can write their documentation just once (such as in the project's README) and automatically generate vim documentation, ensuring consistency and saving time.
206-
3. **Preserving Vim Features**: Vimdoc isn’t just plain text; it supports syntax highlighting, tags, links, and careful formatting using whitespace. It's essential to preserve these features when converting to ensure the quality and usefulness of the documentation. See <https://vimhelp.org/helphelp.txt.html#help-writing> or [`@nanotree`'s project](https://github.com/nanotee/vimdoc-notes) for more information.
207-
4. **Leveraging Pandoc**: Unlike existing solutions, this project leverages Pandoc's wide range of features, including support for multiple Markdown flavors and easy-to-write custom filters in Lua.
208-
5. **Interoperability**: The choice of Pandoc allows for enhanced flexibility, making it easier to extend functionality or even adapt the converter for other documentation formats in the future.
212+
1. **Simplicity**: Writing in Markdown is often more intuitive for developers. By converting from
213+
Markdown to vimdoc, authors can maintain the simplicity of Markdown while adhering to the vimdoc
214+
standards.
215+
2. **Unified Documentation**: Plugin authors can write their documentation just once (such as in the
216+
project's README) and automatically generate vim documentation, ensuring consistency and saving
217+
time.
218+
3. **Preserving Vim Features**: Vimdoc isn’t just plain text; it supports syntax highlighting, tags,
219+
links, and careful formatting using whitespace. It's essential to preserve these features when
220+
converting to ensure the quality and usefulness of the documentation. See
221+
<https://vimhelp.org/helphelp.txt.html#help-writing> or
222+
[`@nanotree`'s project](https://github.com/nanotee/vimdoc-notes) for more information.
223+
4. **Leveraging Pandoc**: Unlike existing solutions, this project leverages Pandoc's wide range of
224+
features, including support for multiple Markdown flavors and easy-to-write custom filters in
225+
Lua.
226+
5. **Interoperability**: The choice of Pandoc allows for enhanced flexibility, making it easier to
227+
extend functionality or even adapt the converter for other documentation formats in the future.
209228

210229
## Background
211230

212231
Writing documentation in Markdown and converting it to vimdoc is not a novel idea.
213232

214-
For example, [ibhagwan/ts-vimdoc.nvim](https://github.com/ibhagwan/ts-vimdoc.nvim) is an implementation a neovim treesitter based markdown to vimdoc converter that works fairly well.
215-
There are no dependencies except for the Markdown treesitter parser.
216-
It is neovim only but you can use this on github actions even for a vim plugin documentation.
233+
For example, [ibhagwan/ts-vimdoc.nvim](https://github.com/ibhagwan/ts-vimdoc.nvim) is an
234+
implementation a neovim treesitter based markdown to vimdoc converter that works fairly well. There
235+
are no dependencies except for the Markdown treesitter parser. It is neovim only but you can use
236+
this on github actions even for a vim plugin documentation.
217237

218238
There's also [wincent/docvim](https://github.com/wincent/docvim) which is written in Haskell.
219239
Finally there's [FooSoft/md2vim](https://github.com/FooSoft/md2vim) which is written in Go.
220240

221-
None of these projects use Pandoc.
222-
Pandoc Markdown supports a wide number of features: See <https://pandoc.org/MANUAL.html> for more information.
223-
Most importantly, it supports a range of Markdown formats and flavors.
224-
And, Pandoc has filters and a custom output writer that can be configured in lua.
225-
Pandoc filters can extend the capability of Pandoc with minimal lua scripting, and these are very easy to write and maintain too.
241+
None of these projects use Pandoc. Pandoc Markdown supports a wide number of features: See
242+
<https://pandoc.org/MANUAL.html> for more information. Most importantly, it supports a range of
243+
Markdown formats and flavors. And, Pandoc has filters and a custom output writer that can be
244+
configured in lua. Pandoc filters can extend the capability of Pandoc with minimal lua scripting,
245+
and these are very easy to write and maintain too.
226246

227-
That means, with this project, you can write your Vim documentation in Markdown, RestructuredText, AsciiDoc, etc and convert it to VimDoc, PDF, Word, HTML etc.
247+
That means, with this project, you can write your Vim documentation in Markdown, RestructuredText,
248+
AsciiDoc, etc and convert it to VimDoc, PDF, Word, HTML etc.
228249

229250
# Goals
230251

231-
By offering a specification and reference implementation for converting Pandoc Markdown to vimdoc, this project aims to reduce friction in the documentation process for vim plugin authors.
252+
By offering a specification and reference implementation for converting Pandoc Markdown to vimdoc,
253+
this project aims to reduce friction in the documentation process for vim plugin authors.
232254

233255
Here are the specific goals that guide this project:
234256

235-
- **Readability**: The Markdown files must render correctly when presented as README files on platforms like GitHub, GitLab, or SourceHut.
236-
- **Web-Friendly HTML**: If converted to HTML using Pandoc, the Markdown files must be web-friendly and render appropriately.
237-
- **VimDoc Features**: The generated vim documentation must support essential features like links and tags.
238-
- **Aesthetically Pleasing**: The vim documentation must not only be functional but also visually pleasing in both vim and plain text files. This includes the appropriate use of columns and spacing.
239-
- **Guidelines**: While the format of built-in Vim documentation is a valuable reference, it is used as guidelines rather than strict rules.
257+
- **Readability**: The Markdown files must render correctly when presented as README files on
258+
platforms like GitHub, GitLab, or SourceHut.
259+
- **Web-Friendly HTML**: If converted to HTML using Pandoc, the Markdown files must be web-friendly
260+
and render appropriately.
261+
- **VimDoc Features**: The generated vim documentation must support essential features like links
262+
and tags.
263+
- **Aesthetically Pleasing**: The vim documentation must not only be functional but also visually
264+
pleasing in both vim and plain text files. This includes the appropriate use of columns and
265+
spacing.
266+
- **Guidelines**: While the format of built-in Vim documentation is a valuable reference, it is used
267+
as guidelines rather than strict rules.
240268

241269
# Features
242270

243-
This project offers a comprehensive suite of features designed to streamline the conversion process from Markdown to vimdoc:
271+
This project offers a comprehensive suite of features designed to streamline the conversion process
272+
from Markdown to vimdoc:
244273

245274
- Automatically generates titles for vim documentation.
246275
- Creates a table of contents to enhance navigation within the document.
247276
- Automatically handles the generation of links and tags.
248277
- Maintains markdown syntax for tables, ensuring proper rendering.
249278
- Allows for manual control through raw vimdoc syntax where necessary.
250-
- Offers the ability to include multiple Markdown files, providing flexibility in documentation structure.
279+
- Offers the ability to include multiple Markdown files, providing flexibility in documentation
280+
structure.
251281

252282
# Specification
253283

254-
The specification is described in [panvimdoc.md](./doc/panvimdoc.md) along with examples.
255-
The generated output is in [panvimdoc.txt](./doc/panvimdoc.txt).
256-
The reference implementation of the Pandoc lua filter is in [panvimdoc.lua](./scripts/panvimdoc.lua).
257-
See [panvimdoc.sh](./panvimdoc.sh) for how to use this script, or check the [Usage](#usage) section.
284+
The specification is described in [panvimdoc.md](./doc/panvimdoc.md) along with examples. The
285+
generated output is in [panvimdoc.txt](./doc/panvimdoc.txt). The reference implementation of the
286+
Pandoc lua filter is in [panvimdoc.lua](./scripts/panvimdoc.lua). See [panvimdoc.sh](./panvimdoc.sh)
287+
for how to use this script, or check the [Usage](#usage) section.
258288

259289
<!-- panvimdoc-ignore-start -->
260290

261-
If you would like to contribute to the specification, or if you have feature requests or opinions, please feel free to comment here: <https://github.com/kdheepak/panvimdoc/discussions/11>.
291+
If you would like to contribute to the specification, or if you have feature requests or opinions,
292+
please feel free to comment here: <https://github.com/kdheepak/panvimdoc/discussions/11>.
262293

263294
<!-- panvimdoc-ignore-end -->
264295

0 commit comments

Comments
 (0)