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

Missing documentation regarding git based links and how they are treated when converted to Confluence page #55

Open
prokod opened this issue Jan 16, 2021 · 5 comments · May be fixed by #181
Labels

Comments

@prokod
Copy link
Contributor

prokod commented Jan 16, 2021

Hi @kovetskiy

I have looked at #25 and in the README, but I could not find clear enough explanation on how the behavior got changed/enhanced after #25 got merged.

Any details regarding what to expect and how to design an MD file to auto generate correct links, especially those links that refer to other MD files in the same git repo, will be most appreciated

@kovetskiy kovetskiy added the docs label Jan 18, 2021
@kovetskiy
Copy link
Owner

@prokod Hi

Here is a thing — this feature is still in a half-working state because it doesn't work perfectly out of the box.

For example, we want to have a link between alice.md and bob.md:

alice.md

<!-- Space: MARKTEST -->
<!-- Parent: mark -->
<!-- Title: Alice -->

Hello.
Here is the link on Bob: [bob](bob.md)

bob.md

<!-- Space: MARKTEST -->
<!-- Parent: mark -->
<!-- Title: Bob -->

Alice: [alice](alice.md)

If you run mark against alice.md and bob.md you will see two different results.

The confluence page called Alice will have a link to https://bob.md because the content of bob.md is not in Confluence at this moment, so Mark was not able to find it there and just put the link "as is".

image

Running mark against bob.md now will generate a correct link because mark will be able to find the Alice page in Confluence by the space/parent/title.

image

Therefore, you'll need to run mark against alice.md again to get the expected result.
image

This feature works without bugs, it's just the way how mark works — it deals with single files instead of dealing with a set of files.

But it still kind of sucks and I don't know how to deal with it yet. Calling mark twice is definitely not a good solution.

@prokod
Copy link
Contributor Author

prokod commented Jan 18, 2021

@kovetskiy Thanks! this explanation is clear now. Thx again!

@prokod
Copy link
Contributor Author

prokod commented Jan 18, 2021

@kovetskiy Hi again,

What about the working dir you run the tool from and the links created ?
I have the following tree:

|-roor-dir
  |- README.md
  |- dir-a
    |- dir-b
       |- toc.md
       |- chapter-a.md
  • README.md has inside it a link to toc.md -> this works fine when syncing to Confluence
  • toc.md has inside it a link to chapter-a.md -> this breaks already - the link is incorrect

I am running mark from root dir

Any idea ?

@enummela
Copy link

Unfortunately markdown links are not are not being replaced with Confluence links for me either. My project has the following structure:

|- apps
   |- README.md
   |- app1
      |- README.md
   |- app2
      |- README.md

When I put links in apps/README.md like this:

[App: app1](app1/README.md)

then run Mark using the file, the link in Confluence just appends app1/README.md to the end of current the URL.

@ITler
Copy link

ITler commented Mar 15, 2022

Hi @kovetskiy

what you wrote here seem to not work with version 8.0. At least I couldn't reproduce it.

In general: Couldn't it work like mark would

  1. check for a relative! link (by convention considered to belong to the documentation 'suite' and managed by mark) to another markdown (*.md) file,
  2. get the title of the other file (the metadata headers from within the file or its H1) and error out or fail processing on invalid links (file not exists)
  3. compute the link to a valid confluence link, like replace spaces with + and respecting other linked file's metadata (like space key - defaulting to the actual file's space key) and whatever else is needed. Then use the computed link when uploading the doc to confluence.

For 3. the 'compute'-logic to create a confluence link would most likely be manually reproduced within mark if the confluence API could not be leveraged for this. In theory, the compute logic could change with newer confluence versions so mark should internally choose the correct algorithm for the recognized version.

Does this make sense? I hope this idea would provide a base foundation and at least a first valuable iteration.

I think, this would be the key feature to close the gap between engineering people's way-of-working and maintainable and scalable corporate-level documentation requirements

@jack-fireworkhq jack-fireworkhq linked a pull request Apr 29, 2022 that will close this issue
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 a pull request may close this issue.

4 participants