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

docs: Fix highlighting in examples #195

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Conversation

jmgate
Copy link
Collaborator

@jmgate jmgate commented Sep 12, 2024

Type: Documentation

Description

I never noticed when we added the license and copyright information to the top of all the source files that we didn't account for the lines highlighted in the included examples. This adjusts things such that (1) we don't include all that header stuff when generating the docs, and only include the lines of code that are really relevant to share on the examples page, and (2) the appropriate lines are highlighted.

Related Issues/PRs

Closes #194.

Motivation

We need the docs to be accurate so potential new users don't get confused when coming up to speed.

Screenshots/Recordings

Before:

Screenshot 2024-09-12 at 4 46 27 PM

After::

Screenshot 2024-09-12 at 4 50 50 PM

@jmgate jmgate self-assigned this Sep 12, 2024
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.04%. Comparing base (04cf2cc) to head (149e48c).
Report is 89 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #195   +/-   ##
=======================================
  Coverage   94.04%   94.04%           
=======================================
  Files           2        2           
  Lines         168      168           
  Branches       43       43           
=======================================
  Hits          158      158           
  Misses          4        4           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

I never noticed when we added the license and copyright information to
the top of all the source files that we didn't account for the
lines highlighted in the included examples.  This adjusts things such
that (1) we don't include all that header stuff when generating the
docs, and only include the lines of code that are really relevant to
share on the examples page, and (2) the appropriate lines are
highlighted.
@jmgate jmgate force-pushed the 194-fix-highlighting-in-examples branch from ecd21e4 to 149e48c Compare September 12, 2024 22:51
@jmgate jmgate requested a review from william76 September 12, 2024 22:53
@jmgate
Copy link
Collaborator Author

jmgate commented Sep 12, 2024

@william76, you want to give this a quick once-over and approve? Just ensure the highlighting in all the built examples looks right to you.

@jmgate
Copy link
Collaborator Author

jmgate commented Sep 16, 2024

@GhostofGoes, you mind giving this a quick review and approval?

@jmgate jmgate requested a review from GhostofGoes September 16, 2024 14:09
Copy link
Collaborator

@GhostofGoes GhostofGoes left a comment

Choose a reason for hiding this comment

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

LGTM. In the future, you could use comments as markers for start/end, instead of manually specifying lines.

@jmgate jmgate merged commit 25527b5 into master Sep 16, 2024
14 checks passed
@jmgate jmgate deleted the 194-fix-highlighting-in-examples branch September 16, 2024 21:07
@jmgate
Copy link
Collaborator Author

jmgate commented Sep 16, 2024

That sounds spiffy. Can you give me an example of what that looks like?

@GhostofGoes
Copy link
Collaborator

GhostofGoes commented Sep 16, 2024

That sounds spiffy. Can you give me an example of what that looks like?

That sounds spiffy. Can you give me an example of what that looks like?

https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-literalinclude

"Another way to control which part of the file is included is to use the start-after and end-before options (or only one of them). If start-after is given as a string option, only lines that follow the first line containing that string are included. If end-before is given as a string option, only lines that precede the first lines containing that string are included. The start-at and end-at options behave in a similar way, but the lines containing the matched string are included.

start-after/start-at and end-before/end-at can have same string. start-after/start-at filter lines before the line that contains option string (start-at will keep the line). Then end-before/end-at filter lines after the line that contains option string (end-at will keep the line and end-before skip the first line)."

I don't have an example that can be shared publicly unfortunately.

@jmgate
Copy link
Collaborator Author

jmgate commented Sep 17, 2024

Holy cow—why didn't I see that before? I'll file an issue to make that change on a rainy day. Thanks so much 😃

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.

Fix highlighting in examples
2 participants