-
Notifications
You must be signed in to change notification settings - Fork 424
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
Merge documentation of "command-line" and "configuration" options (Issue #469) #473
Conversation
I am adding the file to the git repository to track and review the changes to this generated file. I will then update the XSLT transformation which produces this file to remove duplicate sections. As a first step, I will stop outputting duplicate sections; I will then merge them into existing sections. I will commit the changes to the generated file at each step. Related issue: htacg#469
The rendering to text was done with following command: /usr/bin/groff -Tascii -mandoc -c tidy.1 This format should make the review of differences more readable. Related issue: htacg#469
The new SYNOPSIS expresses the fact that multiple files can be provided as argument, and that options and files can be mixed (options apply only to the files specified after, not the ones before). It does not explain that there are actually two types of options; this shall be detailed afterwards: simple options (aka standard options) start with single dash while configuration options start with a double dash. Only the latter can be defined in configuration files, using their name without the double dash. I have also reformatted the terms 'options' and 'file' to be underlined, to follow conventions that I observed in other man pages (ls, grep, wget...) Related issue: htacg#469
This is an intermediate step before adapting the text to its new location. I will probably start the section with a paragraph to introduce the two different kinds of options. Then describe the "standard" options in more details. Then list the standard options. Then describe the configuration options in more details. Then list the configuration options, using a format similar to the one used for standard options. Related issue: htacg#469
The section now starts with a description of both types of options, and explains that the first part of the section concerns with the "standard" options while the second part of the section concerns with the "expanded" options. More details are provided about "standard" options, which are then listed individually. More details are then provided about "expanded" options and their usage on the command line and in configuration files. The configuration options are not listed yet. In order to avoid repeating a lot of information with every separate configuration option, I will first describe common values and formats; I will then describe each option more succinctly, like "standard" options. Related issue: htacg#469
The fact that the input file defaults to standard input and the output file to standard output is already indicated in the DESCRIPTION section. This was the only information left in this section at this point. Related issue: htacg#469
The line used to separate "standard" usage from "extended" usage. Both forms are now integrated in the common description of OPTIONS. Related issue: htacg#469
The detailed configuration options are now described together with standard options in a common OPTIONS section. Related issue: htacg#469
A single generalized SYNOPSIS now encompasses both kinds of options. Related issue: htacg#469
The WARNING referred to a separate section for the description of "standard" options. They are now described in the same OPTIONS section as "extended" options. Related issue: htacg#469
Just before listing all the configuration options, this is the expected place to describe the "extended" options in more details. The description was already worded as an introduction to the list of configuration options. I will update this description after having compacted entries which describe individual configuration options. Related issue: htacg#469
This section has been merged into the generalized OPTIONS section. Related issue: htacg#469
This list is very long, with lots of duplicate information repeated for entries of the same type. The description of configuration options should be compacted to match as closely as possible the description of "standard" options. Related issue: htacg#469
I contained the list of configuration options, which is now included at the end of the generalized OPTIONS section. Related issue: htacg#469
The template was now empty. Its contents have been merged into the cmdline-section template. Related issue: htacg#469
The sentence listed the five categories of configuration options. This kind of made sense when the options were listed in the following section. Now that they are listed just below, it has become redundant. Related issue: htacg#469
The categories of "standard" options do not end with a colon; no title does actually. Related issue: htacg#469
For consistency with usage, sentences within paragraphs shall be separated by a double space rather than a single space. This was done in most places in the document, with only a few places missing. Related issue: htacg#469
The comment refers to cmdline section at the start of the processing of configuration options. The cmdline options are opposed to config options in the context of this transformation. They are provided through two separate XML input files. Related issue: htacg#469
Related issue: htacg#469
@eric-brechemier have reviewed this WIP, and it is looking great... some little points... SYNOPSISI like you have reduced this to one(1) single simple line, as it should be... but maybe it should read like -
But maybe the additional square braces are too much, too And in fact maybe it could be reduced to just I have never really used, or tested, this multiple In any batch, or scripted processing, I can understand having one set of options applied to a big list of files, although again, you do not know which actual file caused the exit value... but to then change the options for another file, or files, does not seem to make much sense... But ok, maybe this is not the place or time to discuss this quite unique multiple As stated, I am happy with the single line, with, or without, the addition square braces, as it is... OPTIONSAgain it is great that you have added a good description, clearly pointing out tidy has two types, And I like that, for most single dash, And maybe it would be too much if each double Temporary FilesYes, thanks for making this effort, to be able to read them in a non-nix system... But in *nix I found I could just compile tidy in say build/cmake, and view the results with And I certainly hope others, espceially @jidanni, can do this, and offer his comments, since he opened #469. I do understand that he wants to use only released tidy in production, but as stated this great new man page change does not need to be installed - just in a few mintues -
So I think these 'temporary' files can be remove, but as stated, thanks for the thought... Multiple, multiple commitsWhile I have no real problem with this as you were developing the change, but hopefully the final PR is essentially only one commit, since as far as I can see it only effects one file, man/tidy.xsl.in... You would probably need copy your final modified But, as stated, not really a problem... Other possible changes
So, as stated, this is a sterling effort... look forward to the final... thanks... |
SYNOPSIS
Maybe not pedantic, but definitely confusing in a lispy way. I'll think about it.
This is the option taken by
but then they have a special parameter to separate options that are related to one URL from the next:
while in the case of
It may be useful when using a wildcard from the shell: |
OPTIONS
Ah, good point. Some options are available in both flavors. That deserves at least a mention when it is the case. I will look into it. |
Temporary Files
I looked long and large for this option, which is simply not available in macOS's Multiple, multiple commits
Sure, I will squash the commits into one, leaving no trace of the temporary files. Apparently, it is also possible to do it directly from GitHub interface when you merge the branch. |
This puts it in the position expected on the command line. Related issue: htacg#469
I tried different formats for the default value: --clean Boolean:no --clean Boolean[no] and more formats after I realized that the 'default' value is not applied when the value is omitted, but when the option is not used at all: --clean Boolean (initially: no) --clean Boolean (unset: no) I selected the less confusing format: --clean Boolean (no if unset) which is self-explanatory. Related issue: htacg#469
For example, using --clean without a value is not equivalent to using -clean option: curl -s https://www.google.com | tidy --clean 2>&1 1>/dev/null | head -n 1 results in: Config: missing or malformed argument for option: clean Related issue: htacg#469
I revisited this issue and enhanced the wording in 29215e3. The terms are now in line with the descriptions of |
I gave more thought to this. I noticed that the documentation of some command-line options includes an equivalent configuration option and value, in the For example:
Therefore, a configuration option alone is not equivalent to using a command-line option: it is a pair option+value that must be used. This could justify having references only in one direction from command-line options to configuration options, and no references back. If we do want to include the references from configuration options back to command-line options, mixing both kinds of options in the 'See also' section, we should use the same mechanism currently used to refer only to the double dash options, using
We could change the format of
This would allow to mix references to both kinds of options:
Which would result in: See also: |
This is consistent with the format used at the top of the description of configuration options. Related issue: htacg#469
The 'seealso' comes last actually, after the description.
…cters) This makes no change on the text generated by /usr/bin/groff -Tascii -mandoc -c tidy.1 > tidy.1.txt
Otherwise, the description starts with an empty line when no Example section is present. Related issue: htacg#469
Using a template match instead of a named template, I will then add rules with higher priority to ignore examples for certain types of values, which are very redundant (identical for all options of the same type). Related issue: htacg#469
Examples for Boolean and AutoBool are redundant because they are described in the main text and identical for all options of that type. Examples for Tag names are redundant because they are redundant with the name of the Type, and identical for all options of that type. Examples for Integer are redundant because they are identical for all options of that type but one, where the value 0 is followed with a comment, but even in this case the examples are redundant because the comment for the value 0 is also included in the description. Related issue: htacg#469
I also updated the description related to 'Examples' section in the introduction paragraphs to the configuration options. Related issue: htacg#469
Previously, a mix of * Type set in bold font * Type set in regular font * "types" (quoted) * types (unquoted) was found. I replaced all instances by Type in regular font. Related issue: htacg#469
Both parameter names and values are now in bold, while keys and values for configuration files are in italics. Related issue: htacg#469
The subsection is now flush left, in regular font, like the 'Supported values' subsection. The previous format was less adequate when the list wrapped to the next line (--new-inline-tags): wrapping started on the very first column, breaking the alignment of the rest of the description. Related issue: htacg#469
Parts of the file were indented with 2 spaces, others with 3 spaces. Parts of the templates were separated with two empty lines, others with a single one.
@geoffmcl the PR is ready for review. |
Note: I still need to delete the temporary |
@eric-brechemier ok, have pulled your fork, As far as I can see, so far this is only modification of one file, And if I read, and understand things correctly, as a further enhancement, you would now like to modify the Like I see in the code - I certainly like the idea the we could have xml ouput of -
which in turn would add See also: But is it convenient to separate this as a further, separate step? Regards, geoff. |
@geoffmcl Agreed. It's a wrap! I noticed a few other things that I would like to improve; let's open separate issues for further enhancements. I have removed the temporary files from the branch. |
@eric-brechemier yes, it's a wrap, even if we do not get another unix reviewer... Just about out of time tonight, but tomorrow, or soonest, will merge this using the special Be back soonest... thanks And look forward to your further enhancement as a separate issue... thanks... |
@eric-brechemier seems the |
I finished opening new issues for the improvements that I wanted to suggest:
|
I have generalized the SYNOPSIS and the description of OPTIONS to cover both "standard" options and "extended" configuration options in the same sections of the documentation.
I have modified the XSLT transformation which generates the man page. I have also added two temporary files, the generated man page (source) and the formatted text (for display in terminal) generated by
groff
.The latter is best viewed in a terminal, e.g. using
less tidy.1.text
to view the file, orgit log -p tidy.1.txt
to review the effect of individual commits on the resulting document.This is a work in progress submitted for preliminary review and discussion.
Before this branch is merged, I intend to simplify the description of each configuration option to avoid repeating information, make entries shorter and similar in format to the description of standard options. I will also delete the temporary files once the review has been completed.