Confluence Macro: How to include content - confluence

There are these two macros available in Confluence: Excerpt Macro and Excerpt Include Macro, but these are somewhat limited.
I created my own User Macro to extend the existing Excerpt Macro in a way that I can add some parameters to the excerpt, like ID, etc.
I am also able to get the content from my macro via the REST api in my code, which is cool.
BUT, I am unable to find a way to get the content and include it into another page via another macro.
In other words, I am trying to figure out a way to create my own User Macro to extend the existing Excerpt Include Macro.
Is there a way to see the Template content for these existing Confluence Macros, or is there a way to have a User Macro include some content from some other page?

This is not your exact answer, but there is a plug-in multiexcerpt which probably does exactly what you are looking for.

Related

Textmate scopes in custom hover-provider for vscode extension

I've created a custom language extension for my own script language. I've written a tmlanguage file to tokenize my script and do custom highlighting. I created a hover-provider that currently only shows the word that is hovered for testing the provider itself. I want to react on the textmate scopes of the current position in this hover, like the vs code Developer tool "Inspect Editor Token and Scopes" does.
At the end I want to react to one particular scope whose value I want to read and show a corresponding image of this value in the hover.
Fore example a line in my script could look like:
setImage(dic_1/dic_2/testImg)
Now I want to show the image that correlates with the path in the brackets if I hover over it.
I tried to find something in the documentation (https://code.visualstudio.com/api/references/vscode-api#languages) if there is something that would help me but couldn't see anything related.
I tried to ask ChatGPT for help after he suggested "possible internal and not public available methods" it suggested to create a custom hover provider with the help of the library "oniguruma" and tokenize the document again.
However, this feels a bit like an overkill. If vscode has a internal tool that does return the textmate scopes I would guess there is a easy way to access those tokens.
I found this thread (Is there a way to find the textmate scope from within my VSCode extension language functions?) but I don't rally understand why I need to write another parser.
Is there any way to access this textmate scopes in a hover-provider?

Is there an easy way to create individual snippets in spring-restdocs?

I just dived into spring-restdocs and i really like the way how to document my API. Now I would like to extend the generated examples by python. Means I want snippets like the curl ones just for python.
this is what I found out so far:
I will have to create my own template like default-curl-request.snippet. Is it right that is followed by extending my own implementation by org.springframework.restdocs.snippet.TemplatedSnippet?
If you want to use a template to generate the snippet then what you have described is the right approach to take.
Note that you don't have to use a template. You could opt to implement the Snippet interface directly and you're then free to generate a snippet using any means you like. Here's a snippet implementation from a third-party extensions that takes this approach.

How to embed DSL keyword highlighting and code completion into application

I am creating custom DSL with groovy for purpose of creating rules (for rule engine). My target audience will be non-programmers.
Something like this:
when user visit page "test" within 5.days
then assign campaign 200
I would like to provide my users with at least some kind of text box where they will be able to create rules using the DSL. To make it simple and professional I am looking for a third party component to help me with the task of keywords highlighting and code completion. I read about groovy DSL descriptor but apparently thry working only inside eclipse IDE. Is there any way to incorporate required functionality into my application?
You have a bunch of code editor to put in your projects. Check the wiki http://en.wikipedia.org/wiki/Comparison_of_JavaScript-based_source_code_editors.
You can see a great example: Console Plugin source code

customized links in the org mode

I use org mode to store shortcuts for my projects. Such org files contain mostly links which I create using org-insert-link. But sometimes the simple link is not sufficient so I have to use lisp functions. This works fine but it does not look very nice.
Is there a way to create a link which would call a lisp function?
you can define new "link types" in org-mode with the function org-add-link-type to which you tell what elisp function you want to call for a particular protocol. So, in your case, you could define new protocols for "http-ie" and "load-xml-dirs" and write wrapper functions to process the parameters right. Then you would write your links as normal org links, but with a protocol prefix.
The example from the documentation page is quite straightforward I guess, let me know if it's not enough.

How to extract labels from Symfony forms I18n Extract Task

I am quite aware that the extract task accepts application as a parameter, and thus one can't expect it too look into the forms folder.
However, I referred the link (below) and tried a couple of ways:
1. defining my proxy __() method
2. including the I18n helper in App Configuration
However, both aren't working.
Can anyone tell me how to extract these from the form classes?
Thanks
http://groups.google.com/group/symfony-devs/browse_thread/thread/1d034f5f7367fe0c
You need to use the i18n helper and add the translated strings manually to your XML/XLIFF files. The translations themselves work, it's just the i18n:extract task that doesn't look inside form classes so it has to be done manually. I hope they add this feature in Symfony 2.0.
See the first few paragraphs here: http://www.symfony-project.org/forms/1_4/en/08-Internationalisation-and-Localisation
There's a way to extract it altough it's not recommended by the developers:
In lib/i18n/extract/sfI18nApplicationExtract.class.php add:
$this->extractFromPhpFiles(sfConfig::get('sf_lib_dir').'/form');
to function extract()
In your form class's configure method add:
sfLoader::loadHelpers('I18N');
This way you can use the __() function in your form class.
I'm currently testing it. Will share my findings.