Skip to content

chore: resolve broken and empty links across modelina documentation#2432

Open
Ishita-190 wants to merge 7 commits intoasyncapi:masterfrom
Ishita-190:ishi
Open

chore: resolve broken and empty links across modelina documentation#2432
Ishita-190 wants to merge 7 commits intoasyncapi:masterfrom
Ishita-190:ishi

Conversation

@Ishita-190
Copy link
Copy Markdown
Contributor

@Ishita-190 Ishita-190 commented Feb 6, 2026

Fixes: #2408
A previous attempt to fix this issue (#2416) was blocked due to TypeScript errors in the netlify build preview

Description

Fixed all broken, empty, and outdated links throughout the Modelina documentation to improve user experience and navigation.

Changes Made

  • docs/champions.md - Fixed empty anchor links for "Versioning and maintenance" and "Reviewing a PR"
  • docs/constraints/README.md - Fixed broken link to internal-model.md
  • docs/inputs/XSD.md - Fixed broken link to usage.md
  • docs/internal-model.md - Fixed empty anchor link, added missing "The Splitting of Meta Models" section
  • docs/languages/Java.md - Fixed broken integration.md link
  • docs/languages/Rust.md - Added missing content sections, fixed table formatting, removed link functionality from empty links
 Implement `From<String> (serde_json)`
 Implement `Into<String> (serde_json)`
 Implement `From<FramedByteStream> (tokio_serde)`
 Implement `Into<FramedByteStream> (tokio_serde)`
  • docs/other-tools.md - Fixed broken constrainer link
  • Updated all constraint files to fix:
    Broken input-processing.md links
    Constants.ts links missing /master/ in path
    Files affected: CSharp, Cplusplus, Dart, Go, Java, JavaScript, Python, Rust, TypeScript
  • docs/migrations/README.md - Updated migration links to absolute URLs
  • docs/migrations/version-0-to-1.md - Fixed ConstrainedMetaModel, ConstrainedObjectPropertyModel, and ConstrainedEnumValueModel links
  • docs/migrations/version-1-to-2.md - Fixed discriminator link and meta model link

Checklist

  • The code follows the project's coding standards and is properly linted (npm run lint).
  • Tests have been added or updated to cover the changes.
  • Documentation has been updated to reflect the changes.
  • All tests pass successfully locally.(npm run test).

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 6, 2026

Deploy Preview for modelina ready!

Name Link
🔨 Latest commit 64f958e
🔍 Latest deploy log https://app.netlify.com/projects/modelina/deploys/699b6642c6db0d0008897834
😎 Deploy Preview https://deploy-preview-2432--modelina.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Ishita-190
Copy link
Copy Markdown
Contributor Author

@jonaslagoni I've made the changes you requested in the other PR for this issue, please take a look and let me know if any other changes need to be made.

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 8, 2026

Pull Request Test Coverage Report for Build 21903770163

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 90.997%

Totals Coverage Status
Change from base Build 21874638391: 0.0%
Covered Lines: 6942
Relevant Lines: 7421

💛 - Coveralls

Copy link
Copy Markdown
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

When using code agents, always make sure you review your PR first :P

Remove PR_DESCRIPTION.md

@Ishita-190
Copy link
Copy Markdown
Contributor Author

Ah that's embarrassing, I've removed it now. Thank you for pointing it out 😄

@jonaslagoni jonaslagoni changed the title fix: resolve broken and empty links across modelina documentation chore: resolve broken and empty links across modelina documentation Feb 11, 2026
@sonarqubecloud
Copy link
Copy Markdown

// Use absolute links for anything relative and non-markdown related
content = content.replace(/\]\((\.(.*?))\)/g, '](https://github.com/asyncapi/modelina/blob/master/docs/.$2)');
// Handle ../ links specifically to resolve them correctly to GitHub URLs
content = content.replace(/\]\(\.\.\/(.*?\.md[^)]*)\)/g, '](https://github.com/asyncapi/modelina/blob/master/docs/$1)');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is incorrect.. Relative links in majority of the case should work (if they are docs) relatively on the website too :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Working on it, could you please confirm if this works?

function prepareContent(content, currentRelativePath = '/docs/README.md') { 
  content = content.replace('<!-- toc is generated with GitHub Actions do not remove toc markers -->', '');
  content = content.replace('<!-- toc -->', '');
  content = content.replace('<!-- tocstop -->', '');
  const normalizedCurrentPath = currentRelativePath.replace(/\\/g, '/');
  const currentDir = path.posix.dirname(normalizedCurrentPath);
  
  // Resolve relative links based on the current docs file path
  content = content.replace(/\]\(((?:\.\.\/|\.\/)[^)]+)\)/g, (fullMatch, relPath) => {
    const [, relativePathWithoutSuffix = relPath, suffix = ''] = relPath.match(/^([^?#]+)([?#].*)?$/) || [];
    const resolvedPath = path.posix.normalize(path.posix.join(currentDir, relativePathWithoutSuffix));
    if (/\.md$/i.test(relativePathWithoutSuffix)) {
      const docsPath = resolvedPath
        .replace(/\.md$/i, '')
        .replace(/\/README$/i, '')
        .toLowerCase();
      return `](${docsPath || '/docs'}${suffix})`;
    }
    return `](https://github.com/asyncapi/modelina/blob/master${resolvedPath}${suffix})`;
  });
  
  content = content.replace(/\]\(\/docs\/(.*?)README(?:\.md)?([^)]*)\)/gi, (fullMatch, folderPath, suffix) => {
    const normalizedFolderPath = folderPath.replace(/\/$/, '');
    return `](/docs/${normalizedFolderPath}${suffix})`;
  });

  // Use correct example links
  content = content.replace(/\]\((.*?)examples\/(.*?)\/?\)/g, '](/examples?selectedExample=$2)');
  content = content.replace('/examples?selectedExample=integrate-with-react', 'https://github.com/asyncapi/modelina/tree/master/examples/integrate-with-react');
  content = content.replace('/examples?selectedExample=integrate-with-next', 'https://github.com/asyncapi/modelina/tree/master/examples/integrate-with-next');
  content = content.replace('/examples?selectedExample=integrate-with-maven', 'https://github.com/asyncapi/modelina/tree/master/examples/integrate-with-maven');

  // Replace all references to local images for docs
  content = content.replace(/"(.*?)\/img\/(.*?)"/g, '"/img/docs/$2"');

  return content;
}

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.

[Docs Bug 🐞 report]: multiple broken and empty links across /docs

3 participants