Comments (5)
from cosmere.
Brainstorming:
if the relative link target is in the cosmere config
generate a link to that confluence page
else if the relative link is part of the repository
generate a link to the repository
else
???
``
from cosmere.
Automatically converting links to relative paths would indeed be a very nice feature! I would give this a shot and try to come up with a patch, but so far I haven't been able to figure out where in the code links get converted. Could you give me a pointer?
else if the relative link is part of the repository
generate a link to the repository
Which repository are you referring to?
from cosmere.
Hi @codethief
So I was assuming (based on how I use it and how I've seen others use it) that people keep their markdown files in a git repository.
So case 1 would be a lookup in the cosmere.json
config. Case 2 would be a lookup in the repository that contains the file itself. An example might be that you're linking to a file in your codebase, e.g. package.json
or pom.xml
which will be lost in Confluence. But to really make these links useful, they would have to point to the repository. So maybe <a href="https://github.com/mihaeu/cosmere/package.json">...</a>
, but the question is where to get the base URL from. It could be guessed from the git remote, but that's not reliable because if it's ssh then it's hard to extrapolate the URL from that. I think it would have to be another setting in the cosmere.json
. Another option would be to lookup the property from the package.json
. It's already in there, but I've also seen people use cosmere
from a Docker container, globally or without really installing it using npx
and then there wouldn't be a package.json
to refer to.
Long story short: I guess a first step would be a simple config lookup. Step two could be adding a new field to the config and printing warnings if there are relative links that cannot be resolved.
And to make things even more complicated it would be nice if anchors would be resolved properly, because afaik that's not working properly right now.
from cosmere.
Hmm I'm not sure I see the use case yet. What stops you from linking the Github URL directly in your Markdown files? I think what you're having in mind is a general way to re-write anchor links. That might definitely be useful but I think as a very first step I would focus on getting relative links (to other pages handled by Cosmere) right.
from cosmere.
Related Issues (20)
- collapsible code blocks
- Document that the base url needs the API base url
- Allow usage of `./path` paths HOT 1
- Add link to original document HOT 4
- Horizontal lines not supported? HOT 2
- Document which version of Markdown is supported
- Add support for Atlassian access tokens HOT 8
- HTML tags in code fences are not encoded and cause exceptions HOT 1
- Anchors don't work in Confluence HOT 1
- Add support for include/exclude options HOT 1
- Code blocks break <details> rendering HOT 2
- Axios error in 0.17.0 HOT 5
- Cosmere crashes with `TypeError: Cannot read property 'filter' of undefined` HOT 6
- CDATA fails
- HTML alphanumeric values breaking local - remote equality check HOT 4
- New Version HOT 2
- AggregateError HOT 3
- Option to compare the current document with document rendered in Confluence HOT 6
- Images in numbered and bulleted lists are not displayed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cosmere.