astoff / digestif

A language server for TeX and friends
Other
256 stars 6 forks source link

Enable tikz docstrings #37

Closed JensAc closed 3 years ago

JensAc commented 3 years ago

Hi Augusto,

I merged your old script with your newer one, and generated tag files for tikz and pgf. These are definitely not perfect. Yet, I think the docstrings could help, and experienced LaTeX users would be able to read them easily. Most probably you haven't been happy with a similar result in the past. However, you might want to have a look at this PR. I won't be disappointed, if you don't want to merge, but as I a already expected: it would consume too much time to get something perfect....at least for me.

astoff commented 3 years ago

Yeah, I think this doesn't look too bad, in fact. I have some further requests:

Okay, that was quite a lot... I hope you get the chance to try this some time. Thanks!

astoff commented 3 years ago

There's also the case of the path commands (\draw, \fill, etc.), which are heavily used but don't have a super enlightening docstring.

What do you think of copying the doctring of the corresponding key? This can be done by setting, for instance, commands.draw.details to "$ref:tikz#/keys/tikz/draw/details".

JensAc commented 3 years ago

Alright...Actually, I did not notice that there are issues with the links, as my starting point was the script on master. Seems like you have used another version of it for generating the tags files. I am on it, and will try to push commits related to your requests.

astoff commented 3 years ago

I think I modified tikz.tags and pgf.tags by hand when I changed my mind about some details of the tags file format, so these things are reflected in the script. But I promise I'll only used the script to update the data files in the future :-)

JensAc commented 3 years ago

So, I do not really get the points of the last two bullets. I feel like I am not using any inspect function.

There's also the case of the path commands (\draw, \fill, etc.), which are heavily used but don't have a super enlightening docstring. What do you think of copying the doctring of the corresponding key? This can be done by setting, for instance, commands.draw.details to "$ref:tikz#/keys/tikz/draw/details".

IMHO this would be missleading. If the docstring for the key is needed, one can check either the PDF or simply add another line to the LaTeX code, which calls the command including the key.

astoff commented 3 years ago

Hi Jens, I have a few modifications to suggest. Can you enable the option allow edits from maintainers?

astoff commented 3 years ago

Okay, I managed to push to your branch.

IMHO this would be missleading. If the docstring for the key is needed, one can check either the PDF or simply add another line to the LaTeX code, which calls the command including the key.

I've added this in such a way that the user sees the command short summary, and the long documentation from the key. Hopefully it's not confusing.

So I'll let you take a look if you agree with this and other changes, and then I'll merge.

JensAc commented 3 years ago

Looks fine for me. Thanks for your feedback. I am not really sure, whether we should really clean the command.details here, as a newline might make it a little bit more readable. However, that is only a minor (and pedantic) comment ;-).

JensAc commented 3 years ago

And...actually I set the pandoc output to plain on purpose, since this was removing the   lines in the tags file. For me the output appeared to be clean and formatted correctly with plain output instead of markdown_strict

astoff commented 3 years ago

I am not really sure, whether we should really clean the command.details here, as a newline might make it a little bit more readable.

The cleaning is for the summary, right? The summary field is supposed to be a single line. We can change the formatting of the Eldoc buffer if you have any suggestions.

And...actually I set the pandoc output to plain on purpose, since this was removing the   lines in the tags file. For me the output appeared to be clean and formatted correctly with plain output instead of markdown_strict

You said are using Eglot – do you have markdown-mode installed as well? In this case the backticks will disappear and become colors.

So I'll merge this now. Future improvements are always welcome.

Thanks!

JensAc commented 3 years ago

Alright, I am totally fine, with the current state! If I find any improvements during usage, I will file another PR.