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

fix: make description consistent with link-external-filter example code #1332

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mcanouil
Copy link
Contributor

@mcanouil mcanouil commented Sep 15, 2024

The pull request fixes an inconsistency in the example description, making it consistent with the example code.

Fixes quarto-dev/quarto-cli#10780

+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `link-external-filter` | A regular expression that can be used to determine whether a link is an internal link. For example |
| | |
| | `^(?:http:|https:)\/\/www\.quarto\.org\/custom` |

Choose a reason for hiding this comment

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

The "custom" in this example looks a bit weird imho. It's not a common url part. Why not make it a little more concrete and self-explanatory by changing it to be about www.quarto.org/docs or something alike?

And to be really nitpicky: I would also change the domain to something non-quarto, e.g. www.example.com, which is designed for exactly these kind of things

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 issue was that it was not consistent. Changing "custom" to "docs" or "whatever" does not change/improve anything. Same as using example.com.

Choose a reason for hiding this comment

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

does not change/improve anything.

  • changing /custom to /docs improves the familiarity and self-explanatory nature of the snippet (I've never seen /custom being used as top-level path components in docs)
  • changing quarto.org to example.com makes it more clear that you have to put your own URL there, not the URL of the software you are using. The domain example.com is explicitly being defined for documentation purposes like this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

example.com does not have pages beside index.html.

You seem to want to restrict the example to be what you know/expect rather that for it to be whatever regular expressions allows.
It's a regular expression, if "you" don't understand what it is, using example.com or quarto.org/docs in the example won't change anything.

Here, Carlos' comment applies:

The confusion can be solved by experimenting with the option, and understanding regexes are necessary to using them.

I won't make changes here until one of the maintainers makes a review.
As I said, the goal is was to fix the inconsistency and not to change the whole example.

Choose a reason for hiding this comment

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

Nevermind. I was just trying to help improve the docs based on my first hand experience trying to make sense of the example.
And I have plenty of regex experience, that wasn't even the issue to begin with.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be clear, what I'm saying is that I don't want to make more changes without having the feedback of the maintainers first, not that your feedback is not valuable.

@soxofaan
Copy link

also note that this example is repeated at

"name": "link-external-filter",
"description": "A regular expression that can be used to determine whether a link is an internal link. For example, \nthe following will treat links that start with http://www.quarto.org as internal links (and others\nwill be considered external):\n\n```\n^(?:http:|https:)\\/\\/www\\.quarto\\.org\\/custom\n```\n"
which also has to be addressed I think

@mcanouil mcanouil changed the title fix: make example description consistent with example code fix: make description consistent with link-external-filter example code Sep 16, 2024
@cderv cderv requested a review from cscheid September 16, 2024 14:16
@cscheid
Copy link
Collaborator

cscheid commented Sep 16, 2024

which also has to be addressed I think

For everyone's sake, quarto-web/docs/reference/formats/html.json is autogenerated by tools/reference.ts, which is updated by quarto run tools/reference.ts, as described on our README.

So the workflow here is we first fix the schema files (that's quarto-dev/quarto-cli#10806), then we run the command above, and do a separate PR here with the results here.

@mcanouil
Copy link
Contributor Author

Indeed for the reference pages.
Also why this PR only changes the hardcoded example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing link-external-filter example
3 participants