-
Notifications
You must be signed in to change notification settings - Fork 630
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
Update the docs: extending.rst and optlib.rst sections #1826
Conversation
Any comments/issues with this PR? If not I'd like to merge it in. (I have more things to add to |
Could you wait till next week? |
Sure, of course. |
I will concentrate on this important PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for updating this document.
I have one request. I don't remove the sentence about the cork API.
I wonder why you put python
and/or perl
after .. code-block::
. I don't want to use it just for highlighting regex patterns.
I'm thinking about extending rst parser to run another parser inside code blocks.
If we use .. code-block::ctags
, the rst parser can schedule to run ctags optlib parser to the blocks.
Anyway, thank again.
passed in command line. | ||
|
||
Following file is an example of option file. | ||
|
||
.. code-block:: | ||
.. code-block:: python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why python?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember for this particular code block, but I generated the HTML for each of them while trying various highlighters sphinx/pygment/whatever has built-in support for, and picked the ones that looked the best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember now - when you build the docs into html, you get warnings if the code-block language highlighting fails. For this particular code block, perl
failed but python
worked while still looking ok.
@@ -81,98 +103,101 @@ Quoted from man page of Exuberant-ctags:: | |||
use new lines to indicate separate command-line | |||
arguments. | |||
|
|||
Let me explain the differences and their intentions. | |||
What follows explains the differences and their intentions... | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder ...
is needed here. Just .
is not enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a single dot .
is enough - using three is less formal, and not necessary.
e extend | ||
i icase | ||
=========== =========== | ||
.. code-block:: perl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use perl here?
For highlighting the regex patterns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shows fairly nicely in the generated HTML.
|
||
NOTE: Giving a scope long flag implies setting `useCork` of the parser | ||
to `TRUE`. See `cork API`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could keep the above sentence about cork ?
I think the sentence helps a developer understand u-ctags internal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But an optlib developer (i.e., a person who creates optlib files) does not need to know anything about it, and will be confused why they should care. I mean it's just an internal implementation detail, like setting the parserDefinition.method
flag METHOD_REGEX
. No?
This is an example of something that confused me when reading the doc the first time: who's the target audience? Is it general users of ctags and authors of optlib files, or is it for C-code developers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though I have not written well as I expect, this document is for rather C-code developers.
I assume optlib developers (== general users) read ctags-optlib.7 man page.
I will write more about this topic in #1835.
|
||
.. Q: this was fixed in https://github.com/universal-ctags/ctags/pull/331 | ||
so can we remove this section? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can remove this section because I wrote this to man/ctags-incompatibilities.7.rst.in.
I marked .. IN MAN PAGE
when I wrote the topic to our man pages.
In the case, we can remove it. I planed removing all the marked topic when releasing 6.0.
However, you can remove some of them now.
That name seems like an internal detail. Users of ctags never see that | ||
name anywhere except in these docs, and it's weird. How about | ||
"specified" option files, or "requested" or some such? (i.e., the file | ||
is explicitly specified or requested when ctags is run) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
The idea behind the term "optlib" is written at the head of man/ctags-optlib.7.rst.in.
|
||
.. Q: why even discuss the single-character version of the flags? Just | ||
make everyone use the long form. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong reason.
The single character version (letter version) like i
may be still used by users.
It is still useful if a flag is still appears frequently in a .ctags file.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
...................................................................... | ||
|
||
.. Q: what is the point of documenting this? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove this section.
start position of the whole regex pattern). You do not need to add it for | ||
the multi-table ``--_mtable-regex-<LANG>``. | ||
|
||
.. Q: isn't the above restriction really a bug? I think it is. I should fix it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it looks a bug.
Can I ask you to open an issue with an example (or .b
unit test).
|
||
.. Q: this was previously titled "Byte oriented pattern matching...", presumably | ||
because it "matched against the input at the current byte position, not line". | ||
But that's also true for --mline-regex-<LANG>, as far as I can tell. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I agree.
Yes it was mostly for highlighting the regex, but also it makes the
Yes, a pygment or whatever parser for ctags optlib format in rst files would be really nice! |
I will make a reply for #1835 first. |
@hadrielk, could make a separated commit for changing the |
Though I made some comments, I will merge this; the change makes the document much better. |
Thank you very much. |
This is a first pass at updating the optlib.rst doc (and minor stuff for extending.rst).
There's still more to do, but I thought this is a big enough change to get some feedback on.
There are also a few open questions I had, which I added as comments in optlib.rst, marked
.. Q:
.Feedback would be great. Even if it's: "this is crap".