Skip to content

Switch to a markdown server where internal (#) links work #615

Open

Description

@braughtg

Description

The current markdown server used for documentation (@mryhryki/markdown-preview) does not support internal links within a page.

Steps to Reproduce

  1. Open the documentation server
  2. Visit the "Documentation Guide"
  3. Click any of the links in the "Outline"

Observed Behavior

Clicking the link in the "Outline" has no effect. Specifically it does not take you to the intended section.

Expected Behavior

Clicking the link should take you to the intended section of the document.

bugInfo.bash Output

git remote -v
-------------
origin  https://github.com/FarmData2/FarmData2 (fetch)
origin  https://github.com/FarmData2/FarmData2 (push)
upstream        https://github.com/FarmData2/FarmData2 (fetch)
upstream        https://github.com/FarmData2/FarmData2 (push)

git log -1 | head -3
--------------------
commit 6d57886e550259872278053a62e556e68685510f
Author: Grant Braught <[email protected]>
Date:   Sun May 3 16:18:10 2026 -0400

cat ~/FarmData2/.fd2dev/db.conf
-------------------------------
v3.8.0
db.sample.tar.gz

docker ps (Images and Names)
----------------------------
farmdata2/nginx:fd2.1    fd2_nginx
farmdata2/farmos3:fd2.1          fd2_farmos
farmdata2/postgres:fd2.2         fd2_postgres

Further Details

This fix will require changing the dependency and docs:view script in package.json, regenerating package-lock.json. We should strongly consider pinning all of the versions of the dependencies in package.json so that external updates do not break when generating the package-lock.json.

Activity

  1. added
    bug
    on May 23, 2026
  2. Neha406-ui commented on Jul 6, 2026

    @Neha406-ui
    Contributor

    I reproduced the bug locally and also tested the latest version of @mryhryki/markdown-preview (0.8.23). The URL updates to the expected #anchor, but the page still doesn't scroll to the target section.

    Before I start replacing the preview server, is there a preferred replacement package you'd like contributors to use, or are we free to choose any Markdown preview server that supports internal anchor links while preserving the current workflow?

  3. braughtg commented on Jul 6, 2026

    @braughtg
    ContributorAuthor

    I do not have preference for the markdown preview replacement. A few things that I think would be ideal are:

    • Can be installed via npm as the current one is.
    • Uses GitHub flavored markdown.
    • Renders the existing document reasonably and supports the internal links.

    If you find several good candidates feel free to post them here and I'll be happy to have a quick look and see if anything jumps out.

  4. Neha406-ui commented on Jul 7, 2026

    @Neha406-ui
    Contributor

    I evaluated MarkServ as a replacement. It installs through npm, renders the existing documentation correctly with GitHub-style Markdown, and supports internal anchor links. Images and relative links also appear to work correctly. Unless you have concerns about using it, I'll prepare a PR with the dependency and docs:view updates.

  5. braughtg commented on Jul 7, 2026

    @braughtg
    ContributorAuthor

    MarkServ looks like a good solution to me. Give it a try and see how it works. Updating docs:view should be sufficient to start that server instead of the old one when a codespace is created or started.

    One other thing you'll want to check on is the postStart.bash script in .devcontainer. It uses some functions from bin/lib/checkServices.lib.bash to check that all of the servers are running when a codespace is created or started. The relevant code in checkServices.lib.bash may be specific to the current markdown server and thus may need to be updated.

  6. Neha406-ui commented on Jul 8, 2026

    @Neha406-ui
    Contributor

    I tested a few alternatives.

    • ** MarkServ** renders the documentation well and supports the existing links, but it brings in a snyk dependency that is causing installation issues in my environment.
    • serve-markdown-local didn't work with the FarmData2 documentation layout because it couldn't resolve the root markdown files correctly.
    • I also ran into an unrelated @vvago/vale installation error (ReferenceError: unzipper is not defined) on Windows, which prevents a clean npm install regardless of the markdown preview package.

    Before I continue evaluating more options, do you have a preferred direction? For example, would you prefer another npm-based preview package, or would a small in-repo markdown server (using libraries like markdown-it) be acceptable?

  7. braughtg commented on Jul 8, 2026

    @braughtg
    ContributorAuthor

    I have a strong preference for an npm installed preview package.

    You mention an issue on Windows. Are you trying to install the dev environment locally on your machine? Everything in the current dev environment is designed to run within a Codespace on Github which will run on a linux box. If you are not already, I'd suggest trying MarkServ in the dev environment Codespace and see if that resolves the snyk issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions