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 anchors to link json artifact #353

Merged
merged 5 commits into from
Jan 28, 2025
Merged

Add anchors to link json artifact #353

merged 5 commits into from
Jan 28, 2025

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Jan 27, 2025

Refactored LinkReference to use a dictionary for better anchor tracking and adjusted anchor validations. Added extensive test coverage, revamped test setup, and improved generator logic for markdown files.```

Several testing features are coming through in this PR too.

We can now bootstrap not just markdown fragments (Setup.Markdown) or full documents (Setup.Document) but also full virtual file system through Setup.Generate see:

static let generator = Setup.Generate [
    Index """
# A Document that lives at the root

*Welcome* to this documentation
"""
    Markdown "file.md" "*hello* world"
]

We can now also test different output markdown files explicitly

[<Fact>]
let ``validate file.md HTML`` () =
    generator |> converts "file.md" |> toHtml "<p><em>hello</em>world</p>"

We can now also do json diff testing similar to our html testing see #344 for more info about the better test failure messages.

[<Fact>]
let ``validate links.json`` () =
    generator |> convertsToJson ".artifacts/docs/html/links.json" jsonString

The text will be properly highlighted again:

image image

Lastly but most importantly we now actually call DocumentationGenerator().GenerateAll() just like docs-builder does.

The output of which now flows properly to test output so we can see it in test explorers in any IDE:

image

Refactored `LinkReference` to use a dictionary for better anchor tracking and adjusted anchor validations. Added extensive test coverage, revamped test setup, and improved generator logic for markdown files.```
@Mpdreamz Mpdreamz added the fix label Jan 27, 2025
@Mpdreamz Mpdreamz requested a review from reakaleek January 27, 2025 21:14
Copy link
Member

@reakaleek reakaleek left a comment

Choose a reason for hiding this comment

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

🔥

@Mpdreamz Mpdreamz requested a review from reakaleek January 28, 2025 11:07
@Mpdreamz Mpdreamz merged commit 9e7b896 into main Jan 28, 2025
5 checks passed
@Mpdreamz Mpdreamz deleted the fix/anchor-links-json branch January 28, 2025 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants