Why don't the Target 8 files implement the project as described in the tutorial? - dom

In Target 8: Define a Custom DOM Tag, the reader is told about custom DOM tags that can be created by extending other tags. A sample is described for an example called "x-converter" before listing the files as "These files implement the app:".
The three files are...
a drseuss.html file (not sure why there's a sudden deviation in the project name and the HTML file, as opposed to the matching names in previous tutorials...),
a converter-element.html file,
and a convertercomponent.dart file.
I tried creating a new application in the latest Dart editor, and replaced the default HTML file contents with that of drseuss.html, replaced the default dart file contents with that of convertercomponent.dart, and added converter-element.html file.
After fixing an include issue (the file from the tutorial refers to drseuss.css and not the default project name's CSS file), I only see the following in the Chromium browser.
As you can see, the element described in the tutorial (converter-element) doesn't show up. Why don't the files provided for the project result in what's shown in the tutorial?
For reference, here's what's shown in the tutorial.

Web UI requires the build.dart script which compiles the various components into the executable output HTML+Dart.
Take a look at the parent folder in the github src that you reference, and you will see the build.dart script.
In addition, you will need the pubspec.yaml from that folder, too, which includes web_ui package, which brings in the dwc tool(Dart Web Components compiler) used by build.dart.
Take a look at the article Tools for Web UI for more information about dwc and build.dart, and Target 6 - Getting Started with Web UI which covers similar ground, but in a tutorial format.

Related

Rename README.md to custom name and use as a project description

I do apologize if similar question already put, but I haven't found one.
I would like to change the default project description file name (called README.md) to be a custom name (let's say XXX.md) and I wonder if it is possible to be the XXX.md the initial readme file for the project (typical situation: you open the project Code page and you will see the content of XXX.md down at bottom).
I would like to verify if this approach possible in general, but I am mainly interested in Github and Bitbucket services. I briefly checked project settings and I cannot find there such customization. Is it even possible?
GitHub, at least, doesn't provide the ability to do this. It is possible to use a different format (e.g., README.asciidoc or README.rst), but the root file must be called README.
Note that you can include other text markup documents like this and they'll be rendered if they're visited, it's just that they won't appear at the bottom of the file listing like a README will.

Hugo deploy and delete not necessary files

I'm developing a new Hugo site and in this case I thought to create also a template so.I can use for future site.
Well in the template there are tons of vendor files and library because depending of the pages that the site will implement these library will be used. The problem is on the deploy. For example I use Line icons library that has a lot of .png files. (For example 200 files).
Well in the template I put all the files but could happen that in the site that implement this template I use only five icons. Is there a way that look around the final HTML and the usage of the icons and delete in the public folder the not necessary files?
Not directly.
You would need to add an utility script to your template, in order for any user implementing said template to be able to call this script on demand.
That script should then be able to:
analyze the HTML files generated in public_html
cleanup the icons accordingly

How to add language icons in liferay DXP

How to add the Language icon image in liferay 7(liferay-ce-portal-7.0-ga4).
I have followed the steps mentioned in following article,
https://web.liferay.com/web/salman.khan/blog/-/blogs/add-a-new-language-to-liferay-detailed-step-by-step-
After the language configuration I can be able to see the languages but not the flags on web content forms.
So I created the custom theme to add the language file and added th_TH.png file in theme\src\images\language\th_TH.png. But din't work.
Then I tried the implementing the lexicon-icon approach mention in,
how can i add a new language in liferay 7?
Still I am not able to see the language images.
Please refer the screenshot for details,
Theme-layout and file location
To add a custom icon that is not supported yet you need to add 2 artefacts into the theme. Liferay using 2 things for displaying icons. Somewhere it uses png flag and somewhere svg you need to adjust both.
Have a look at this sample project. https://github.com/mir333/custom-flag-admin-theme
It takes the admin theme of Liferay (it is a copy so it needs to be kept in sync with updates) and adds a new flag to the admin theme. The magic is in adding the flag into the lexicon. Under the hood, it takes the added flag svg files and recompiles the icons.svg files to include it.
To anyone who still have issue showing the flag, I just want to point out that this helped me: https://stackoverflow.com/a/45907250
As described, open the icons.svg and add your flag's svg code in as a symbol with the id "xx-yy" (your language and country code, in lowercase).
The flag does not magically generate just from putting the flags-xx-YY.svg file into lexicon folder, not for me at least.

Unity web open custom html after build

I made a custom html file for my Unity web project. Though after building my project, it opens the default pre-made one. Is there a way to make Unity open my own html file instead of the default one?
You're looking for the Web Player Templates manual page.
In your Assets folder, create a folder named WebPlayerTemplates, and put your template in there. You'll need an HTML file. To help make this slightly easier, Unity will look in that HTML for certain tokens that it can replace with data from the project.
For example, one such tag is %UNITY_WEB_PATH%, which will be replaced with the path to your built project file.
Some tags include:
UNITY_WEB_NAME Name of the webplayer.
UNITY_WIDTH UNITY_HEIGHT Onscreen width and height of the player in
pixels.
UNITY_WEB_PATH Local path to the webplayer file.
UNITY_UNITYOBJECT_URL In the usual case where the page will download
UnityObject2.js from the Unity’s website (ie, the Offline Deployment
option is disabled), this tag will provide the download URL.
UNITY_UNITYOBJECT_DEPENDENCIES The UnityObject2.js have dependencies
and this tag will be replaced with the needed dependencies for it to
work properly.
In every deployment I've seen, the WebPlayer plugin is is launched via JavaScript, by instantiating a UnityObject2 and calling its initPlugin method:
var u = new UnityObject2();
u.initPlugin(jQuery("#unityPlayer")[0], "Example.unity3d");
The above assumes that you have a div with id #unityPlayer, and that Example.unity3d is a valid path to your Unity build file.
In practice, though, I recommend working from Unity's generated HTML files; they include some failsafes for cases where the WebPlayer plugin isn't installed or fails to load. The manual page linked above also has HTML source examples which include some of those special tags.
UnityObject2 does have some advanced features, which are also documented in the manual. If your game needs to communicate with the outer web page, that is also possible.

change html output doxygen link

I am working on a project that is heavily documented with doxygen.
In a UI I have a list of all the classes available - I would like to be able to open the right documentation page of the class I select. In order to do that I need an easy to read link, so I can dynamically build it and run it.
Is it there any way I can control the generated link of the html file? Because the ones I have right now are impossible do be built dynamically.
You could use Doxygen's tag file mechanism for that (see GENERATE_TAGFILE in the config file).
A tag file is a reasonably easy to understand and parse XML file that basically lists all symbols in your project, with for each symbol the corresponding (relative) URL to the documentation.
So you could parse the tag file from your UI to resolve the links to the doxygen generated documentation in a robust way.