Valid output types for play twirl template - playframework-2.5

What are the valid types that can be generated by a Twirl template in play framework? I know that I can generate HTML. I would like to generate an svg. Is that possible?
If I have a file named foo.scala.html, then I do get a generated class. foo.scala.svg does not result in a class.
Are the options documented anywhere?
I am currently using PlayFramework 2.5.2, but upgrading should be possible.

What are the valid types that can be generated by a Twirl template in play framework?
https://github.com/playframework/twirl#template-files:
Template files must be named {name}.scala.{ext} where ext can be html, js, xml, or txt.
I would like to generate an svg. Is that possible?
Not out of the box. You can implement a custom format yourself though. See https://www.playframework.com/documentation/2.5.x/ScalaCustomTemplateFormat

Related

Can more than one scss be used for one SPFx Web Part?

I am new to The SharePoint Framework (SPFx). I am trying to convert old Content Type Web Part into SPFx Web Part. Earlier we have used multiple css files and included into html page. But for SPFx Web Part, I got stuck for how to use more than one scss for one Web Part. I searched but found suggestions on how to give give names of scss for your Web Part but no where i found like it allows only one scss or something.
So i would like to know whether it is possible to have multiple scss file for one web part or not? And if yes then how?
This should be quite easy to accomplish. Just add a new .module.scss file to your solution and reference it with a unique identifier.
Example:
import styles from './Existing.module.scss'; // this is the one you already have
import additionalStyles from './Example.module.scss'; // your new module
Then you can reference these like <div className={additionalStyles.awesomeClass} />

eXistDB HTML Templating files outside of current app

I’ve an eXistDB app set up with templating. Is it possible to make HTML Files outside of the app (in a different collection) use the same templating mechanisms to get the page header and styles and so on from my app?
Thank you!
Yes, you can use eXist's HTML templating feature in any of your collections, but as the set up section of the documentation states, you will need to ensure the following modules responsible for handling the templating functionality are in the new collection:
controller.xql
modules/view.xql
For simplicity's sake, you could just copy these files from your original collection into the target collection, and they should work identically.

csv,pdf, xml supported in freemarker template output

Does freemarker template support output in csv, pdf, html and xml.
any other java based template framework supporting all these formats.
Thanks.
It supports all kind of text output, like most other template engines as well. Template engines, with some exceptions, don't care what the generated output means. (For PDF you certainly want to generate in some more human-readable format, and then use another software to render it to PDF.)

How to print entities from entity print module?

I am using Drupal 8 and working on Eform types. I had to generate PDF from eform submissions. I used entity print module for this and am using DOMPDF as PDF Engine. I am able to apply custom css to the pdf but the requirements are still not covered. Now I need to override the template so that I can customize the PDF as per my requirement, I could not achieve this. Few requirements:
I need to insert tabular format.
Custom sequence of entities/fields.
Site Logo
Is there any way to do so?
You could also go to he link to get more details on the output before it is sent to the pdf engine.
/print/pdf/node/86/debug

Rmarkdown and Pandoc templates - specifying paths to assets

I am attempting to create my own pandoc template for use with RStudio/Rmarkdown and HTML output. After some code snooping, google searches and trial/error I have a functional template that works as expected. I have included the template within an R package as well as my own custom function for calling html_document().
However, I am unable to determine the appropriate way to specify/reference local assets (e.g. images) I would like included within my pandoc HTML template. I have tried specifying the path relative to the pandoc template with no luck. I'm surmising that I need to provide an absolute path and I can get that from System.file(). For assets such as css files that are specified within the header, I can handle that as part of my custom call to html_document. In this case, however, I'm trying to specify a path within the HTML body and not sure how to elegantly include that within the pandoc template.

Resources