fermyon / developer

This is the home for developer.fermyon.com
https://developer.fermyon.com
Apache License 2.0
51 stars 66 forks source link

Fix no copy code block and weird link #1270

Closed garikAsplund closed 4 months ago

garikAsplund commented 4 months ago

I think the example for <!-- @nocpy --> was off before--it had a copy block! Also there was a link that was kinda botched so fixed that.

When I run cat -ve <filename> | grep '^M' | wc -l I get 2 😞

Content must go through a pre-merge checklist.

Pre-Merge Content Checklist

This documentation has been checked to ensure that:

itowlson commented 4 months ago

@garikAsplund Are the CR characters on lines you've changed? Normally git takes care of this stuff - if you're on Windows and have autocrlf turned on then it shouldn't be an issue - and if you're on Linux or Mac then I'm not sure where they'd have come from!

garikAsplund commented 4 months ago

I'm on a Mac and was confused by it too! Hope it gets sorted out.

itowlson commented 4 months ago

Huh. I see three matches for the grep and they are all "M at the beginning of a line".

@tpmccallum any idea what's going on with that check?

@karthik2804 does Bartholomew really still get mad about CRs? could we fix it at source and make this check go away?

karthik2804 commented 4 months ago

@itowlson I am not sure if Bartholomew gets mad about CRs but if that is the case, we can take a leaf out of this PR and just make the CRs vanish (i.e) doc.replace{"\r", ""} which would cover both cases.

tpmccallum commented 4 months ago

Hi @garikAsplund Thanks for this contribution. A few updates: It looks like the cat -ve <filename> | grep '^M' | wc -l is actually matching on lines that start with upper-case M. This is not an issue. Apologies for the confusion. I will adjust the template so this is not a roadblock for others.

I see you have tried really hard to incorporate the no copy in the example. This is a tough task. Perhaps an image will do the trick. Please see how the latest commit to this PR adds an image and resolves this meta issue.

I am happy with this PR now. Just touching in with you to see if you agree. Thanks again for catching this and creating the PR. Really appreciate your contribution.

tpmccallum commented 4 months ago

Screenshot 2024-05-07 at 10 42 59

tpmccallum commented 4 months ago

The ol' extra backtick trick Screenshot 2024-05-07 at 11 06 57