ref: template use {{X}} instead of __X__
This commit is contained in:
@@ -2,100 +2,100 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<style>__CSS__</style>
|
<style>{{CSS}}</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>__QuickLookTitle__</h1>
|
<h1>{{QuickLookTitle}}</h1>
|
||||||
|
|
||||||
<div class="app __AppInfoHidden__">
|
<div class="app {{AppInfoHidden}}">
|
||||||
<div class="floatLeft icon"><img alt="App icon" src="data:image/png;base64,__AppIcon__"/></div>
|
<div class="floatLeft icon"><img alt="App icon" src="data:image/png;base64,{{AppIcon}}"/></div>
|
||||||
<div class="floatLeft info">
|
<div class="floatLeft info">
|
||||||
Name: <strong>__AppName__</strong><br />
|
Name: <strong>{{AppName}}</strong><br />
|
||||||
Version: __AppVersion__ (__AppBuildVer__)<br />
|
Version: {{AppVersion}} ({{AppBuildVer}})<br />
|
||||||
BundleId: __AppId__<br />
|
BundleId: {{AppId}}<br />
|
||||||
<div class="__AppExtensionTypeHidden__">
|
<div class="{{AppExtensionTypeHidden}}">
|
||||||
Extension type: __AppExtensionType__<br />
|
Extension type: {{AppExtensionType}}<br />
|
||||||
</div>
|
</div>
|
||||||
DeviceFamily: __AppDeviceFamily__<br />
|
DeviceFamily: {{AppDeviceFamily}}<br />
|
||||||
SDK: __AppSDK__<br />
|
SDK: {{AppSDK}}<br />
|
||||||
Minimum OS Version: __AppMinOS__<br />
|
Minimum OS Version: {{AppMinOS}}<br />
|
||||||
</div>
|
</div>
|
||||||
<br class="clear" />
|
<br class="clear" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="not-__AppInfoHidden__">
|
<div class="not-{{AppInfoHidden}}">
|
||||||
Could not find any Info.plist
|
Could not find any Info.plist
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="__ArchiveHidden__">
|
<div class="{{ArchiveHidden}}">
|
||||||
<h2>Archive Notes</h2>
|
<h2>Archive Notes</h2>
|
||||||
<pre>__ArchiveComment__</pre>
|
<pre>{{ArchiveComment}}</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="__iTunesHidden__">
|
<div class="{{iTunesHidden}}">
|
||||||
<h2>iTunes Metadata</h2>
|
<h2>iTunes Metadata</h2>
|
||||||
iTunesId: __iTunesId__<br />
|
iTunesId: {{iTunesId}}<br />
|
||||||
Title: __iTunesName__<br />
|
Title: {{iTunesName}}<br />
|
||||||
Genres: __iTunesGenres__<br />
|
Genres: {{iTunesGenres}}<br />
|
||||||
Released: __iTunesReleaseDate__<br />
|
Released: {{iTunesReleaseDate}}<br />
|
||||||
<br />
|
<br />
|
||||||
AppleId: __iTunesAppleId__<br />
|
AppleId: {{iTunesAppleId}}<br />
|
||||||
Purchased: __iTunesPurchaseDate__<br />
|
Purchased: {{iTunesPurchaseDate}}<br />
|
||||||
Price: __iTunesPrice__<br />
|
Price: {{iTunesPrice}}<br />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="__TransportSecurityHidden__">
|
<div class="{{TransportSecurityHidden}}">
|
||||||
<h2>App Transport Security</h2>
|
<h2>App Transport Security</h2>
|
||||||
__TransportSecurityDict__
|
{{TransportSecurityDict}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="__EntitlementsHidden__">
|
<div class="{{EntitlementsHidden}}">
|
||||||
<h2>Entitlements</h2>
|
<h2>Entitlements</h2>
|
||||||
<div class="warning __EntitlementsWarningHidden__">
|
<div class="warning {{EntitlementsWarningHidden}}">
|
||||||
<strong>Entitlements extraction failed.</strong>
|
<strong>Entitlements extraction failed.</strong>
|
||||||
</div>
|
</div>
|
||||||
__EntitlementsDict__
|
{{EntitlementsDict}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="__ProvisionHidden__">
|
<div class="{{ProvisionHidden}}">
|
||||||
<h2>Provisioning</h2>
|
<h2>Provisioning</h2>
|
||||||
Profile name: <strong>__ProvisionProfileName__</strong><br />
|
Profile name: <strong>{{ProvisionProfileName}}</strong><br />
|
||||||
Profile UUID: __ProvisionProfileId__<br />
|
Profile UUID: {{ProvisionProfileId}}<br />
|
||||||
Profile Type: __ProvisionProfilePlatform__ __ProvisionProfileType__<br />
|
Profile Type: {{ProvisionProfilePlatform}} {{ProvisionProfileType}}<br />
|
||||||
Team: __ProvisionTeamName__ (__ProvisionTeamIds__)<br />
|
Team: {{ProvisionTeamName}} ({{ProvisionTeamIds}})<br />
|
||||||
Creation date: __ProvisionCreateDate__<br />
|
Creation date: {{ProvisionCreateDate}}<br />
|
||||||
Expiration Date: <strong><span class="__ProvisionExpireStatus__">__ProvisionExpireDate__</span></strong><br />
|
Expiration Date: <strong><span class="{{ProvisionExpireStatus}}">{{ProvisionExpireDate}}</span></strong><br />
|
||||||
|
|
||||||
<h2>Developer Certificates</h2>
|
<h2>Developer Certificates</h2>
|
||||||
__ProvisionDevelopCertificates__
|
{{ProvisionDevelopCertificates}}
|
||||||
|
|
||||||
<h2>Devices (__ProvisionDeviceCount__)</h2>
|
<h2>Devices ({{ProvisionDeviceCount}})</h2>
|
||||||
__ProvisionDeviceIds__
|
{{ProvisionDeviceIds}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="__ApkFeaturesRequiredHidden__">
|
<div class="{{ApkFeaturesRequiredHidden}}">
|
||||||
<h2>Features (required)</h2>
|
<h2>Features (required)</h2>
|
||||||
__ApkFeaturesRequiredList__
|
{{ApkFeaturesRequiredList}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="__ApkFeaturesOptionalHidden__">
|
<div class="{{ApkFeaturesOptionalHidden}}">
|
||||||
<h2>Features (optional)</h2>
|
<h2>Features (optional)</h2>
|
||||||
__ApkFeaturesOptionalList__
|
{{ApkFeaturesOptionalList}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="__ApkPermissionsHidden__">
|
<div class="{{ApkPermissionsHidden}}">
|
||||||
<h2>Permissions</h2>
|
<h2>Permissions</h2>
|
||||||
__ApkPermissionsList__
|
{{ApkPermissionsList}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h2>File info</h2>
|
<h2>File info</h2>
|
||||||
__FileName__<br />
|
{{FileName}}<br />
|
||||||
__FileSize__, Modified __FileModified__<br />
|
{{FileSize}}, Modified {{FileModified}}<br />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<p>__SrcAppName__ v__SrcVersion__ (__SrcBuildVer__) (Github: <a href="__SrcLinkUrl__">__SrcLinkName__</a>)</p>
|
<p>{{SrcAppName}} v{{SrcVersion}} ({{SrcBuildVer}}) (Github: <a href="{{SrcLinkUrl}}">{{SrcLinkName}}</a>)</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ struct PreviewGenerator {
|
|||||||
/// prepare html, replace values
|
/// prepare html, replace values
|
||||||
func generate(template html: String, css: String) -> String {
|
func generate(template html: String, css: String) -> String {
|
||||||
let templateValues = data.merging(["CSS": css]) { (_, new) in new }
|
let templateValues = data.merging(["CSS": css]) { (_, new) in new }
|
||||||
return html.regexReplace("__([^ _]{1,40}?)__") { templateValues[$0] }
|
return html.regexReplace("\\{\\{([^ }]{1,40}?)\\}\\}") { templateValues[$0] }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,6 +94,7 @@ extension String {
|
|||||||
if let value = fn(key) {
|
if let value = fn(key) {
|
||||||
rv.append(value)
|
rv.append(value)
|
||||||
} else {
|
} else {
|
||||||
|
// do not append anything -> removes all template keys from template
|
||||||
// os_log(.debug, log: log, "unknown template key: %{public}@", key)
|
// os_log(.debug, log: log, "unknown template key: %{public}@", key)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user