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

Add path annotation for codeblock #2610

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

izissise
Copy link

@izissise izissise commented Aug 11, 2024

https://zola.discourse.group/t/allow-to-specify-path-associated-with-a-codeblock/2253

Sanity check:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

@izissise izissise changed the base branch from master to next August 11, 2024 15:31
@Keats
Copy link
Collaborator

Keats commented Aug 14, 2024

What's the main usage for it? Is it be displayed or retrieve by the frontend?

@izissise
Copy link
Author

For now I use it like so:

pre code[data-path]:after {
  border-radius: 0 0 0.25rem 0.25rem;
  font-size: 12px;
  letter-spacing: .025rem;
  padding: .1rem .5rem;
  position: absolute;
  left: 5.5rem;
  margin-top: 0;
  text-align: right;
  top: 0;
  content: attr(data-path);
  background: lightgrey;
  color: green;
  visibility: visible;
}

I find useful to have the required file path associated with the code block when blogging about specific tool configuration. Some tools expect configuration at pre determined paths

@Keats
Copy link
Collaborator

Keats commented Aug 21, 2024

I agree it's nice, I'm just wondering if it doubles as the code sample name as well potentially?

@Keats
Copy link
Collaborator

Keats commented Aug 21, 2024

Ah can you rebase the PR? It looks like it's got some unrelated stuff due to the last release

@izissise
Copy link
Author

Yes I agree it could be the name. I can change path to name as you prefer

@izissise
Copy link
Author

I rebased the branch

@Keats
Copy link
Collaborator

Keats commented Aug 26, 2024

Let's call it name, this way it can be used for more stuff.

@izissise
Copy link
Author

Should be good :)

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.

2 participants