listmyaps
listmyaps copied to clipboard
Add a HTML Table template
First of all, thank you for this great application, it really works like a charm!
Synopsis
The aim of this pull request is to add another default template, which would show up under the other default templates in the Template Editor and behave accordingly.
This new template would be a HTML template in table format and it would include almost every custom variable available. I really don't know if this works as it should, but this is what I've done:
Workflow
- Modify the HTML source code of a full web page (such as this one, for example) to suit one's taste (here the ASCII art was dropped, the footer was cropped and the header Google Store was changed to Google Play).
- Add \n to the beginning of all lines using for example LibreOffice.
- Header
- Escape the Header with XML-rules (XML Escape).
- Escape the Header with Java rules (Java/.Net String Escape - I guess there are too many newlines and carriage returns after this step, so onto the Steps 3 and 4...).
- Find the string: \r\n\n and replace it with: \n
- Make sure the string ends with only a single instance of \n
- Footer
- Escape the Footer with XML-rules (XML Escape).
- Escape the Footer with Java rules (Java/.Net String Escape - I guess there are too many newlines and carriage returns after this step, so onto the Steps 3 and 4...).
- Find the string: \r\n\n and replace it with: \n
- Make sure the string doesn't end with either \n or \r
- Escape Body with custom Java rules.
- Java/.Net String Escape (Again, I guess there are too many newlines and carriage returns after this step, so onto the Steps 2 and 3...)
- Find the string: \r\n\n and replace it with: \n
- Make sure the string ends with only a single instance of \n
- Find: < and replace it with: \u003c
- Find: > and replace it with: \u003e
- Insert Header, Body and Footer -sections to \res\values\strings.xml (by adding new <item></item> -elements under "stdheaders", "stdformats" and "stdfooters") and give the template a name under "stdformattitles".
Other List My Apps custom templates, which can be manually added to the List My Apps' Template Editor (or used for forking...)
- List My Apps Template - Table
- List My Apps Template - List
- List My Apps Template - Pro
- List My Apps Template - Data
- List My Apps Template - XML plain
- List My Apps Template - XML style
- List My Apps Template - JSON
ToDo
- I guess also the German localization (\res\values-de\strings.xml) and Italian localization (\res\values-it\strings.xml) should be altered similarly for full deployment.
Notes
- To make the added strings more legible, the strings could be first unescaped using Java rules (for example Java/.Net String Escape) and then unescaped using XML-rules (for example XML Escape).
- The deleted <item></item> line under "stdfooters" was the sixth item, whereas under the other headers concerning default templates there were originally just five instances of item.
Questions
-
In the header and footer sections ("stdheaders" and "stdfooters") of \res\values\strings.xml, is there a difference between < and \u003c or between > and \u003e ?
If one could use either < or \u003c to escape < (and either > or \u003e to escape >) under "stdheaders" and "stdfooters" that would streamline the process of adding new templates a bit.
That looks great @auberginehill & @onyxbits! 😎