Skip to content

[WIP] new render implementation at src/writer.jl:549 #259

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

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

Conversation

ajinkya-k
Copy link

fixes #237

@ajinkya-k
Copy link
Author

@asinghvi17 please review. meanwhile I am trying to figure out how i can test this

@asinghvi17
Copy link
Collaborator

I would just add it to the DocumenterVitepress docs, we don't actually have tests at the moment 😅

@ajinkya-k
Copy link
Author

okay. i might try to run my own test. I am sure I made some mistake

src/writer.jl Outdated
Comment on lines 569 to 571
_print(io, "\\t"^(level-1) * "[", id, "](")
latex(io, header.children)
_println(io, ")")
Copy link
Collaborator

@asinghvi17 asinghvi17 May 14, 2025

Choose a reason for hiding this comment

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

This is the other way around I think, we need the logic from

anchor_frag = Documenter.anchor_fragment(anchor)
anchor_frag = vitepress_anchor(anchor_frag)
url = replace(string(path, anchor_frag), " " => "%20")

and the underscores can be dropped from _print and _println.

It may be worth sticking to the original approach for the rendering here but we keep the rendering header.children instead. You can check what we do for lists in writer.jl to see how to do that inline. Since we need to strip the Markdown it may be nice to have the Markdown.plaininline stuff.

Copy link
Author

Choose a reason for hiding this comment

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

can you put that in as a suggested change? sorry for the inconvenience

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.

```contents renders the header id not header content
2 participants