Maven site documentation: Add links to additional documents - maven

I want to generate project documentations with the Maven site plugin. The default layout, structure and functions with "Project Information" and "Project Reports" is ok for me.
But I want to add an additional (third) section "Additional Documentation", which links to some more documents, if there are such documents in the project.
I can create a directory src/site/resources/otherDocu and the documents will be copied to the target/site/otherDocu directory, as desired. However, the generated site does not link to them.
I would like a third section "Additional Documentation", which lists and links the files in the mentioned directory. I want to do this with as small an overhead as possible. Specifically, if it can be avoided, I do not want to include an own site.xml, along with css etc. as described in many solutions. How can I use the default site configuration and only "inject" a part? Or, if this is the only way, it should be possible to configure a file (say site.xml) only once in a parent POM and inherit it for all other projects. How can I make it list the files found in src/site/resources/otherDocu and display links to them?
Or, what I also was thinking of: I could write an own report plugin, which does this, and then I only need to specify this plugin in the "reporting / plugins" section in the POM, as I did for the other reporting plugins. With this solution, I could probably create an additional entry in the "Project Reports" section, like for every other reporting plugin, which is a step in the correct direction. But I need several entries (because of several linked documents), or one entry "Additional docu" with sub-entries.
Which way is the easier to go? Does you have a recommendation or a similar solution? Does anyone have a file (site.xml or similar) which already does some listing, does not need all other resources (images etc.) and can be inherited?

This is what I have done .. relatively straightforward:
src/site/site.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="${project.name}">
<body>
<menu name="Menu Title">
<item name="Documentation" href="docs.html"/>
</menu>
</body>
</project>
Above creates a link to docs.html page. Then create the docs page using apt (or other languages possible)
src/site/apt/docs.apt:
-------------
Documentation
-------------
Documentation
Some text {{{/path/to/doc}document}}.
If you don't want to create a separate page, you can probably just insert links to the documents in the site.xml.

The first thing to keep the default behaviour is to use something in your site descriptor:
<body>
<menu ref="reports"/>
<menu ref="modules"/>
</body>
The thing you are using to automatically copying the files to the target is suposed for resources as you can read in the docs.
Furthermore to automatically created documents you need to go the way via a report plugin.

Related

How to create a VisualStudio item template that does not offer numbered file names by default

If I create an item template with default name foo.txt, Visual Studio by default offers the name foo1.txt in the add new dialog, even if there is no foo.txt in the folder.
This is normally fine, but I would need to create an item template, that does not offer a "1" suffix for the file name by default, exactly like the App.config template behaves.
I have checked the App.vstemplate file in the VS2019 installation, but I don't see any special setting that would cause this behavior.
Sample:
<?xml version="1.0" encoding="utf-8"?>
<VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<DefaultName>foo.txt</DefaultName>
<Name>Foo.txt file</Name>
<Description>A foo.txt.</Description>
<ProjectType>CSharp</ProjectType>
</TemplateData>
<TemplateContent>
<ProjectItem>foo.txt</ProjectItem>
</TemplateContent>
</VSTemplate>
Shows in the add new dialog as:
Sorry but I'm afraid the answer would be negative. I think this
behavior is by design and can't be controlled by any Element in the
.vstemplate.
I've reproduced this issue in my side. And one interesting thing I found is if we change the file extensions to .manifest and this issue goes away.
For example:
If the Item template I want to create is something like a foo.manifest instead of foo.txt, then when I add this item in new project it won't display the 1 suffix. You can easily confirm this point by change all your foo.txt content to foo.manifest.
I agree with Will that they're special casing some of the templates. And to be more specific, this behavior is special for the file extensions of the Item we created. I haven't done anything differently when creating xxx.manifest Item, but it just makes a difference from the xxx.txt Item. So I would think there is a invisible and unknown rule to control this behavior, and this behavior may not be changed or controlled in custom extension. It would be something like a rule designed by the Product Team I believe.
In my opinion, it's not supported by current VS SDK to control the behavior to let VS won't display '1' suffix for item whose file extension is .txt. And if you do want this feature, go Developer Community to share your great idea there. Actually after your reminder, it would be better if this feature comes then we can really control the Default Name, so if you decide to post your idea, share the link in your question and members interested in it would help vote for it.
Hope it helps and if i misunderstand anything, feel free to let me know:)

Antora top navigation bar customization

My question is quite simple though I cannot find anything that points to it in the documentation.
I am generating documentation for a project with the default generator in Antora but I cannot figure out how to customize the top navigation bar, items on the right side, which have some defaults.
Since the site is generated, where should I change, or how, those items? I do not want to list such items there.
There is an additional approach that does not require you to create a standalone UI: supplemental_files
In your playbook file, you can specify:
...
ui:
supplemental_files: <path to supplemental UI folder>
...
The supplemental UI folder provides replacement files for the UI, provided that they appear in the same structure as the UI that is in use.
So, to replace header-content.hbs for the default UI, you would create this folder structure:
supplemental-ui/
partials/
header-content.hbs
You can see how this facility is used by exploring the repo for the Antora docs: https://gitlab.com/antora/docs.antora.org
You can replace any file used by the UI in this fashion, and add new files. You cannot remove files, but you can make their content empty. Altogether, this means that you can change any CSS, Javascript, partials, layouts, and provide any additional global UI assets as required.
Yep, you need to build your own UI. The docs for that are available here: https://docs.antora.org/antora-ui-default/
Like Matt said, you'll need to check your header-content.hbs handlebars.

JOOMLA, Best way to make alternate layouts for articles?

I can't find a answer for this, I want to know what is the best way to have an alternative layouts for articles in Joomla.
If I understand you correctly you are looking for a way to create additional Alternative Layouts for articles. Under parameter tab "Article Options":
If that is the case, its very close to the other provided answers here. Its just that you got to rename the copied default.php file to something else. If you rename it to custom.php it will end up with the text "custom" like the image above.
Here goes my shot for a step by step:
Find the default layout file(s). You could use the ones provided by the com_content component. They can be found at components/com_content/views/article/tmpl. Copy both default.php and default_links.php.
Now you need to rename and copy the file(s) into a template. The target template can be any of the installed templates. Using beez_20 the new path for the copied file(s) should be templates/beez_20/html/com_content/article/custom.php and templates/beez_20/html/com_content/article/custom_links.php.
Goto to edit article using the backend. Expand the Article Options tab and find Alternative Layout. Select your new layout.
Your template might already provide a article override. If so, you might want to use the files of that template instead (instead of the ones in step 1). So if you are using beez_20, you could copy templates/beez_20/html/com_content/article/default.php and templates/beez_20/html/com_content/article/default_links.php.
Helpful links:
Using Joomla’s Template and Layout Override
Layout overrides in Joomla 1.6
The best way to do this would either to install another content component - such as k2 which is highly customizable. Or any other content component on JED.
Alternatively you could create a template override on the existing Joomla Template. This is preferable to editing the files directly in com_content component as the template overrides will never be overwritten whereas the core files will be in any Joomla Updates. I should add, hopefully unnecessarily that this requires Joomla 1.5, 1.6, 1.7, 2.5 or 3.0 (although this is still in beta as of present). So make sure you're not using 1.0.
To create an alternative layout for the built in articles component the best way to do it is probably to create a template over-ride.
See this article on docs.joomla.org on "How to override the output from the Joomla! core"
Creating an alternative for an article layout is pretty straight forward. You can achieve this by using the core layout override with your published template(s).
First you want to get/copy the core article layout file:
components/com_content/views/article/tmpl/default.php
Then place it into your published template:
templates/YOURTEMPLATE/html/com_content/article/default.php
If the template you are using doesn't have the html folder, then you will have to create that folder and each folder to make that path correct.
Once you have this in place, all you need to do is make changes to that default.php file you have just place in the template and that is it!

How can I show which cshtml files are building my page?

The scenario
My team is building a fairly complex MVC3/C# site. There's been some refactoring lately, and many of the views, partial views, and templates have moved around. When I look at one of our pages, it's hard to tell which cshtml file is responsible for which piece of the page. I'd like a faster way to see which file I should be working on.
Why it's a problem
There are a lot of files in our presentation layer, and the folder structure is complicated.
Some cshtml files have the same name, but different file paths.
Our routing tables are similarly complex.
We've made significant use of layouts, shared views, partial views, and templates. A single page could have upwards of 10 cshtml files building it.
Most of the client-side text comes from resource strings, so I can't just Ctrl-F for the text on the page.
Stepping through the debugger doesn't save me much time.
None of these things is a show-stopper, but they make this time-consuming.
What I want
When I run it on localhost (only), I'd like the rendered HTML to come out something like this:
<!-- From: ~/shared/_layout.cshtml -->
<html>
<body>
<!-- From: ~/admin/view.cshtml -->
<h1>Here comes a list of widgets:</h1>
<!-- From: ~/widgets/list.cshtml -->
<ul>
<!-- From: ~/widgets/view.cshtml -->
<li>Widget 1</li>
...etc.
I'd be open to other ways of getting the info I need, including third-party tools.
Ideas so far
My idea was to tweak the base class we're using for our pageBaseType, but I'm a bit new to MVC (< 1 year), and that's still a bit over my head. I'm not sure which method to override, or how to get and render the view's filename.
There's some nuget packages available for this kind of debugging:
http://nuget.org/packages/Glimpse.Mvc3
http://nuget.org/packages/routedebugger
https://preview.nuget.org/packages/RouteMagic

Adding a "Big Icon" to the Joomla admin dashboard

I've done this befor but with all my memory, search efforts and logic failing I can't figure out how to add a new "Big Icon" link on the main dashboard of the Joomla administration.
What file am i looking to change?
I'm sitting on a fresh install of 1.5.15
Do you mean addin a new "big Icon" to the control panel of the Joomla administration dashboard?
image-example: http://i49.tinypic.com/9ampmq.png
(image is in spanish, just an example)
Anyway, if that is what you're looking for:
Check the mod_quickicon folder inside of /administrator/modules/.
Inside, you should see mod_quickicon.php, open it.
Scroll down and you'll find a <div id="cpanel">...</div>
Here's where you make the magic happen. Just copy one of the quick-icons, i.e.
$link = 'index.php?option=com_media';
quickiconButton( $link, 'icon-48-media.png', JText::_( 'Media Manager' ) );
.. and edit it according to what you need/want. I guess you know what I mean, but just to make sure, you probably want to change the image, the $link (for that you'll have to create a custom folder if you wanna keep it clean, such as "com_whateveryouwant".
I hope this helps.
You could also just download this extension.. but it'll be boring:
--sorry can't post more links, if you're interested, write me back--
Chris.
The best way is to make new Quickicon plugin. The simpliest way is to inspire in Extensionupdate or Joomlaupdate Quickicon plugin.
Copy the directory of some plugin, rename the directory to your own Quickicon Plugin name, edit the file in what you want ... the base thing is that the plugin must return Icon Definition array
Need to add to SQL DB do #_extensions (# is db prefix) new line of code defining that the plg_guickicon_ownplugin is there (again, inspire in Joomlaupdate/Extensionupdate plugin SQL record)
And that's all, no hacking needed, just make own plugin for Quickicon module
The file is a module, you can create a module and assign it to the position of 'icons'.

Resources