Skip to content

Commit

Permalink
Don't hash links (#17)
Browse files Browse the repository at this point in the history
* Don't hash links

* be better

* fix links finally

* typo
  • Loading branch information
asinghvi17 authored Feb 18, 2024
1 parent 6fe2857 commit c0090b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ jobs:
- name: Instantiate NPM
run: cd docs/; npm i; cd ..
#- name: Creating new mds from src
- name: Build and deploy
- name: Build and deploy docs
uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
GKSwstype: "100"
GKSwstype: "100" # for Plots.jl plots (if you have them)
JULIA_DEBUG: "Documenter"
DATADEPS_ALWAYS_ACCEPT: true
run: |
julia --project=docs/ --color=yes docs/make.jl # this should ideally AUTO-DEPLOY!
DATADEPS_ALWAYS_ACCEPT: true
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ features:

<p style="margin-bottom:2cm"></p>

<div class="vp-doc" style="width:60%; margin:auto">
<div class="vp-doc" style="width:80%; margin:auto">

<h1> What is DocumenterVitepress.jl? </h1>

Expand Down
18 changes: 9 additions & 9 deletions src/writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ end
# Headers
function render(io::IO, mime::MIME"text/plain", node::Documenter.MarkdownAST.Node, header::Documenter.AnchoredHeader, page, doc; kwargs...)
anchor = header.anchor
id = string(hash(Documenter.anchor_label(anchor)))
id = string(Documenter.anchor_label(anchor))
# @infiltrate
heading = first(node.children)
println(io)
Expand Down Expand Up @@ -507,24 +507,24 @@ end

# Documenter.jl page links
function render(io::IO, mime::MIME"text/plain", node::Documenter.MarkdownAST.Node, link::Documenter.PageLink, page, doc; kwargs...)
# @infiltrate
# Main.@infiltrate
path = if !isempty(link.fragment)
string(hash(link.fragment))
replace(Documenter.pagekey(doc, link.page), ".md" => "") * "#" * string(link.fragment)
else
Documenter.pagekey(io.doc, link.page)
Documenter.pagekey(doc, link.page)
end
print(io, "<a href=\"$path\">")
print(io, "[")
render(io, mime, node, node.children, page, doc; kwargs...)
print(io, "</a>")
print(io, "]($path)")
end

# Documenter.jl local links
function render(io::IO, mime::MIME"text/plain", node::Documenter.MarkdownAST.Node, link::Documenter.LocalLink, page, doc; kwargs...)
# @infiltrate
href = isempty(link.fragment) ? link.path : "$(link.path)#($(link.fragment))"
print(io, "<a href=\"$href\">")
path = isempty(link.fragment) ? link.path : "$(link.path)#$(link.fragment)"
print(io, "[")
render(io, mime, node, node.children, page, doc; kwargs...)
print(io, "</a>")
print(io, "]($path)")
end


3 comments on commit c0090b8

@asinghvi17
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/101106

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.0.1 -m "<description of version>" c0090b8e86e73787844155dcf5b04d6c84d3f0d1
git push origin v0.0.1

@asinghvi17
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Release notes:

This is the first release of DocumenterVitepress.jl, compatible with Documenter.jl v1.0! There are still some bugs and more will probably be caught pretty fast - hence the low version number.

Please sign in to comment.