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

Add Docs.hasdoc #52139

Merged
merged 14 commits into from Dec 5, 2023
Merged

Add Docs.hasdoc #52139

merged 14 commits into from Dec 5, 2023

Conversation

jariji
Copy link
Contributor

@jariji jariji commented Nov 13, 2023

Add @stevengj's Docs.hasdoc from #51174.

check_documented still should be added but that can happen separately.

test/docs.jl Outdated Show resolved Hide resolved
@stevengj stevengj added domain:docs This change adds or pertains to documentation needs news A NEWS entry is required for this change labels Nov 17, 2023
@stevengj
Copy link
Member

stevengj commented Nov 17, 2023

Needs a NEWS.md item.

Should also be mentioned in doc/src/manual/documentation.md.

jariji and others added 3 commits November 17, 2023 10:21
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
NEWS.md Outdated Show resolved Hide resolved
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
@jariji
Copy link
Contributor Author

jariji commented Nov 18, 2023

I don't know why it's failing.

@stevengj stevengj added docsystem The documentation building system and removed needs news A NEWS entry is required for this change domain:docs This change adds or pertains to documentation labels Nov 20, 2023
@stevengj
Copy link
Member

The CI failures look like unrelated glitches in the test system.

@stevengj
Copy link
Member

stevengj commented Dec 4, 2023

@vtjnash, @malmaud, is this good to merge?

@vtjnash
Copy link
Sponsor Member

vtjnash commented Dec 5, 2023

Seems good to go

@vtjnash vtjnash merged commit 4209474 into JuliaLang:master Dec 5, 2023
7 checks passed
@LilithHafner
Copy link
Member

Late to the party here, but wouldn't has_docstring be a more appropriate name as that is what this function actually checks? (a function may be documented via a mechanism other than a docstring)

Also this function should be public.

@jariji
Copy link
Contributor Author

jariji commented Jan 3, 2024

a function may be documented via a mechanism other than a docstring

You mean it might be in the manual somewhere? I don't think I'd call a function "documented" if it doesn't have a docstring. Maybe others disagree?

@jariji jariji mentioned this pull request Jan 3, 2024
@LilithHafner
Copy link
Member

I was thinking about the other direction as well. If a function has a docstring but is not in the manual then, in Julia base at least, it is not considered "documented". E.g. the 1.10 API is defined in part with

Functions, types, and constants are not part of the public API if they are not included in the documentation, even if they have docstrings.

@jariji
Copy link
Contributor Author

jariji commented Jan 3, 2024

I'd kinda forgotten about that policy. Tbh I don't see the advantage of it.

I would think if a function is public it should be considered part of the API. I tend to think the manual is secondary to the experience of living in the runtime and using ? --- if it points me to a manual page, I'll read it for context, but I don't think it's good to have to check an external manual to know whether a public function-with-docstring is "documented" or "public" so I can rely on it. I'd prefer a policy where I can check the API status of a function easily from within the system.

@DilumAluthge
Copy link
Member

Late to the party here, but wouldn't has_docstring be a more appropriate name as that is what this function actually checks? (a function may be documented via a mechanism other than a docstring)

I also think that this should be named has_docstring, to reduce ambiguity.

@DilumAluthge
Copy link
Member

Late to the party here, but wouldn't has_docstring be a more appropriate name as that is what this function actually checks? (a function may be documented via a mechanism other than a docstring)

#52724

@stevengj
Copy link
Member

stevengj commented Jan 4, 2024

Late to the party here, but wouldn't has_docstring be a more appropriate name as that is what this function actually checks?

I disagree, for reasons stated in #52724 (comment) — this is in the Docs module, and in that context "doc" always refers to docstrings.

IanButterworth pushed a commit that referenced this pull request Jan 18, 2024
Making `Docs.hasdoc` `public` per @LilithHafner
#52139 (comment).

---------

Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Lilith Orion Hafner <lilithhafner@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docsystem The documentation building system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants