I am writing my Doxyfile configuration and was wondering if I can include a link within the PROJECT_BRIEF. I have tried HTML and Markdown syntax, but it appears to only accept plaintext. Is there a way to add simple markup to the PROJECT_BRIEF?
PROJECT_BRIEF = "Project heavily inspired by <a href='https://example.com'>Other Project</a>"
PROJECT_BRIEF = "Project heavily inspired by [Other Project](https://example.com)"
My system currently has Doxygen 1.8.17 installed.
I managed to accomplish this using a custom HTML_HEADER.
Generate default templates (we will only be looking at header.html).
doxygen -w html header.html footer.html stylesheet.css Doxyfile
rm footer.html stylesheet.css
Modify header.html.
Find the existing $projectbrief tag.
<div id="projectbrief">$projectbrief</div>
Add some javascript to "unescape" the HTML.
<script>
function htmlDecode(input) {
var doc = new DOMParser().parseFromString(input, "text/html");
return doc.documentElement.textContent;
}
document.getElementById("projectbrief").innerHTML = htmlDecode("$projectbrief");
</script>
Modify Doxyfile to use new HTML_HEADER
HTML_HEADER = header.html
Admire your markup!
Note: Other output types (e.g. LaTeX) also can similarly use custom header files.
Additionally, Markdown syntax is theoretically possible using any number of JavaScript Markdown parsers.
Related
I need the teaser as pure plain text , without any links or text formatting in the Latest view, the possibility . Is it provided for a corresponding ViewHelper or a different approach ?
HTML entities , it should not be served as & for & for example.
Use <f:format.stripTags> Viewhelper.
To ensure all html entities are decoded use <f:format.htmlentitiesDecode>
So you can use:
<f:format.stripTags>
<f:format.htmlentitiesDecode>
{newsTeaserVar}
</f:format.htmlentitiesDecode>
</f:format.stripTags>
The news list is rendered using a partial for each item (Resources/Private/Partials/List/Item.html). In that, you can see the line used for rendering the teaser:
{newsItem.teaser -> f:format.crop(maxCharacters: '{settings.cropMaxCharacters}', respectWordBoundaries:'1') -> f:format.html()}
If you remove the last view helper f:format.html(), then it won’t be converted to HTML. If you replace it with f:format.raw() (in case you have HTML in the teaser), then the HTML will be output as is, w/o converting < to < and > to > etc.
When overriding the partials, you should not directly modify the extension, but do it in an upgrade-safe way. For that, put them in your site extension or into fileadmin/ and add that partials path to the TS config:
plugin.tx_productview {
view {
partialRootPaths.1 = [path to partials folder]
}
}
For news, there is also a special mechanism: you can set a constant
plugin.tx_news.view.partialRootPath = […]
to the path.
I'm trying to send a Newsletter with tx_news and direct_mail.
The HTML rendering is fine, but I have problems with the plain text and the documentation handles only tt_news.
How do I get the plaintext of tx_news?
Addendum: I only have a Template for the HTML rendering and a Template for the plaintext - the plaintext template is empty yet. I have integrated the template via TypoScript.
plugin.tx_directmail_pi1 {
siteUrl = http://my.domain.com/
}
tx_directmail_pi1.10 = TEMPLATE
tx_directmail_pi1.10 {
template = FILE
template.file = EXT:my_extension/Resources/Private/Layouts/Page/Newsletter.tmpl
}
I propose the following solution: Use a different template for plaintext. This is described in the manual at https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/Templates/Start/Index.html and afterwards use one of those scripts to transform HTML to plaintext. I found https://github.com/mtibben/html2text and https://github.com/soundasleep/html2text or search yourself for "plaintext html to text".
The reason is simple: there is no transformation available in news or the TYPO3 core which transforms the bodytext with its links to plain text.
While documenting a project with Doxygen, I encountered the following problem.
I have a set of example programs (demo_1.c, demo_2.c,...) which reside inside the EXAMPLE_PATH set in the Doxyfile. I created a file examples.c with the following content to include the examples:
/**
* \example demo_1.c
* \example demo_2.c
* ...
*/
After running Doxygen, an Examples page is created within the navigation as I want it but the Examples section always looks like:
Examples
--------
Here is a list of all examples:
* demo_1.c
* demo_2.c
How can I change this page? I especially want to replace the text "Here is a list of all examples:" with a larger introduction.
I already generated the doxygen layout file and the header/footer files but this does not give me any useful information.
The solution is to create a DoxygenLayout.xml file and customize it with the information you want to appear on the examples page.
Doxygen will produce a template XML file, in the current directory, from the configuration it is using currently via the following command line:
$ doxygen -l
Point Doxygen to this file by editing the Doxyfile configuration file or using the Doxywizard GUI (Expert tab -> Build -> LAYOUT_FILE) to change the LAYOUT_FILE path to your new DoxygenLayout.xml file.
I recommend doing this step explicitly instead of relying on the default behavior to pickup the DoxygenLayout.xml when it exists in the folder Doxygen is run from.
You will need to edit the <tab type="examples"> XML tag and change the existing title attribute and add an intro attribute to suit your needs. The title attribute changes both the name of the header on the page and the TAB name across the top of the HTML browser so something shorter is better.
For example:
<tab type="examples" visible="yes" title="ALI Library Examples" intro="Welcome to the fantastic set of examples I have prepared for your enjoyment."/>
Produces:
ALI Library Examples
Welcome to the fantastic set of examples I have prepared for your enjoyment.
csv-simple.tcl
Note that I could not find any information about the intro attribute in the formal Doxygen documentation. I noticed it while reading the article Adding new user Tab in the Doxygen Layout.
I have to prevent loading backgrounds by style="" attributes in the frontend but still need to be able to set up background images from the cms.
TYPO3 has a default stylesheet (e.g. typo3temp/stylesheet_[hash].css?[timestamp] for loading CSS registred by TypoScript:
plugin.tx_myext._CSS_DEFAULT_STYLE (
.css {}
)
But is it possible to extend this css file from a Extbase Controller?
Unfortunately \TYPO3\CMS\Core\Page\PageRenderer has not such a functionality.
I also tried:
$GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_myext.']['_CSS_DEFAULT_STYLE'] = 'body {display:none}';
But it seems that the \TYPO3\CMS\Frontend\Page\PageGenerator generates the page before any content is called.
You can add this to $GLOBALS['TSFE']->additionalHeaderData array, it will add any content to head section of HTML doc, just make sure that used index is unique! so you have two soultions:
One is adding styles directly to head like:
$GLOBALS['TSFE']->additionalHeaderData['tx_yourext_styles_for_action_foo_bar']
.= '<style>body {background: orange;}</style>';
second is the same technique but in better edition, let's say that you have dedicated typeNum - 1234 which generates stylesheet file for given page as a standalone stylesheet file, so you can just include it as usually:
$cssUrl = 'index.php?id=' . $GLOBALS['TSFE']->id . '&type=1234';
$GLOBALS['TSFE']->additionalHeaderData['tx_yourext_styles_for_action_foo_bar']
.= '<link rel="stylesheet" type="text/css" href="' . $cssUrl . '" media="all">';
Of course you can use any other combination ;)
When I generate CSS or JavaScript files using PHP I like to use .js.php or .css.php file extensions. so that I know what's going on.
Is there a way of associating these "compound" file extensions to their respective languages?
I don't use NetBeans or PHP, but the following trick helped me in a similar setting:
<?php if(0) { ?><script><?php } ?>
# code goes here
<?php if(0) { ?></script><?php } ?>
Simply surround the js code with <script> or <style> tags that don't get rendered. No need to configure any special associations, assuming the editor is smart enough about HTML.
What I usually do is condense such "compound" extensions into one, following the tradition of condensing .tar.gz into .tgz.