Skip to content

Add CI job that checks for consistent @meta blocks in all md pages #4823

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

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

Conversation

lgoettgens
Copy link
Member

While looking through the diff of #4758, I noticed that many files have slightly different content in their @meta blocks. This PR adds a simple check that all of them coincide, and if not, prints out a list of files that need adaptation.

I deliberately did not attempt to fix these issue yet, as that would produce loads of conflicts with #4758.

@lgoettgens lgoettgens added documentation Improvements or additions to documentation CI labels Apr 23, 2025
@lgoettgens lgoettgens requested review from benlorenz and thofma April 23, 2025 15:22
@fingolfin
Copy link
Member

I'd rather wish we could just specify a single @meta block, in one place, and be done with it.... IIRC I had a Documenter.jl feature request for it. Perhaps we can submit a PR to Documenter...

meta = """```@meta
CurrentModule = Oscar
DocTestSetup = Oscar.doctestsetup()
```
Copy link
Member

Choose a reason for hiding this comment

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

Aren't there cases where we need the standard block plus something more? In that case it might be better to only match the first three lines?

Suggested change
```

for file in files
endswith(file, ".md") || continue
path = joinpath(dir, file)
if read(`head -n4 $path`, String) != meta
Copy link
Member

Choose a reason for hiding this comment

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

Maybe do this

Suggested change
if read(`head -n4 $path`, String) != meta
if read(`head -n$n $path`, String) != meta

and then set n to the number of lines in meta?

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

Successfully merging this pull request may close these issues.

2 participants