Referencing another link in a markdown link definition (GitLab) - gitlab

I have an .MD file with the following reference-style link:
[Test link][test-link]
[test-link]: https://google.com/
Is it possible to reuse the test-link value inside of another link?
I would like to define a base URL and build another link on top of it, meaning that test-link-with-params will render to https://google.com/#search
I imagine it working like this:
[Test link][test-link]
[Test link 2][test-link-with-params]
[test-link]: https://google.com/
[test-link-with-params]: [test-link]#search

No I don't believe it is possible. Perhaps the best way round would be to do a sub/replace on the markdown file after you've written it.

Related

Link to an arbitrary spot in a multimarkdown file

I'm trying to make the following work:
Here is my markdown text I would like to link to. [link]
Then I write something else.
Then I say [see above](link)
This does not work and I cannot find a way to link to some arbitrary text.
Note: This is not a duplicate of 6695493 as that is a conversation about headers.
This is not a duplicate of any answer that talks about linking to headers.
It looks like the answer is, "No you cannot do this with pure markdown"
You can put some HTML into your file to create a link and then link to that.

Grav - Parse URL

I want to define a new template called "product".
This template calls an external service and retrieves the information about that specific product. That is easily done with a custom plugin that access the product information. Information on how to do that has been found here.
However, I would like that the URL of the page would be something like:
/product/<id>/<seo-friendly-description>
So I can retrieve in the Twig template both <id> and <seo-friendly-description> which will be used later to retrieve the specific product information.
I have tried to find something that could help in the documentation, without success. Could someone either point me to the right doc section or highlight the basic steps that shall be achieved so I can start solving this issue?
Just in case it helps, I am trying to find something similar to how bottle or other web frameworks work:
#route('/hello/<name>')
def greet(name):
return 'Hello ' + name
I've been building a family recipebook into my own website and I've been working through a similar problem. I haven't quite worked out all the kinks, but my solution is mostly working if you want to checkout my github repo.
In short, you need the plugin to watch what the active route is. If the route matches, you then create the page and populate it using your plugin data.
I haven't quite figured out how to get the active page to highlight in the navigation menu for generated pages, but you might still find this solution helpful.

How do I create a reusable mailto link in ModX?

I want to create a link to an email address like somebody.
I tried to use a weblink resource (which gets an id of 20) with mailto:person1#provider.nl as link value and render this in my content with the tag [[~20?~]]. (and different variations of it)
But ModX renders it as somebody This is not what I want.
So how do I do this properly, so that I can reuse this resource in several places in the website?
This link needs to be editable for a 'Content editor' with reduced rights, so I don't think a chunk is the best way to go.
Because to do this you need to create weblink:
and this is works as expected in Wayfinder/PdoMenu:
UPDATE:
[[~20]] - will output alias field. You need to output content field. To do this use pdoField snippet (part of pdoTools):
[[pdoField?&id=`20`&field=`content`]]

Can links to anchors in haddock be labeled?

When linking to a URL, one can provide a label that specifies what the reader will see; for example, <http://www.haskell.org haskell> will have "haskell" for the link text. Unfortunately the documentation does not provide an obvious way to label links to anchors; the link "Data.FooBar#foo" will have "Data.FooBar" for the link text so that it is not obvious to the reader that this link is going to an anchor.
So my question is: is there a trick to label links to anchors in haddock, or is this impossible?
This is now https://github.com/haskell/haddock/issues/262 (submitted by OP).
As I write this, it is open and has not been commented on.
At the moment, when you link to an anchor in haddock using something like "MyModule#anchor", the link on the generated page just says "MyModule". This is very confusing because it looks like the link is taking one to the module page, when really it goes to a specific anchor on that page. It would be great if either the anchor name could be added to the label for the link to make it clear where the links is going, or if there were a way one could manually specify the label of the link --- say, by borrowing the syntax used by URLs to specify the label using a space, such as "MyModule#anchor label goes here".
Its appears they offer no direct way even though their documentation seems to advise on a solution.
REF : http://www.haskell.org/haddock/doc/html/ch03s08.html

Dividing long content to subpages

I need to divide long content to sub-pages.
Rule for dividing: Heading1 (H1)
Cms-system: MODX Evolution
As far as i know, there is nothing in modx to use for this kind of problem.
I probably got to do this manually anyway, but i still would like to know if there is a way to do this in MODX Evo / Revo.
Edit:
I need to do this in MODX; sub-pages got to be actual subpages, and original page becomes to container.
Navigation will be done with wayfinder.
Edit2:
All done.. manually. Question still open, though.
This is not possible out of the box and I don't know of any extra that archieves what you want. You would have to write a plugin that acts everytime you save a resource and split up the content, create/delete sibling resources as needed etc. Sounds like a lot of work for what you want to archieve to me.
I suppose you have a look at the MIGX extra. It provides you with a TV with the possibility to store an indefinite amount of distinct TV content sets. Have a look at the documentation and Mark Hamstra's tutorial (with screenshots) to see how it is done. You should define one MIGX entry to consist of a text field for the <h1> and a rich text field for the content of the "subpage".
Afterwards, you can use form customization to hide the original content field and display your MIGX Tv instead.
I think, this is a much easier way to archieve, what you want, and can't think of any way, where you would benefit from actual subpages.
Edit: Sorry, I just recognized that you were asking about Evolution, not Revolution. My solution would work in Revo, but I don't think there's something like MIGX for Evo. Sorry, my mistake.
not 'out of the box' you will have to run your content through a snippet to parse it into separate divs or something that you can run some javascript on to possibly 'tab' the content.
If you need to show the 'subpages' in your navigation, you will probably have to use the gatResources extra to parse your content ~ which will be very expensive on resource usage.
You can (depending on how you're using the tree) just create actual sub resources under the parent resource, using Ditto or Wayfinder to build navigation for it.
If you can't use the tree like that (though from your description I think you can), you could also set up a number of template variables ("content1", "content2", "content3" etc) and show that with a simple snippet or so.

Resources