Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting of the Documentation #1961

Closed
wants to merge 27 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
14b6746
Additions:
TornaxO7 Feb 16, 2021
28a292a
Additions:
TornaxO7 Feb 16, 2021
37079ea
- Removed the documentation section in CONTRIBUTING.md
TornaxO7 Feb 23, 2021
1778c1f
removed the html directory. Probably I misclicked on my keyboard and …
TornaxO7 Feb 24, 2021
a2843b7
Added description for:
TornaxO7 Feb 24, 2021
da271d8
Changed one line in the `Documentation` section.
TornaxO7 Feb 24, 2021
133558e
Added a little explanation to `autoload/unite/source`.
TornaxO7 Feb 25, 2021
66ddf82
Added a documentation to the next sections.
TornaxO7 Feb 28, 2021
b4e77b4
Added description for the 'delim.vim' and 'cache.vim'.
TornaxO7 Mar 7, 2021
6a59e1c
Refreshed the TOC.
TornaxO7 Mar 7, 2021
45be05e
Removed the `latex` directory. Looks like that I pasted it here as well
TornaxO7 Mar 7, 2021
feba98a
Added a very small description about the complete directory. I'm not …
TornaxO7 Mar 7, 2021
ad34f7e
- Added some images for the DOCUMENTATION.md file
TornaxO7 Mar 10, 2021
9ddec6f
Added description to `vimtex/autoload/vimtex/context.vim` and to
TornaxO7 Mar 10, 2021
dab4804
- Removed the `Documentation` section in CONTRIBUTING.md => Moved it …
TornaxO7 Mar 11, 2021
d090c6a
- Changed typo "VimTex" to "VimTeX"
TornaxO7 Mar 11, 2021
3a4aff8
- Removed the bold-marks from "VimTeX" (didn't work before)
TornaxO7 Mar 11, 2021
e5e6573
Change the order of the TOC
TornaxO7 Mar 11, 2021
a721719
Added a reference to `:h autoload` in the autoload section and a refe…
TornaxO7 Mar 11, 2021
b7292da
Section `health`:
TornaxO7 Mar 11, 2021
66d9fae
Added a little description to `vimtex/autoload/vimtex.vim`.
TornaxO7 Mar 11, 2021
055b3f0
Added empty line between text paragraphs and code listings.
TornaxO7 Mar 11, 2021
ccc014d
Set code indentation from 4 spaces to 2
TornaxO7 Mar 11, 2021
762ff23
Added description to `compiler.vim`.
TornaxO7 Mar 11, 2021
4e90554
Added description to the following files:
TornaxO7 Mar 11, 2021
0f27003
Added description for:
TornaxO7 Mar 11, 2021
3b6a3dc
Refreshed TOC
TornaxO7 Mar 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Guide for code contributions

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the value of doctoc, but I don't expect this file to change that much, so I would propose to remove the auto update tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... but I'd like to let

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
(...)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->

there because, who know's how this file develops :)



- [Branch model](#branch-model)
- [Documentation style](#documentation-style)
- [Code style](#code-style)
- [Running tests](#running-tests)
- [Documentation](#documentation)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Branch model

VimTeX is developed mainly through the master branch, and pull requests should
Expand Down Expand Up @@ -63,3 +75,89 @@ the executable by setting the environment variable `MYVIM` before running. To
run with vanilla vim, use `MYVIM="vim -T dumb --not-a-term --noplugin -n"`.
Either export this in your shell, or prepend to `make`, that is, run
`MYVIM="vim -T dumb --not-a-term --noplugin -n" make`.

## Documentation
lervag marked this conversation as resolved.
Show resolved Hide resolved
This section should help you to understand the structure of this plugin and how
it works.

So first of all, we're taking a look into the first layer of the plugin, after
that, we're going to through each necessary directory, if it needs some more
description. We won't go through *every* file, because it would take a little
bit too long the most should be probably self explained.
lervag marked this conversation as resolved.
Show resolved Hide resolved
```
vimtex
├── after
│   └── ftplugin
│   └── tex.vim
├── autoload
│   ├── health
│   ├── unite
│   ├── vimtex
│   └── vimtex.vim
├── compiler
│   ├── bibertool.vim
│   ├── chktex.vim
│   ├── lacheck.vim
│   ├── style-check.vim
│   ├── textidote.vim
│   └── vlty.vim
├── CONTRIBUTING.md
├── doc
│   ├── targets-textobj-cheatsheet.md
│   └── vimtex.txt
├── docker
│   └── Dockerfile
├── ftdetect
│   └── tex.vim
├── ftplugin
│   ├── bib.vim
│   └── tex.vim
├── indent
│   ├── bib.vim
│   └── tex.vim
├── LICENSE.md
├── media
│   └── quick_start.gif
├── README.md
├── rplugin
│   └── python3
│   └── denite
│   └── source
│   └── vimtex.py
├── syntax
│   └── tex.vim
├── test
└── xclip
```
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with adding a listing like this is that it quickly becomes out-of-date because I (and other contributors) will forget to update it. Do we really need to list all of this?

What's the main intent? Perhaps the structure? How about taking it one step back and instead explain the intent of the directories themselves, and not the individual files? We can point the user to the relevant sections in the vim help docs (e.g. :help autoload, :help ftdetect, etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with adding a listing like this is that it quickly becomes out-of-date because I (and other contributors) will forget to update it. Do we really need to list all of this?

You're right. I've got another idea: Let's create a table of contents, which should represent the directory-structure of VimTex. So if someone VimTex/autoload/vimtex/compiler, than he/she just needs to click on this path in the TOC and gets a short description about the directory.

How about taking it one step back and instead explain the intent of the directories themselves, and not the individual files?

Aye!

We can point the user to the relevant sections in the vim help docs (e.g. :help autoload, :help ftdetect, etc).

Yes, I'd also like to add a link to this awesome book which taught me vimscript ;)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I've got another idea: Let's create a table of contents, which should represent the directory-structure of VimTex. So if someone VimTex/autoload/vimtex/compiler, than he/she just needs to click on this path in the TOC and gets a short description about the directory.

I'm not sure I fully understand... "So if someone VimTex/autoload/vimtex/compiler" - I think you forgot a verb in the sentence...?

Yes, I'd also like to add a link to this awesome book which taught me vimscript ;)

Yes, feel free to add a link in the code documentation resource. I agree it is a good resource!

So how does vimtex start? Well, it calls the `vimtex#init()` function at the
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that the plugin should be referred to as VimTeX (see latest release notes). :)

beginning, if you open a `tex` or a `bib` file (see in `ftplugin`). So let's
take a look, how vimtex initialises:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to make initialization into a sub section.

```vim
function! vimtex#init() abort " {{{1
if exists('#User#VimtexEventInitPre')
doautocmd <nomodeline> User VimtexEventInitPre
endif

call vimtex#options#init()

call s:init_state()
call s:init_buffer()
call s:init_default_mappings()

if exists('#User#VimtexEventInitPost')
doautocmd <nomodeline> User VimtexEventInitPost
endif

augroup vimtex_main
autocmd!
autocmd VimLeave * call s:quit()
augroup END
endfunction
```
So here're its steps:
1. `vimtex#options#init()`:
1. Create some new highlight-types, which are used in vimtex (for example,
use the color of a vim-error-msg for all vimtex errors).
2. Warn the user, if he/she is using deprecated settings
3. Save the settings of vimtex which are provided from the user or load its
default values (like `g:vimtex_compiler_enabled`)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is going in the right direction. The vimtex#options#init() is made available like this because I realized I sometimes needed it even when not really loading the full plugin (e.g. if you only want the syntax highlighting part).

I think I would say that setting the options are the main part and should be number 1 here, while defining highlight groups is "less important". Also, it is important to use correct names here: there is no such thing as vim-error-msg. There is a group called VimtexError, though.