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 pagetitle for minutes and motions #414

Merged
merged 2 commits into from
Sep 30, 2024
Merged

Conversation

Nanush7
Copy link
Member

@Nanush7 Nanush7 commented Aug 21, 2024

Fixes #398

I'm not a bash expert, but I think this solution should be fine.

Note that I used (([a-zA-Z0-9.\-]|[[:blank:]])+)\.md to match the filename. I tried [a-zA-Z0-9.\- ], [a-zA-Z0-9.\-\ ] and [a-zA-Z0-9.\-\s], but none of those worked (with docker) to match spaces in the filename. That's why I added [[:blank:]].

Anyway, it can be as simple as (.+)\.md, but I guess the complex regex should be safer.

@Nanush7 Nanush7 requested a review from dmint789 August 21, 2024 15:43
@Nanush7 Nanush7 self-assigned this Aug 21, 2024
@Nanush7 Nanush7 requested a review from a team as a code owner August 21, 2024 15:43
@dmint789
Copy link
Member

Hmm, I'm wondering if it would be easier to just use the intended document title as the first line, and just remove that line during the build step. OR we can straight up try using some HTML meta tag in the markdown directly, and the meta tag would include the document title.

@dmint789
Copy link
Member

dmint789 commented Aug 24, 2024

Alright, I just tried the <title> tag idea, and it doesn't work. But the other idea is feasible. We could make it so it either uses the first line, if it starts with a # or, if the first line doesn't start with a #, it parses a first line like this and removes it during the build process: {document_title="DRAFT MINUTES OF ANNUAL MEETING OF THE MEMBERS OF WORLD CUBE ASSOCIATION"}.

@Nanush7
Copy link
Member Author

Nanush7 commented Aug 24, 2024

I mean, if we want the easiest approach, then we probably want the current proposal, which requires zero changes to the actual documents.

Any reason why you don't feel comfortable with it?

@dmint789
Copy link
Member

I mean, if we want the easiest approach, then we probably want the current proposal, which requires zero changes to the actual documents.

Any reason why you don't feel comfortable with it?

Actually, I guess your options isn't bad, but I'm not a fan of limiting it to just the motions and minutes. I think instead we should check if a normal # title exists, and if not, just use the file name, as you've done here.

@Nanush7
Copy link
Member Author

Nanush7 commented Aug 31, 2024

The problem is that a normal # title exists for motions, but it's not the title we want. # SUBMISSION OF PROPOSED MOTION.

@dmint789
Copy link
Member

dmint789 commented Sep 1, 2024

Oh, makes sense now

bin/build.sh Outdated Show resolved Hide resolved
@Nanush7 Nanush7 requested a review from dmint789 September 4, 2024 00:59
@dmint789
Copy link
Member

dmint789 commented Sep 5, 2024

@thewca/software-team could someone from the WST please review this?

@Nanush7
Copy link
Member Author

Nanush7 commented Sep 17, 2024

@thewca/software-team ?

@dmint789
Copy link
Member

@gregorbg would you mind approving this?

@Nanush7 Nanush7 merged commit 5008100 into thewca:master Sep 30, 2024
1 check passed
@Nanush7 Nanush7 deleted the fix-pagetitle branch September 30, 2024 12:35
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.

Document titles showing unrendered styling text in browser
3 participants