Remove obsolete scripts

This commit is contained in:
pietervdvn 2022-09-19 12:34:05 +02:00
parent afa6402fe9
commit 6879495afb
3 changed files with 1 additions and 102 deletions

View file

@ -29,7 +29,7 @@ function genImages(dryrun = false) {
if (hasNonAsciiChars) { if (hasNonAsciiChars) {
throw "The svg '" + path + "' has non-ascii characters" throw "The svg '" + path + "' has non-ascii characters"
} }
const name = path.substr(0, path.length - 4).replace(/[ -]/g, "_") const name = path.substring(0, path.length - 4).replace(/[ -]/g, "_")
if (dryrun) { if (dryrun) {
svg = "xxx" svg = "xxx"

View file

@ -1,53 +0,0 @@
import { writeFile } from "fs"
import Translations from "../UI/i18n/Translations"
import * as themeOverview from "../assets/generated/theme_overview.json"
function generateWikiEntry(layout: {
hideFromOverview: boolean
id: string
shortDescription: any
}) {
if (layout.hideFromOverview) {
return ""
}
const languagesInDescr = []
for (const shortDescriptionKey in layout.shortDescription) {
languagesInDescr.push(shortDescriptionKey)
}
const languages = languagesInDescr.map((ln) => `{{#language:${ln}|en}}`).join(", ")
let auth = "Yes"
return `{{service_item
|name= [https://mapcomplete.osm.be/${layout.id} ${layout.id}]
|region= Worldwide
|lang= ${languages}
|descr= A MapComplete theme: ${Translations.T(layout.shortDescription)
.textFor("en")
.replace("<a href='", "[[")
.replace(/'>.*<\/a>/, "]]")}
|material= {{yes|[https://mapcomplete.osm.be/ ${auth}]}}
|image= MapComplete_Screenshot.png
|genre= POI, editor, ${layout.id}
}}`
}
let wikiPage =
'{|class="wikitable sortable"\n' +
"! Name, link !! Genre !! Covered region !! Language !! Description !! Free materials !! Image\n" +
"|-"
for (const layout of themeOverview) {
if (layout.hideFromOverview) {
continue
}
wikiPage += "\n" + generateWikiEntry(layout)
}
wikiPage += "\n|}"
writeFile("Docs/wikiIndex.txt", wikiPage, (err) => {
if (err !== null) {
console.log("Could not save wikiindex", err)
}
})

View file

@ -1,48 +0,0 @@
import { Utils } from "../Utils"
import { AllKnownLayouts } from "../Customizations/AllKnownLayouts"
import TranslatorsPanel from "../UI/BigComponents/TranslatorsPanel"
import * as languages from "../assets/generated/used_languages.json"
{
const usedLanguages = languages.languages
// Some statistics
console.log(
Utils.FixedLength("", 12) + " " + usedLanguages.map((l) => Utils.FixedLength(l, 6)).join("")
)
const all = new Map<string, number[]>()
usedLanguages.forEach((ln) => all.set(ln, []))
for (const layoutId of Array.from(AllKnownLayouts.allKnownLayouts.keys())) {
const layout = AllKnownLayouts.allKnownLayouts.get(layoutId)
if (layout.hideFromOverview) {
continue
}
const { completeness, total } = TranslatorsPanel.MissingTranslationsFor(layout)
process.stdout.write(Utils.FixedLength(layout.id, 12) + " ")
for (const language of usedLanguages) {
const compl = completeness.get(language)
all.get(language).push((compl ?? 0) / total)
if (compl === undefined) {
process.stdout.write(" ")
continue
}
const percentage = Math.round((100 * compl) / total)
process.stdout.write(Utils.FixedLength(percentage + "%", 6))
}
process.stdout.write("\n")
}
process.stdout.write(Utils.FixedLength("average", 12) + " ")
for (const language of usedLanguages) {
const ratios = all.get(language)
let sum = 0
ratios.forEach((x) => (sum += x))
const percentage = Math.round(100 * (sum / ratios.length))
process.stdout.write(Utils.FixedLength(percentage + "%", 6))
}
process.stdout.write("\n")
console.log(
Utils.FixedLength("", 12) + " " + usedLanguages.map((l) => Utils.FixedLength(l, 6)).join("")
)
}