eecs485staff / primer-spec

A Jekyll theme for sites with content-heavy pages
https://eecs485staff.github.io/primer-spec/
MIT License
22 stars 12 forks source link

specify starting line number in enhanced code block #173

Closed eecs441staff closed 2 years ago

eecs441staff commented 2 years ago

Is your feature request related to a problem? Please describe. When the narrative breaks up a block of code into multiple code blocks, it would be useful to start subsequent code blocks' line number not at 1.

Describe the solution you'd like To specify a starting line number with each enhanced code block: {: data-variant="enhanced" start-at="21" }

Describe alternatives you've considered Could be: {: line-number-start-at="21" } but prefer shorter variable name.

eecs441staff commented 2 years ago

On second thought, it's very hard to keep the starting line numbers synch with the actual code. Students may find it confusing when the line numbers don't match up. So I'm withdrawing this suggestion.

seshrs commented 2 years ago

it's very hard to keep the starting line numbers synch with the actual code

I was wondering the same thing! It's actually quite easy for me to implement, but like you said, I feel like it might be hard for spec authors to maintain.

I personally think of line numbers in code blocks as a way to reference them (for instance, a student on Piazza might say, "I don't understand why we need to do X on line 7"). That said, I can also imagine it's confusing when the code is a subset of an actual starter file.

I guess like you mentioned in previous feedback, this is a good use-case for the data-variant="no-line-numbers" (#165).