I have made a Doxygen documentation, which itself references another documentation using the tag-file mechanism. But inside its mainpage I now would like to link to the mainpage of the external documentation. Of course, I can always specify the file directly:
... uses [OtherDoc](../../../OtherProject/doc/html/index.html) for ...
even more so since the projects are located relative to each other. But nevertheless I would like Doxygen to automate this process, since it needs to know the location of the external documentation, anyway.
So is there a way to somehow symbolically reference the external documentation's mainpage, something along the lines of:
[OtherDoc](\ref OtherProject::mainpage)
or
[OtherDoc](#OtherProject::mainpage)
There is a trick to do this. Say you have projects A and B, then in the main page of project A you could put an #anchor command like so:
/** #mainpage
* #anchor project_a
*/
And in the documentation of project b you can then simply use
[OtherDoc](\ref project_a)
Note that anchors have to be globally unique, so you need to carefully choose them!
Related
I studied the documentation for automatic global generation of base components but it is confusing. Can anyone please explain it in detail?
You can use require.context() in order to resolve a directory where components live during webpack's build process. this exposes to you, within the browser, the list of files in that directory. From that, you can use some magic to automatically register them, here's an example:
const files = require.context('./components', true, /\.vue$/i);
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
So in the above, we've said that we want webpack to create a context for us of all files in the './components' directory. From there, we can loop over all the keys of the files (which represent the file name) and register them with Vue.component(...)
I recommend watching this video:
https://www.vuemastery.com/courses/real-world-vue-js/global-components
First you can understand why you may want to use global components, then why you would want to automatically global register those components, and then what the registration code (taken from the following link) actually does.
https://v2.vuejs.org/v2/guide/components-registration.html#Automatic-Global-Registration-of-Base-Components
I am attempting to build a little modification in our code to allow easier A/B testing.
I'd like to know if I can somehow
have my regular code under the /templates directory
have any a/b code under /templates/_abtests/, but also follow the same hierarchy as the regular code. for example... an ab test can overwrite a file like '/templates/foo.tpl', and use instead '/templates/_abtests/testfoo/foo.tpl'
I tried changing the template directory when in a test. Right before calling the display method, I would check if a user is in a test, and if so, set up the template_dir accordingly. I'd assign an array with the 'ab' directory first, then the default. I am using Smarty2.
the problem with this is that it caches the first instance, and uses that as the template for the baseline and ab test case. ie: i have a parameter to force me into a test bucket, but the template is the same.
thoughts on how to achieve this? goal is to not have to add a bunch of template hooks (if/else) in the templates. and achieve this by simple template/file includes.
I believe that the solution to my problem could be to put templates into folders. ie: /templates/base/, /templates/test_foo/, etc.". then in my template_dir setting, set the array up based on what test we are in.
I had tried this with mobile/desktop before, and forgot about this solution.
I can extend the smarty_template class and override the display method to change the template_dir. adding the test directory first.
I am trying to build a custom module based on the 'basic' template, with extra fields without using the module builder.
I have looked trough the SugarCRM 6.5 documentation, bought the book SuiteCRM for Developers and looked trough the sources of existing modules, but I still can not figure out how to put a working module together.
Does a minimal module template exists anywhere? What I am looking for is a fully working module with one extra field, which can be deployed on a SuiteCRM instance. I can take it from there.
There's no minimal module template that I know of, you may want to consider creating a test module through module builder and exporting that to see what the parts are.
Usually though modules have the following files. Example uses the module ABC_Sport.
custom/Extension/application/Ext/Include/ABC_Sport.php
This adds the module to the module list and adds the beans. I.e.
$beanList['ABC_Sport'] = 'ABC_Sport';
$beanFiles['ABC_Sport'] = 'modules/ABC_Sport/ABC_Sport.php';
$moduleList[] = 'ABC_Sport';
custom/Extension/application/Ext/Include/en_us.ABC_Sport.php
(Note you may want to add files for different languages).
Next up you'll need to create the bean file in
modules/ABC_Sport/ABC_Sport.php
and the vardefs in
modules/ABC_Sport/vardefs.php
I'm not totally sure if the metadata files are required or not but you'll also likely want to add the editviewdefs,detailviewdefs and listviewdefs.
I have two products. For example A and B. In A product i need to enable to one validation which is present in AValidator.xtend file and B product is depends on A so when i run B product that check needs to be disable the warning.
AValidator.xtend:
#Check
def validateElement(Element e)
{
warning('''Element «e.name» missing in files.''', e, package.Literals.NAMED__NAME)
}
The same check should not be work for BProduct.
Is there any override function can do for these?
Many thanks in advance.
There are two ways to solve this:
You can add a system property (probably a boolean flag) which enables this feature. In the ini file of A, you enable the option. In B, you omit it.
You can split the plugin into a library and then two plugins which you use in the products.
Splitting the plugin works like this:
You need to create a new plugin and copy all the shared code into it. It can also contain the code from the validation which is the same for both products. Give the validation code the name SharedValidator
In this plugin, you need to rename DslRuntimeModule (Dsl is the name of your grammer, it extends AbstractDslRuntimeModule which contains the binding for the validation). Rename it to SharedDslRuntimeModule.
Then you create a plugin for product A. It contains the specific validation. This class needs to extend SharedValidator.
You also need to create a binding which extends SharedDslRuntimeModule and so you can bind the new validator class.
That's the rough outline. You will have to copy/change several other files (like the DslStandaloneSetup and the plugin.xml), too, but those changes should become obvious when you fix the compile errors.
... Maybe a flag is more simple.
Solution for this problem is Creating extension point.
I have created one extension point in AProduct validator plugin with the name of interface IProdcutEnabled with one method.
And Added that extension point in BProduct validator plugin.
Then AProduct validator class,Validation i checked whether extension point is used by any product or not. If it's used don't show warning.
I'm creating a workflow app with pyramid and i'm searching how to make the application modulable : meaning create a core app with sqlalchemy models, base forms with wtforms, and some base templates with mako.
The basic structure of the "Core" app is:
App_Core/core.ini
/setup.py
/...
/App_Core/
/__init__.py
/models.py
/forms.py
/utils.py
/templates/
/templates/base.mako...
/static/
/static/staticfiles...
My goal is to create 1 application per workflow which will be included in the Core app : it seems possible to do that via the includeme function provided with pyramid.
I want to include each workflow via the core.ini file, for example:
pyramid.includes =
workflow_app1
workflow_app2
workflow_app3
...
I defined an new app called workflow_app1 with the following structure:
worflow_app1/
/setup.py
/...
/workflow_app1/
/__init__.py
/models.py
/forms.py
/views.py
/templates/
/templates/workflow_app1.mako
/...
And the _init_.py file will contain the includeme function and will define new routes:
def includeme(config):
config.add_route('route1', '/route1/')
config.add_route('route2', '/route2/')
config.scan()
When i'm writing a view for the worflow_app1, i'm rendering to a template included with that app, but when i'm calling it from the core app, it can't render the template and gives the following error:
TopLevelLookupException: Cant locate template for uri 'workflow-app1.mako'
This error quite logical cause the mako.directories directive is given with the path App_Core_PATH/templates so my template should be in the same folder.
Question1:
Is it possible to make mako searching in each folder of modules the wanted templates?
Question2:
Is it possible to make the workflow-app1.mako inheriting of the base.mako from the core app?
Thanks by advance for your answer.
The solution that I would recommend is switching to asset specs for your templates. They are explicit, allow overriding, and provide better control over your template hierarchy. This means that you would stop using mako.directories and instead use 'workflow_app1:templates/workflow_app1.mako' in your inherits or include or renderer arguments. Given this, it's obvious that you can inherit from your base.mako in your core app, whereas managing the mako.directories option is more difficult.
If you're deadset on mako.directories then you can add a line to it every time you add a package to pyramid.includes.
mako.directores =
App_Core:templates
workflow_app1:templates
workflow_app2:templates
Another option is to switch to jinja2, as its plugin has the ability to add search paths after the fact. Thus your included modules can config.add_jinja2_search_path(...) throwing themselves into the lookup order. Pyramid's mako integration does not offer this option right now.