question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docs editUrl should accept a function to handle specific cases

See original GitHub issue

🐛 Bug Report

In v2 alpha 59, the “Edit this page” links for content docs are generated by joining the editUrl with the path setting. I am using a markdown preprocessor that generates files into the provided path, so I would like the edit links to point at the original files, not the generated ones.

Have you read the Contributing Guidelines on issues?

Y

To Reproduce

(Write your steps here:)

in presets:

  presets: [
    [
      '@docusaurus/preset-classic',
      {
        docs: {
          homePageId: 'intro',
          sidebarPath: require.resolve('./sidebars.js'),
          editUrl: 'https://github.com/scalapb/zio-grpc/edit/master/docs',
          path: '../zio-grpc-docs/target/mdoc'
        },

Expected behavior

The path setting doesn’t play a part in the edit url. In other words, the editUrl will look like https://github.com/scalapb/zio-grpc/edit/master/docs/intro.md

Actual Behavior

The generated edit url contains the path to the generated file (which is not checked in):

https://github.com/scalapb/zio-grpc/edit/master/zio-grpc-docs/target/mdoc/intro.md

Your Environment

Repository: https://github.com/scalapb/zio-grpc Markdown generator processes files in docs into zio-grpc-docs/target/mdoc. To invoke it, install sbt, and type: sbt docs/mdoc. Then cd to website and do a yarn start.

The docs dire

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:14

github_iconTop GitHub Comments

2reactions
slorbercommented, Jul 30, 2020

Would it work for you if the editUrl was a function that takes the absolute doc path, and then you return the edit url?

Something like:

        docs: {
          editUrl: (absoluteMDPath) => getMDEditUrl(absoluteMDPath),
        },
1reaction
thesametcommented, Jul 30, 2020

Getting a function would be fine, though I think it would be preferable to get the relative path to the docs directory - this way the function would get the same input in dev and on CI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

plugin-content-docs | Docusaurus
The edit URL will always target the current version doc instead of older versions. Ignored when editUrl is a function. routeBasePath, string, ' ......
Read more >
Pass parameters in Edit Url of jqGrid for Form Editing
In the case jqGrid will send to the server (to cellurl ) 3 parameters (see the documentation):. The editing data with the name...
Read more >
How to Edit Google Forms Responses in the Spreadsheet?
This tutorial shows you in steps how to add form response links to your spreadsheet and edit form responses right in your spreadsheet....
Read more >
Protocol Guide | Google Sites
Requests to the Google Sites Data API for non-public user data must be authorized by an authenticated user. The details of the authorization...
Read more >
US8914461B2 - Method and device for editing web contents by URL ...
In the relay server, the WEB server and contents data positions are specified based on the edit URL accessed from the WEB browser,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found